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 Environment and the Collector associated by this request.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AssociateCollectorOutput {
    /// The unique identifier of the Environment making the association.
    pub environment_id: ::std::string::String,
    /// The ARN of the Environment making the association.
    pub environment_arn: ::std::string::String,
    /// The Collector identifier and ARN validated by this operation.
    pub associated_collector: ::std::option::Option<crate::types::AssociatedCollector>,
    _request_id: Option<String>,
}
impl AssociateCollectorOutput {
    /// The unique identifier of the Environment making the association.
    pub fn environment_id(&self) -> &str {
        use std::ops::Deref;
        self.environment_id.deref()
    }
    /// The ARN of the Environment making the association.
    pub fn environment_arn(&self) -> &str {
        use std::ops::Deref;
        self.environment_arn.deref()
    }
    /// The Collector identifier and ARN validated by this operation.
    pub fn associated_collector(&self) -> ::std::option::Option<&crate::types::AssociatedCollector> {
        self.associated_collector.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for AssociateCollectorOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl AssociateCollectorOutput {
    /// Creates a new builder-style object to manufacture [`AssociateCollectorOutput`](crate::operation::associate_collector::AssociateCollectorOutput).
    pub fn builder() -> crate::operation::associate_collector::builders::AssociateCollectorOutputBuilder {
        crate::operation::associate_collector::builders::AssociateCollectorOutputBuilder::default()
    }
}

/// A builder for [`AssociateCollectorOutput`](crate::operation::associate_collector::AssociateCollectorOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AssociateCollectorOutputBuilder {
    pub(crate) environment_id: ::std::option::Option<::std::string::String>,
    pub(crate) environment_arn: ::std::option::Option<::std::string::String>,
    pub(crate) associated_collector: ::std::option::Option<crate::types::AssociatedCollector>,
    _request_id: Option<String>,
}
impl AssociateCollectorOutputBuilder {
    /// The unique identifier of the Environment making the association.
    /// 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 making the association.
    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 making the association.
    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_id
    }
    /// The ARN of the Environment making the association.
    /// 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 making the association.
    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 making the association.
    pub fn get_environment_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_arn
    }
    /// The Collector identifier and ARN validated by this operation.
    /// This field is required.
    pub fn associated_collector(mut self, input: crate::types::AssociatedCollector) -> Self {
        self.associated_collector = ::std::option::Option::Some(input);
        self
    }
    /// The Collector identifier and ARN validated by this operation.
    pub fn set_associated_collector(mut self, input: ::std::option::Option<crate::types::AssociatedCollector>) -> Self {
        self.associated_collector = input;
        self
    }
    /// The Collector identifier and ARN validated by this operation.
    pub fn get_associated_collector(&self) -> &::std::option::Option<crate::types::AssociatedCollector> {
        &self.associated_collector
    }
    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 [`AssociateCollectorOutput`](crate::operation::associate_collector::AssociateCollectorOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`environment_id`](crate::operation::associate_collector::builders::AssociateCollectorOutputBuilder::environment_id)
    /// - [`environment_arn`](crate::operation::associate_collector::builders::AssociateCollectorOutputBuilder::environment_arn)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::associate_collector::AssociateCollectorOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::associate_collector::AssociateCollectorOutput {
            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 AssociateCollectorOutput",
                )
            })?,
            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 AssociateCollectorOutput",
                )
            })?,
            associated_collector: self.associated_collector,
            _request_id: self._request_id,
        })
    }
}