Skip to main content

aws_sdk_customerprofiles/operation/get_profile_object_type_template/
_get_profile_object_type_template_output.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 GetProfileObjectTypeTemplateOutput {
6    /// <p>A unique identifier for the object template.</p>
7    pub template_id: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the source of the object template.</p>
9    pub source_name: ::std::option::Option<::std::string::String>,
10    /// <p>The source of the object template.</p>
11    pub source_object: ::std::option::Option<::std::string::String>,
12    /// <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>
13    pub allow_profile_creation: bool,
14    /// <p>The format of your <code>sourceLastUpdatedTimestamp</code> that was previously set up.</p>
15    pub source_last_updated_timestamp_format: ::std::option::Option<::std::string::String>,
16    /// <p>A map of the name and ObjectType field.</p>
17    pub fields: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ObjectTypeField>>,
18    /// <p>A list of unique keys that can be used to map data to the profile.</p>
19    pub keys: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ObjectTypeKey>>>,
20    _request_id: Option<String>,
21}
22impl GetProfileObjectTypeTemplateOutput {
23    /// <p>A unique identifier for the object template.</p>
24    pub fn template_id(&self) -> ::std::option::Option<&str> {
25        self.template_id.as_deref()
26    }
27    /// <p>The name of the source of the object template.</p>
28    pub fn source_name(&self) -> ::std::option::Option<&str> {
29        self.source_name.as_deref()
30    }
31    /// <p>The source of the object template.</p>
32    pub fn source_object(&self) -> ::std::option::Option<&str> {
33        self.source_object.as_deref()
34    }
35    /// <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>
36    pub fn allow_profile_creation(&self) -> bool {
37        self.allow_profile_creation
38    }
39    /// <p>The format of your <code>sourceLastUpdatedTimestamp</code> that was previously set up.</p>
40    pub fn source_last_updated_timestamp_format(&self) -> ::std::option::Option<&str> {
41        self.source_last_updated_timestamp_format.as_deref()
42    }
43    /// <p>A map of the name and ObjectType field.</p>
44    pub fn fields(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::ObjectTypeField>> {
45        self.fields.as_ref()
46    }
47    /// <p>A list of unique keys that can be used to map data to the profile.</p>
48    pub fn keys(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ObjectTypeKey>>> {
49        self.keys.as_ref()
50    }
51}
52impl ::std::fmt::Debug for GetProfileObjectTypeTemplateOutput {
53    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
54        let mut formatter = f.debug_struct("GetProfileObjectTypeTemplateOutput");
55        formatter.field("template_id", &self.template_id);
56        formatter.field("source_name", &self.source_name);
57        formatter.field("source_object", &self.source_object);
58        formatter.field("allow_profile_creation", &self.allow_profile_creation);
59        formatter.field("source_last_updated_timestamp_format", &self.source_last_updated_timestamp_format);
60        formatter.field("fields", &"*** Sensitive Data Redacted ***");
61        formatter.field("keys", &"*** Sensitive Data Redacted ***");
62        formatter.field("_request_id", &self._request_id);
63        formatter.finish()
64    }
65}
66impl ::aws_types::request_id::RequestId for GetProfileObjectTypeTemplateOutput {
67    fn request_id(&self) -> Option<&str> {
68        self._request_id.as_deref()
69    }
70}
71impl GetProfileObjectTypeTemplateOutput {
72    /// Creates a new builder-style object to manufacture [`GetProfileObjectTypeTemplateOutput`](crate::operation::get_profile_object_type_template::GetProfileObjectTypeTemplateOutput).
73    pub fn builder() -> crate::operation::get_profile_object_type_template::builders::GetProfileObjectTypeTemplateOutputBuilder {
74        crate::operation::get_profile_object_type_template::builders::GetProfileObjectTypeTemplateOutputBuilder::default()
75    }
76}
77
78/// A builder for [`GetProfileObjectTypeTemplateOutput`](crate::operation::get_profile_object_type_template::GetProfileObjectTypeTemplateOutput).
79#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
80#[non_exhaustive]
81pub struct GetProfileObjectTypeTemplateOutputBuilder {
82    pub(crate) template_id: ::std::option::Option<::std::string::String>,
83    pub(crate) source_name: ::std::option::Option<::std::string::String>,
84    pub(crate) source_object: ::std::option::Option<::std::string::String>,
85    pub(crate) allow_profile_creation: ::std::option::Option<bool>,
86    pub(crate) source_last_updated_timestamp_format: ::std::option::Option<::std::string::String>,
87    pub(crate) fields: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ObjectTypeField>>,
88    pub(crate) keys: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ObjectTypeKey>>>,
89    _request_id: Option<String>,
90}
91impl GetProfileObjectTypeTemplateOutputBuilder {
92    /// <p>A unique identifier for the object template.</p>
93    pub fn template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.template_id = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <p>A unique identifier for the object template.</p>
98    pub fn set_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99        self.template_id = input;
100        self
101    }
102    /// <p>A unique identifier for the object template.</p>
103    pub fn get_template_id(&self) -> &::std::option::Option<::std::string::String> {
104        &self.template_id
105    }
106    /// <p>The name of the source of the object template.</p>
107    pub fn source_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108        self.source_name = ::std::option::Option::Some(input.into());
109        self
110    }
111    /// <p>The name of the source of the object template.</p>
112    pub fn set_source_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113        self.source_name = input;
114        self
115    }
116    /// <p>The name of the source of the object template.</p>
117    pub fn get_source_name(&self) -> &::std::option::Option<::std::string::String> {
118        &self.source_name
119    }
120    /// <p>The source of the object template.</p>
121    pub fn source_object(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.source_object = ::std::option::Option::Some(input.into());
123        self
124    }
125    /// <p>The source of the object template.</p>
126    pub fn set_source_object(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.source_object = input;
128        self
129    }
130    /// <p>The source of the object template.</p>
131    pub fn get_source_object(&self) -> &::std::option::Option<::std::string::String> {
132        &self.source_object
133    }
134    /// <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>
135    pub fn allow_profile_creation(mut self, input: bool) -> Self {
136        self.allow_profile_creation = ::std::option::Option::Some(input);
137        self
138    }
139    /// <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>
140    pub fn set_allow_profile_creation(mut self, input: ::std::option::Option<bool>) -> Self {
141        self.allow_profile_creation = input;
142        self
143    }
144    /// <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>
145    pub fn get_allow_profile_creation(&self) -> &::std::option::Option<bool> {
146        &self.allow_profile_creation
147    }
148    /// <p>The format of your <code>sourceLastUpdatedTimestamp</code> that was previously set up.</p>
149    pub fn source_last_updated_timestamp_format(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.source_last_updated_timestamp_format = ::std::option::Option::Some(input.into());
151        self
152    }
153    /// <p>The format of your <code>sourceLastUpdatedTimestamp</code> that was previously set up.</p>
154    pub fn set_source_last_updated_timestamp_format(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.source_last_updated_timestamp_format = input;
156        self
157    }
158    /// <p>The format of your <code>sourceLastUpdatedTimestamp</code> that was previously set up.</p>
159    pub fn get_source_last_updated_timestamp_format(&self) -> &::std::option::Option<::std::string::String> {
160        &self.source_last_updated_timestamp_format
161    }
162    /// Adds a key-value pair to `fields`.
163    ///
164    /// To override the contents of this collection use [`set_fields`](Self::set_fields).
165    ///
166    /// <p>A map of the name and ObjectType field.</p>
167    pub fn fields(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ObjectTypeField) -> Self {
168        let mut hash_map = self.fields.unwrap_or_default();
169        hash_map.insert(k.into(), v);
170        self.fields = ::std::option::Option::Some(hash_map);
171        self
172    }
173    /// <p>A map of the name and ObjectType field.</p>
174    pub fn set_fields(
175        mut self,
176        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ObjectTypeField>>,
177    ) -> Self {
178        self.fields = input;
179        self
180    }
181    /// <p>A map of the name and ObjectType field.</p>
182    pub fn get_fields(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ObjectTypeField>> {
183        &self.fields
184    }
185    /// Adds a key-value pair to `keys`.
186    ///
187    /// To override the contents of this collection use [`set_keys`](Self::set_keys).
188    ///
189    /// <p>A list of unique keys that can be used to map data to the profile.</p>
190    pub fn keys(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<crate::types::ObjectTypeKey>) -> Self {
191        let mut hash_map = self.keys.unwrap_or_default();
192        hash_map.insert(k.into(), v);
193        self.keys = ::std::option::Option::Some(hash_map);
194        self
195    }
196    /// <p>A list of unique keys that can be used to map data to the profile.</p>
197    pub fn set_keys(
198        mut self,
199        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ObjectTypeKey>>>,
200    ) -> Self {
201        self.keys = input;
202        self
203    }
204    /// <p>A list of unique keys that can be used to map data to the profile.</p>
205    pub fn get_keys(
206        &self,
207    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ObjectTypeKey>>> {
208        &self.keys
209    }
210    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
211        self._request_id = Some(request_id.into());
212        self
213    }
214
215    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
216        self._request_id = request_id;
217        self
218    }
219    /// Consumes the builder and constructs a [`GetProfileObjectTypeTemplateOutput`](crate::operation::get_profile_object_type_template::GetProfileObjectTypeTemplateOutput).
220    pub fn build(self) -> crate::operation::get_profile_object_type_template::GetProfileObjectTypeTemplateOutput {
221        crate::operation::get_profile_object_type_template::GetProfileObjectTypeTemplateOutput {
222            template_id: self.template_id,
223            source_name: self.source_name,
224            source_object: self.source_object,
225            allow_profile_creation: self.allow_profile_creation.unwrap_or_default(),
226            source_last_updated_timestamp_format: self.source_last_updated_timestamp_format,
227            fields: self.fields,
228            keys: self.keys,
229            _request_id: self._request_id,
230        }
231    }
232}
233impl ::std::fmt::Debug for GetProfileObjectTypeTemplateOutputBuilder {
234    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
235        let mut formatter = f.debug_struct("GetProfileObjectTypeTemplateOutputBuilder");
236        formatter.field("template_id", &self.template_id);
237        formatter.field("source_name", &self.source_name);
238        formatter.field("source_object", &self.source_object);
239        formatter.field("allow_profile_creation", &self.allow_profile_creation);
240        formatter.field("source_last_updated_timestamp_format", &self.source_last_updated_timestamp_format);
241        formatter.field("fields", &"*** Sensitive Data Redacted ***");
242        formatter.field("keys", &"*** Sensitive Data Redacted ***");
243        formatter.field("_request_id", &self._request_id);
244        formatter.finish()
245    }
246}