aws-sdk-continuum 1.0.0

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

/// Contains the current state of the updated environment. Use GetEnvironment to read its source and environment configuration.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateEnvironmentOutput {
    /// The unique identifier of the updated environment.
    pub environment_id: ::std::string::String,
    /// The ARN of the updated environment.
    pub environment_arn: ::std::string::String,
    /// The current customer-visible name of the environment.
    pub name: ::std::string::String,
    /// The current operational status of the environment.
    pub status: crate::types::EnvironmentStatus,
    /// Human-readable details about the current status.
    pub status_message: ::std::option::Option<::std::string::String>,
    /// The timestamp when the status last transitioned. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
    pub status_updated_at: ::aws_smithy_types::DateTime,
    /// The timestamp when the environment was created. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
    pub created_at: ::aws_smithy_types::DateTime,
    /// Type-specific state, including Collector details and the latest scan. Read source and operating-policy settings through GetEnvironment.
    pub configuration: ::std::option::Option<crate::types::EnvironmentConfigurationDetails>,
    _request_id: Option<String>,
}
impl UpdateEnvironmentOutput {
    /// The unique identifier of the updated environment.
    pub fn environment_id(&self) -> &str {
        use std::ops::Deref;
        self.environment_id.deref()
    }
    /// The ARN of the updated environment.
    pub fn environment_arn(&self) -> &str {
        use std::ops::Deref;
        self.environment_arn.deref()
    }
    /// The current customer-visible name of the environment.
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// The current operational status of the environment.
    pub fn status(&self) -> &crate::types::EnvironmentStatus {
        &self.status
    }
    /// Human-readable details about the current status.
    pub fn status_message(&self) -> ::std::option::Option<&str> {
        self.status_message.as_deref()
    }
    /// The timestamp when the status last transitioned. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
    pub fn status_updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.status_updated_at
    }
    /// The timestamp when the environment was created. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// Type-specific state, including Collector details and the latest scan. Read source and operating-policy settings through GetEnvironment.
    pub fn configuration(&self) -> ::std::option::Option<&crate::types::EnvironmentConfigurationDetails> {
        self.configuration.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for UpdateEnvironmentOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl UpdateEnvironmentOutput {
    /// Creates a new builder-style object to manufacture [`UpdateEnvironmentOutput`](crate::operation::update_environment::UpdateEnvironmentOutput).
    pub fn builder() -> crate::operation::update_environment::builders::UpdateEnvironmentOutputBuilder {
        crate::operation::update_environment::builders::UpdateEnvironmentOutputBuilder::default()
    }
}

/// A builder for [`UpdateEnvironmentOutput`](crate::operation::update_environment::UpdateEnvironmentOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateEnvironmentOutputBuilder {
    pub(crate) environment_id: ::std::option::Option<::std::string::String>,
    pub(crate) environment_arn: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::EnvironmentStatus>,
    pub(crate) status_message: ::std::option::Option<::std::string::String>,
    pub(crate) status_updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) configuration: ::std::option::Option<crate::types::EnvironmentConfigurationDetails>,
    _request_id: Option<String>,
}
impl UpdateEnvironmentOutputBuilder {
    /// The unique identifier of the updated environment.
    /// This field is required.
    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The unique identifier of the updated environment.
    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_id = input;
        self
    }
    /// The unique identifier of the updated environment.
    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_id
    }
    /// The ARN of the updated environment.
    /// This field is required.
    pub fn environment_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The ARN of the updated environment.
    pub fn set_environment_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_arn = input;
        self
    }
    /// The ARN of the updated environment.
    pub fn get_environment_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_arn
    }
    /// The current customer-visible name of the environment.
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// The current customer-visible name of the environment.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// The current customer-visible name of the environment.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// The current operational status of the environment.
    /// This field is required.
    pub fn status(mut self, input: crate::types::EnvironmentStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// The current operational status of the environment.
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::EnvironmentStatus>) -> Self {
        self.status = input;
        self
    }
    /// The current operational status of the environment.
    pub fn get_status(&self) -> &::std::option::Option<crate::types::EnvironmentStatus> {
        &self.status
    }
    /// Human-readable details about the current status.
    pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.status_message = ::std::option::Option::Some(input.into());
        self
    }
    /// Human-readable details about the current status.
    pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.status_message = input;
        self
    }
    /// Human-readable details about the current status.
    pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.status_message
    }
    /// The timestamp when the status last transitioned. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
    /// This field is required.
    pub fn status_updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.status_updated_at = ::std::option::Option::Some(input);
        self
    }
    /// The timestamp when the status last transitioned. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
    pub fn set_status_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.status_updated_at = input;
        self
    }
    /// The timestamp when the status last transitioned. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
    pub fn get_status_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.status_updated_at
    }
    /// The timestamp when the environment was created. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// The timestamp when the environment was created. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// The timestamp when the environment was created. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// Type-specific state, including Collector details and the latest scan. Read source and operating-policy settings through GetEnvironment.
    /// This field is required.
    pub fn configuration(mut self, input: crate::types::EnvironmentConfigurationDetails) -> Self {
        self.configuration = ::std::option::Option::Some(input);
        self
    }
    /// Type-specific state, including Collector details and the latest scan. Read source and operating-policy settings through GetEnvironment.
    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::EnvironmentConfigurationDetails>) -> Self {
        self.configuration = input;
        self
    }
    /// Type-specific state, including Collector details and the latest scan. Read source and operating-policy settings through GetEnvironment.
    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::EnvironmentConfigurationDetails> {
        &self.configuration
    }
    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 [`UpdateEnvironmentOutput`](crate::operation::update_environment::UpdateEnvironmentOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`environment_id`](crate::operation::update_environment::builders::UpdateEnvironmentOutputBuilder::environment_id)
    /// - [`environment_arn`](crate::operation::update_environment::builders::UpdateEnvironmentOutputBuilder::environment_arn)
    /// - [`name`](crate::operation::update_environment::builders::UpdateEnvironmentOutputBuilder::name)
    /// - [`status`](crate::operation::update_environment::builders::UpdateEnvironmentOutputBuilder::status)
    /// - [`status_updated_at`](crate::operation::update_environment::builders::UpdateEnvironmentOutputBuilder::status_updated_at)
    /// - [`created_at`](crate::operation::update_environment::builders::UpdateEnvironmentOutputBuilder::created_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_environment::UpdateEnvironmentOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_environment::UpdateEnvironmentOutput {
            environment_id: self.environment_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "environment_id",
                    "environment_id was not specified but it is required when building UpdateEnvironmentOutput",
                )
            })?,
            environment_arn: self.environment_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "environment_arn",
                    "environment_arn was not specified but it is required when building UpdateEnvironmentOutput",
                )
            })?,
            name: self.name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "name",
                    "name was not specified but it is required when building UpdateEnvironmentOutput",
                )
            })?,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building UpdateEnvironmentOutput",
                )
            })?,
            status_message: self.status_message,
            status_updated_at: self.status_updated_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status_updated_at",
                    "status_updated_at was not specified but it is required when building UpdateEnvironmentOutput",
                )
            })?,
            created_at: self.created_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_at",
                    "created_at was not specified but it is required when building UpdateEnvironmentOutput",
                )
            })?,
            configuration: self.configuration,
            _request_id: self._request_id,
        })
    }
}