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 current state of the updated Collector.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateCollectorOutput {
    /// The unique identifier of the updated Collector.
    pub collector_id: ::std::string::String,
    /// The ARN of the updated 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 ARN of the provisioned AWS Config Recorder.
    pub config_recorder_arn: ::std::option::Option<::std::string::String>,
    /// IAM role used to collect Kubernetes cluster metadata.
    pub kubernetes_cluster_role_arn: ::std::option::Option<::std::string::String>,
    /// The timestamp when the Collector was created.
    pub created_at: ::aws_smithy_types::DateTime,
    /// The time of the last successful UpdateCollector call, returned at whole-second precision in the same date-time format as createdAt.
    pub updated_at: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl UpdateCollectorOutput {
    /// The unique identifier of the updated Collector.
    pub fn collector_id(&self) -> &str {
        use std::ops::Deref;
        self.collector_id.deref()
    }
    /// The ARN of the updated 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 ARN of the provisioned AWS Config Recorder.
    pub fn config_recorder_arn(&self) -> ::std::option::Option<&str> {
        self.config_recorder_arn.as_deref()
    }
    /// IAM role used to collect Kubernetes cluster metadata.
    pub fn kubernetes_cluster_role_arn(&self) -> ::std::option::Option<&str> {
        self.kubernetes_cluster_role_arn.as_deref()
    }
    /// The timestamp when the Collector was created.
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// The time of the last successful UpdateCollector call, returned at whole-second precision in the same date-time format as createdAt.
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
}
impl ::aws_types::request_id::RequestId for UpdateCollectorOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl UpdateCollectorOutput {
    /// Creates a new builder-style object to manufacture [`UpdateCollectorOutput`](crate::operation::update_collector::UpdateCollectorOutput).
    pub fn builder() -> crate::operation::update_collector::builders::UpdateCollectorOutputBuilder {
        crate::operation::update_collector::builders::UpdateCollectorOutputBuilder::default()
    }
}

/// A builder for [`UpdateCollectorOutput`](crate::operation::update_collector::UpdateCollectorOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateCollectorOutputBuilder {
    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) config_recorder_arn: ::std::option::Option<::std::string::String>,
    pub(crate) kubernetes_cluster_role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl UpdateCollectorOutputBuilder {
    /// The unique identifier of the updated 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 of the updated Collector.
    pub fn set_collector_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.collector_id = input;
        self
    }
    /// The unique identifier of the updated Collector.
    pub fn get_collector_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.collector_id
    }
    /// The ARN of the updated 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 updated 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 updated 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 ARN of the provisioned AWS Config Recorder.
    pub fn config_recorder_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.config_recorder_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The ARN of the provisioned AWS Config Recorder.
    pub fn set_config_recorder_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.config_recorder_arn = input;
        self
    }
    /// The ARN of the provisioned AWS Config Recorder.
    pub fn get_config_recorder_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.config_recorder_arn
    }
    /// IAM role used to collect Kubernetes cluster metadata.
    pub fn kubernetes_cluster_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.kubernetes_cluster_role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// IAM role used to collect Kubernetes cluster metadata.
    pub fn set_kubernetes_cluster_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.kubernetes_cluster_role_arn = input;
        self
    }
    /// IAM role used to collect Kubernetes cluster metadata.
    pub fn get_kubernetes_cluster_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.kubernetes_cluster_role_arn
    }
    /// 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
    }
    /// The time of the last successful UpdateCollector call, returned at whole-second precision in the same date-time format as createdAt.
    /// 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 time of the last successful UpdateCollector call, returned at whole-second precision in the same date-time format as createdAt.
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// The time of the last successful UpdateCollector call, returned at whole-second precision in the same date-time format as createdAt.
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_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 [`UpdateCollectorOutput`](crate::operation::update_collector::UpdateCollectorOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`collector_id`](crate::operation::update_collector::builders::UpdateCollectorOutputBuilder::collector_id)
    /// - [`collector_arn`](crate::operation::update_collector::builders::UpdateCollectorOutputBuilder::collector_arn)
    /// - [`r#type`](crate::operation::update_collector::builders::UpdateCollectorOutputBuilder::type)
    /// - [`status`](crate::operation::update_collector::builders::UpdateCollectorOutputBuilder::status)
    /// - [`created_at`](crate::operation::update_collector::builders::UpdateCollectorOutputBuilder::created_at)
    /// - [`updated_at`](crate::operation::update_collector::builders::UpdateCollectorOutputBuilder::updated_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_collector::UpdateCollectorOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_collector::UpdateCollectorOutput {
            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 UpdateCollectorOutput",
                )
            })?,
            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 UpdateCollectorOutput",
                )
            })?,
            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 UpdateCollectorOutput",
                )
            })?,
            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 UpdateCollectorOutput",
                )
            })?,
            config_recorder_arn: self.config_recorder_arn,
            kubernetes_cluster_role_arn: self.kubernetes_cluster_role_arn,
            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 UpdateCollectorOutput",
                )
            })?,
            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 UpdateCollectorOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}