aws_sdk_iot/operation/create_package/
_create_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 CreatePackageInput {
6    /// <p>The name of the new software package.</p>
7    pub package_name: ::std::option::Option<::std::string::String>,
8    /// <p>A summary of the package being created. This can be used to outline the package's contents or purpose.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>Metadata that can be used to manage the package.</p>
11    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12    /// <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>
13    pub client_token: ::std::option::Option<::std::string::String>,
14}
15impl CreatePackageInput {
16    /// <p>The name of the new software package.</p>
17    pub fn package_name(&self) -> ::std::option::Option<&str> {
18        self.package_name.as_deref()
19    }
20    /// <p>A summary of the package being created. This can be used to outline the package's contents or purpose.</p>
21    pub fn description(&self) -> ::std::option::Option<&str> {
22        self.description.as_deref()
23    }
24    /// <p>Metadata that can be used to manage the package.</p>
25    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
26        self.tags.as_ref()
27    }
28    /// <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>
29    pub fn client_token(&self) -> ::std::option::Option<&str> {
30        self.client_token.as_deref()
31    }
32}
33impl ::std::fmt::Debug for CreatePackageInput {
34    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
35        let mut formatter = f.debug_struct("CreatePackageInput");
36        formatter.field("package_name", &self.package_name);
37        formatter.field("description", &"*** Sensitive Data Redacted ***");
38        formatter.field("tags", &self.tags);
39        formatter.field("client_token", &self.client_token);
40        formatter.finish()
41    }
42}
43impl CreatePackageInput {
44    /// Creates a new builder-style object to manufacture [`CreatePackageInput`](crate::operation::create_package::CreatePackageInput).
45    pub fn builder() -> crate::operation::create_package::builders::CreatePackageInputBuilder {
46        crate::operation::create_package::builders::CreatePackageInputBuilder::default()
47    }
48}
49
50/// A builder for [`CreatePackageInput`](crate::operation::create_package::CreatePackageInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
52#[non_exhaustive]
53pub struct CreatePackageInputBuilder {
54    pub(crate) package_name: ::std::option::Option<::std::string::String>,
55    pub(crate) description: ::std::option::Option<::std::string::String>,
56    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
57    pub(crate) client_token: ::std::option::Option<::std::string::String>,
58}
59impl CreatePackageInputBuilder {
60    /// <p>The name of the new software package.</p>
61    /// This field is required.
62    pub fn package_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.package_name = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// <p>The name of the new software package.</p>
67    pub fn set_package_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.package_name = input;
69        self
70    }
71    /// <p>The name of the new software package.</p>
72    pub fn get_package_name(&self) -> &::std::option::Option<::std::string::String> {
73        &self.package_name
74    }
75    /// <p>A summary of the package being created. This can be used to outline the package's contents or purpose.</p>
76    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.description = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>A summary of the package being created. This can be used to outline the package's contents or purpose.</p>
81    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.description = input;
83        self
84    }
85    /// <p>A summary of the package being created. This can be used to outline the package's contents or purpose.</p>
86    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
87        &self.description
88    }
89    /// Adds a key-value pair to `tags`.
90    ///
91    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
92    ///
93    /// <p>Metadata that can be used to manage the package.</p>
94    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
95        let mut hash_map = self.tags.unwrap_or_default();
96        hash_map.insert(k.into(), v.into());
97        self.tags = ::std::option::Option::Some(hash_map);
98        self
99    }
100    /// <p>Metadata that can be used to manage the package.</p>
101    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
102        self.tags = input;
103        self
104    }
105    /// <p>Metadata that can be used to manage the package.</p>
106    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
107        &self.tags
108    }
109    /// <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>
110    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.client_token = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <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>
115    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.client_token = input;
117        self
118    }
119    /// <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>
120    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
121        &self.client_token
122    }
123    /// Consumes the builder and constructs a [`CreatePackageInput`](crate::operation::create_package::CreatePackageInput).
124    pub fn build(
125        self,
126    ) -> ::std::result::Result<crate::operation::create_package::CreatePackageInput, ::aws_smithy_types::error::operation::BuildError> {
127        ::std::result::Result::Ok(crate::operation::create_package::CreatePackageInput {
128            package_name: self.package_name,
129            description: self.description,
130            tags: self.tags,
131            client_token: self.client_token,
132        })
133    }
134}
135impl ::std::fmt::Debug for CreatePackageInputBuilder {
136    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
137        let mut formatter = f.debug_struct("CreatePackageInputBuilder");
138        formatter.field("package_name", &self.package_name);
139        formatter.field("description", &"*** Sensitive Data Redacted ***");
140        formatter.field("tags", &self.tags);
141        formatter.field("client_token", &self.client_token);
142        formatter.finish()
143    }
144}