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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Represents a request to add or update a sending authorization policy for an identity. Sending authorization is an Amazon SES feature that enables you to authorize other senders to use your identities. For information, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/sending-authorization.html">Amazon SES Developer Guide</a>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PutIdentityPolicyInput {
/// <p>The identity to which that the policy applies. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). Examples: <code>user@example.com</code>, <code>example.com</code>, <code>arn:aws:ses:us-east-1:123456789012:identity/example.com</code>.</p>
/// <p>To successfully call this operation, you must own the identity.</p>
pub identity: ::std::option::Option<::std::string::String>,
/// <p>The name of the policy.</p>
/// <p>The policy name cannot exceed 64 characters and can only include alphanumeric characters, dashes, and underscores.</p>
pub policy_name: ::std::option::Option<::std::string::String>,
/// <p>The text of the policy in JSON format. The policy cannot exceed 4 KB.</p>
/// <p>For information about the syntax of sending authorization policies, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/sending-authorization-policies.html">Amazon SES Developer Guide</a>.</p>
pub policy: ::std::option::Option<::std::string::String>,
}
impl PutIdentityPolicyInput {
/// <p>The identity to which that the policy applies. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). Examples: <code>user@example.com</code>, <code>example.com</code>, <code>arn:aws:ses:us-east-1:123456789012:identity/example.com</code>.</p>
/// <p>To successfully call this operation, you must own the identity.</p>
pub fn identity(&self) -> ::std::option::Option<&str> {
self.identity.as_deref()
}
/// <p>The name of the policy.</p>
/// <p>The policy name cannot exceed 64 characters and can only include alphanumeric characters, dashes, and underscores.</p>
pub fn policy_name(&self) -> ::std::option::Option<&str> {
self.policy_name.as_deref()
}
/// <p>The text of the policy in JSON format. The policy cannot exceed 4 KB.</p>
/// <p>For information about the syntax of sending authorization policies, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/sending-authorization-policies.html">Amazon SES Developer Guide</a>.</p>
pub fn policy(&self) -> ::std::option::Option<&str> {
self.policy.as_deref()
}
}
impl PutIdentityPolicyInput {
/// Creates a new builder-style object to manufacture [`PutIdentityPolicyInput`](crate::operation::put_identity_policy::PutIdentityPolicyInput).
pub fn builder() -> crate::operation::put_identity_policy::builders::PutIdentityPolicyInputBuilder {
crate::operation::put_identity_policy::builders::PutIdentityPolicyInputBuilder::default()
}
}
/// A builder for [`PutIdentityPolicyInput`](crate::operation::put_identity_policy::PutIdentityPolicyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutIdentityPolicyInputBuilder {
pub(crate) identity: ::std::option::Option<::std::string::String>,
pub(crate) policy_name: ::std::option::Option<::std::string::String>,
pub(crate) policy: ::std::option::Option<::std::string::String>,
}
impl PutIdentityPolicyInputBuilder {
/// <p>The identity to which that the policy applies. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). Examples: <code>user@example.com</code>, <code>example.com</code>, <code>arn:aws:ses:us-east-1:123456789012:identity/example.com</code>.</p>
/// <p>To successfully call this operation, you must own the identity.</p>
/// This field is required.
pub fn identity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.identity = ::std::option::Option::Some(input.into());
self
}
/// <p>The identity to which that the policy applies. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). Examples: <code>user@example.com</code>, <code>example.com</code>, <code>arn:aws:ses:us-east-1:123456789012:identity/example.com</code>.</p>
/// <p>To successfully call this operation, you must own the identity.</p>
pub fn set_identity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.identity = input;
self
}
/// <p>The identity to which that the policy applies. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). Examples: <code>user@example.com</code>, <code>example.com</code>, <code>arn:aws:ses:us-east-1:123456789012:identity/example.com</code>.</p>
/// <p>To successfully call this operation, you must own the identity.</p>
pub fn get_identity(&self) -> &::std::option::Option<::std::string::String> {
&self.identity
}
/// <p>The name of the policy.</p>
/// <p>The policy name cannot exceed 64 characters and can only include alphanumeric characters, dashes, and underscores.</p>
/// This field is required.
pub fn policy_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.policy_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the policy.</p>
/// <p>The policy name cannot exceed 64 characters and can only include alphanumeric characters, dashes, and underscores.</p>
pub fn set_policy_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.policy_name = input;
self
}
/// <p>The name of the policy.</p>
/// <p>The policy name cannot exceed 64 characters and can only include alphanumeric characters, dashes, and underscores.</p>
pub fn get_policy_name(&self) -> &::std::option::Option<::std::string::String> {
&self.policy_name
}
/// <p>The text of the policy in JSON format. The policy cannot exceed 4 KB.</p>
/// <p>For information about the syntax of sending authorization policies, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/sending-authorization-policies.html">Amazon SES Developer Guide</a>.</p>
/// This field is required.
pub fn policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.policy = ::std::option::Option::Some(input.into());
self
}
/// <p>The text of the policy in JSON format. The policy cannot exceed 4 KB.</p>
/// <p>For information about the syntax of sending authorization policies, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/sending-authorization-policies.html">Amazon SES Developer Guide</a>.</p>
pub fn set_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.policy = input;
self
}
/// <p>The text of the policy in JSON format. The policy cannot exceed 4 KB.</p>
/// <p>For information about the syntax of sending authorization policies, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/sending-authorization-policies.html">Amazon SES Developer Guide</a>.</p>
pub fn get_policy(&self) -> &::std::option::Option<::std::string::String> {
&self.policy
}
/// Consumes the builder and constructs a [`PutIdentityPolicyInput`](crate::operation::put_identity_policy::PutIdentityPolicyInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::put_identity_policy::PutIdentityPolicyInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::put_identity_policy::PutIdentityPolicyInput {
identity: self.identity,
policy_name: self.policy_name,
policy: self.policy,
})
}
}