aws-sdk-rtbfabric 1.26.0

AWS SDK for RTBFabric
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 CreateLinkOutput {
    /// <p>The unique identifier of the gateway.</p>
    pub gateway_id: ::std::string::String,
    /// <p>The unique identifier of the peer gateway.</p>
    pub peer_gateway_id: ::std::string::String,
    /// <p>The status of the request.</p>
    pub status: crate::types::LinkStatus,
    /// <p>The timestamp of when the link was created.</p>
    pub created_at: ::aws_smithy_types::DateTime,
    /// <p>The timestamp of when the link was updated.</p>
    pub updated_at: ::aws_smithy_types::DateTime,
    /// <p>The direction of the link.</p>
    pub direction: ::std::option::Option<crate::types::LinkDirection>,
    /// <p>The configuration of flow modules.</p>
    pub flow_modules: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>,
    /// <p>The configuration of pending flow modules.</p>
    pub pending_flow_modules: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>,
    /// <p>Attributes of the link.</p>
    pub attributes: ::std::option::Option<crate::types::LinkAttributes>,
    /// <p>Describes the settings for a link log.</p>
    pub log_settings: ::std::option::Option<crate::types::LinkLogSettings>,
    /// <p>The connectivity type of the link.</p>
    pub connectivity_type: ::std::option::Option<crate::types::ConnectivityType>,
    /// <p>The unique identifier of the link.</p>
    pub link_id: ::std::string::String,
    /// <p>The customer-provided unique identifier of the link.</p>
    pub customer_provided_id: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateLinkOutput {
    /// <p>The unique identifier of the gateway.</p>
    pub fn gateway_id(&self) -> &str {
        use std::ops::Deref;
        self.gateway_id.deref()
    }
    /// <p>The unique identifier of the peer gateway.</p>
    pub fn peer_gateway_id(&self) -> &str {
        use std::ops::Deref;
        self.peer_gateway_id.deref()
    }
    /// <p>The status of the request.</p>
    pub fn status(&self) -> &crate::types::LinkStatus {
        &self.status
    }
    /// <p>The timestamp of when the link was created.</p>
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// <p>The timestamp of when the link was updated.</p>
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
    /// <p>The direction of the link.</p>
    pub fn direction(&self) -> ::std::option::Option<&crate::types::LinkDirection> {
        self.direction.as_ref()
    }
    /// <p>The configuration of flow modules.</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 `.flow_modules.is_none()`.
    pub fn flow_modules(&self) -> &[crate::types::ModuleConfiguration] {
        self.flow_modules.as_deref().unwrap_or_default()
    }
    /// <p>The configuration of pending flow modules.</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 `.pending_flow_modules.is_none()`.
    pub fn pending_flow_modules(&self) -> &[crate::types::ModuleConfiguration] {
        self.pending_flow_modules.as_deref().unwrap_or_default()
    }
    /// <p>Attributes of the link.</p>
    pub fn attributes(&self) -> ::std::option::Option<&crate::types::LinkAttributes> {
        self.attributes.as_ref()
    }
    /// <p>Describes the settings for a link log.</p>
    pub fn log_settings(&self) -> ::std::option::Option<&crate::types::LinkLogSettings> {
        self.log_settings.as_ref()
    }
    /// <p>The connectivity type of the link.</p>
    pub fn connectivity_type(&self) -> ::std::option::Option<&crate::types::ConnectivityType> {
        self.connectivity_type.as_ref()
    }
    /// <p>The unique identifier of the link.</p>
    pub fn link_id(&self) -> &str {
        use std::ops::Deref;
        self.link_id.deref()
    }
    /// <p>The customer-provided unique identifier of the link.</p>
    pub fn customer_provided_id(&self) -> ::std::option::Option<&str> {
        self.customer_provided_id.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for CreateLinkOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateLinkOutput {
    /// Creates a new builder-style object to manufacture [`CreateLinkOutput`](crate::operation::create_link::CreateLinkOutput).
    pub fn builder() -> crate::operation::create_link::builders::CreateLinkOutputBuilder {
        crate::operation::create_link::builders::CreateLinkOutputBuilder::default()
    }
}

/// A builder for [`CreateLinkOutput`](crate::operation::create_link::CreateLinkOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateLinkOutputBuilder {
    pub(crate) gateway_id: ::std::option::Option<::std::string::String>,
    pub(crate) peer_gateway_id: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::LinkStatus>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) direction: ::std::option::Option<crate::types::LinkDirection>,
    pub(crate) flow_modules: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>,
    pub(crate) pending_flow_modules: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>,
    pub(crate) attributes: ::std::option::Option<crate::types::LinkAttributes>,
    pub(crate) log_settings: ::std::option::Option<crate::types::LinkLogSettings>,
    pub(crate) connectivity_type: ::std::option::Option<crate::types::ConnectivityType>,
    pub(crate) link_id: ::std::option::Option<::std::string::String>,
    pub(crate) customer_provided_id: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateLinkOutputBuilder {
    /// <p>The unique identifier of the gateway.</p>
    /// This field is required.
    pub fn gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.gateway_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the gateway.</p>
    pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.gateway_id = input;
        self
    }
    /// <p>The unique identifier of the gateway.</p>
    pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.gateway_id
    }
    /// <p>The unique identifier of the peer gateway.</p>
    /// This field is required.
    pub fn peer_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.peer_gateway_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the peer gateway.</p>
    pub fn set_peer_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.peer_gateway_id = input;
        self
    }
    /// <p>The unique identifier of the peer gateway.</p>
    pub fn get_peer_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.peer_gateway_id
    }
    /// <p>The status of the request.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::LinkStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the request.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::LinkStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the request.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::LinkStatus> {
        &self.status
    }
    /// <p>The timestamp of when the link was created.</p>
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp of when the link was created.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The timestamp of when the link was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The timestamp of when the link was updated.</p>
    /// This field is required.
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp of when the link was updated.</p>
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// <p>The timestamp of when the link was updated.</p>
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// <p>The direction of the link.</p>
    pub fn direction(mut self, input: crate::types::LinkDirection) -> Self {
        self.direction = ::std::option::Option::Some(input);
        self
    }
    /// <p>The direction of the link.</p>
    pub fn set_direction(mut self, input: ::std::option::Option<crate::types::LinkDirection>) -> Self {
        self.direction = input;
        self
    }
    /// <p>The direction of the link.</p>
    pub fn get_direction(&self) -> &::std::option::Option<crate::types::LinkDirection> {
        &self.direction
    }
    /// Appends an item to `flow_modules`.
    ///
    /// To override the contents of this collection use [`set_flow_modules`](Self::set_flow_modules).
    ///
    /// <p>The configuration of flow modules.</p>
    pub fn flow_modules(mut self, input: crate::types::ModuleConfiguration) -> Self {
        let mut v = self.flow_modules.unwrap_or_default();
        v.push(input);
        self.flow_modules = ::std::option::Option::Some(v);
        self
    }
    /// <p>The configuration of flow modules.</p>
    pub fn set_flow_modules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>) -> Self {
        self.flow_modules = input;
        self
    }
    /// <p>The configuration of flow modules.</p>
    pub fn get_flow_modules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>> {
        &self.flow_modules
    }
    /// Appends an item to `pending_flow_modules`.
    ///
    /// To override the contents of this collection use [`set_pending_flow_modules`](Self::set_pending_flow_modules).
    ///
    /// <p>The configuration of pending flow modules.</p>
    pub fn pending_flow_modules(mut self, input: crate::types::ModuleConfiguration) -> Self {
        let mut v = self.pending_flow_modules.unwrap_or_default();
        v.push(input);
        self.pending_flow_modules = ::std::option::Option::Some(v);
        self
    }
    /// <p>The configuration of pending flow modules.</p>
    pub fn set_pending_flow_modules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>>) -> Self {
        self.pending_flow_modules = input;
        self
    }
    /// <p>The configuration of pending flow modules.</p>
    pub fn get_pending_flow_modules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ModuleConfiguration>> {
        &self.pending_flow_modules
    }
    /// <p>Attributes of the link.</p>
    pub fn attributes(mut self, input: crate::types::LinkAttributes) -> Self {
        self.attributes = ::std::option::Option::Some(input);
        self
    }
    /// <p>Attributes of the link.</p>
    pub fn set_attributes(mut self, input: ::std::option::Option<crate::types::LinkAttributes>) -> Self {
        self.attributes = input;
        self
    }
    /// <p>Attributes of the link.</p>
    pub fn get_attributes(&self) -> &::std::option::Option<crate::types::LinkAttributes> {
        &self.attributes
    }
    /// <p>Describes the settings for a link log.</p>
    pub fn log_settings(mut self, input: crate::types::LinkLogSettings) -> Self {
        self.log_settings = ::std::option::Option::Some(input);
        self
    }
    /// <p>Describes the settings for a link log.</p>
    pub fn set_log_settings(mut self, input: ::std::option::Option<crate::types::LinkLogSettings>) -> Self {
        self.log_settings = input;
        self
    }
    /// <p>Describes the settings for a link log.</p>
    pub fn get_log_settings(&self) -> &::std::option::Option<crate::types::LinkLogSettings> {
        &self.log_settings
    }
    /// <p>The connectivity type of the link.</p>
    pub fn connectivity_type(mut self, input: crate::types::ConnectivityType) -> Self {
        self.connectivity_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The connectivity type of the link.</p>
    pub fn set_connectivity_type(mut self, input: ::std::option::Option<crate::types::ConnectivityType>) -> Self {
        self.connectivity_type = input;
        self
    }
    /// <p>The connectivity type of the link.</p>
    pub fn get_connectivity_type(&self) -> &::std::option::Option<crate::types::ConnectivityType> {
        &self.connectivity_type
    }
    /// <p>The unique identifier of the link.</p>
    /// This field is required.
    pub fn link_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.link_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the link.</p>
    pub fn set_link_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.link_id = input;
        self
    }
    /// <p>The unique identifier of the link.</p>
    pub fn get_link_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.link_id
    }
    /// <p>The customer-provided unique identifier of the link.</p>
    pub fn customer_provided_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.customer_provided_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The customer-provided unique identifier of the link.</p>
    pub fn set_customer_provided_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.customer_provided_id = input;
        self
    }
    /// <p>The customer-provided unique identifier of the link.</p>
    pub fn get_customer_provided_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.customer_provided_id
    }
    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 [`CreateLinkOutput`](crate::operation::create_link::CreateLinkOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`gateway_id`](crate::operation::create_link::builders::CreateLinkOutputBuilder::gateway_id)
    /// - [`peer_gateway_id`](crate::operation::create_link::builders::CreateLinkOutputBuilder::peer_gateway_id)
    /// - [`status`](crate::operation::create_link::builders::CreateLinkOutputBuilder::status)
    /// - [`created_at`](crate::operation::create_link::builders::CreateLinkOutputBuilder::created_at)
    /// - [`updated_at`](crate::operation::create_link::builders::CreateLinkOutputBuilder::updated_at)
    /// - [`link_id`](crate::operation::create_link::builders::CreateLinkOutputBuilder::link_id)
    pub fn build(self) -> ::std::result::Result<crate::operation::create_link::CreateLinkOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_link::CreateLinkOutput {
            gateway_id: self.gateway_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "gateway_id",
                    "gateway_id was not specified but it is required when building CreateLinkOutput",
                )
            })?,
            peer_gateway_id: self.peer_gateway_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "peer_gateway_id",
                    "peer_gateway_id was not specified but it is required when building CreateLinkOutput",
                )
            })?,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building CreateLinkOutput",
                )
            })?,
            created_at: self.created_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_at",
                    "created_at was not specified but it is required when building CreateLinkOutput",
                )
            })?,
            updated_at: self.updated_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "updated_at",
                    "updated_at was not specified but it is required when building CreateLinkOutput",
                )
            })?,
            direction: self.direction,
            flow_modules: self.flow_modules,
            pending_flow_modules: self.pending_flow_modules,
            attributes: self.attributes,
            log_settings: self.log_settings,
            connectivity_type: self.connectivity_type,
            link_id: self.link_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "link_id",
                    "link_id was not specified but it is required when building CreateLinkOutput",
                )
            })?,
            customer_provided_id: self.customer_provided_id,
            _request_id: self._request_id,
        })
    }
}