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 GetAccountAssociationOutput {
    /// <p>The unique identifier of the retrieved account association.</p>
    pub account_association_id: ::std::string::String,
    /// <p>The current status state for the account association.</p>
    pub association_state: crate::types::AssociationState,
    /// <p>The error message explaining the current account association error.</p>
    pub error_message: ::std::option::Option<::std::string::String>,
    /// <p>The identifier of the connector destination associated with this account association.</p>
    pub connector_destination_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the account association.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The description of the account association.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the account association.</p>
    pub arn: ::std::option::Option<::std::string::String>,
    /// <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>A set of key/value pairs that are used to manage the account association.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>The General Authorization reference by authorization material name.</p>
    pub general_authorization: ::std::option::Option<crate::types::GeneralAuthorizationName>,
    _request_id: Option<String>,
}
impl GetAccountAssociationOutput {
    /// <p>The unique identifier of the retrieved account association.</p>
    pub fn account_association_id(&self) -> &str {
        use std::ops::Deref;
        self.account_association_id.deref()
    }
    /// <p>The current status state for the account association.</p>
    pub fn association_state(&self) -> &crate::types::AssociationState {
        &self.association_state
    }
    /// <p>The error message explaining the current account association error.</p>
    pub fn error_message(&self) -> ::std::option::Option<&str> {
        self.error_message.as_deref()
    }
    /// <p>The identifier of the connector destination associated with this account association.</p>
    pub fn connector_destination_id(&self) -> ::std::option::Option<&str> {
        self.connector_destination_id.as_deref()
    }
    /// <p>The name of the account association.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The description of the account association.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the account association.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <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>A set of key/value pairs that are used to manage the account association.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
    /// <p>The General Authorization reference by authorization material name.</p>
    pub fn general_authorization(&self) -> ::std::option::Option<&crate::types::GeneralAuthorizationName> {
        self.general_authorization.as_ref()
    }
}
impl ::std::fmt::Debug for GetAccountAssociationOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetAccountAssociationOutput");
        formatter.field("account_association_id", &self.account_association_id);
        formatter.field("association_state", &self.association_state);
        formatter.field("error_message", &self.error_message);
        formatter.field("connector_destination_id", &self.connector_destination_id);
        formatter.field("name", &self.name);
        formatter.field("description", &self.description);
        formatter.field("arn", &self.arn);
        formatter.field("o_auth_authorization_url", &"*** Sensitive Data Redacted ***");
        formatter.field("tags", &"*** Sensitive Data Redacted ***");
        formatter.field("general_authorization", &self.general_authorization);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for GetAccountAssociationOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetAccountAssociationOutput {
    /// Creates a new builder-style object to manufacture [`GetAccountAssociationOutput`](crate::operation::get_account_association::GetAccountAssociationOutput).
    pub fn builder() -> crate::operation::get_account_association::builders::GetAccountAssociationOutputBuilder {
        crate::operation::get_account_association::builders::GetAccountAssociationOutputBuilder::default()
    }
}

/// A builder for [`GetAccountAssociationOutput`](crate::operation::get_account_association::GetAccountAssociationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct GetAccountAssociationOutputBuilder {
    pub(crate) account_association_id: ::std::option::Option<::std::string::String>,
    pub(crate) association_state: ::std::option::Option<crate::types::AssociationState>,
    pub(crate) error_message: ::std::option::Option<::std::string::String>,
    pub(crate) connector_destination_id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) o_auth_authorization_url: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) general_authorization: ::std::option::Option<crate::types::GeneralAuthorizationName>,
    _request_id: Option<String>,
}
impl GetAccountAssociationOutputBuilder {
    /// <p>The unique identifier of the retrieved account association.</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 unique identifier of the retrieved account association.</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 unique identifier of the retrieved account association.</p>
    pub fn get_account_association_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.account_association_id
    }
    /// <p>The current status state for the account association.</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 status state for the account association.</p>
    pub fn set_association_state(mut self, input: ::std::option::Option<crate::types::AssociationState>) -> Self {
        self.association_state = input;
        self
    }
    /// <p>The current status state for the account association.</p>
    pub fn get_association_state(&self) -> &::std::option::Option<crate::types::AssociationState> {
        &self.association_state
    }
    /// <p>The error message explaining the current account association error.</p>
    pub fn error_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.error_message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The error message explaining the current account association error.</p>
    pub fn set_error_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.error_message = input;
        self
    }
    /// <p>The error message explaining the current account association error.</p>
    pub fn get_error_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.error_message
    }
    /// <p>The identifier of the connector destination associated with this account association.</p>
    pub fn connector_destination_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.connector_destination_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the connector destination associated with this account association.</p>
    pub fn set_connector_destination_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.connector_destination_id = input;
        self
    }
    /// <p>The identifier of the connector destination associated with this account association.</p>
    pub fn get_connector_destination_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.connector_destination_id
    }
    /// <p>The name of the account association.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the account association.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the account association.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The description of the account association.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of the account association.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description of the account association.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <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
    }
    /// <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
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>A set of key/value pairs that are used to manage the account association.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>A set of key/value pairs that are used to manage the account association.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>A set of key/value pairs that are used to manage the account association.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// <p>The General Authorization reference by authorization material name.</p>
    pub fn general_authorization(mut self, input: crate::types::GeneralAuthorizationName) -> Self {
        self.general_authorization = ::std::option::Option::Some(input);
        self
    }
    /// <p>The General Authorization reference by authorization material name.</p>
    pub fn set_general_authorization(mut self, input: ::std::option::Option<crate::types::GeneralAuthorizationName>) -> Self {
        self.general_authorization = input;
        self
    }
    /// <p>The General Authorization reference by authorization material name.</p>
    pub fn get_general_authorization(&self) -> &::std::option::Option<crate::types::GeneralAuthorizationName> {
        &self.general_authorization
    }
    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 [`GetAccountAssociationOutput`](crate::operation::get_account_association::GetAccountAssociationOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`account_association_id`](crate::operation::get_account_association::builders::GetAccountAssociationOutputBuilder::account_association_id)
    /// - [`association_state`](crate::operation::get_account_association::builders::GetAccountAssociationOutputBuilder::association_state)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_account_association::GetAccountAssociationOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::get_account_association::GetAccountAssociationOutput {
            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 GetAccountAssociationOutput",
                )
            })?,
            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 GetAccountAssociationOutput",
                )
            })?,
            error_message: self.error_message,
            connector_destination_id: self.connector_destination_id,
            name: self.name,
            description: self.description,
            arn: self.arn,
            o_auth_authorization_url: self.o_auth_authorization_url.unwrap_or_default(),
            tags: self.tags,
            general_authorization: self.general_authorization,
            _request_id: self._request_id,
        })
    }
}
impl ::std::fmt::Debug for GetAccountAssociationOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetAccountAssociationOutputBuilder");
        formatter.field("account_association_id", &self.account_association_id);
        formatter.field("association_state", &self.association_state);
        formatter.field("error_message", &self.error_message);
        formatter.field("connector_destination_id", &self.connector_destination_id);
        formatter.field("name", &self.name);
        formatter.field("description", &self.description);
        formatter.field("arn", &self.arn);
        formatter.field("o_auth_authorization_url", &"*** Sensitive Data Redacted ***");
        formatter.field("tags", &"*** Sensitive Data Redacted ***");
        formatter.field("general_authorization", &self.general_authorization);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}