aws_sdk_connectcases/operation/update_case/
_update_case_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 UpdateCaseInput {
6    /// <p>The unique identifier of the Cases domain.</p>
7    pub domain_id: ::std::option::Option<::std::string::String>,
8    /// <p>A unique identifier of the case.</p>
9    pub case_id: ::std::option::Option<::std::string::String>,
10    /// <p>An array of objects with <code>fieldId</code> (matching ListFields/DescribeField) and value union data, structured identical to <code>CreateCase</code>.</p>
11    pub fields: ::std::option::Option<::std::vec::Vec<crate::types::FieldValue>>,
12    /// <p>Represents the entity that performed the action.</p>
13    pub performed_by: ::std::option::Option<crate::types::UserUnion>,
14}
15impl UpdateCaseInput {
16    /// <p>The unique identifier of the Cases domain.</p>
17    pub fn domain_id(&self) -> ::std::option::Option<&str> {
18        self.domain_id.as_deref()
19    }
20    /// <p>A unique identifier of the case.</p>
21    pub fn case_id(&self) -> ::std::option::Option<&str> {
22        self.case_id.as_deref()
23    }
24    /// <p>An array of objects with <code>fieldId</code> (matching ListFields/DescribeField) and value union data, structured identical to <code>CreateCase</code>.</p>
25    ///
26    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.fields.is_none()`.
27    pub fn fields(&self) -> &[crate::types::FieldValue] {
28        self.fields.as_deref().unwrap_or_default()
29    }
30    /// <p>Represents the entity that performed the action.</p>
31    pub fn performed_by(&self) -> ::std::option::Option<&crate::types::UserUnion> {
32        self.performed_by.as_ref()
33    }
34}
35impl UpdateCaseInput {
36    /// Creates a new builder-style object to manufacture [`UpdateCaseInput`](crate::operation::update_case::UpdateCaseInput).
37    pub fn builder() -> crate::operation::update_case::builders::UpdateCaseInputBuilder {
38        crate::operation::update_case::builders::UpdateCaseInputBuilder::default()
39    }
40}
41
42/// A builder for [`UpdateCaseInput`](crate::operation::update_case::UpdateCaseInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct UpdateCaseInputBuilder {
46    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
47    pub(crate) case_id: ::std::option::Option<::std::string::String>,
48    pub(crate) fields: ::std::option::Option<::std::vec::Vec<crate::types::FieldValue>>,
49    pub(crate) performed_by: ::std::option::Option<crate::types::UserUnion>,
50}
51impl UpdateCaseInputBuilder {
52    /// <p>The unique identifier of the Cases domain.</p>
53    /// This field is required.
54    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.domain_id = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The unique identifier of the Cases domain.</p>
59    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.domain_id = input;
61        self
62    }
63    /// <p>The unique identifier of the Cases domain.</p>
64    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
65        &self.domain_id
66    }
67    /// <p>A unique identifier of the case.</p>
68    /// This field is required.
69    pub fn case_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.case_id = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>A unique identifier of the case.</p>
74    pub fn set_case_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.case_id = input;
76        self
77    }
78    /// <p>A unique identifier of the case.</p>
79    pub fn get_case_id(&self) -> &::std::option::Option<::std::string::String> {
80        &self.case_id
81    }
82    /// Appends an item to `fields`.
83    ///
84    /// To override the contents of this collection use [`set_fields`](Self::set_fields).
85    ///
86    /// <p>An array of objects with <code>fieldId</code> (matching ListFields/DescribeField) and value union data, structured identical to <code>CreateCase</code>.</p>
87    pub fn fields(mut self, input: crate::types::FieldValue) -> Self {
88        let mut v = self.fields.unwrap_or_default();
89        v.push(input);
90        self.fields = ::std::option::Option::Some(v);
91        self
92    }
93    /// <p>An array of objects with <code>fieldId</code> (matching ListFields/DescribeField) and value union data, structured identical to <code>CreateCase</code>.</p>
94    pub fn set_fields(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FieldValue>>) -> Self {
95        self.fields = input;
96        self
97    }
98    /// <p>An array of objects with <code>fieldId</code> (matching ListFields/DescribeField) and value union data, structured identical to <code>CreateCase</code>.</p>
99    pub fn get_fields(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FieldValue>> {
100        &self.fields
101    }
102    /// <p>Represents the entity that performed the action.</p>
103    pub fn performed_by(mut self, input: crate::types::UserUnion) -> Self {
104        self.performed_by = ::std::option::Option::Some(input);
105        self
106    }
107    /// <p>Represents the entity that performed the action.</p>
108    pub fn set_performed_by(mut self, input: ::std::option::Option<crate::types::UserUnion>) -> Self {
109        self.performed_by = input;
110        self
111    }
112    /// <p>Represents the entity that performed the action.</p>
113    pub fn get_performed_by(&self) -> &::std::option::Option<crate::types::UserUnion> {
114        &self.performed_by
115    }
116    /// Consumes the builder and constructs a [`UpdateCaseInput`](crate::operation::update_case::UpdateCaseInput).
117    pub fn build(self) -> ::std::result::Result<crate::operation::update_case::UpdateCaseInput, ::aws_smithy_types::error::operation::BuildError> {
118        ::std::result::Result::Ok(crate::operation::update_case::UpdateCaseInput {
119            domain_id: self.domain_id,
120            case_id: self.case_id,
121            fields: self.fields,
122            performed_by: self.performed_by,
123        })
124    }
125}