aws_sdk_wellarchitected/operation/update_profile/
_update_profile_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 UpdateProfileInput {
6    /// <p>The profile ARN.</p>
7    pub profile_arn: ::std::option::Option<::std::string::String>,
8    /// <p>The profile description.</p>
9    pub profile_description: ::std::option::Option<::std::string::String>,
10    /// <p>Profile questions.</p>
11    pub profile_questions: ::std::option::Option<::std::vec::Vec<crate::types::ProfileQuestionUpdate>>,
12}
13impl UpdateProfileInput {
14    /// <p>The profile ARN.</p>
15    pub fn profile_arn(&self) -> ::std::option::Option<&str> {
16        self.profile_arn.as_deref()
17    }
18    /// <p>The profile description.</p>
19    pub fn profile_description(&self) -> ::std::option::Option<&str> {
20        self.profile_description.as_deref()
21    }
22    /// <p>Profile questions.</p>
23    ///
24    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.profile_questions.is_none()`.
25    pub fn profile_questions(&self) -> &[crate::types::ProfileQuestionUpdate] {
26        self.profile_questions.as_deref().unwrap_or_default()
27    }
28}
29impl UpdateProfileInput {
30    /// Creates a new builder-style object to manufacture [`UpdateProfileInput`](crate::operation::update_profile::UpdateProfileInput).
31    pub fn builder() -> crate::operation::update_profile::builders::UpdateProfileInputBuilder {
32        crate::operation::update_profile::builders::UpdateProfileInputBuilder::default()
33    }
34}
35
36/// A builder for [`UpdateProfileInput`](crate::operation::update_profile::UpdateProfileInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct UpdateProfileInputBuilder {
40    pub(crate) profile_arn: ::std::option::Option<::std::string::String>,
41    pub(crate) profile_description: ::std::option::Option<::std::string::String>,
42    pub(crate) profile_questions: ::std::option::Option<::std::vec::Vec<crate::types::ProfileQuestionUpdate>>,
43}
44impl UpdateProfileInputBuilder {
45    /// <p>The profile ARN.</p>
46    /// This field is required.
47    pub fn profile_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.profile_arn = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>The profile ARN.</p>
52    pub fn set_profile_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.profile_arn = input;
54        self
55    }
56    /// <p>The profile ARN.</p>
57    pub fn get_profile_arn(&self) -> &::std::option::Option<::std::string::String> {
58        &self.profile_arn
59    }
60    /// <p>The profile description.</p>
61    pub fn profile_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.profile_description = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The profile description.</p>
66    pub fn set_profile_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.profile_description = input;
68        self
69    }
70    /// <p>The profile description.</p>
71    pub fn get_profile_description(&self) -> &::std::option::Option<::std::string::String> {
72        &self.profile_description
73    }
74    /// Appends an item to `profile_questions`.
75    ///
76    /// To override the contents of this collection use [`set_profile_questions`](Self::set_profile_questions).
77    ///
78    /// <p>Profile questions.</p>
79    pub fn profile_questions(mut self, input: crate::types::ProfileQuestionUpdate) -> Self {
80        let mut v = self.profile_questions.unwrap_or_default();
81        v.push(input);
82        self.profile_questions = ::std::option::Option::Some(v);
83        self
84    }
85    /// <p>Profile questions.</p>
86    pub fn set_profile_questions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ProfileQuestionUpdate>>) -> Self {
87        self.profile_questions = input;
88        self
89    }
90    /// <p>Profile questions.</p>
91    pub fn get_profile_questions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProfileQuestionUpdate>> {
92        &self.profile_questions
93    }
94    /// Consumes the builder and constructs a [`UpdateProfileInput`](crate::operation::update_profile::UpdateProfileInput).
95    pub fn build(
96        self,
97    ) -> ::std::result::Result<crate::operation::update_profile::UpdateProfileInput, ::aws_smithy_types::error::operation::BuildError> {
98        ::std::result::Result::Ok(crate::operation::update_profile::UpdateProfileInput {
99            profile_arn: self.profile_arn,
100            profile_description: self.profile_description,
101            profile_questions: self.profile_questions,
102        })
103    }
104}