1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A complex type that contains information about the traffic policy that you want to create.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateTrafficPolicyInput {
/// <p>The name of the traffic policy.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The definition of this traffic policy in JSON format. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html">Traffic Policy Document Format</a>.</p>
pub document: ::std::option::Option<::std::string::String>,
/// <p>(Optional) Any comments that you want to include about the traffic policy.</p>
pub comment: ::std::option::Option<::std::string::String>,
}
impl CreateTrafficPolicyInput {
/// <p>The name of the traffic policy.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The definition of this traffic policy in JSON format. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html">Traffic Policy Document Format</a>.</p>
pub fn document(&self) -> ::std::option::Option<&str> {
self.document.as_deref()
}
/// <p>(Optional) Any comments that you want to include about the traffic policy.</p>
pub fn comment(&self) -> ::std::option::Option<&str> {
self.comment.as_deref()
}
}
impl CreateTrafficPolicyInput {
/// Creates a new builder-style object to manufacture [`CreateTrafficPolicyInput`](crate::operation::create_traffic_policy::CreateTrafficPolicyInput).
pub fn builder() -> crate::operation::create_traffic_policy::builders::CreateTrafficPolicyInputBuilder {
crate::operation::create_traffic_policy::builders::CreateTrafficPolicyInputBuilder::default()
}
}
/// A builder for [`CreateTrafficPolicyInput`](crate::operation::create_traffic_policy::CreateTrafficPolicyInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CreateTrafficPolicyInputBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) document: ::std::option::Option<::std::string::String>,
pub(crate) comment: ::std::option::Option<::std::string::String>,
}
impl CreateTrafficPolicyInputBuilder {
/// <p>The name of the traffic policy.</p>
/// This field is required.
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the traffic policy.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the traffic policy.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The definition of this traffic policy in JSON format. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html">Traffic Policy Document Format</a>.</p>
/// This field is required.
pub fn document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.document = ::std::option::Option::Some(input.into());
self
}
/// <p>The definition of this traffic policy in JSON format. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html">Traffic Policy Document Format</a>.</p>
pub fn set_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.document = input;
self
}
/// <p>The definition of this traffic policy in JSON format. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html">Traffic Policy Document Format</a>.</p>
pub fn get_document(&self) -> &::std::option::Option<::std::string::String> {
&self.document
}
/// <p>(Optional) Any comments that you want to include about the traffic policy.</p>
pub fn comment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.comment = ::std::option::Option::Some(input.into());
self
}
/// <p>(Optional) Any comments that you want to include about the traffic policy.</p>
pub fn set_comment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.comment = input;
self
}
/// <p>(Optional) Any comments that you want to include about the traffic policy.</p>
pub fn get_comment(&self) -> &::std::option::Option<::std::string::String> {
&self.comment
}
/// Consumes the builder and constructs a [`CreateTrafficPolicyInput`](crate::operation::create_traffic_policy::CreateTrafficPolicyInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_traffic_policy::CreateTrafficPolicyInput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::create_traffic_policy::CreateTrafficPolicyInput {
name: self.name,
document: self.document,
comment: self.comment,
})
}
}