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.

/// Creates a Collector for the authenticated caller.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateCollectorInput {
    /// Source to collect. Defaults to AWS_COLLECTOR when omitted.
    pub r#type: ::std::option::Option<crate::types::CollectorType>,
    /// IAM role configuration used to collect Kubernetes cluster metadata. The authenticated caller must be allowed to pass its exact roleArn to Continuum.
    pub kubernetes_cluster_role: ::std::option::Option<crate::types::KubernetesClusterRoleConfiguration>,
    /// Caller-provided token that makes retried create requests return the original Collector rather than creating a duplicate.
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl CreateCollectorInput {
    /// Source to collect. Defaults to AWS_COLLECTOR when omitted.
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::CollectorType> {
        self.r#type.as_ref()
    }
    /// IAM role configuration used to collect Kubernetes cluster metadata. The authenticated caller must be allowed to pass its exact roleArn to Continuum.
    pub fn kubernetes_cluster_role(&self) -> ::std::option::Option<&crate::types::KubernetesClusterRoleConfiguration> {
        self.kubernetes_cluster_role.as_ref()
    }
    /// Caller-provided token that makes retried create requests return the original Collector rather than creating a duplicate.
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl CreateCollectorInput {
    /// Creates a new builder-style object to manufacture [`CreateCollectorInput`](crate::operation::create_collector::CreateCollectorInput).
    pub fn builder() -> crate::operation::create_collector::builders::CreateCollectorInputBuilder {
        crate::operation::create_collector::builders::CreateCollectorInputBuilder::default()
    }
}

/// A builder for [`CreateCollectorInput`](crate::operation::create_collector::CreateCollectorInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateCollectorInputBuilder {
    pub(crate) r#type: ::std::option::Option<crate::types::CollectorType>,
    pub(crate) kubernetes_cluster_role: ::std::option::Option<crate::types::KubernetesClusterRoleConfiguration>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl CreateCollectorInputBuilder {
    /// Source to collect. Defaults to AWS_COLLECTOR when omitted.
    pub fn r#type(mut self, input: crate::types::CollectorType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// Source to collect. Defaults to AWS_COLLECTOR when omitted.
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::CollectorType>) -> Self {
        self.r#type = input;
        self
    }
    /// Source to collect. Defaults to AWS_COLLECTOR when omitted.
    pub fn get_type(&self) -> &::std::option::Option<crate::types::CollectorType> {
        &self.r#type
    }
    /// IAM role configuration used to collect Kubernetes cluster metadata. The authenticated caller must be allowed to pass its exact roleArn to Continuum.
    pub fn kubernetes_cluster_role(mut self, input: crate::types::KubernetesClusterRoleConfiguration) -> Self {
        self.kubernetes_cluster_role = ::std::option::Option::Some(input);
        self
    }
    /// IAM role configuration used to collect Kubernetes cluster metadata. The authenticated caller must be allowed to pass its exact roleArn to Continuum.
    pub fn set_kubernetes_cluster_role(mut self, input: ::std::option::Option<crate::types::KubernetesClusterRoleConfiguration>) -> Self {
        self.kubernetes_cluster_role = input;
        self
    }
    /// IAM role configuration used to collect Kubernetes cluster metadata. The authenticated caller must be allowed to pass its exact roleArn to Continuum.
    pub fn get_kubernetes_cluster_role(&self) -> &::std::option::Option<crate::types::KubernetesClusterRoleConfiguration> {
        &self.kubernetes_cluster_role
    }
    /// Caller-provided token that makes retried create requests return the original Collector rather than creating a duplicate.
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// Caller-provided token that makes retried create requests return the original Collector rather than creating a duplicate.
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// Caller-provided token that makes retried create requests return the original Collector rather than creating a duplicate.
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`CreateCollectorInput`](crate::operation::create_collector::CreateCollectorInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_collector::CreateCollectorInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_collector::CreateCollectorInput {
            r#type: self.r#type,
            kubernetes_cluster_role: self.kubernetes_cluster_role,
            client_token: self.client_token,
        })
    }
}