aws_sdk_customerprofiles/operation/detect_profile_object_type/
_detect_profile_object_type_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 DetectProfileObjectTypeInput {
6    /// <p>A string that is serialized from a JSON object.</p>
7    pub objects: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8    /// <p>The unique name of the domain.</p>
9    pub domain_name: ::std::option::Option<::std::string::String>,
10}
11impl DetectProfileObjectTypeInput {
12    /// <p>A string that is serialized from a JSON object.</p>
13    ///
14    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.objects.is_none()`.
15    pub fn objects(&self) -> &[::std::string::String] {
16        self.objects.as_deref().unwrap_or_default()
17    }
18    /// <p>The unique name of the domain.</p>
19    pub fn domain_name(&self) -> ::std::option::Option<&str> {
20        self.domain_name.as_deref()
21    }
22}
23impl ::std::fmt::Debug for DetectProfileObjectTypeInput {
24    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
25        let mut formatter = f.debug_struct("DetectProfileObjectTypeInput");
26        formatter.field("objects", &"*** Sensitive Data Redacted ***");
27        formatter.field("domain_name", &self.domain_name);
28        formatter.finish()
29    }
30}
31impl DetectProfileObjectTypeInput {
32    /// Creates a new builder-style object to manufacture [`DetectProfileObjectTypeInput`](crate::operation::detect_profile_object_type::DetectProfileObjectTypeInput).
33    pub fn builder() -> crate::operation::detect_profile_object_type::builders::DetectProfileObjectTypeInputBuilder {
34        crate::operation::detect_profile_object_type::builders::DetectProfileObjectTypeInputBuilder::default()
35    }
36}
37
38/// A builder for [`DetectProfileObjectTypeInput`](crate::operation::detect_profile_object_type::DetectProfileObjectTypeInput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
40#[non_exhaustive]
41pub struct DetectProfileObjectTypeInputBuilder {
42    pub(crate) objects: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
43    pub(crate) domain_name: ::std::option::Option<::std::string::String>,
44}
45impl DetectProfileObjectTypeInputBuilder {
46    /// Appends an item to `objects`.
47    ///
48    /// To override the contents of this collection use [`set_objects`](Self::set_objects).
49    ///
50    /// <p>A string that is serialized from a JSON object.</p>
51    pub fn objects(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
52        let mut v = self.objects.unwrap_or_default();
53        v.push(input.into());
54        self.objects = ::std::option::Option::Some(v);
55        self
56    }
57    /// <p>A string that is serialized from a JSON object.</p>
58    pub fn set_objects(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
59        self.objects = input;
60        self
61    }
62    /// <p>A string that is serialized from a JSON object.</p>
63    pub fn get_objects(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
64        &self.objects
65    }
66    /// <p>The unique name of the domain.</p>
67    /// This field is required.
68    pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.domain_name = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The unique name of the domain.</p>
73    pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.domain_name = input;
75        self
76    }
77    /// <p>The unique name of the domain.</p>
78    pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
79        &self.domain_name
80    }
81    /// Consumes the builder and constructs a [`DetectProfileObjectTypeInput`](crate::operation::detect_profile_object_type::DetectProfileObjectTypeInput).
82    pub fn build(
83        self,
84    ) -> ::std::result::Result<
85        crate::operation::detect_profile_object_type::DetectProfileObjectTypeInput,
86        ::aws_smithy_types::error::operation::BuildError,
87    > {
88        ::std::result::Result::Ok(crate::operation::detect_profile_object_type::DetectProfileObjectTypeInput {
89            objects: self.objects,
90            domain_name: self.domain_name,
91        })
92    }
93}
94impl ::std::fmt::Debug for DetectProfileObjectTypeInputBuilder {
95    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
96        let mut formatter = f.debug_struct("DetectProfileObjectTypeInputBuilder");
97        formatter.field("objects", &"*** Sensitive Data Redacted ***");
98        formatter.field("domain_name", &self.domain_name);
99        formatter.finish()
100    }
101}