aws-sdk-resourcegroupstagging 0.24.0

AWS SDK for AWS Resource Groups Tagging API
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Information about the errors that are returned for each failed resource. This information can include <code>InternalServiceException</code> and <code>InvalidParameterException</code> errors. It can also include any valid error code returned by the Amazon Web Services service that hosts the resource that the ARN key represents.</p>
/// <p>The following are common error codes that you might receive from other Amazon Web Services services:</p>
/// <ul>
/// <li> <p> <b>InternalServiceException</b> – This can mean that the Resource Groups Tagging API didn't receive a response from another Amazon Web Services service. It can also mean that the resource type in the request is not supported by the Resource Groups Tagging API. In these cases, it's safe to retry the request and then call <a href="https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html">GetResources</a> to verify the changes.</p> </li>
/// <li> <p> <b>AccessDeniedException</b> – This can mean that you need permission to call the tagging operations in the Amazon Web Services service that contains the resource. For example, to use the Resource Groups Tagging API to tag a Amazon CloudWatch alarm resource, you need permission to call both <a href="https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_TagResources.html"> <code>TagResources</code> </a> <i>and</i> <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html"> <code>TagResource</code> </a> in the CloudWatch API. </p> </li>
/// </ul>
/// <p>For more information on errors that are generated from other Amazon Web Services services, see the documentation for that service. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct FailureInfo {
    /// <p>The HTTP status code of the common error.</p>
    #[doc(hidden)]
    pub status_code: i32,
    /// <p>The code of the common error. Valid values include <code>InternalServiceException</code>, <code>InvalidParameterException</code>, and any valid error code returned by the Amazon Web Services service that hosts the resource that you want to tag.</p>
    #[doc(hidden)]
    pub error_code: std::option::Option<crate::model::ErrorCode>,
    /// <p>The message of the common error.</p>
    #[doc(hidden)]
    pub error_message: std::option::Option<std::string::String>,
}
impl FailureInfo {
    /// <p>The HTTP status code of the common error.</p>
    pub fn status_code(&self) -> i32 {
        self.status_code
    }
    /// <p>The code of the common error. Valid values include <code>InternalServiceException</code>, <code>InvalidParameterException</code>, and any valid error code returned by the Amazon Web Services service that hosts the resource that you want to tag.</p>
    pub fn error_code(&self) -> std::option::Option<&crate::model::ErrorCode> {
        self.error_code.as_ref()
    }
    /// <p>The message of the common error.</p>
    pub fn error_message(&self) -> std::option::Option<&str> {
        self.error_message.as_deref()
    }
}
/// See [`FailureInfo`](crate::model::FailureInfo).
pub mod failure_info {

    /// A builder for [`FailureInfo`](crate::model::FailureInfo).
    #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) status_code: std::option::Option<i32>,
        pub(crate) error_code: std::option::Option<crate::model::ErrorCode>,
        pub(crate) error_message: std::option::Option<std::string::String>,
    }
    impl Builder {
        /// <p>The HTTP status code of the common error.</p>
        pub fn status_code(mut self, input: i32) -> Self {
            self.status_code = Some(input);
            self
        }
        /// <p>The HTTP status code of the common error.</p>
        pub fn set_status_code(mut self, input: std::option::Option<i32>) -> Self {
            self.status_code = input;
            self
        }
        /// <p>The code of the common error. Valid values include <code>InternalServiceException</code>, <code>InvalidParameterException</code>, and any valid error code returned by the Amazon Web Services service that hosts the resource that you want to tag.</p>
        pub fn error_code(mut self, input: crate::model::ErrorCode) -> Self {
            self.error_code = Some(input);
            self
        }
        /// <p>The code of the common error. Valid values include <code>InternalServiceException</code>, <code>InvalidParameterException</code>, and any valid error code returned by the Amazon Web Services service that hosts the resource that you want to tag.</p>
        pub fn set_error_code(
            mut self,
            input: std::option::Option<crate::model::ErrorCode>,
        ) -> Self {
            self.error_code = input;
            self
        }
        /// <p>The message of the common error.</p>
        pub fn error_message(mut self, input: impl Into<std::string::String>) -> Self {
            self.error_message = Some(input.into());
            self
        }
        /// <p>The message of the common error.</p>
        pub fn set_error_message(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.error_message = input;
            self
        }
        /// Consumes the builder and constructs a [`FailureInfo`](crate::model::FailureInfo).
        pub fn build(self) -> crate::model::FailureInfo {
            crate::model::FailureInfo {
                status_code: self.status_code.unwrap_or_default(),
                error_code: self.error_code,
                error_message: self.error_message,
            }
        }
    }
}
impl FailureInfo {
    /// Creates a new builder-style object to manufacture [`FailureInfo`](crate::model::FailureInfo).
    pub fn builder() -> crate::model::failure_info::Builder {
        crate::model::failure_info::Builder::default()
    }
}

/// When writing a match expression against `ErrorCode`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let errorcode = unimplemented!();
/// match errorcode {
///     ErrorCode::InternalServiceException => { /* ... */ },
///     ErrorCode::InvalidParameterException => { /* ... */ },
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
///     _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `errorcode` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `ErrorCode::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `ErrorCode::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `ErrorCode::NewFeature` is defined.
/// Specifically, when `errorcode` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `ErrorCode::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum ErrorCode {
    #[allow(missing_docs)] // documentation missing in model
    InternalServiceException,
    #[allow(missing_docs)] // documentation missing in model
    InvalidParameterException,
    /// `Unknown` contains new variants that have been added since this code was generated.
    Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for ErrorCode {
    fn from(s: &str) -> Self {
        match s {
            "InternalServiceException" => ErrorCode::InternalServiceException,
            "InvalidParameterException" => ErrorCode::InvalidParameterException,
            other => ErrorCode::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
        }
    }
}
impl std::str::FromStr for ErrorCode {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(ErrorCode::from(s))
    }
}
impl ErrorCode {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            ErrorCode::InternalServiceException => "InternalServiceException",
            ErrorCode::InvalidParameterException => "InvalidParameterException",
            ErrorCode::Unknown(value) => value.as_str(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub const fn values() -> &'static [&'static str] {
        &["InternalServiceException", "InvalidParameterException"]
    }
}
impl AsRef<str> for ErrorCode {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

/// <p>A list of resource ARNs and the tags (keys and values) that are associated with each.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ResourceTagMapping {
    /// <p>The ARN of the resource.</p>
    #[doc(hidden)]
    pub resource_arn: std::option::Option<std::string::String>,
    /// <p>The tags that have been applied to one or more Amazon Web Services resources.</p>
    #[doc(hidden)]
    pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
    /// <p>Information that shows whether a resource is compliant with the effective tag policy, including details on any noncompliant tag keys.</p>
    #[doc(hidden)]
    pub compliance_details: std::option::Option<crate::model::ComplianceDetails>,
}
impl ResourceTagMapping {
    /// <p>The ARN of the resource.</p>
    pub fn resource_arn(&self) -> std::option::Option<&str> {
        self.resource_arn.as_deref()
    }
    /// <p>The tags that have been applied to one or more Amazon Web Services resources.</p>
    pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
        self.tags.as_deref()
    }
    /// <p>Information that shows whether a resource is compliant with the effective tag policy, including details on any noncompliant tag keys.</p>
    pub fn compliance_details(&self) -> std::option::Option<&crate::model::ComplianceDetails> {
        self.compliance_details.as_ref()
    }
}
/// See [`ResourceTagMapping`](crate::model::ResourceTagMapping).
pub mod resource_tag_mapping {

    /// A builder for [`ResourceTagMapping`](crate::model::ResourceTagMapping).
    #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) resource_arn: std::option::Option<std::string::String>,
        pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
        pub(crate) compliance_details: std::option::Option<crate::model::ComplianceDetails>,
    }
    impl Builder {
        /// <p>The ARN of the resource.</p>
        pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
            self.resource_arn = Some(input.into());
            self
        }
        /// <p>The ARN of the resource.</p>
        pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.resource_arn = input;
            self
        }
        /// Appends an item to `tags`.
        ///
        /// To override the contents of this collection use [`set_tags`](Self::set_tags).
        ///
        /// <p>The tags that have been applied to one or more Amazon Web Services resources.</p>
        pub fn tags(mut self, input: crate::model::Tag) -> Self {
            let mut v = self.tags.unwrap_or_default();
            v.push(input);
            self.tags = Some(v);
            self
        }
        /// <p>The tags that have been applied to one or more Amazon Web Services resources.</p>
        pub fn set_tags(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
        ) -> Self {
            self.tags = input;
            self
        }
        /// <p>Information that shows whether a resource is compliant with the effective tag policy, including details on any noncompliant tag keys.</p>
        pub fn compliance_details(mut self, input: crate::model::ComplianceDetails) -> Self {
            self.compliance_details = Some(input);
            self
        }
        /// <p>Information that shows whether a resource is compliant with the effective tag policy, including details on any noncompliant tag keys.</p>
        pub fn set_compliance_details(
            mut self,
            input: std::option::Option<crate::model::ComplianceDetails>,
        ) -> Self {
            self.compliance_details = input;
            self
        }
        /// Consumes the builder and constructs a [`ResourceTagMapping`](crate::model::ResourceTagMapping).
        pub fn build(self) -> crate::model::ResourceTagMapping {
            crate::model::ResourceTagMapping {
                resource_arn: self.resource_arn,
                tags: self.tags,
                compliance_details: self.compliance_details,
            }
        }
    }
}
impl ResourceTagMapping {
    /// Creates a new builder-style object to manufacture [`ResourceTagMapping`](crate::model::ResourceTagMapping).
    pub fn builder() -> crate::model::resource_tag_mapping::Builder {
        crate::model::resource_tag_mapping::Builder::default()
    }
}

/// <p>Information that shows whether a resource is compliant with the effective tag policy, including details on any noncompliant tag keys.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ComplianceDetails {
    /// <p>These tag keys on the resource are noncompliant with the effective tag policy.</p>
    #[doc(hidden)]
    pub noncompliant_keys: std::option::Option<std::vec::Vec<std::string::String>>,
    /// <p>These are keys defined in the effective policy that are on the resource with either incorrect case treatment or noncompliant values. </p>
    #[doc(hidden)]
    pub keys_with_noncompliant_values: std::option::Option<std::vec::Vec<std::string::String>>,
    /// <p>Whether a resource is compliant with the effective tag policy.</p>
    #[doc(hidden)]
    pub compliance_status: std::option::Option<bool>,
}
impl ComplianceDetails {
    /// <p>These tag keys on the resource are noncompliant with the effective tag policy.</p>
    pub fn noncompliant_keys(&self) -> std::option::Option<&[std::string::String]> {
        self.noncompliant_keys.as_deref()
    }
    /// <p>These are keys defined in the effective policy that are on the resource with either incorrect case treatment or noncompliant values. </p>
    pub fn keys_with_noncompliant_values(&self) -> std::option::Option<&[std::string::String]> {
        self.keys_with_noncompliant_values.as_deref()
    }
    /// <p>Whether a resource is compliant with the effective tag policy.</p>
    pub fn compliance_status(&self) -> std::option::Option<bool> {
        self.compliance_status
    }
}
/// See [`ComplianceDetails`](crate::model::ComplianceDetails).
pub mod compliance_details {

    /// A builder for [`ComplianceDetails`](crate::model::ComplianceDetails).
    #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) noncompliant_keys: std::option::Option<std::vec::Vec<std::string::String>>,
        pub(crate) keys_with_noncompliant_values:
            std::option::Option<std::vec::Vec<std::string::String>>,
        pub(crate) compliance_status: std::option::Option<bool>,
    }
    impl Builder {
        /// Appends an item to `noncompliant_keys`.
        ///
        /// To override the contents of this collection use [`set_noncompliant_keys`](Self::set_noncompliant_keys).
        ///
        /// <p>These tag keys on the resource are noncompliant with the effective tag policy.</p>
        pub fn noncompliant_keys(mut self, input: impl Into<std::string::String>) -> Self {
            let mut v = self.noncompliant_keys.unwrap_or_default();
            v.push(input.into());
            self.noncompliant_keys = Some(v);
            self
        }
        /// <p>These tag keys on the resource are noncompliant with the effective tag policy.</p>
        pub fn set_noncompliant_keys(
            mut self,
            input: std::option::Option<std::vec::Vec<std::string::String>>,
        ) -> Self {
            self.noncompliant_keys = input;
            self
        }
        /// Appends an item to `keys_with_noncompliant_values`.
        ///
        /// To override the contents of this collection use [`set_keys_with_noncompliant_values`](Self::set_keys_with_noncompliant_values).
        ///
        /// <p>These are keys defined in the effective policy that are on the resource with either incorrect case treatment or noncompliant values. </p>
        pub fn keys_with_noncompliant_values(
            mut self,
            input: impl Into<std::string::String>,
        ) -> Self {
            let mut v = self.keys_with_noncompliant_values.unwrap_or_default();
            v.push(input.into());
            self.keys_with_noncompliant_values = Some(v);
            self
        }
        /// <p>These are keys defined in the effective policy that are on the resource with either incorrect case treatment or noncompliant values. </p>
        pub fn set_keys_with_noncompliant_values(
            mut self,
            input: std::option::Option<std::vec::Vec<std::string::String>>,
        ) -> Self {
            self.keys_with_noncompliant_values = input;
            self
        }
        /// <p>Whether a resource is compliant with the effective tag policy.</p>
        pub fn compliance_status(mut self, input: bool) -> Self {
            self.compliance_status = Some(input);
            self
        }
        /// <p>Whether a resource is compliant with the effective tag policy.</p>
        pub fn set_compliance_status(mut self, input: std::option::Option<bool>) -> Self {
            self.compliance_status = input;
            self
        }
        /// Consumes the builder and constructs a [`ComplianceDetails`](crate::model::ComplianceDetails).
        pub fn build(self) -> crate::model::ComplianceDetails {
            crate::model::ComplianceDetails {
                noncompliant_keys: self.noncompliant_keys,
                keys_with_noncompliant_values: self.keys_with_noncompliant_values,
                compliance_status: self.compliance_status,
            }
        }
    }
}
impl ComplianceDetails {
    /// Creates a new builder-style object to manufacture [`ComplianceDetails`](crate::model::ComplianceDetails).
    pub fn builder() -> crate::model::compliance_details::Builder {
        crate::model::compliance_details::Builder::default()
    }
}

/// <p>The metadata that you apply to Amazon Web Services resources to help you categorize and organize them. Each tag consists of a key and a value, both of which you define. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Tag {
    /// <p>One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.</p>
    #[doc(hidden)]
    pub key: std::option::Option<std::string::String>,
    /// <p>One part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key). The value can be empty or null.</p>
    #[doc(hidden)]
    pub value: std::option::Option<std::string::String>,
}
impl Tag {
    /// <p>One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.</p>
    pub fn key(&self) -> std::option::Option<&str> {
        self.key.as_deref()
    }
    /// <p>One part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key). The value can be empty or null.</p>
    pub fn value(&self) -> std::option::Option<&str> {
        self.value.as_deref()
    }
}
/// See [`Tag`](crate::model::Tag).
pub mod tag {

    /// A builder for [`Tag`](crate::model::Tag).
    #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) key: std::option::Option<std::string::String>,
        pub(crate) value: std::option::Option<std::string::String>,
    }
    impl Builder {
        /// <p>One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.</p>
        pub fn key(mut self, input: impl Into<std::string::String>) -> Self {
            self.key = Some(input.into());
            self
        }
        /// <p>One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.</p>
        pub fn set_key(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.key = input;
            self
        }
        /// <p>One part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key). The value can be empty or null.</p>
        pub fn value(mut self, input: impl Into<std::string::String>) -> Self {
            self.value = Some(input.into());
            self
        }
        /// <p>One part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key). The value can be empty or null.</p>
        pub fn set_value(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.value = input;
            self
        }
        /// Consumes the builder and constructs a [`Tag`](crate::model::Tag).
        pub fn build(self) -> crate::model::Tag {
            crate::model::Tag {
                key: self.key,
                value: self.value,
            }
        }
    }
}
impl Tag {
    /// Creates a new builder-style object to manufacture [`Tag`](crate::model::Tag).
    pub fn builder() -> crate::model::tag::Builder {
        crate::model::tag::Builder::default()
    }
}

/// <p>A list of tags (keys and values) that are used to specify the associated resources.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct TagFilter {
    /// <p>One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.</p>
    #[doc(hidden)]
    pub key: std::option::Option<std::string::String>,
    /// <p>One part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key). The value can be empty or null.</p>
    #[doc(hidden)]
    pub values: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl TagFilter {
    /// <p>One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.</p>
    pub fn key(&self) -> std::option::Option<&str> {
        self.key.as_deref()
    }
    /// <p>One part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key). The value can be empty or null.</p>
    pub fn values(&self) -> std::option::Option<&[std::string::String]> {
        self.values.as_deref()
    }
}
/// See [`TagFilter`](crate::model::TagFilter).
pub mod tag_filter {

    /// A builder for [`TagFilter`](crate::model::TagFilter).
    #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) key: std::option::Option<std::string::String>,
        pub(crate) values: std::option::Option<std::vec::Vec<std::string::String>>,
    }
    impl Builder {
        /// <p>One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.</p>
        pub fn key(mut self, input: impl Into<std::string::String>) -> Self {
            self.key = Some(input.into());
            self
        }
        /// <p>One part of a key-value pair that makes up a tag. A key is a general label that acts like a category for more specific tag values.</p>
        pub fn set_key(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.key = input;
            self
        }
        /// Appends an item to `values`.
        ///
        /// To override the contents of this collection use [`set_values`](Self::set_values).
        ///
        /// <p>One part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key). The value can be empty or null.</p>
        pub fn values(mut self, input: impl Into<std::string::String>) -> Self {
            let mut v = self.values.unwrap_or_default();
            v.push(input.into());
            self.values = Some(v);
            self
        }
        /// <p>One part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key). The value can be empty or null.</p>
        pub fn set_values(
            mut self,
            input: std::option::Option<std::vec::Vec<std::string::String>>,
        ) -> Self {
            self.values = input;
            self
        }
        /// Consumes the builder and constructs a [`TagFilter`](crate::model::TagFilter).
        pub fn build(self) -> crate::model::TagFilter {
            crate::model::TagFilter {
                key: self.key,
                values: self.values,
            }
        }
    }
}
impl TagFilter {
    /// Creates a new builder-style object to manufacture [`TagFilter`](crate::model::TagFilter).
    pub fn builder() -> crate::model::tag_filter::Builder {
        crate::model::tag_filter::Builder::default()
    }
}

/// <p>A count of noncompliant resources.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Summary {
    /// <p>The timestamp that shows when this summary was generated in this Region. </p>
    #[doc(hidden)]
    pub last_updated: std::option::Option<std::string::String>,
    /// <p>The account identifier or the root identifier of the organization. If you don't know the root ID, you can call the Organizations <a href="https://docs.aws.amazon.com/organizations/latest/APIReference/API_ListRoots.html">ListRoots</a> API.</p>
    #[doc(hidden)]
    pub target_id: std::option::Option<std::string::String>,
    /// <p>Whether the target is an account, an OU, or the organization root.</p>
    #[doc(hidden)]
    pub target_id_type: std::option::Option<crate::model::TargetIdType>,
    /// <p>The Amazon Web Services Region that the summary applies to.</p>
    #[doc(hidden)]
    pub region: std::option::Option<std::string::String>,
    /// <p>The Amazon Web Services resource type.</p>
    #[doc(hidden)]
    pub resource_type: std::option::Option<std::string::String>,
    /// <p>The count of noncompliant resources.</p>
    #[doc(hidden)]
    pub non_compliant_resources: i64,
}
impl Summary {
    /// <p>The timestamp that shows when this summary was generated in this Region. </p>
    pub fn last_updated(&self) -> std::option::Option<&str> {
        self.last_updated.as_deref()
    }
    /// <p>The account identifier or the root identifier of the organization. If you don't know the root ID, you can call the Organizations <a href="https://docs.aws.amazon.com/organizations/latest/APIReference/API_ListRoots.html">ListRoots</a> API.</p>
    pub fn target_id(&self) -> std::option::Option<&str> {
        self.target_id.as_deref()
    }
    /// <p>Whether the target is an account, an OU, or the organization root.</p>
    pub fn target_id_type(&self) -> std::option::Option<&crate::model::TargetIdType> {
        self.target_id_type.as_ref()
    }
    /// <p>The Amazon Web Services Region that the summary applies to.</p>
    pub fn region(&self) -> std::option::Option<&str> {
        self.region.as_deref()
    }
    /// <p>The Amazon Web Services resource type.</p>
    pub fn resource_type(&self) -> std::option::Option<&str> {
        self.resource_type.as_deref()
    }
    /// <p>The count of noncompliant resources.</p>
    pub fn non_compliant_resources(&self) -> i64 {
        self.non_compliant_resources
    }
}
/// See [`Summary`](crate::model::Summary).
pub mod summary {

    /// A builder for [`Summary`](crate::model::Summary).
    #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
    pub struct Builder {
        pub(crate) last_updated: std::option::Option<std::string::String>,
        pub(crate) target_id: std::option::Option<std::string::String>,
        pub(crate) target_id_type: std::option::Option<crate::model::TargetIdType>,
        pub(crate) region: std::option::Option<std::string::String>,
        pub(crate) resource_type: std::option::Option<std::string::String>,
        pub(crate) non_compliant_resources: std::option::Option<i64>,
    }
    impl Builder {
        /// <p>The timestamp that shows when this summary was generated in this Region. </p>
        pub fn last_updated(mut self, input: impl Into<std::string::String>) -> Self {
            self.last_updated = Some(input.into());
            self
        }
        /// <p>The timestamp that shows when this summary was generated in this Region. </p>
        pub fn set_last_updated(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.last_updated = input;
            self
        }
        /// <p>The account identifier or the root identifier of the organization. If you don't know the root ID, you can call the Organizations <a href="https://docs.aws.amazon.com/organizations/latest/APIReference/API_ListRoots.html">ListRoots</a> API.</p>
        pub fn target_id(mut self, input: impl Into<std::string::String>) -> Self {
            self.target_id = Some(input.into());
            self
        }
        /// <p>The account identifier or the root identifier of the organization. If you don't know the root ID, you can call the Organizations <a href="https://docs.aws.amazon.com/organizations/latest/APIReference/API_ListRoots.html">ListRoots</a> API.</p>
        pub fn set_target_id(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.target_id = input;
            self
        }
        /// <p>Whether the target is an account, an OU, or the organization root.</p>
        pub fn target_id_type(mut self, input: crate::model::TargetIdType) -> Self {
            self.target_id_type = Some(input);
            self
        }
        /// <p>Whether the target is an account, an OU, or the organization root.</p>
        pub fn set_target_id_type(
            mut self,
            input: std::option::Option<crate::model::TargetIdType>,
        ) -> Self {
            self.target_id_type = input;
            self
        }
        /// <p>The Amazon Web Services Region that the summary applies to.</p>
        pub fn region(mut self, input: impl Into<std::string::String>) -> Self {
            self.region = Some(input.into());
            self
        }
        /// <p>The Amazon Web Services Region that the summary applies to.</p>
        pub fn set_region(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.region = input;
            self
        }
        /// <p>The Amazon Web Services resource type.</p>
        pub fn resource_type(mut self, input: impl Into<std::string::String>) -> Self {
            self.resource_type = Some(input.into());
            self
        }
        /// <p>The Amazon Web Services resource type.</p>
        pub fn set_resource_type(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.resource_type = input;
            self
        }
        /// <p>The count of noncompliant resources.</p>
        pub fn non_compliant_resources(mut self, input: i64) -> Self {
            self.non_compliant_resources = Some(input);
            self
        }
        /// <p>The count of noncompliant resources.</p>
        pub fn set_non_compliant_resources(mut self, input: std::option::Option<i64>) -> Self {
            self.non_compliant_resources = input;
            self
        }
        /// Consumes the builder and constructs a [`Summary`](crate::model::Summary).
        pub fn build(self) -> crate::model::Summary {
            crate::model::Summary {
                last_updated: self.last_updated,
                target_id: self.target_id,
                target_id_type: self.target_id_type,
                region: self.region,
                resource_type: self.resource_type,
                non_compliant_resources: self.non_compliant_resources.unwrap_or_default(),
            }
        }
    }
}
impl Summary {
    /// Creates a new builder-style object to manufacture [`Summary`](crate::model::Summary).
    pub fn builder() -> crate::model::summary::Builder {
        crate::model::summary::Builder::default()
    }
}

/// When writing a match expression against `TargetIdType`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let targetidtype = unimplemented!();
/// match targetidtype {
///     TargetIdType::Account => { /* ... */ },
///     TargetIdType::Ou => { /* ... */ },
///     TargetIdType::Root => { /* ... */ },
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
///     _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `targetidtype` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `TargetIdType::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `TargetIdType::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `TargetIdType::NewFeature` is defined.
/// Specifically, when `targetidtype` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `TargetIdType::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum TargetIdType {
    #[allow(missing_docs)] // documentation missing in model
    Account,
    #[allow(missing_docs)] // documentation missing in model
    Ou,
    #[allow(missing_docs)] // documentation missing in model
    Root,
    /// `Unknown` contains new variants that have been added since this code was generated.
    Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for TargetIdType {
    fn from(s: &str) -> Self {
        match s {
            "ACCOUNT" => TargetIdType::Account,
            "OU" => TargetIdType::Ou,
            "ROOT" => TargetIdType::Root,
            other => TargetIdType::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
        }
    }
}
impl std::str::FromStr for TargetIdType {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(TargetIdType::from(s))
    }
}
impl TargetIdType {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            TargetIdType::Account => "ACCOUNT",
            TargetIdType::Ou => "OU",
            TargetIdType::Root => "ROOT",
            TargetIdType::Unknown(value) => value.as_str(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub const fn values() -> &'static [&'static str] {
        &["ACCOUNT", "OU", "ROOT"]
    }
}
impl AsRef<str> for TargetIdType {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

/// When writing a match expression against `GroupByAttribute`, it is important to ensure
/// your code is forward-compatible. That is, if a match arm handles a case for a
/// feature that is supported by the service but has not been represented as an enum
/// variant in a current version of SDK, your code should continue to work when you
/// upgrade SDK to a future version in which the enum does include a variant for that
/// feature.
///
/// Here is an example of how you can make a match expression forward-compatible:
///
/// ```text
/// # let groupbyattribute = unimplemented!();
/// match groupbyattribute {
///     GroupByAttribute::Region => { /* ... */ },
///     GroupByAttribute::ResourceType => { /* ... */ },
///     GroupByAttribute::TargetId => { /* ... */ },
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
///     _ => { /* ... */ },
/// }
/// ```
/// The above code demonstrates that when `groupbyattribute` represents
/// `NewFeature`, the execution path will lead to the second last match arm,
/// even though the enum does not contain a variant `GroupByAttribute::NewFeature`
/// in the current version of SDK. The reason is that the variable `other`,
/// created by the `@` operator, is bound to
/// `GroupByAttribute::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
/// and calling `as_str` on it yields `"NewFeature"`.
/// This match expression is forward-compatible when executed with a newer
/// version of SDK where the variant `GroupByAttribute::NewFeature` is defined.
/// Specifically, when `groupbyattribute` represents `NewFeature`,
/// the execution path will hit the second last match arm as before by virtue of
/// calling `as_str` on `GroupByAttribute::NewFeature` also yielding `"NewFeature"`.
///
/// Explicitly matching on the `Unknown` variant should
/// be avoided for two reasons:
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
/// - It might inadvertently shadow other intended match arms.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
    std::clone::Clone,
    std::cmp::Eq,
    std::cmp::Ord,
    std::cmp::PartialEq,
    std::cmp::PartialOrd,
    std::fmt::Debug,
    std::hash::Hash,
)]
pub enum GroupByAttribute {
    #[allow(missing_docs)] // documentation missing in model
    Region,
    #[allow(missing_docs)] // documentation missing in model
    ResourceType,
    #[allow(missing_docs)] // documentation missing in model
    TargetId,
    /// `Unknown` contains new variants that have been added since this code was generated.
    Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for GroupByAttribute {
    fn from(s: &str) -> Self {
        match s {
            "REGION" => GroupByAttribute::Region,
            "RESOURCE_TYPE" => GroupByAttribute::ResourceType,
            "TARGET_ID" => GroupByAttribute::TargetId,
            other => GroupByAttribute::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
        }
    }
}
impl std::str::FromStr for GroupByAttribute {
    type Err = std::convert::Infallible;

    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
        Ok(GroupByAttribute::from(s))
    }
}
impl GroupByAttribute {
    /// Returns the `&str` value of the enum member.
    pub fn as_str(&self) -> &str {
        match self {
            GroupByAttribute::Region => "REGION",
            GroupByAttribute::ResourceType => "RESOURCE_TYPE",
            GroupByAttribute::TargetId => "TARGET_ID",
            GroupByAttribute::Unknown(value) => value.as_str(),
        }
    }
    /// Returns all the `&str` values of the enum members.
    pub const fn values() -> &'static [&'static str] {
        &["REGION", "RESOURCE_TYPE", "TARGET_ID"]
    }
}
impl AsRef<str> for GroupByAttribute {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}