aws_sdk_customerprofiles/operation/put_profile_object_type/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::put_profile_object_type::_put_profile_object_type_output::PutProfileObjectTypeOutputBuilder;
3
4pub use crate::operation::put_profile_object_type::_put_profile_object_type_input::PutProfileObjectTypeInputBuilder;
5
6impl crate::operation::put_profile_object_type::builders::PutProfileObjectTypeInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::put_profile_object_type::PutProfileObjectTypeOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::put_profile_object_type::PutProfileObjectTypeError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.put_profile_object_type();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `PutProfileObjectType`.
24///
25/// <p>Defines a ProfileObjectType.</p>
26/// <p>To add or remove tags on an existing ObjectType, see <a href="https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_TagResource.html"> TagResource</a>/<a href="https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_UntagResource.html">UntagResource</a>.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct PutProfileObjectTypeFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::put_profile_object_type::builders::PutProfileObjectTypeInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::put_profile_object_type::PutProfileObjectTypeOutput,
36        crate::operation::put_profile_object_type::PutProfileObjectTypeError,
37    > for PutProfileObjectTypeFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<
44            crate::operation::put_profile_object_type::PutProfileObjectTypeOutput,
45            crate::operation::put_profile_object_type::PutProfileObjectTypeError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl PutProfileObjectTypeFluentBuilder {
52    /// Creates a new `PutProfileObjectTypeFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the PutProfileObjectType as a reference.
61    pub fn as_input(&self) -> &crate::operation::put_profile_object_type::builders::PutProfileObjectTypeInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::put_profile_object_type::PutProfileObjectTypeOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::put_profile_object_type::PutProfileObjectTypeError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::put_profile_object_type::PutProfileObjectType::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::put_profile_object_type::PutProfileObjectType::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::put_profile_object_type::PutProfileObjectTypeOutput,
98        crate::operation::put_profile_object_type::PutProfileObjectTypeError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// <p>The unique name of the domain.</p>
113    pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.domain_name(input.into());
115        self
116    }
117    /// <p>The unique name of the domain.</p>
118    pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.inner = self.inner.set_domain_name(input);
120        self
121    }
122    /// <p>The unique name of the domain.</p>
123    pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
124        self.inner.get_domain_name()
125    }
126    /// <p>The name of the profile object type.</p>
127    pub fn object_type_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.object_type_name(input.into());
129        self
130    }
131    /// <p>The name of the profile object type.</p>
132    pub fn set_object_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_object_type_name(input);
134        self
135    }
136    /// <p>The name of the profile object type.</p>
137    pub fn get_object_type_name(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_object_type_name()
139    }
140    /// <p>Description of the profile object type.</p>
141    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.inner = self.inner.description(input.into());
143        self
144    }
145    /// <p>Description of the profile object type.</p>
146    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.inner = self.inner.set_description(input);
148        self
149    }
150    /// <p>Description of the profile object type.</p>
151    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
152        self.inner.get_description()
153    }
154    /// <p>A unique identifier for the object template. For some attributes in the request, the service will use the default value from the object template when TemplateId is present. If these attributes are present in the request, the service may return a <code>BadRequestException</code>. These attributes include: AllowProfileCreation, SourceLastUpdatedTimestampFormat, Fields, and Keys. For example, if AllowProfileCreation is set to true when TemplateId is set, the service may return a <code>BadRequestException</code>.</p>
155    pub fn template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156        self.inner = self.inner.template_id(input.into());
157        self
158    }
159    /// <p>A unique identifier for the object template. For some attributes in the request, the service will use the default value from the object template when TemplateId is present. If these attributes are present in the request, the service may return a <code>BadRequestException</code>. These attributes include: AllowProfileCreation, SourceLastUpdatedTimestampFormat, Fields, and Keys. For example, if AllowProfileCreation is set to true when TemplateId is set, the service may return a <code>BadRequestException</code>.</p>
160    pub fn set_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161        self.inner = self.inner.set_template_id(input);
162        self
163    }
164    /// <p>A unique identifier for the object template. For some attributes in the request, the service will use the default value from the object template when TemplateId is present. If these attributes are present in the request, the service may return a <code>BadRequestException</code>. These attributes include: AllowProfileCreation, SourceLastUpdatedTimestampFormat, Fields, and Keys. For example, if AllowProfileCreation is set to true when TemplateId is set, the service may return a <code>BadRequestException</code>.</p>
165    pub fn get_template_id(&self) -> &::std::option::Option<::std::string::String> {
166        self.inner.get_template_id()
167    }
168    /// <p>The number of days until the data in the object expires.</p>
169    pub fn expiration_days(mut self, input: i32) -> Self {
170        self.inner = self.inner.expiration_days(input);
171        self
172    }
173    /// <p>The number of days until the data in the object expires.</p>
174    pub fn set_expiration_days(mut self, input: ::std::option::Option<i32>) -> Self {
175        self.inner = self.inner.set_expiration_days(input);
176        self
177    }
178    /// <p>The number of days until the data in the object expires.</p>
179    pub fn get_expiration_days(&self) -> &::std::option::Option<i32> {
180        self.inner.get_expiration_days()
181    }
182    /// <p>The customer-provided key to encrypt the profile object that will be created in this profile object type.</p>
183    pub fn encryption_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184        self.inner = self.inner.encryption_key(input.into());
185        self
186    }
187    /// <p>The customer-provided key to encrypt the profile object that will be created in this profile object type.</p>
188    pub fn set_encryption_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189        self.inner = self.inner.set_encryption_key(input);
190        self
191    }
192    /// <p>The customer-provided key to encrypt the profile object that will be created in this profile object type.</p>
193    pub fn get_encryption_key(&self) -> &::std::option::Option<::std::string::String> {
194        self.inner.get_encryption_key()
195    }
196    /// <p>Indicates whether a profile should be created when data is received if one doesn’t exist for an object of this type. The default is <code>FALSE</code>. If the AllowProfileCreation flag is set to <code>FALSE</code>, then the service tries to fetch a standard profile and associate this object with the profile. If it is set to <code>TRUE</code>, and if no match is found, then the service creates a new standard profile.</p>
197    pub fn allow_profile_creation(mut self, input: bool) -> Self {
198        self.inner = self.inner.allow_profile_creation(input);
199        self
200    }
201    /// <p>Indicates whether a profile should be created when data is received if one doesn’t exist for an object of this type. The default is <code>FALSE</code>. If the AllowProfileCreation flag is set to <code>FALSE</code>, then the service tries to fetch a standard profile and associate this object with the profile. If it is set to <code>TRUE</code>, and if no match is found, then the service creates a new standard profile.</p>
202    pub fn set_allow_profile_creation(mut self, input: ::std::option::Option<bool>) -> Self {
203        self.inner = self.inner.set_allow_profile_creation(input);
204        self
205    }
206    /// <p>Indicates whether a profile should be created when data is received if one doesn’t exist for an object of this type. The default is <code>FALSE</code>. If the AllowProfileCreation flag is set to <code>FALSE</code>, then the service tries to fetch a standard profile and associate this object with the profile. If it is set to <code>TRUE</code>, and if no match is found, then the service creates a new standard profile.</p>
207    pub fn get_allow_profile_creation(&self) -> &::std::option::Option<bool> {
208        self.inner.get_allow_profile_creation()
209    }
210    /// <p>The format of your <code>sourceLastUpdatedTimestamp</code> that was previously set up.</p>
211    pub fn source_last_updated_timestamp_format(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212        self.inner = self.inner.source_last_updated_timestamp_format(input.into());
213        self
214    }
215    /// <p>The format of your <code>sourceLastUpdatedTimestamp</code> that was previously set up.</p>
216    pub fn set_source_last_updated_timestamp_format(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
217        self.inner = self.inner.set_source_last_updated_timestamp_format(input);
218        self
219    }
220    /// <p>The format of your <code>sourceLastUpdatedTimestamp</code> that was previously set up.</p>
221    pub fn get_source_last_updated_timestamp_format(&self) -> &::std::option::Option<::std::string::String> {
222        self.inner.get_source_last_updated_timestamp_format()
223    }
224    /// <p>The amount of profile object max count assigned to the object type</p>
225    pub fn max_profile_object_count(mut self, input: i32) -> Self {
226        self.inner = self.inner.max_profile_object_count(input);
227        self
228    }
229    /// <p>The amount of profile object max count assigned to the object type</p>
230    pub fn set_max_profile_object_count(mut self, input: ::std::option::Option<i32>) -> Self {
231        self.inner = self.inner.set_max_profile_object_count(input);
232        self
233    }
234    /// <p>The amount of profile object max count assigned to the object type</p>
235    pub fn get_max_profile_object_count(&self) -> &::std::option::Option<i32> {
236        self.inner.get_max_profile_object_count()
237    }
238    ///
239    /// Adds a key-value pair to `Fields`.
240    ///
241    /// To override the contents of this collection use [`set_fields`](Self::set_fields).
242    ///
243    /// <p>A map of the name and ObjectType field.</p>
244    pub fn fields(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ObjectTypeField) -> Self {
245        self.inner = self.inner.fields(k.into(), v);
246        self
247    }
248    /// <p>A map of the name and ObjectType field.</p>
249    pub fn set_fields(
250        mut self,
251        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ObjectTypeField>>,
252    ) -> Self {
253        self.inner = self.inner.set_fields(input);
254        self
255    }
256    /// <p>A map of the name and ObjectType field.</p>
257    pub fn get_fields(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ObjectTypeField>> {
258        self.inner.get_fields()
259    }
260    ///
261    /// Adds a key-value pair to `Keys`.
262    ///
263    /// To override the contents of this collection use [`set_keys`](Self::set_keys).
264    ///
265    /// <p>A list of unique keys that can be used to map data to the profile.</p>
266    pub fn keys(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<crate::types::ObjectTypeKey>) -> Self {
267        self.inner = self.inner.keys(k.into(), v);
268        self
269    }
270    /// <p>A list of unique keys that can be used to map data to the profile.</p>
271    pub fn set_keys(
272        mut self,
273        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ObjectTypeKey>>>,
274    ) -> Self {
275        self.inner = self.inner.set_keys(input);
276        self
277    }
278    /// <p>A list of unique keys that can be used to map data to the profile.</p>
279    pub fn get_keys(
280        &self,
281    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ObjectTypeKey>>> {
282        self.inner.get_keys()
283    }
284    ///
285    /// Adds a key-value pair to `Tags`.
286    ///
287    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
288    ///
289    /// <p>The tags used to organize, track, or control access for this resource.</p>
290    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
291        self.inner = self.inner.tags(k.into(), v.into());
292        self
293    }
294    /// <p>The tags used to organize, track, or control access for this resource.</p>
295    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
296        self.inner = self.inner.set_tags(input);
297        self
298    }
299    /// <p>The tags used to organize, track, or control access for this resource.</p>
300    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
301        self.inner.get_tags()
302    }
303}