aws_sdk_iot/operation/update_package/
_update_package_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct UpdatePackageInput {
6    /// <p>The name of the target software package.</p>
7    pub package_name: ::std::option::Option<::std::string::String>,
8    /// <p>The package description.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the default package version.</p>
11    /// <p><b>Note:</b> You cannot name a <code>defaultVersion</code> and set <code>unsetDefaultVersion</code> equal to <code>true</code> at the same time.</p>
12    pub default_version_name: ::std::option::Option<::std::string::String>,
13    /// <p>Indicates whether you want to remove the named default package version from the software package. Set as <code>true</code> to remove the default package version.</p>
14    /// <p><b>Note:</b> You cannot name a <code>defaultVersion</code> and set <code>unsetDefaultVersion</code> equal to <code>true</code> at the same time.</p>
15    pub unset_default_version: ::std::option::Option<bool>,
16    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
17    pub client_token: ::std::option::Option<::std::string::String>,
18}
19impl UpdatePackageInput {
20    /// <p>The name of the target software package.</p>
21    pub fn package_name(&self) -> ::std::option::Option<&str> {
22        self.package_name.as_deref()
23    }
24    /// <p>The package description.</p>
25    pub fn description(&self) -> ::std::option::Option<&str> {
26        self.description.as_deref()
27    }
28    /// <p>The name of the default package version.</p>
29    /// <p><b>Note:</b> You cannot name a <code>defaultVersion</code> and set <code>unsetDefaultVersion</code> equal to <code>true</code> at the same time.</p>
30    pub fn default_version_name(&self) -> ::std::option::Option<&str> {
31        self.default_version_name.as_deref()
32    }
33    /// <p>Indicates whether you want to remove the named default package version from the software package. Set as <code>true</code> to remove the default package version.</p>
34    /// <p><b>Note:</b> You cannot name a <code>defaultVersion</code> and set <code>unsetDefaultVersion</code> equal to <code>true</code> at the same time.</p>
35    pub fn unset_default_version(&self) -> ::std::option::Option<bool> {
36        self.unset_default_version
37    }
38    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
39    pub fn client_token(&self) -> ::std::option::Option<&str> {
40        self.client_token.as_deref()
41    }
42}
43impl ::std::fmt::Debug for UpdatePackageInput {
44    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
45        let mut formatter = f.debug_struct("UpdatePackageInput");
46        formatter.field("package_name", &self.package_name);
47        formatter.field("description", &"*** Sensitive Data Redacted ***");
48        formatter.field("default_version_name", &self.default_version_name);
49        formatter.field("unset_default_version", &self.unset_default_version);
50        formatter.field("client_token", &self.client_token);
51        formatter.finish()
52    }
53}
54impl UpdatePackageInput {
55    /// Creates a new builder-style object to manufacture [`UpdatePackageInput`](crate::operation::update_package::UpdatePackageInput).
56    pub fn builder() -> crate::operation::update_package::builders::UpdatePackageInputBuilder {
57        crate::operation::update_package::builders::UpdatePackageInputBuilder::default()
58    }
59}
60
61/// A builder for [`UpdatePackageInput`](crate::operation::update_package::UpdatePackageInput).
62#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
63#[non_exhaustive]
64pub struct UpdatePackageInputBuilder {
65    pub(crate) package_name: ::std::option::Option<::std::string::String>,
66    pub(crate) description: ::std::option::Option<::std::string::String>,
67    pub(crate) default_version_name: ::std::option::Option<::std::string::String>,
68    pub(crate) unset_default_version: ::std::option::Option<bool>,
69    pub(crate) client_token: ::std::option::Option<::std::string::String>,
70}
71impl UpdatePackageInputBuilder {
72    /// <p>The name of the target software package.</p>
73    /// This field is required.
74    pub fn package_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.package_name = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>The name of the target software package.</p>
79    pub fn set_package_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.package_name = input;
81        self
82    }
83    /// <p>The name of the target software package.</p>
84    pub fn get_package_name(&self) -> &::std::option::Option<::std::string::String> {
85        &self.package_name
86    }
87    /// <p>The package description.</p>
88    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.description = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The package description.</p>
93    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.description = input;
95        self
96    }
97    /// <p>The package description.</p>
98    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
99        &self.description
100    }
101    /// <p>The name of the default package version.</p>
102    /// <p><b>Note:</b> You cannot name a <code>defaultVersion</code> and set <code>unsetDefaultVersion</code> equal to <code>true</code> at the same time.</p>
103    pub fn default_version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.default_version_name = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <p>The name of the default package version.</p>
108    /// <p><b>Note:</b> You cannot name a <code>defaultVersion</code> and set <code>unsetDefaultVersion</code> equal to <code>true</code> at the same time.</p>
109    pub fn set_default_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.default_version_name = input;
111        self
112    }
113    /// <p>The name of the default package version.</p>
114    /// <p><b>Note:</b> You cannot name a <code>defaultVersion</code> and set <code>unsetDefaultVersion</code> equal to <code>true</code> at the same time.</p>
115    pub fn get_default_version_name(&self) -> &::std::option::Option<::std::string::String> {
116        &self.default_version_name
117    }
118    /// <p>Indicates whether you want to remove the named default package version from the software package. Set as <code>true</code> to remove the default package version.</p>
119    /// <p><b>Note:</b> You cannot name a <code>defaultVersion</code> and set <code>unsetDefaultVersion</code> equal to <code>true</code> at the same time.</p>
120    pub fn unset_default_version(mut self, input: bool) -> Self {
121        self.unset_default_version = ::std::option::Option::Some(input);
122        self
123    }
124    /// <p>Indicates whether you want to remove the named default package version from the software package. Set as <code>true</code> to remove the default package version.</p>
125    /// <p><b>Note:</b> You cannot name a <code>defaultVersion</code> and set <code>unsetDefaultVersion</code> equal to <code>true</code> at the same time.</p>
126    pub fn set_unset_default_version(mut self, input: ::std::option::Option<bool>) -> Self {
127        self.unset_default_version = input;
128        self
129    }
130    /// <p>Indicates whether you want to remove the named default package version from the software package. Set as <code>true</code> to remove the default package version.</p>
131    /// <p><b>Note:</b> You cannot name a <code>defaultVersion</code> and set <code>unsetDefaultVersion</code> equal to <code>true</code> at the same time.</p>
132    pub fn get_unset_default_version(&self) -> &::std::option::Option<bool> {
133        &self.unset_default_version
134    }
135    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
136    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.client_token = ::std::option::Option::Some(input.into());
138        self
139    }
140    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
141    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.client_token = input;
143        self
144    }
145    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
146    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
147        &self.client_token
148    }
149    /// Consumes the builder and constructs a [`UpdatePackageInput`](crate::operation::update_package::UpdatePackageInput).
150    pub fn build(
151        self,
152    ) -> ::std::result::Result<crate::operation::update_package::UpdatePackageInput, ::aws_smithy_types::error::operation::BuildError> {
153        ::std::result::Result::Ok(crate::operation::update_package::UpdatePackageInput {
154            package_name: self.package_name,
155            description: self.description,
156            default_version_name: self.default_version_name,
157            unset_default_version: self.unset_default_version,
158            client_token: self.client_token,
159        })
160    }
161}
162impl ::std::fmt::Debug for UpdatePackageInputBuilder {
163    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
164        let mut formatter = f.debug_struct("UpdatePackageInputBuilder");
165        formatter.field("package_name", &self.package_name);
166        formatter.field("description", &"*** Sensitive Data Redacted ***");
167        formatter.field("default_version_name", &self.default_version_name);
168        formatter.field("unset_default_version", &self.unset_default_version);
169        formatter.field("client_token", &self.client_token);
170        formatter.finish()
171    }
172}