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 and configuration of the requested environment.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetEnvironmentOutput {
    /// The unique identifier of the environment.
    pub environment_id: ::std::string::String,
    /// The ARN of the environment.
    pub environment_arn: ::std::string::String,
    /// The 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. Present when the status requires additional context (e.g., failure reason).
    pub status_message: ::std::option::Option<::std::string::String>,
    /// The timestamp when the status last transitioned.
    pub status_updated_at: ::aws_smithy_types::DateTime,
    /// The timestamp when the environment was created.
    pub created_at: ::aws_smithy_types::DateTime,
    /// The timestamp when the environment's properties were last updated.
    pub updated_at: ::aws_smithy_types::DateTime,
    /// Type-specific configuration and state, including code sources, operating policy, Collector details, and the latest scan.
    pub configuration: ::std::option::Option<crate::types::EnvironmentConfigurationDetails>,
    _request_id: Option<String>,
}
impl GetEnvironmentOutput {
    /// The unique identifier of the environment.
    pub fn environment_id(&self) -> &str {
        use std::ops::Deref;
        self.environment_id.deref()
    }
    /// The ARN of the environment.
    pub fn environment_arn(&self) -> &str {
        use std::ops::Deref;
        self.environment_arn.deref()
    }
    /// The 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. Present when the status requires additional context (e.g., failure reason).
    pub fn status_message(&self) -> ::std::option::Option<&str> {
        self.status_message.as_deref()
    }
    /// The timestamp when the status last transitioned.
    pub fn status_updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.status_updated_at
    }
    /// The timestamp when the environment was created.
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// The timestamp when the environment's properties were last updated.
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
    /// Type-specific configuration and state, including code sources, operating policy, Collector details, and the latest scan.
    pub fn configuration(&self) -> ::std::option::Option<&crate::types::EnvironmentConfigurationDetails> {
        self.configuration.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetEnvironmentOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetEnvironmentOutput {
    /// Creates a new builder-style object to manufacture [`GetEnvironmentOutput`](crate::operation::get_environment::GetEnvironmentOutput).
    pub fn builder() -> crate::operation::get_environment::builders::GetEnvironmentOutputBuilder {
        crate::operation::get_environment::builders::GetEnvironmentOutputBuilder::default()
    }
}

/// A builder for [`GetEnvironmentOutput`](crate::operation::get_environment::GetEnvironmentOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetEnvironmentOutputBuilder {
    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) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) configuration: ::std::option::Option<crate::types::EnvironmentConfigurationDetails>,
    _request_id: Option<String>,
}
impl GetEnvironmentOutputBuilder {
    /// The unique identifier of the 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 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 environment.
    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_id
    }
    /// The ARN of the 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 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 environment.
    pub fn get_environment_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_arn
    }
    /// The 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 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 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. Present when the status requires additional context (e.g., failure reason).
    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. Present when the status requires additional context (e.g., failure reason).
    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. Present when the status requires additional context (e.g., failure reason).
    pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.status_message
    }
    /// The timestamp when the status last transitioned.
    /// 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.
    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.
    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.
    /// 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.
    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.
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// The timestamp when the environment's properties were last updated.
    /// This field is required.
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// The timestamp when the environment's properties were last updated.
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// The timestamp when the environment's properties were last updated.
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// Type-specific configuration and state, including code sources, operating policy, Collector details, and the latest scan.
    /// This field is required.
    pub fn configuration(mut self, input: crate::types::EnvironmentConfigurationDetails) -> Self {
        self.configuration = ::std::option::Option::Some(input);
        self
    }
    /// Type-specific configuration and state, including code sources, operating policy, Collector details, and the latest scan.
    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::EnvironmentConfigurationDetails>) -> Self {
        self.configuration = input;
        self
    }
    /// Type-specific configuration and state, including code sources, operating policy, Collector details, and the latest scan.
    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 [`GetEnvironmentOutput`](crate::operation::get_environment::GetEnvironmentOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`environment_id`](crate::operation::get_environment::builders::GetEnvironmentOutputBuilder::environment_id)
    /// - [`environment_arn`](crate::operation::get_environment::builders::GetEnvironmentOutputBuilder::environment_arn)
    /// - [`name`](crate::operation::get_environment::builders::GetEnvironmentOutputBuilder::name)
    /// - [`status`](crate::operation::get_environment::builders::GetEnvironmentOutputBuilder::status)
    /// - [`status_updated_at`](crate::operation::get_environment::builders::GetEnvironmentOutputBuilder::status_updated_at)
    /// - [`created_at`](crate::operation::get_environment::builders::GetEnvironmentOutputBuilder::created_at)
    /// - [`updated_at`](crate::operation::get_environment::builders::GetEnvironmentOutputBuilder::updated_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_environment::GetEnvironmentOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_environment::GetEnvironmentOutput {
            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 GetEnvironmentOutput",
                )
            })?,
            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 GetEnvironmentOutput",
                )
            })?,
            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 GetEnvironmentOutput",
                )
            })?,
            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 GetEnvironmentOutput",
                )
            })?,
            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 GetEnvironmentOutput",
                )
            })?,
            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 GetEnvironmentOutput",
                )
            })?,
            updated_at: self.updated_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "updated_at",
                    "updated_at was not specified but it is required when building GetEnvironmentOutput",
                )
            })?,
            configuration: self.configuration,
            _request_id: self._request_id,
        })
    }
}