aws-sdk-medialive 1.78.0

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

/// Used in DescribeNetworkResult, DescribeNetworkSummary, UpdateNetworkResult.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Route {
    /// A CIDR block for one Route.
    pub cidr: ::std::option::Option<::std::string::String>,
    /// The IP address of the Gateway for this route, if applicable.
    pub gateway: ::std::option::Option<::std::string::String>,
}
impl Route {
    /// A CIDR block for one Route.
    pub fn cidr(&self) -> ::std::option::Option<&str> {
        self.cidr.as_deref()
    }
    /// The IP address of the Gateway for this route, if applicable.
    pub fn gateway(&self) -> ::std::option::Option<&str> {
        self.gateway.as_deref()
    }
}
impl Route {
    /// Creates a new builder-style object to manufacture [`Route`](crate::types::Route).
    pub fn builder() -> crate::types::builders::RouteBuilder {
        crate::types::builders::RouteBuilder::default()
    }
}

/// A builder for [`Route`](crate::types::Route).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RouteBuilder {
    pub(crate) cidr: ::std::option::Option<::std::string::String>,
    pub(crate) gateway: ::std::option::Option<::std::string::String>,
}
impl RouteBuilder {
    /// A CIDR block for one Route.
    pub fn cidr(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.cidr = ::std::option::Option::Some(input.into());
        self
    }
    /// A CIDR block for one Route.
    pub fn set_cidr(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.cidr = input;
        self
    }
    /// A CIDR block for one Route.
    pub fn get_cidr(&self) -> &::std::option::Option<::std::string::String> {
        &self.cidr
    }
    /// The IP address of the Gateway for this route, if applicable.
    pub fn gateway(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.gateway = ::std::option::Option::Some(input.into());
        self
    }
    /// The IP address of the Gateway for this route, if applicable.
    pub fn set_gateway(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.gateway = input;
        self
    }
    /// The IP address of the Gateway for this route, if applicable.
    pub fn get_gateway(&self) -> &::std::option::Option<::std::string::String> {
        &self.gateway
    }
    /// Consumes the builder and constructs a [`Route`](crate::types::Route).
    pub fn build(self) -> crate::types::Route {
        crate::types::Route {
            cidr: self.cidr,
            gateway: self.gateway,
        }
    }
}