aws-sdk-networkmonitor 1.88.0

AWS SDK for Amazon CloudWatch Network Monitor
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 CreateProbeOutput {
    /// <p>The ID of the probe for which details are returned.</p>
    pub probe_id: ::std::option::Option<::std::string::String>,
    /// <p>The ARN of the probe.</p>
    pub probe_arn: ::std::option::Option<::std::string::String>,
    /// <p>The ARN of the probe.</p>
    pub source_arn: ::std::string::String,
    /// <p>The destination IP address for the monitor. This must be either an IPv4 or IPv6 address.</p>
    pub destination: ::std::string::String,
    /// <p>The port associated with the <code>destination</code>. This is required only if the <code>protocol</code> is <code>TCP</code> and must be a number between <code>1</code> and <code>65536</code>.</p>
    pub destination_port: ::std::option::Option<i32>,
    /// <p>The protocol used for the network traffic between the <code>source</code> and <code>destination</code>. This must be either <code>TCP</code> or <code>ICMP</code>.</p>
    pub protocol: crate::types::Protocol,
    /// <p>The size of the packets sent between the source and destination. This must be a number between <code>56</code> and <code>8500</code>.</p>
    pub packet_size: ::std::option::Option<i32>,
    /// <p>Indicates whether the IP address is <code>IPV4</code> or <code>IPV6</code>.</p>
    pub address_family: ::std::option::Option<crate::types::AddressFamily>,
    /// <p>The ID of the source VPC or subnet.</p>
    pub vpc_id: ::std::option::Option<::std::string::String>,
    /// <p>The state of the probe.</p>
    pub state: ::std::option::Option<crate::types::ProbeState>,
    /// <p>The time and date that the probe was created.</p>
    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The time and date when the probe was last modified.</p>
    pub modified_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The list of key-value pairs assigned to the probe.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    _request_id: Option<String>,
}
impl CreateProbeOutput {
    /// <p>The ID of the probe for which details are returned.</p>
    pub fn probe_id(&self) -> ::std::option::Option<&str> {
        self.probe_id.as_deref()
    }
    /// <p>The ARN of the probe.</p>
    pub fn probe_arn(&self) -> ::std::option::Option<&str> {
        self.probe_arn.as_deref()
    }
    /// <p>The ARN of the probe.</p>
    pub fn source_arn(&self) -> &str {
        use std::ops::Deref;
        self.source_arn.deref()
    }
    /// <p>The destination IP address for the monitor. This must be either an IPv4 or IPv6 address.</p>
    pub fn destination(&self) -> &str {
        use std::ops::Deref;
        self.destination.deref()
    }
    /// <p>The port associated with the <code>destination</code>. This is required only if the <code>protocol</code> is <code>TCP</code> and must be a number between <code>1</code> and <code>65536</code>.</p>
    pub fn destination_port(&self) -> ::std::option::Option<i32> {
        self.destination_port
    }
    /// <p>The protocol used for the network traffic between the <code>source</code> and <code>destination</code>. This must be either <code>TCP</code> or <code>ICMP</code>.</p>
    pub fn protocol(&self) -> &crate::types::Protocol {
        &self.protocol
    }
    /// <p>The size of the packets sent between the source and destination. This must be a number between <code>56</code> and <code>8500</code>.</p>
    pub fn packet_size(&self) -> ::std::option::Option<i32> {
        self.packet_size
    }
    /// <p>Indicates whether the IP address is <code>IPV4</code> or <code>IPV6</code>.</p>
    pub fn address_family(&self) -> ::std::option::Option<&crate::types::AddressFamily> {
        self.address_family.as_ref()
    }
    /// <p>The ID of the source VPC or subnet.</p>
    pub fn vpc_id(&self) -> ::std::option::Option<&str> {
        self.vpc_id.as_deref()
    }
    /// <p>The state of the probe.</p>
    pub fn state(&self) -> ::std::option::Option<&crate::types::ProbeState> {
        self.state.as_ref()
    }
    /// <p>The time and date that the probe was created.</p>
    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_at.as_ref()
    }
    /// <p>The time and date when the probe was last modified.</p>
    pub fn modified_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.modified_at.as_ref()
    }
    /// <p>The list of key-value pairs assigned to the probe.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for CreateProbeOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateProbeOutput {
    /// Creates a new builder-style object to manufacture [`CreateProbeOutput`](crate::operation::create_probe::CreateProbeOutput).
    pub fn builder() -> crate::operation::create_probe::builders::CreateProbeOutputBuilder {
        crate::operation::create_probe::builders::CreateProbeOutputBuilder::default()
    }
}

/// A builder for [`CreateProbeOutput`](crate::operation::create_probe::CreateProbeOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateProbeOutputBuilder {
    pub(crate) probe_id: ::std::option::Option<::std::string::String>,
    pub(crate) probe_arn: ::std::option::Option<::std::string::String>,
    pub(crate) source_arn: ::std::option::Option<::std::string::String>,
    pub(crate) destination: ::std::option::Option<::std::string::String>,
    pub(crate) destination_port: ::std::option::Option<i32>,
    pub(crate) protocol: ::std::option::Option<crate::types::Protocol>,
    pub(crate) packet_size: ::std::option::Option<i32>,
    pub(crate) address_family: ::std::option::Option<crate::types::AddressFamily>,
    pub(crate) vpc_id: ::std::option::Option<::std::string::String>,
    pub(crate) state: ::std::option::Option<crate::types::ProbeState>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) modified_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    _request_id: Option<String>,
}
impl CreateProbeOutputBuilder {
    /// <p>The ID of the probe for which details are returned.</p>
    pub fn probe_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.probe_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the probe for which details are returned.</p>
    pub fn set_probe_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.probe_id = input;
        self
    }
    /// <p>The ID of the probe for which details are returned.</p>
    pub fn get_probe_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.probe_id
    }
    /// <p>The ARN of the probe.</p>
    pub fn probe_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.probe_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the probe.</p>
    pub fn set_probe_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.probe_arn = input;
        self
    }
    /// <p>The ARN of the probe.</p>
    pub fn get_probe_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.probe_arn
    }
    /// <p>The ARN of the probe.</p>
    /// This field is required.
    pub fn source_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.source_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the probe.</p>
    pub fn set_source_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.source_arn = input;
        self
    }
    /// <p>The ARN of the probe.</p>
    pub fn get_source_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.source_arn
    }
    /// <p>The destination IP address for the monitor. This must be either an IPv4 or IPv6 address.</p>
    /// This field is required.
    pub fn destination(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.destination = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The destination IP address for the monitor. This must be either an IPv4 or IPv6 address.</p>
    pub fn set_destination(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.destination = input;
        self
    }
    /// <p>The destination IP address for the monitor. This must be either an IPv4 or IPv6 address.</p>
    pub fn get_destination(&self) -> &::std::option::Option<::std::string::String> {
        &self.destination
    }
    /// <p>The port associated with the <code>destination</code>. This is required only if the <code>protocol</code> is <code>TCP</code> and must be a number between <code>1</code> and <code>65536</code>.</p>
    pub fn destination_port(mut self, input: i32) -> Self {
        self.destination_port = ::std::option::Option::Some(input);
        self
    }
    /// <p>The port associated with the <code>destination</code>. This is required only if the <code>protocol</code> is <code>TCP</code> and must be a number between <code>1</code> and <code>65536</code>.</p>
    pub fn set_destination_port(mut self, input: ::std::option::Option<i32>) -> Self {
        self.destination_port = input;
        self
    }
    /// <p>The port associated with the <code>destination</code>. This is required only if the <code>protocol</code> is <code>TCP</code> and must be a number between <code>1</code> and <code>65536</code>.</p>
    pub fn get_destination_port(&self) -> &::std::option::Option<i32> {
        &self.destination_port
    }
    /// <p>The protocol used for the network traffic between the <code>source</code> and <code>destination</code>. This must be either <code>TCP</code> or <code>ICMP</code>.</p>
    /// This field is required.
    pub fn protocol(mut self, input: crate::types::Protocol) -> Self {
        self.protocol = ::std::option::Option::Some(input);
        self
    }
    /// <p>The protocol used for the network traffic between the <code>source</code> and <code>destination</code>. This must be either <code>TCP</code> or <code>ICMP</code>.</p>
    pub fn set_protocol(mut self, input: ::std::option::Option<crate::types::Protocol>) -> Self {
        self.protocol = input;
        self
    }
    /// <p>The protocol used for the network traffic between the <code>source</code> and <code>destination</code>. This must be either <code>TCP</code> or <code>ICMP</code>.</p>
    pub fn get_protocol(&self) -> &::std::option::Option<crate::types::Protocol> {
        &self.protocol
    }
    /// <p>The size of the packets sent between the source and destination. This must be a number between <code>56</code> and <code>8500</code>.</p>
    pub fn packet_size(mut self, input: i32) -> Self {
        self.packet_size = ::std::option::Option::Some(input);
        self
    }
    /// <p>The size of the packets sent between the source and destination. This must be a number between <code>56</code> and <code>8500</code>.</p>
    pub fn set_packet_size(mut self, input: ::std::option::Option<i32>) -> Self {
        self.packet_size = input;
        self
    }
    /// <p>The size of the packets sent between the source and destination. This must be a number between <code>56</code> and <code>8500</code>.</p>
    pub fn get_packet_size(&self) -> &::std::option::Option<i32> {
        &self.packet_size
    }
    /// <p>Indicates whether the IP address is <code>IPV4</code> or <code>IPV6</code>.</p>
    pub fn address_family(mut self, input: crate::types::AddressFamily) -> Self {
        self.address_family = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether the IP address is <code>IPV4</code> or <code>IPV6</code>.</p>
    pub fn set_address_family(mut self, input: ::std::option::Option<crate::types::AddressFamily>) -> Self {
        self.address_family = input;
        self
    }
    /// <p>Indicates whether the IP address is <code>IPV4</code> or <code>IPV6</code>.</p>
    pub fn get_address_family(&self) -> &::std::option::Option<crate::types::AddressFamily> {
        &self.address_family
    }
    /// <p>The ID of the source VPC or subnet.</p>
    pub fn vpc_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.vpc_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the source VPC or subnet.</p>
    pub fn set_vpc_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.vpc_id = input;
        self
    }
    /// <p>The ID of the source VPC or subnet.</p>
    pub fn get_vpc_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.vpc_id
    }
    /// <p>The state of the probe.</p>
    pub fn state(mut self, input: crate::types::ProbeState) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state of the probe.</p>
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::ProbeState>) -> Self {
        self.state = input;
        self
    }
    /// <p>The state of the probe.</p>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::ProbeState> {
        &self.state
    }
    /// <p>The time and date that the probe was created.</p>
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time and date that the probe 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 time and date that the probe was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The time and date when the probe was last modified.</p>
    pub fn modified_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.modified_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time and date when the probe was last modified.</p>
    pub fn set_modified_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.modified_at = input;
        self
    }
    /// <p>The time and date when the probe was last modified.</p>
    pub fn get_modified_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.modified_at
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The list of key-value pairs assigned to the probe.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The list of key-value pairs assigned to the probe.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The list of key-value pairs assigned to the probe.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    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 [`CreateProbeOutput`](crate::operation::create_probe::CreateProbeOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`source_arn`](crate::operation::create_probe::builders::CreateProbeOutputBuilder::source_arn)
    /// - [`destination`](crate::operation::create_probe::builders::CreateProbeOutputBuilder::destination)
    /// - [`protocol`](crate::operation::create_probe::builders::CreateProbeOutputBuilder::protocol)
    pub fn build(self) -> ::std::result::Result<crate::operation::create_probe::CreateProbeOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_probe::CreateProbeOutput {
            probe_id: self.probe_id,
            probe_arn: self.probe_arn,
            source_arn: self.source_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "source_arn",
                    "source_arn was not specified but it is required when building CreateProbeOutput",
                )
            })?,
            destination: self.destination.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "destination",
                    "destination was not specified but it is required when building CreateProbeOutput",
                )
            })?,
            destination_port: self.destination_port,
            protocol: self.protocol.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "protocol",
                    "protocol was not specified but it is required when building CreateProbeOutput",
                )
            })?,
            packet_size: self.packet_size,
            address_family: self.address_family,
            vpc_id: self.vpc_id,
            state: self.state,
            created_at: self.created_at,
            modified_at: self.modified_at,
            tags: self.tags,
            _request_id: self._request_id,
        })
    }
}