aws-sdk-mediaconnect 1.109.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 TakeRouterInputOutput {
    /// <p>The state of the association between the router input and output.</p>
    pub routed_state: crate::types::RouterOutputRoutedState,
    /// <p>The ARN of the associated router output.</p>
    pub router_output_arn: ::std::string::String,
    /// <p>The name of the associated router output.</p>
    pub router_output_name: ::std::string::String,
    /// <p>The ARN of the associated router input.</p>
    pub router_input_arn: ::std::option::Option<::std::string::String>,
    /// <p>The name of the associated router input.</p>
    pub router_input_name: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl TakeRouterInputOutput {
    /// <p>The state of the association between the router input and output.</p>
    pub fn routed_state(&self) -> &crate::types::RouterOutputRoutedState {
        &self.routed_state
    }
    /// <p>The ARN of the associated router output.</p>
    pub fn router_output_arn(&self) -> &str {
        use std::ops::Deref;
        self.router_output_arn.deref()
    }
    /// <p>The name of the associated router output.</p>
    pub fn router_output_name(&self) -> &str {
        use std::ops::Deref;
        self.router_output_name.deref()
    }
    /// <p>The ARN of the associated router input.</p>
    pub fn router_input_arn(&self) -> ::std::option::Option<&str> {
        self.router_input_arn.as_deref()
    }
    /// <p>The name of the associated router input.</p>
    pub fn router_input_name(&self) -> ::std::option::Option<&str> {
        self.router_input_name.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for TakeRouterInputOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl TakeRouterInputOutput {
    /// Creates a new builder-style object to manufacture [`TakeRouterInputOutput`](crate::operation::take_router_input::TakeRouterInputOutput).
    pub fn builder() -> crate::operation::take_router_input::builders::TakeRouterInputOutputBuilder {
        crate::operation::take_router_input::builders::TakeRouterInputOutputBuilder::default()
    }
}

/// A builder for [`TakeRouterInputOutput`](crate::operation::take_router_input::TakeRouterInputOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct TakeRouterInputOutputBuilder {
    pub(crate) routed_state: ::std::option::Option<crate::types::RouterOutputRoutedState>,
    pub(crate) router_output_arn: ::std::option::Option<::std::string::String>,
    pub(crate) router_output_name: ::std::option::Option<::std::string::String>,
    pub(crate) router_input_arn: ::std::option::Option<::std::string::String>,
    pub(crate) router_input_name: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl TakeRouterInputOutputBuilder {
    /// <p>The state of the association between the router input and output.</p>
    /// This field is required.
    pub fn routed_state(mut self, input: crate::types::RouterOutputRoutedState) -> Self {
        self.routed_state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state of the association between the router input and output.</p>
    pub fn set_routed_state(mut self, input: ::std::option::Option<crate::types::RouterOutputRoutedState>) -> Self {
        self.routed_state = input;
        self
    }
    /// <p>The state of the association between the router input and output.</p>
    pub fn get_routed_state(&self) -> &::std::option::Option<crate::types::RouterOutputRoutedState> {
        &self.routed_state
    }
    /// <p>The ARN of the associated router output.</p>
    /// This field is required.
    pub fn router_output_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.router_output_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the associated router output.</p>
    pub fn set_router_output_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.router_output_arn = input;
        self
    }
    /// <p>The ARN of the associated router output.</p>
    pub fn get_router_output_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.router_output_arn
    }
    /// <p>The name of the associated router output.</p>
    /// This field is required.
    pub fn router_output_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.router_output_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the associated router output.</p>
    pub fn set_router_output_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.router_output_name = input;
        self
    }
    /// <p>The name of the associated router output.</p>
    pub fn get_router_output_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.router_output_name
    }
    /// <p>The ARN of the associated router input.</p>
    pub fn router_input_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.router_input_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the associated router input.</p>
    pub fn set_router_input_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.router_input_arn = input;
        self
    }
    /// <p>The ARN of the associated router input.</p>
    pub fn get_router_input_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.router_input_arn
    }
    /// <p>The name of the associated router input.</p>
    pub fn router_input_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.router_input_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the associated router input.</p>
    pub fn set_router_input_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.router_input_name = input;
        self
    }
    /// <p>The name of the associated router input.</p>
    pub fn get_router_input_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.router_input_name
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`TakeRouterInputOutput`](crate::operation::take_router_input::TakeRouterInputOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`routed_state`](crate::operation::take_router_input::builders::TakeRouterInputOutputBuilder::routed_state)
    /// - [`router_output_arn`](crate::operation::take_router_input::builders::TakeRouterInputOutputBuilder::router_output_arn)
    /// - [`router_output_name`](crate::operation::take_router_input::builders::TakeRouterInputOutputBuilder::router_output_name)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::take_router_input::TakeRouterInputOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::take_router_input::TakeRouterInputOutput {
            routed_state: self.routed_state.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "routed_state",
                    "routed_state was not specified but it is required when building TakeRouterInputOutput",
                )
            })?,
            router_output_arn: self.router_output_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "router_output_arn",
                    "router_output_arn was not specified but it is required when building TakeRouterInputOutput",
                )
            })?,
            router_output_name: self.router_output_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "router_output_name",
                    "router_output_name was not specified but it is required when building TakeRouterInputOutput",
                )
            })?,
            router_input_arn: self.router_input_arn,
            router_input_name: self.router_input_name,
            _request_id: self._request_id,
        })
    }
}