aws-sdk-devicefarm 1.97.0

AWS SDK for AWS Device Farm
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Returns the status result for a device offering.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetOfferingStatusOutput {
    /// <p>When specified, gets the offering status for the current period.</p>
    pub current: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::OfferingStatus>>,
    /// <p>When specified, gets the offering status for the next period.</p>
    pub next_period: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::OfferingStatus>>,
    /// <p>An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetOfferingStatusOutput {
    /// <p>When specified, gets the offering status for the current period.</p>
    pub fn current(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::OfferingStatus>> {
        self.current.as_ref()
    }
    /// <p>When specified, gets the offering status for the next period.</p>
    pub fn next_period(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::OfferingStatus>> {
        self.next_period.as_ref()
    }
    /// <p>An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for GetOfferingStatusOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetOfferingStatusOutput {
    /// Creates a new builder-style object to manufacture [`GetOfferingStatusOutput`](crate::operation::get_offering_status::GetOfferingStatusOutput).
    pub fn builder() -> crate::operation::get_offering_status::builders::GetOfferingStatusOutputBuilder {
        crate::operation::get_offering_status::builders::GetOfferingStatusOutputBuilder::default()
    }
}

/// A builder for [`GetOfferingStatusOutput`](crate::operation::get_offering_status::GetOfferingStatusOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetOfferingStatusOutputBuilder {
    pub(crate) current: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::OfferingStatus>>,
    pub(crate) next_period: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::OfferingStatus>>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetOfferingStatusOutputBuilder {
    /// Adds a key-value pair to `current`.
    ///
    /// To override the contents of this collection use [`set_current`](Self::set_current).
    ///
    /// <p>When specified, gets the offering status for the current period.</p>
    pub fn current(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::OfferingStatus) -> Self {
        let mut hash_map = self.current.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.current = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>When specified, gets the offering status for the current period.</p>
    pub fn set_current(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::OfferingStatus>>,
    ) -> Self {
        self.current = input;
        self
    }
    /// <p>When specified, gets the offering status for the current period.</p>
    pub fn get_current(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::OfferingStatus>> {
        &self.current
    }
    /// Adds a key-value pair to `next_period`.
    ///
    /// To override the contents of this collection use [`set_next_period`](Self::set_next_period).
    ///
    /// <p>When specified, gets the offering status for the next period.</p>
    pub fn next_period(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::OfferingStatus) -> Self {
        let mut hash_map = self.next_period.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.next_period = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>When specified, gets the offering status for the next period.</p>
    pub fn set_next_period(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::OfferingStatus>>,
    ) -> Self {
        self.next_period = input;
        self
    }
    /// <p>When specified, gets the offering status for the next period.</p>
    pub fn get_next_period(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::OfferingStatus>> {
        &self.next_period
    }
    /// <p>An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetOfferingStatusOutput`](crate::operation::get_offering_status::GetOfferingStatusOutput).
    pub fn build(self) -> crate::operation::get_offering_status::GetOfferingStatusOutput {
        crate::operation::get_offering_status::GetOfferingStatusOutput {
            current: self.current,
            next_period: self.next_period,
            next_token: self.next_token,
            _request_id: self._request_id,
        }
    }
}