aws-sdk-mediaconnect 1.108.0

AWS SDK for AWS MediaConnect
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GrantFlowEntitlementsInput {
    /// <p>The list of entitlements that you want to grant.</p>
    pub entitlements: ::std::option::Option<::std::vec::Vec<crate::types::GrantEntitlementRequest>>,
    /// <p>The Amazon Resource Name (ARN) of the flow that you want to grant entitlements on.</p>
    pub flow_arn: ::std::option::Option<::std::string::String>,
}
impl GrantFlowEntitlementsInput {
    /// <p>The list of entitlements that you want to grant.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.entitlements.is_none()`.
    pub fn entitlements(&self) -> &[crate::types::GrantEntitlementRequest] {
        self.entitlements.as_deref().unwrap_or_default()
    }
    /// <p>The Amazon Resource Name (ARN) of the flow that you want to grant entitlements on.</p>
    pub fn flow_arn(&self) -> ::std::option::Option<&str> {
        self.flow_arn.as_deref()
    }
}
impl GrantFlowEntitlementsInput {
    /// Creates a new builder-style object to manufacture [`GrantFlowEntitlementsInput`](crate::operation::grant_flow_entitlements::GrantFlowEntitlementsInput).
    pub fn builder() -> crate::operation::grant_flow_entitlements::builders::GrantFlowEntitlementsInputBuilder {
        crate::operation::grant_flow_entitlements::builders::GrantFlowEntitlementsInputBuilder::default()
    }
}

/// A builder for [`GrantFlowEntitlementsInput`](crate::operation::grant_flow_entitlements::GrantFlowEntitlementsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GrantFlowEntitlementsInputBuilder {
    pub(crate) entitlements: ::std::option::Option<::std::vec::Vec<crate::types::GrantEntitlementRequest>>,
    pub(crate) flow_arn: ::std::option::Option<::std::string::String>,
}
impl GrantFlowEntitlementsInputBuilder {
    /// Appends an item to `entitlements`.
    ///
    /// To override the contents of this collection use [`set_entitlements`](Self::set_entitlements).
    ///
    /// <p>The list of entitlements that you want to grant.</p>
    pub fn entitlements(mut self, input: crate::types::GrantEntitlementRequest) -> Self {
        let mut v = self.entitlements.unwrap_or_default();
        v.push(input);
        self.entitlements = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of entitlements that you want to grant.</p>
    pub fn set_entitlements(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GrantEntitlementRequest>>) -> Self {
        self.entitlements = input;
        self
    }
    /// <p>The list of entitlements that you want to grant.</p>
    pub fn get_entitlements(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GrantEntitlementRequest>> {
        &self.entitlements
    }
    /// <p>The Amazon Resource Name (ARN) of the flow that you want to grant entitlements on.</p>
    /// This field is required.
    pub fn flow_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.flow_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the flow that you want to grant entitlements on.</p>
    pub fn set_flow_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.flow_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the flow that you want to grant entitlements on.</p>
    pub fn get_flow_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.flow_arn
    }
    /// Consumes the builder and constructs a [`GrantFlowEntitlementsInput`](crate::operation::grant_flow_entitlements::GrantFlowEntitlementsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::grant_flow_entitlements::GrantFlowEntitlementsInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::grant_flow_entitlements::GrantFlowEntitlementsInput {
            entitlements: self.entitlements,
            flow_arn: self.flow_arn,
        })
    }
}