aws-sdk-securityhub 1.110.0

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

/// <p>Information about a country.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Country {
    /// <p>The 2-letter ISO 3166 country code for the country.</p>
    pub country_code: ::std::option::Option<::std::string::String>,
    /// <p>The name of the country.</p>
    pub country_name: ::std::option::Option<::std::string::String>,
}
impl Country {
    /// <p>The 2-letter ISO 3166 country code for the country.</p>
    pub fn country_code(&self) -> ::std::option::Option<&str> {
        self.country_code.as_deref()
    }
    /// <p>The name of the country.</p>
    pub fn country_name(&self) -> ::std::option::Option<&str> {
        self.country_name.as_deref()
    }
}
impl Country {
    /// Creates a new builder-style object to manufacture [`Country`](crate::types::Country).
    pub fn builder() -> crate::types::builders::CountryBuilder {
        crate::types::builders::CountryBuilder::default()
    }
}

/// A builder for [`Country`](crate::types::Country).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CountryBuilder {
    pub(crate) country_code: ::std::option::Option<::std::string::String>,
    pub(crate) country_name: ::std::option::Option<::std::string::String>,
}
impl CountryBuilder {
    /// <p>The 2-letter ISO 3166 country code for the country.</p>
    pub fn country_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.country_code = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The 2-letter ISO 3166 country code for the country.</p>
    pub fn set_country_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.country_code = input;
        self
    }
    /// <p>The 2-letter ISO 3166 country code for the country.</p>
    pub fn get_country_code(&self) -> &::std::option::Option<::std::string::String> {
        &self.country_code
    }
    /// <p>The name of the country.</p>
    pub fn country_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.country_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the country.</p>
    pub fn set_country_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.country_name = input;
        self
    }
    /// <p>The name of the country.</p>
    pub fn get_country_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.country_name
    }
    /// Consumes the builder and constructs a [`Country`](crate::types::Country).
    pub fn build(self) -> crate::types::Country {
        crate::types::Country {
            country_code: self.country_code,
            country_name: self.country_name,
        }
    }
}