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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// 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)]
pub struct CreateBackupPlanInput {
/// <p>The body of a backup plan. Includes a <code>BackupPlanName</code> and one or more sets of <code>Rules</code>.</p>
pub backup_plan: ::std::option::Option<crate::types::BackupPlanInput>,
/// <p>The tags to assign to the backup plan.</p>
pub backup_plan_tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
/// <p>Identifies the request and allows failed requests to be retried without the risk of running the operation twice. If the request includes a <code>CreatorRequestId</code> that matches an existing backup plan, that plan is returned. This parameter is optional.</p>
/// <p>If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
pub creator_request_id: ::std::option::Option<::std::string::String>,
}
impl CreateBackupPlanInput {
/// <p>The body of a backup plan. Includes a <code>BackupPlanName</code> and one or more sets of <code>Rules</code>.</p>
pub fn backup_plan(&self) -> ::std::option::Option<&crate::types::BackupPlanInput> {
self.backup_plan.as_ref()
}
/// <p>The tags to assign to the backup plan.</p>
pub fn backup_plan_tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.backup_plan_tags.as_ref()
}
/// <p>Identifies the request and allows failed requests to be retried without the risk of running the operation twice. If the request includes a <code>CreatorRequestId</code> that matches an existing backup plan, that plan is returned. This parameter is optional.</p>
/// <p>If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
pub fn creator_request_id(&self) -> ::std::option::Option<&str> {
self.creator_request_id.as_deref()
}
}
impl ::std::fmt::Debug for CreateBackupPlanInput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("CreateBackupPlanInput");
formatter.field("backup_plan", &self.backup_plan);
formatter.field("backup_plan_tags", &"*** Sensitive Data Redacted ***");
formatter.field("creator_request_id", &self.creator_request_id);
formatter.finish()
}
}
impl CreateBackupPlanInput {
/// Creates a new builder-style object to manufacture [`CreateBackupPlanInput`](crate::operation::create_backup_plan::CreateBackupPlanInput).
pub fn builder() -> crate::operation::create_backup_plan::builders::CreateBackupPlanInputBuilder {
crate::operation::create_backup_plan::builders::CreateBackupPlanInputBuilder::default()
}
}
/// A builder for [`CreateBackupPlanInput`](crate::operation::create_backup_plan::CreateBackupPlanInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateBackupPlanInputBuilder {
pub(crate) backup_plan: ::std::option::Option<crate::types::BackupPlanInput>,
pub(crate) backup_plan_tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) creator_request_id: ::std::option::Option<::std::string::String>,
}
impl CreateBackupPlanInputBuilder {
/// <p>The body of a backup plan. Includes a <code>BackupPlanName</code> and one or more sets of <code>Rules</code>.</p>
/// This field is required.
pub fn backup_plan(mut self, input: crate::types::BackupPlanInput) -> Self {
self.backup_plan = ::std::option::Option::Some(input);
self
}
/// <p>The body of a backup plan. Includes a <code>BackupPlanName</code> and one or more sets of <code>Rules</code>.</p>
pub fn set_backup_plan(mut self, input: ::std::option::Option<crate::types::BackupPlanInput>) -> Self {
self.backup_plan = input;
self
}
/// <p>The body of a backup plan. Includes a <code>BackupPlanName</code> and one or more sets of <code>Rules</code>.</p>
pub fn get_backup_plan(&self) -> &::std::option::Option<crate::types::BackupPlanInput> {
&self.backup_plan
}
/// Adds a key-value pair to `backup_plan_tags`.
///
/// To override the contents of this collection use [`set_backup_plan_tags`](Self::set_backup_plan_tags).
///
/// <p>The tags to assign to the backup plan.</p>
pub fn backup_plan_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.backup_plan_tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.backup_plan_tags = ::std::option::Option::Some(hash_map);
self
}
/// <p>The tags to assign to the backup plan.</p>
pub fn set_backup_plan_tags(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.backup_plan_tags = input;
self
}
/// <p>The tags to assign to the backup plan.</p>
pub fn get_backup_plan_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.backup_plan_tags
}
/// <p>Identifies the request and allows failed requests to be retried without the risk of running the operation twice. If the request includes a <code>CreatorRequestId</code> that matches an existing backup plan, that plan is returned. This parameter is optional.</p>
/// <p>If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
pub fn creator_request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.creator_request_id = ::std::option::Option::Some(input.into());
self
}
/// <p>Identifies the request and allows failed requests to be retried without the risk of running the operation twice. If the request includes a <code>CreatorRequestId</code> that matches an existing backup plan, that plan is returned. This parameter is optional.</p>
/// <p>If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
pub fn set_creator_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.creator_request_id = input;
self
}
/// <p>Identifies the request and allows failed requests to be retried without the risk of running the operation twice. If the request includes a <code>CreatorRequestId</code> that matches an existing backup plan, that plan is returned. This parameter is optional.</p>
/// <p>If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
pub fn get_creator_request_id(&self) -> &::std::option::Option<::std::string::String> {
&self.creator_request_id
}
/// Consumes the builder and constructs a [`CreateBackupPlanInput`](crate::operation::create_backup_plan::CreateBackupPlanInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_backup_plan::CreateBackupPlanInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_backup_plan::CreateBackupPlanInput {
backup_plan: self.backup_plan,
backup_plan_tags: self.backup_plan_tags,
creator_request_id: self.creator_request_id,
})
}
}
impl ::std::fmt::Debug for CreateBackupPlanInputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("CreateBackupPlanInputBuilder");
formatter.field("backup_plan", &self.backup_plan);
formatter.field("backup_plan_tags", &"*** Sensitive Data Redacted ***");
formatter.field("creator_request_id", &self.creator_request_id);
formatter.finish()
}
}