aws-sdk-identitystore 1.27.0

AWS SDK for AWS SSO Identity Store
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A group object that contains the metadata and attributes for a specified group.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Group {
    /// <p>The identifier for a group in the identity store.</p>
    pub group_id: ::std::string::String,
    /// <p>The display name value for the group. The length limit is 1,024 characters. This value can consist of letters, accented characters, symbols, numbers, punctuation, tab, new line, carriage return, space, and nonbreaking space in this attribute. This value is specified at the time the group is created and stored as an attribute of the group object in the identity store.</p>
    pub display_name: ::std::option::Option<::std::string::String>,
    /// <p>A list of <code>ExternalId</code> objects that contains the identifiers issued to this resource by an external identity provider.</p>
    pub external_ids: ::std::option::Option<::std::vec::Vec<crate::types::ExternalId>>,
    /// <p>A string containing a description of the specified group.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The globally unique identifier for the identity store.</p>
    pub identity_store_id: ::std::string::String,
}
impl Group {
    /// <p>The identifier for a group in the identity store.</p>
    pub fn group_id(&self) -> &str {
        use std::ops::Deref;
        self.group_id.deref()
    }
    /// <p>The display name value for the group. The length limit is 1,024 characters. This value can consist of letters, accented characters, symbols, numbers, punctuation, tab, new line, carriage return, space, and nonbreaking space in this attribute. This value is specified at the time the group is created and stored as an attribute of the group object in the identity store.</p>
    pub fn display_name(&self) -> ::std::option::Option<&str> {
        self.display_name.as_deref()
    }
    /// <p>A list of <code>ExternalId</code> objects that contains the identifiers issued to this resource by an external identity provider.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.external_ids.is_none()`.
    pub fn external_ids(&self) -> &[crate::types::ExternalId] {
        self.external_ids.as_deref().unwrap_or_default()
    }
    /// <p>A string containing a description of the specified group.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The globally unique identifier for the identity store.</p>
    pub fn identity_store_id(&self) -> &str {
        use std::ops::Deref;
        self.identity_store_id.deref()
    }
}
impl ::std::fmt::Debug for Group {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("Group");
        formatter.field("group_id", &self.group_id);
        formatter.field("display_name", &"*** Sensitive Data Redacted ***");
        formatter.field("external_ids", &self.external_ids);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("identity_store_id", &self.identity_store_id);
        formatter.finish()
    }
}
impl Group {
    /// Creates a new builder-style object to manufacture [`Group`](crate::types::Group).
    pub fn builder() -> crate::types::builders::GroupBuilder {
        crate::types::builders::GroupBuilder::default()
    }
}

/// A builder for [`Group`](crate::types::Group).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct GroupBuilder {
    pub(crate) group_id: ::std::option::Option<::std::string::String>,
    pub(crate) display_name: ::std::option::Option<::std::string::String>,
    pub(crate) external_ids: ::std::option::Option<::std::vec::Vec<crate::types::ExternalId>>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) identity_store_id: ::std::option::Option<::std::string::String>,
}
impl GroupBuilder {
    /// <p>The identifier for a group in the identity store.</p>
    /// This field is required.
    pub fn group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.group_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier for a group in the identity store.</p>
    pub fn set_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.group_id = input;
        self
    }
    /// <p>The identifier for a group in the identity store.</p>
    pub fn get_group_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.group_id
    }
    /// <p>The display name value for the group. The length limit is 1,024 characters. This value can consist of letters, accented characters, symbols, numbers, punctuation, tab, new line, carriage return, space, and nonbreaking space in this attribute. This value is specified at the time the group is created and stored as an attribute of the group object in the identity store.</p>
    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.display_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The display name value for the group. The length limit is 1,024 characters. This value can consist of letters, accented characters, symbols, numbers, punctuation, tab, new line, carriage return, space, and nonbreaking space in this attribute. This value is specified at the time the group is created and stored as an attribute of the group object in the identity store.</p>
    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.display_name = input;
        self
    }
    /// <p>The display name value for the group. The length limit is 1,024 characters. This value can consist of letters, accented characters, symbols, numbers, punctuation, tab, new line, carriage return, space, and nonbreaking space in this attribute. This value is specified at the time the group is created and stored as an attribute of the group object in the identity store.</p>
    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.display_name
    }
    /// Appends an item to `external_ids`.
    ///
    /// To override the contents of this collection use [`set_external_ids`](Self::set_external_ids).
    ///
    /// <p>A list of <code>ExternalId</code> objects that contains the identifiers issued to this resource by an external identity provider.</p>
    pub fn external_ids(mut self, input: crate::types::ExternalId) -> Self {
        let mut v = self.external_ids.unwrap_or_default();
        v.push(input);
        self.external_ids = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of <code>ExternalId</code> objects that contains the identifiers issued to this resource by an external identity provider.</p>
    pub fn set_external_ids(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ExternalId>>) -> Self {
        self.external_ids = input;
        self
    }
    /// <p>A list of <code>ExternalId</code> objects that contains the identifiers issued to this resource by an external identity provider.</p>
    pub fn get_external_ids(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ExternalId>> {
        &self.external_ids
    }
    /// <p>A string containing a description of the specified group.</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>A string containing a description of the specified group.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A string containing a description of the specified group.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The globally unique identifier for the identity store.</p>
    /// This field is required.
    pub fn identity_store_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.identity_store_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The globally unique identifier for the identity store.</p>
    pub fn set_identity_store_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.identity_store_id = input;
        self
    }
    /// <p>The globally unique identifier for the identity store.</p>
    pub fn get_identity_store_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.identity_store_id
    }
    /// Consumes the builder and constructs a [`Group`](crate::types::Group).
    /// This method will fail if any of the following fields are not set:
    /// - [`group_id`](crate::types::builders::GroupBuilder::group_id)
    /// - [`identity_store_id`](crate::types::builders::GroupBuilder::identity_store_id)
    pub fn build(self) -> ::std::result::Result<crate::types::Group, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Group {
            group_id: self.group_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "group_id",
                    "group_id was not specified but it is required when building Group",
                )
            })?,
            display_name: self.display_name,
            external_ids: self.external_ids,
            description: self.description,
            identity_store_id: self.identity_store_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "identity_store_id",
                    "identity_store_id was not specified but it is required when building Group",
                )
            })?,
        })
    }
}
impl ::std::fmt::Debug for GroupBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GroupBuilder");
        formatter.field("group_id", &self.group_id);
        formatter.field("display_name", &"*** Sensitive Data Redacted ***");
        formatter.field("external_ids", &self.external_ids);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("identity_store_id", &self.identity_store_id);
        formatter.finish()
    }
}