Skip to main content

aws_sdk_ec2/types/
_cidr_authorization_context.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Provides authorization for Amazon to bring a specific IP address range to a specific Amazon Web Services account using bring your own IP addresses (BYOIP). For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#prepare-for-byoip">Configuring your BYOIP address range</a> in the <i>Amazon EC2 User Guide</i>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CidrAuthorizationContext {
7    /// <p>The plain-text authorization message for the prefix and account.</p>
8    pub message: ::std::option::Option<::std::string::String>,
9    /// <p>The signed authorization message for the prefix and account.</p>
10    pub signature: ::std::option::Option<::std::string::String>,
11}
12impl CidrAuthorizationContext {
13    /// <p>The plain-text authorization message for the prefix and account.</p>
14    pub fn message(&self) -> ::std::option::Option<&str> {
15        self.message.as_deref()
16    }
17    /// <p>The signed authorization message for the prefix and account.</p>
18    pub fn signature(&self) -> ::std::option::Option<&str> {
19        self.signature.as_deref()
20    }
21}
22impl CidrAuthorizationContext {
23    /// Creates a new builder-style object to manufacture [`CidrAuthorizationContext`](crate::types::CidrAuthorizationContext).
24    pub fn builder() -> crate::types::builders::CidrAuthorizationContextBuilder {
25        crate::types::builders::CidrAuthorizationContextBuilder::default()
26    }
27}
28
29/// A builder for [`CidrAuthorizationContext`](crate::types::CidrAuthorizationContext).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct CidrAuthorizationContextBuilder {
33    pub(crate) message: ::std::option::Option<::std::string::String>,
34    pub(crate) signature: ::std::option::Option<::std::string::String>,
35}
36impl CidrAuthorizationContextBuilder {
37    /// <p>The plain-text authorization message for the prefix and account.</p>
38    /// This field is required.
39    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
40        self.message = ::std::option::Option::Some(input.into());
41        self
42    }
43    /// <p>The plain-text authorization message for the prefix and account.</p>
44    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
45        self.message = input;
46        self
47    }
48    /// <p>The plain-text authorization message for the prefix and account.</p>
49    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
50        &self.message
51    }
52    /// <p>The signed authorization message for the prefix and account.</p>
53    /// This field is required.
54    pub fn signature(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.signature = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The signed authorization message for the prefix and account.</p>
59    pub fn set_signature(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.signature = input;
61        self
62    }
63    /// <p>The signed authorization message for the prefix and account.</p>
64    pub fn get_signature(&self) -> &::std::option::Option<::std::string::String> {
65        &self.signature
66    }
67    /// Consumes the builder and constructs a [`CidrAuthorizationContext`](crate::types::CidrAuthorizationContext).
68    pub fn build(self) -> crate::types::CidrAuthorizationContext {
69        crate::types::CidrAuthorizationContext {
70            message: self.message,
71            signature: self.signature,
72        }
73    }
74}