aws-sdk-iotmanagedintegrations 1.42.0

AWS SDK for Managed integrations for AWS IoT Device Management
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct CreateAccountAssociationOutput {
    /// <p>Third-party IoT platform OAuth authorization server URL backed with all the required parameters to perform end-user authentication. This field will be empty when using General Authorization flows that do not require OAuth.</p>
    pub o_auth_authorization_url: ::std::string::String,
    /// <p>The identifier for the account association request.</p>
    pub account_association_id: ::std::string::String,
    /// <p>The current state of the account association request.</p>
    pub association_state: crate::types::AssociationState,
    /// <p>The Amazon Resource Name (ARN) of the account association.</p>
    pub arn: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateAccountAssociationOutput {
    /// <p>Third-party IoT platform OAuth authorization server URL backed with all the required parameters to perform end-user authentication. This field will be empty when using General Authorization flows that do not require OAuth.</p>
    pub fn o_auth_authorization_url(&self) -> &str {
        use std::ops::Deref;
        self.o_auth_authorization_url.deref()
    }
    /// <p>The identifier for the account association request.</p>
    pub fn account_association_id(&self) -> &str {
        use std::ops::Deref;
        self.account_association_id.deref()
    }
    /// <p>The current state of the account association request.</p>
    pub fn association_state(&self) -> &crate::types::AssociationState {
        &self.association_state
    }
    /// <p>The Amazon Resource Name (ARN) of the account association.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
}
impl ::std::fmt::Debug for CreateAccountAssociationOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateAccountAssociationOutput");
        formatter.field("o_auth_authorization_url", &"*** Sensitive Data Redacted ***");
        formatter.field("account_association_id", &self.account_association_id);
        formatter.field("association_state", &self.association_state);
        formatter.field("arn", &self.arn);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for CreateAccountAssociationOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateAccountAssociationOutput {
    /// Creates a new builder-style object to manufacture [`CreateAccountAssociationOutput`](crate::operation::create_account_association::CreateAccountAssociationOutput).
    pub fn builder() -> crate::operation::create_account_association::builders::CreateAccountAssociationOutputBuilder {
        crate::operation::create_account_association::builders::CreateAccountAssociationOutputBuilder::default()
    }
}

/// A builder for [`CreateAccountAssociationOutput`](crate::operation::create_account_association::CreateAccountAssociationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateAccountAssociationOutputBuilder {
    pub(crate) o_auth_authorization_url: ::std::option::Option<::std::string::String>,
    pub(crate) account_association_id: ::std::option::Option<::std::string::String>,
    pub(crate) association_state: ::std::option::Option<crate::types::AssociationState>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateAccountAssociationOutputBuilder {
    /// <p>Third-party IoT platform OAuth authorization server URL backed with all the required parameters to perform end-user authentication. This field will be empty when using General Authorization flows that do not require OAuth.</p>
    /// This field is required.
    pub fn o_auth_authorization_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.o_auth_authorization_url = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Third-party IoT platform OAuth authorization server URL backed with all the required parameters to perform end-user authentication. This field will be empty when using General Authorization flows that do not require OAuth.</p>
    pub fn set_o_auth_authorization_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.o_auth_authorization_url = input;
        self
    }
    /// <p>Third-party IoT platform OAuth authorization server URL backed with all the required parameters to perform end-user authentication. This field will be empty when using General Authorization flows that do not require OAuth.</p>
    pub fn get_o_auth_authorization_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.o_auth_authorization_url
    }
    /// <p>The identifier for the account association request.</p>
    /// This field is required.
    pub fn account_association_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.account_association_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier for the account association request.</p>
    pub fn set_account_association_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.account_association_id = input;
        self
    }
    /// <p>The identifier for the account association request.</p>
    pub fn get_account_association_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.account_association_id
    }
    /// <p>The current state of the account association request.</p>
    /// This field is required.
    pub fn association_state(mut self, input: crate::types::AssociationState) -> Self {
        self.association_state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current state of the account association request.</p>
    pub fn set_association_state(mut self, input: ::std::option::Option<crate::types::AssociationState>) -> Self {
        self.association_state = input;
        self
    }
    /// <p>The current state of the account association request.</p>
    pub fn get_association_state(&self) -> &::std::option::Option<crate::types::AssociationState> {
        &self.association_state
    }
    /// <p>The Amazon Resource Name (ARN) of the account association.</p>
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the account association.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the account association.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    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 [`CreateAccountAssociationOutput`](crate::operation::create_account_association::CreateAccountAssociationOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`account_association_id`](crate::operation::create_account_association::builders::CreateAccountAssociationOutputBuilder::account_association_id)
    /// - [`association_state`](crate::operation::create_account_association::builders::CreateAccountAssociationOutputBuilder::association_state)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_account_association::CreateAccountAssociationOutput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::create_account_association::CreateAccountAssociationOutput {
            o_auth_authorization_url: self.o_auth_authorization_url.unwrap_or_default(),
            account_association_id: self.account_association_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "account_association_id",
                    "account_association_id was not specified but it is required when building CreateAccountAssociationOutput",
                )
            })?,
            association_state: self.association_state.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "association_state",
                    "association_state was not specified but it is required when building CreateAccountAssociationOutput",
                )
            })?,
            arn: self.arn,
            _request_id: self._request_id,
        })
    }
}
impl ::std::fmt::Debug for CreateAccountAssociationOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateAccountAssociationOutputBuilder");
        formatter.field("o_auth_authorization_url", &"*** Sensitive Data Redacted ***");
        formatter.field("account_association_id", &self.account_association_id);
        formatter.field("association_state", &self.association_state);
        formatter.field("arn", &self.arn);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}