aws-sdk-medialive 1.76.0

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

/// Create as many Clusters as you want, but create at least one. Each Cluster groups together Nodes that you want to treat as a collection. Within the Cluster, you will set up some Nodes as active Nodes, and some as backup Nodes, for Node failover purposes. Each Node can belong to only one Cluster.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateClusterInput {
    /// Specify a type. All the Nodes that you later add to this Cluster must be this type of hardware. One Cluster instance can't contain different hardware types. You won't be able to change this parameter after you create the Cluster.
    pub cluster_type: ::std::option::Option<crate::types::ClusterType>,
    /// The ARN of the IAM role for the Node in this Cluster. The role must include all the operations that you expect these Node to perform. If necessary, create a role in IAM, then attach it here.
    pub instance_role_arn: ::std::option::Option<::std::string::String>,
    /// Specify a name that is unique in the AWS account. We recommend that you assign a name that hints at the types of Nodes in the Cluster. Names are case-sensitive.
    pub name: ::std::option::Option<::std::string::String>,
    /// Network settings that connect the Nodes in the Cluster to one or more of the Networks that the Cluster is associated with.
    pub network_settings: ::std::option::Option<crate::types::ClusterNetworkSettingsCreateRequest>,
    /// The unique ID of the request.
    pub request_id: ::std::option::Option<::std::string::String>,
    /// A collection of key-value pairs.
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateClusterInput {
    /// Specify a type. All the Nodes that you later add to this Cluster must be this type of hardware. One Cluster instance can't contain different hardware types. You won't be able to change this parameter after you create the Cluster.
    pub fn cluster_type(&self) -> ::std::option::Option<&crate::types::ClusterType> {
        self.cluster_type.as_ref()
    }
    /// The ARN of the IAM role for the Node in this Cluster. The role must include all the operations that you expect these Node to perform. If necessary, create a role in IAM, then attach it here.
    pub fn instance_role_arn(&self) -> ::std::option::Option<&str> {
        self.instance_role_arn.as_deref()
    }
    /// Specify a name that is unique in the AWS account. We recommend that you assign a name that hints at the types of Nodes in the Cluster. Names are case-sensitive.
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// Network settings that connect the Nodes in the Cluster to one or more of the Networks that the Cluster is associated with.
    pub fn network_settings(&self) -> ::std::option::Option<&crate::types::ClusterNetworkSettingsCreateRequest> {
        self.network_settings.as_ref()
    }
    /// The unique ID of the request.
    pub fn request_id(&self) -> ::std::option::Option<&str> {
        self.request_id.as_deref()
    }
    /// A collection of key-value pairs.
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl CreateClusterInput {
    /// Creates a new builder-style object to manufacture [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
    pub fn builder() -> crate::operation::create_cluster::builders::CreateClusterInputBuilder {
        crate::operation::create_cluster::builders::CreateClusterInputBuilder::default()
    }
}

/// A builder for [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateClusterInputBuilder {
    pub(crate) cluster_type: ::std::option::Option<crate::types::ClusterType>,
    pub(crate) instance_role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) network_settings: ::std::option::Option<crate::types::ClusterNetworkSettingsCreateRequest>,
    pub(crate) request_id: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateClusterInputBuilder {
    /// Specify a type. All the Nodes that you later add to this Cluster must be this type of hardware. One Cluster instance can't contain different hardware types. You won't be able to change this parameter after you create the Cluster.
    pub fn cluster_type(mut self, input: crate::types::ClusterType) -> Self {
        self.cluster_type = ::std::option::Option::Some(input);
        self
    }
    /// Specify a type. All the Nodes that you later add to this Cluster must be this type of hardware. One Cluster instance can't contain different hardware types. You won't be able to change this parameter after you create the Cluster.
    pub fn set_cluster_type(mut self, input: ::std::option::Option<crate::types::ClusterType>) -> Self {
        self.cluster_type = input;
        self
    }
    /// Specify a type. All the Nodes that you later add to this Cluster must be this type of hardware. One Cluster instance can't contain different hardware types. You won't be able to change this parameter after you create the Cluster.
    pub fn get_cluster_type(&self) -> &::std::option::Option<crate::types::ClusterType> {
        &self.cluster_type
    }
    /// The ARN of the IAM role for the Node in this Cluster. The role must include all the operations that you expect these Node to perform. If necessary, create a role in IAM, then attach it here.
    pub fn instance_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The ARN of the IAM role for the Node in this Cluster. The role must include all the operations that you expect these Node to perform. If necessary, create a role in IAM, then attach it here.
    pub fn set_instance_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_role_arn = input;
        self
    }
    /// The ARN of the IAM role for the Node in this Cluster. The role must include all the operations that you expect these Node to perform. If necessary, create a role in IAM, then attach it here.
    pub fn get_instance_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_role_arn
    }
    /// Specify a name that is unique in the AWS account. We recommend that you assign a name that hints at the types of Nodes in the Cluster. Names are case-sensitive.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// Specify a name that is unique in the AWS account. We recommend that you assign a name that hints at the types of Nodes in the Cluster. Names are case-sensitive.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// Specify a name that is unique in the AWS account. We recommend that you assign a name that hints at the types of Nodes in the Cluster. Names are case-sensitive.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// Network settings that connect the Nodes in the Cluster to one or more of the Networks that the Cluster is associated with.
    pub fn network_settings(mut self, input: crate::types::ClusterNetworkSettingsCreateRequest) -> Self {
        self.network_settings = ::std::option::Option::Some(input);
        self
    }
    /// Network settings that connect the Nodes in the Cluster to one or more of the Networks that the Cluster is associated with.
    pub fn set_network_settings(mut self, input: ::std::option::Option<crate::types::ClusterNetworkSettingsCreateRequest>) -> Self {
        self.network_settings = input;
        self
    }
    /// Network settings that connect the Nodes in the Cluster to one or more of the Networks that the Cluster is associated with.
    pub fn get_network_settings(&self) -> &::std::option::Option<crate::types::ClusterNetworkSettingsCreateRequest> {
        &self.network_settings
    }
    /// The unique ID of the request.
    pub fn request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.request_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The unique ID of the request.
    pub fn set_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.request_id = input;
        self
    }
    /// The unique ID of the request.
    pub fn get_request_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.request_id
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// A collection of key-value pairs.
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// A collection of key-value pairs.
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// A collection of key-value pairs.
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_cluster::CreateClusterInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_cluster::CreateClusterInput {
            cluster_type: self.cluster_type,
            instance_role_arn: self.instance_role_arn,
            name: self.name,
            network_settings: self.network_settings,
            request_id: self.request_id,
            tags: self.tags,
        })
    }
}