aws-sdk-supplychain 1.97.0

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

/// <p>The details of the instance.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Instance {
    /// <p>The Amazon Web Services Supply Chain instance identifier.</p>
    pub instance_id: ::std::string::String,
    /// <p>The Amazon Web Services account ID that owns the instance.</p>
    pub aws_account_id: ::std::string::String,
    /// <p>The state of the instance.</p>
    pub state: crate::types::InstanceState,
    /// <p>The Amazon Web Services Supply Chain instance error message. If the instance results in an unhealthy state, customers need to check the error message, delete the current instance, and recreate a new one based on the mitigation from the error message.</p>
    pub error_message: ::std::option::Option<::std::string::String>,
    /// <p>The WebApp DNS domain name of the instance.</p>
    pub web_app_dns_domain: ::std::option::Option<::std::string::String>,
    /// <p>The instance creation timestamp.</p>
    pub created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The instance last modified timestamp.</p>
    pub last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The Amazon Web Services Supply Chain instance name.</p>
    pub instance_name: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Web Services Supply Chain instance description.</p>
    pub instance_description: ::std::option::Option<::std::string::String>,
    /// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you optionally provided for encryption. If you did not provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key and nothing is returned.</p>
    pub kms_key_arn: ::std::option::Option<::std::string::String>,
    /// <p>The version number of the instance.</p>
    pub version_number: ::std::option::Option<f64>,
}
impl Instance {
    /// <p>The Amazon Web Services Supply Chain instance identifier.</p>
    pub fn instance_id(&self) -> &str {
        use std::ops::Deref;
        self.instance_id.deref()
    }
    /// <p>The Amazon Web Services account ID that owns the instance.</p>
    pub fn aws_account_id(&self) -> &str {
        use std::ops::Deref;
        self.aws_account_id.deref()
    }
    /// <p>The state of the instance.</p>
    pub fn state(&self) -> &crate::types::InstanceState {
        &self.state
    }
    /// <p>The Amazon Web Services Supply Chain instance error message. If the instance results in an unhealthy state, customers need to check the error message, delete the current instance, and recreate a new one based on the mitigation from the error message.</p>
    pub fn error_message(&self) -> ::std::option::Option<&str> {
        self.error_message.as_deref()
    }
    /// <p>The WebApp DNS domain name of the instance.</p>
    pub fn web_app_dns_domain(&self) -> ::std::option::Option<&str> {
        self.web_app_dns_domain.as_deref()
    }
    /// <p>The instance creation timestamp.</p>
    pub fn created_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_time.as_ref()
    }
    /// <p>The instance last modified timestamp.</p>
    pub fn last_modified_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_modified_time.as_ref()
    }
    /// <p>The Amazon Web Services Supply Chain instance name.</p>
    pub fn instance_name(&self) -> ::std::option::Option<&str> {
        self.instance_name.as_deref()
    }
    /// <p>The Amazon Web Services Supply Chain instance description.</p>
    pub fn instance_description(&self) -> ::std::option::Option<&str> {
        self.instance_description.as_deref()
    }
    /// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you optionally provided for encryption. If you did not provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key and nothing is returned.</p>
    pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
        self.kms_key_arn.as_deref()
    }
    /// <p>The version number of the instance.</p>
    pub fn version_number(&self) -> ::std::option::Option<f64> {
        self.version_number
    }
}
impl Instance {
    /// Creates a new builder-style object to manufacture [`Instance`](crate::types::Instance).
    pub fn builder() -> crate::types::builders::InstanceBuilder {
        crate::types::builders::InstanceBuilder::default()
    }
}

/// A builder for [`Instance`](crate::types::Instance).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct InstanceBuilder {
    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
    pub(crate) aws_account_id: ::std::option::Option<::std::string::String>,
    pub(crate) state: ::std::option::Option<crate::types::InstanceState>,
    pub(crate) error_message: ::std::option::Option<::std::string::String>,
    pub(crate) web_app_dns_domain: ::std::option::Option<::std::string::String>,
    pub(crate) created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) instance_name: ::std::option::Option<::std::string::String>,
    pub(crate) instance_description: ::std::option::Option<::std::string::String>,
    pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
    pub(crate) version_number: ::std::option::Option<f64>,
}
impl InstanceBuilder {
    /// <p>The Amazon Web Services Supply Chain instance identifier.</p>
    /// This field is required.
    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Web Services Supply Chain instance identifier.</p>
    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_id = input;
        self
    }
    /// <p>The Amazon Web Services Supply Chain instance identifier.</p>
    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_id
    }
    /// <p>The Amazon Web Services account ID that owns the instance.</p>
    /// This field is required.
    pub fn aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.aws_account_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Web Services account ID that owns the instance.</p>
    pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.aws_account_id = input;
        self
    }
    /// <p>The Amazon Web Services account ID that owns the instance.</p>
    pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.aws_account_id
    }
    /// <p>The state of the instance.</p>
    /// This field is required.
    pub fn state(mut self, input: crate::types::InstanceState) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state of the instance.</p>
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::InstanceState>) -> Self {
        self.state = input;
        self
    }
    /// <p>The state of the instance.</p>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::InstanceState> {
        &self.state
    }
    /// <p>The Amazon Web Services Supply Chain instance error message. If the instance results in an unhealthy state, customers need to check the error message, delete the current instance, and recreate a new one based on the mitigation from the error message.</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 Amazon Web Services Supply Chain instance error message. If the instance results in an unhealthy state, customers need to check the error message, delete the current instance, and recreate a new one based on the mitigation from the error message.</p>
    pub fn set_error_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.error_message = input;
        self
    }
    /// <p>The Amazon Web Services Supply Chain instance error message. If the instance results in an unhealthy state, customers need to check the error message, delete the current instance, and recreate a new one based on the mitigation from the error message.</p>
    pub fn get_error_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.error_message
    }
    /// <p>The WebApp DNS domain name of the instance.</p>
    pub fn web_app_dns_domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.web_app_dns_domain = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The WebApp DNS domain name of the instance.</p>
    pub fn set_web_app_dns_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.web_app_dns_domain = input;
        self
    }
    /// <p>The WebApp DNS domain name of the instance.</p>
    pub fn get_web_app_dns_domain(&self) -> &::std::option::Option<::std::string::String> {
        &self.web_app_dns_domain
    }
    /// <p>The instance creation timestamp.</p>
    pub fn created_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The instance creation timestamp.</p>
    pub fn set_created_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_time = input;
        self
    }
    /// <p>The instance creation timestamp.</p>
    pub fn get_created_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_time
    }
    /// <p>The instance last modified timestamp.</p>
    pub fn last_modified_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_modified_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The instance last modified timestamp.</p>
    pub fn set_last_modified_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_modified_time = input;
        self
    }
    /// <p>The instance last modified timestamp.</p>
    pub fn get_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_modified_time
    }
    /// <p>The Amazon Web Services Supply Chain instance name.</p>
    pub fn instance_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Web Services Supply Chain instance name.</p>
    pub fn set_instance_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_name = input;
        self
    }
    /// <p>The Amazon Web Services Supply Chain instance name.</p>
    pub fn get_instance_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_name
    }
    /// <p>The Amazon Web Services Supply Chain instance description.</p>
    pub fn instance_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Web Services Supply Chain instance description.</p>
    pub fn set_instance_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_description = input;
        self
    }
    /// <p>The Amazon Web Services Supply Chain instance description.</p>
    pub fn get_instance_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_description
    }
    /// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you optionally provided for encryption. If you did not provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key and nothing is returned.</p>
    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.kms_key_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you optionally provided for encryption. If you did not provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key and nothing is returned.</p>
    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.kms_key_arn = input;
        self
    }
    /// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you optionally provided for encryption. If you did not provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key and nothing is returned.</p>
    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.kms_key_arn
    }
    /// <p>The version number of the instance.</p>
    pub fn version_number(mut self, input: f64) -> Self {
        self.version_number = ::std::option::Option::Some(input);
        self
    }
    /// <p>The version number of the instance.</p>
    pub fn set_version_number(mut self, input: ::std::option::Option<f64>) -> Self {
        self.version_number = input;
        self
    }
    /// <p>The version number of the instance.</p>
    pub fn get_version_number(&self) -> &::std::option::Option<f64> {
        &self.version_number
    }
    /// Consumes the builder and constructs a [`Instance`](crate::types::Instance).
    /// This method will fail if any of the following fields are not set:
    /// - [`instance_id`](crate::types::builders::InstanceBuilder::instance_id)
    /// - [`aws_account_id`](crate::types::builders::InstanceBuilder::aws_account_id)
    /// - [`state`](crate::types::builders::InstanceBuilder::state)
    pub fn build(self) -> ::std::result::Result<crate::types::Instance, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Instance {
            instance_id: self.instance_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "instance_id",
                    "instance_id was not specified but it is required when building Instance",
                )
            })?,
            aws_account_id: self.aws_account_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "aws_account_id",
                    "aws_account_id was not specified but it is required when building Instance",
                )
            })?,
            state: self.state.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "state",
                    "state was not specified but it is required when building Instance",
                )
            })?,
            error_message: self.error_message,
            web_app_dns_domain: self.web_app_dns_domain,
            created_time: self.created_time,
            last_modified_time: self.last_modified_time,
            instance_name: self.instance_name,
            instance_description: self.instance_description,
            kms_key_arn: self.kms_key_arn,
            version_number: self.version_number,
        })
    }
}