aws-sdk-mediaconnect 0.27.0

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

/// A request to grant entitlements on a flow.
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GrantFlowEntitlementsInput {
    /// The list of entitlements that you want to grant.
    #[doc(hidden)]
    pub entitlements: std::option::Option<std::vec::Vec<crate::types::GrantEntitlementRequest>>,
    /// The flow that you want to grant entitlements on.
    #[doc(hidden)]
    pub flow_arn: std::option::Option<std::string::String>,
}
impl GrantFlowEntitlementsInput {
    /// The list of entitlements that you want to grant.
    pub fn entitlements(&self) -> std::option::Option<&[crate::types::GrantEntitlementRequest]> {
        self.entitlements.as_deref()
    }
    /// The flow that you want to grant entitlements on.
    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).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
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).
    ///
    /// The list of entitlements that you want to grant.
    pub fn entitlements(mut self, input: crate::types::GrantEntitlementRequest) -> Self {
        let mut v = self.entitlements.unwrap_or_default();
        v.push(input);
        self.entitlements = Some(v);
        self
    }
    /// The list of entitlements that you want to grant.
    pub fn set_entitlements(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::GrantEntitlementRequest>>,
    ) -> Self {
        self.entitlements = input;
        self
    }
    /// The flow that you want to grant entitlements on.
    pub fn flow_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.flow_arn = Some(input.into());
        self
    }
    /// The flow that you want to grant entitlements on.
    pub fn set_flow_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.flow_arn = input;
        self
    }
    /// Consumes the builder and constructs a [`GrantFlowEntitlementsInput`](crate::operation::grant_flow_entitlements::GrantFlowEntitlementsInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::grant_flow_entitlements::GrantFlowEntitlementsInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(
            crate::operation::grant_flow_entitlements::GrantFlowEntitlementsInput {
                entitlements: self.entitlements,
                flow_arn: self.flow_arn,
            },
        )
    }
}