Skip to main content

aws_sdk_glue/operation/put_asset/
_put_asset_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, ::std::fmt::Debug)]
5pub struct PutAssetInput {
6    /// <p>The identifier of the asset type for the asset.</p>
7    pub asset_type_id: ::std::option::Option<::std::string::String>,
8    /// <p>The unique identifier of the asset. If an asset with this identifier already exists, it is updated.</p>
9    pub identifier: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the asset.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>The description of the asset.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    /// <p>The forms to set on the asset, keyed by form name. Each entry specifies the form type and its JSON content.</p>
15    pub forms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
16    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
17    pub client_token: ::std::option::Option<::std::string::String>,
18}
19impl PutAssetInput {
20    /// <p>The identifier of the asset type for the asset.</p>
21    pub fn asset_type_id(&self) -> ::std::option::Option<&str> {
22        self.asset_type_id.as_deref()
23    }
24    /// <p>The unique identifier of the asset. If an asset with this identifier already exists, it is updated.</p>
25    pub fn identifier(&self) -> ::std::option::Option<&str> {
26        self.identifier.as_deref()
27    }
28    /// <p>The name of the asset.</p>
29    pub fn name(&self) -> ::std::option::Option<&str> {
30        self.name.as_deref()
31    }
32    /// <p>The description of the asset.</p>
33    pub fn description(&self) -> ::std::option::Option<&str> {
34        self.description.as_deref()
35    }
36    /// <p>The forms to set on the asset, keyed by form name. Each entry specifies the form type and its JSON content.</p>
37    pub fn forms(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>> {
38        self.forms.as_ref()
39    }
40    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
41    pub fn client_token(&self) -> ::std::option::Option<&str> {
42        self.client_token.as_deref()
43    }
44}
45impl PutAssetInput {
46    /// Creates a new builder-style object to manufacture [`PutAssetInput`](crate::operation::put_asset::PutAssetInput).
47    pub fn builder() -> crate::operation::put_asset::builders::PutAssetInputBuilder {
48        crate::operation::put_asset::builders::PutAssetInputBuilder::default()
49    }
50}
51
52/// A builder for [`PutAssetInput`](crate::operation::put_asset::PutAssetInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct PutAssetInputBuilder {
56    pub(crate) asset_type_id: ::std::option::Option<::std::string::String>,
57    pub(crate) identifier: ::std::option::Option<::std::string::String>,
58    pub(crate) name: ::std::option::Option<::std::string::String>,
59    pub(crate) description: ::std::option::Option<::std::string::String>,
60    pub(crate) forms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
61    pub(crate) client_token: ::std::option::Option<::std::string::String>,
62}
63impl PutAssetInputBuilder {
64    /// <p>The identifier of the asset type for the asset.</p>
65    /// This field is required.
66    pub fn asset_type_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.asset_type_id = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The identifier of the asset type for the asset.</p>
71    pub fn set_asset_type_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.asset_type_id = input;
73        self
74    }
75    /// <p>The identifier of the asset type for the asset.</p>
76    pub fn get_asset_type_id(&self) -> &::std::option::Option<::std::string::String> {
77        &self.asset_type_id
78    }
79    /// <p>The unique identifier of the asset. If an asset with this identifier already exists, it is updated.</p>
80    /// This field is required.
81    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.identifier = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>The unique identifier of the asset. If an asset with this identifier already exists, it is updated.</p>
86    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.identifier = input;
88        self
89    }
90    /// <p>The unique identifier of the asset. If an asset with this identifier already exists, it is updated.</p>
91    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
92        &self.identifier
93    }
94    /// <p>The name of the asset.</p>
95    /// This field is required.
96    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.name = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>The name of the asset.</p>
101    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.name = input;
103        self
104    }
105    /// <p>The name of the asset.</p>
106    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
107        &self.name
108    }
109    /// <p>The description of the asset.</p>
110    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.description = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>The description of the asset.</p>
115    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.description = input;
117        self
118    }
119    /// <p>The description of the asset.</p>
120    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
121        &self.description
122    }
123    /// Adds a key-value pair to `forms`.
124    ///
125    /// To override the contents of this collection use [`set_forms`](Self::set_forms).
126    ///
127    /// <p>The forms to set on the asset, keyed by form name. Each entry specifies the form type and its JSON content.</p>
128    pub fn forms(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AssetFormEntry) -> Self {
129        let mut hash_map = self.forms.unwrap_or_default();
130        hash_map.insert(k.into(), v);
131        self.forms = ::std::option::Option::Some(hash_map);
132        self
133    }
134    /// <p>The forms to set on the asset, keyed by form name. Each entry specifies the form type and its JSON content.</p>
135    pub fn set_forms(
136        mut self,
137        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
138    ) -> Self {
139        self.forms = input;
140        self
141    }
142    /// <p>The forms to set on the asset, keyed by form name. Each entry specifies the form type and its JSON content.</p>
143    pub fn get_forms(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>> {
144        &self.forms
145    }
146    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
147    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.client_token = ::std::option::Option::Some(input.into());
149        self
150    }
151    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
152    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.client_token = input;
154        self
155    }
156    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
157    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
158        &self.client_token
159    }
160    /// Consumes the builder and constructs a [`PutAssetInput`](crate::operation::put_asset::PutAssetInput).
161    pub fn build(self) -> ::std::result::Result<crate::operation::put_asset::PutAssetInput, ::aws_smithy_types::error::operation::BuildError> {
162        ::std::result::Result::Ok(crate::operation::put_asset::PutAssetInput {
163            asset_type_id: self.asset_type_id,
164            identifier: self.identifier,
165            name: self.name,
166            description: self.description,
167            forms: self.forms,
168            client_token: self.client_token,
169        })
170    }
171}