aws-sdk-continuum 1.1.0

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

/// Contains the identifier and ARN of the newly created Collector.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateCollectorOutput {
    /// The unique identifier assigned to the Collector.
    pub collector_id: ::std::string::String,
    /// The ARN of the created Collector.
    pub collector_arn: ::std::string::String,
    /// The source collected by this Collector.
    pub r#type: crate::types::CollectorType,
    /// The current lifecycle status.
    pub status: crate::types::CollectorStatus,
    /// The timestamp when the Collector was created.
    pub created_at: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl CreateCollectorOutput {
    /// The unique identifier assigned to the Collector.
    pub fn collector_id(&self) -> &str {
        use std::ops::Deref;
        self.collector_id.deref()
    }
    /// The ARN of the created Collector.
    pub fn collector_arn(&self) -> &str {
        use std::ops::Deref;
        self.collector_arn.deref()
    }
    /// The source collected by this Collector.
    pub fn r#type(&self) -> &crate::types::CollectorType {
        &self.r#type
    }
    /// The current lifecycle status.
    pub fn status(&self) -> &crate::types::CollectorStatus {
        &self.status
    }
    /// The timestamp when the Collector was created.
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
}
impl ::aws_types::request_id::RequestId for CreateCollectorOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateCollectorOutput {
    /// Creates a new builder-style object to manufacture [`CreateCollectorOutput`](crate::operation::create_collector::CreateCollectorOutput).
    pub fn builder() -> crate::operation::create_collector::builders::CreateCollectorOutputBuilder {
        crate::operation::create_collector::builders::CreateCollectorOutputBuilder::default()
    }
}

/// A builder for [`CreateCollectorOutput`](crate::operation::create_collector::CreateCollectorOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateCollectorOutputBuilder {
    pub(crate) collector_id: ::std::option::Option<::std::string::String>,
    pub(crate) collector_arn: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::CollectorType>,
    pub(crate) status: ::std::option::Option<crate::types::CollectorStatus>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl CreateCollectorOutputBuilder {
    /// The unique identifier assigned to the Collector.
    /// This field is required.
    pub fn collector_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.collector_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The unique identifier assigned to the Collector.
    pub fn set_collector_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.collector_id = input;
        self
    }
    /// The unique identifier assigned to the Collector.
    pub fn get_collector_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.collector_id
    }
    /// The ARN of the created Collector.
    /// This field is required.
    pub fn collector_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.collector_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The ARN of the created Collector.
    pub fn set_collector_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.collector_arn = input;
        self
    }
    /// The ARN of the created Collector.
    pub fn get_collector_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.collector_arn
    }
    /// The source collected by this Collector.
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::CollectorType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// The source collected by this Collector.
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::CollectorType>) -> Self {
        self.r#type = input;
        self
    }
    /// The source collected by this Collector.
    pub fn get_type(&self) -> &::std::option::Option<crate::types::CollectorType> {
        &self.r#type
    }
    /// The current lifecycle status.
    /// This field is required.
    pub fn status(mut self, input: crate::types::CollectorStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// The current lifecycle status.
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::CollectorStatus>) -> Self {
        self.status = input;
        self
    }
    /// The current lifecycle status.
    pub fn get_status(&self) -> &::std::option::Option<crate::types::CollectorStatus> {
        &self.status
    }
    /// The timestamp when the Collector 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 Collector 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 Collector was created.
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    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 [`CreateCollectorOutput`](crate::operation::create_collector::CreateCollectorOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`collector_id`](crate::operation::create_collector::builders::CreateCollectorOutputBuilder::collector_id)
    /// - [`collector_arn`](crate::operation::create_collector::builders::CreateCollectorOutputBuilder::collector_arn)
    /// - [`r#type`](crate::operation::create_collector::builders::CreateCollectorOutputBuilder::type)
    /// - [`status`](crate::operation::create_collector::builders::CreateCollectorOutputBuilder::status)
    /// - [`created_at`](crate::operation::create_collector::builders::CreateCollectorOutputBuilder::created_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_collector::CreateCollectorOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_collector::CreateCollectorOutput {
            collector_id: self.collector_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "collector_id",
                    "collector_id was not specified but it is required when building CreateCollectorOutput",
                )
            })?,
            collector_arn: self.collector_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "collector_arn",
                    "collector_arn was not specified but it is required when building CreateCollectorOutput",
                )
            })?,
            r#type: self.r#type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "r#type",
                    "r#type was not specified but it is required when building CreateCollectorOutput",
                )
            })?,
            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 CreateCollectorOutput",
                )
            })?,
            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 CreateCollectorOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}