aws-sdk-medialive 1.149.0

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

/// A request to update the node.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateNodeInput {
    /// The ID of the cluster
    pub cluster_id: ::std::option::Option<::std::string::String>,
    /// Include this parameter only if you want to change the current name of the Node. Specify a name that is unique in the Cluster. You can't change the name. Names are case-sensitive.
    pub name: ::std::option::Option<::std::string::String>,
    /// The ID of the node.
    pub node_id: ::std::option::Option<::std::string::String>,
    /// The initial role of the Node in the Cluster. ACTIVE means the Node is available for encoding. BACKUP means the Node is a redundant Node and might get used if an ACTIVE Node fails.
    pub role: ::std::option::Option<crate::types::NodeRole>,
    /// The mappings of a SDI capture card port to a logical SDI data stream
    pub sdi_source_mappings: ::std::option::Option<::std::vec::Vec<crate::types::SdiSourceMappingUpdateRequest>>,
}
impl UpdateNodeInput {
    /// The ID of the cluster
    pub fn cluster_id(&self) -> ::std::option::Option<&str> {
        self.cluster_id.as_deref()
    }
    /// Include this parameter only if you want to change the current name of the Node. Specify a name that is unique in the Cluster. You can't change the name. Names are case-sensitive.
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// The ID of the node.
    pub fn node_id(&self) -> ::std::option::Option<&str> {
        self.node_id.as_deref()
    }
    /// The initial role of the Node in the Cluster. ACTIVE means the Node is available for encoding. BACKUP means the Node is a redundant Node and might get used if an ACTIVE Node fails.
    pub fn role(&self) -> ::std::option::Option<&crate::types::NodeRole> {
        self.role.as_ref()
    }
    /// The mappings of a SDI capture card port to a logical SDI data stream
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sdi_source_mappings.is_none()`.
    pub fn sdi_source_mappings(&self) -> &[crate::types::SdiSourceMappingUpdateRequest] {
        self.sdi_source_mappings.as_deref().unwrap_or_default()
    }
}
impl UpdateNodeInput {
    /// Creates a new builder-style object to manufacture [`UpdateNodeInput`](crate::operation::update_node::UpdateNodeInput).
    pub fn builder() -> crate::operation::update_node::builders::UpdateNodeInputBuilder {
        crate::operation::update_node::builders::UpdateNodeInputBuilder::default()
    }
}

/// A builder for [`UpdateNodeInput`](crate::operation::update_node::UpdateNodeInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateNodeInputBuilder {
    pub(crate) cluster_id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) node_id: ::std::option::Option<::std::string::String>,
    pub(crate) role: ::std::option::Option<crate::types::NodeRole>,
    pub(crate) sdi_source_mappings: ::std::option::Option<::std::vec::Vec<crate::types::SdiSourceMappingUpdateRequest>>,
}
impl UpdateNodeInputBuilder {
    /// The ID of the cluster
    /// This field is required.
    pub fn cluster_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.cluster_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The ID of the cluster
    pub fn set_cluster_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.cluster_id = input;
        self
    }
    /// The ID of the cluster
    pub fn get_cluster_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.cluster_id
    }
    /// Include this parameter only if you want to change the current name of the Node. Specify a name that is unique in the Cluster. You can't change the name. 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
    }
    /// Include this parameter only if you want to change the current name of the Node. Specify a name that is unique in the Cluster. You can't change the name. Names are case-sensitive.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// Include this parameter only if you want to change the current name of the Node. Specify a name that is unique in the Cluster. You can't change the name. Names are case-sensitive.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// The ID of the node.
    /// This field is required.
    pub fn node_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.node_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The ID of the node.
    pub fn set_node_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.node_id = input;
        self
    }
    /// The ID of the node.
    pub fn get_node_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.node_id
    }
    /// The initial role of the Node in the Cluster. ACTIVE means the Node is available for encoding. BACKUP means the Node is a redundant Node and might get used if an ACTIVE Node fails.
    pub fn role(mut self, input: crate::types::NodeRole) -> Self {
        self.role = ::std::option::Option::Some(input);
        self
    }
    /// The initial role of the Node in the Cluster. ACTIVE means the Node is available for encoding. BACKUP means the Node is a redundant Node and might get used if an ACTIVE Node fails.
    pub fn set_role(mut self, input: ::std::option::Option<crate::types::NodeRole>) -> Self {
        self.role = input;
        self
    }
    /// The initial role of the Node in the Cluster. ACTIVE means the Node is available for encoding. BACKUP means the Node is a redundant Node and might get used if an ACTIVE Node fails.
    pub fn get_role(&self) -> &::std::option::Option<crate::types::NodeRole> {
        &self.role
    }
    /// Appends an item to `sdi_source_mappings`.
    ///
    /// To override the contents of this collection use [`set_sdi_source_mappings`](Self::set_sdi_source_mappings).
    ///
    /// The mappings of a SDI capture card port to a logical SDI data stream
    pub fn sdi_source_mappings(mut self, input: crate::types::SdiSourceMappingUpdateRequest) -> Self {
        let mut v = self.sdi_source_mappings.unwrap_or_default();
        v.push(input);
        self.sdi_source_mappings = ::std::option::Option::Some(v);
        self
    }
    /// The mappings of a SDI capture card port to a logical SDI data stream
    pub fn set_sdi_source_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SdiSourceMappingUpdateRequest>>) -> Self {
        self.sdi_source_mappings = input;
        self
    }
    /// The mappings of a SDI capture card port to a logical SDI data stream
    pub fn get_sdi_source_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SdiSourceMappingUpdateRequest>> {
        &self.sdi_source_mappings
    }
    /// Consumes the builder and constructs a [`UpdateNodeInput`](crate::operation::update_node::UpdateNodeInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::update_node::UpdateNodeInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_node::UpdateNodeInput {
            cluster_id: self.cluster_id,
            name: self.name,
            node_id: self.node_id,
            role: self.role,
            sdi_source_mappings: self.sdi_source_mappings,
        })
    }
}