aws_sdk_connectcases/operation/get_case/
_get_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 GetCaseInput {
6    /// <p>A unique identifier of the case.</p>
7    pub case_id: ::std::option::Option<::std::string::String>,
8    /// <p>The unique identifier of the Cases domain.</p>
9    pub domain_id: ::std::option::Option<::std::string::String>,
10    /// <p>A list of unique field identifiers.</p>
11    pub fields: ::std::option::Option<::std::vec::Vec<crate::types::FieldIdentifier>>,
12    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
13    pub next_token: ::std::option::Option<::std::string::String>,
14}
15impl GetCaseInput {
16    /// <p>A unique identifier of the case.</p>
17    pub fn case_id(&self) -> ::std::option::Option<&str> {
18        self.case_id.as_deref()
19    }
20    /// <p>The unique identifier of the Cases domain.</p>
21    pub fn domain_id(&self) -> ::std::option::Option<&str> {
22        self.domain_id.as_deref()
23    }
24    /// <p>A list of unique field identifiers.</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::FieldIdentifier] {
28        self.fields.as_deref().unwrap_or_default()
29    }
30    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
31    pub fn next_token(&self) -> ::std::option::Option<&str> {
32        self.next_token.as_deref()
33    }
34}
35impl GetCaseInput {
36    /// Creates a new builder-style object to manufacture [`GetCaseInput`](crate::operation::get_case::GetCaseInput).
37    pub fn builder() -> crate::operation::get_case::builders::GetCaseInputBuilder {
38        crate::operation::get_case::builders::GetCaseInputBuilder::default()
39    }
40}
41
42/// A builder for [`GetCaseInput`](crate::operation::get_case::GetCaseInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct GetCaseInputBuilder {
46    pub(crate) case_id: ::std::option::Option<::std::string::String>,
47    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
48    pub(crate) fields: ::std::option::Option<::std::vec::Vec<crate::types::FieldIdentifier>>,
49    pub(crate) next_token: ::std::option::Option<::std::string::String>,
50}
51impl GetCaseInputBuilder {
52    /// <p>A unique identifier of the case.</p>
53    /// This field is required.
54    pub fn case_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.case_id = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>A unique identifier of the case.</p>
59    pub fn set_case_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.case_id = input;
61        self
62    }
63    /// <p>A unique identifier of the case.</p>
64    pub fn get_case_id(&self) -> &::std::option::Option<::std::string::String> {
65        &self.case_id
66    }
67    /// <p>The unique identifier of the Cases domain.</p>
68    /// This field is required.
69    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.domain_id = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>The unique identifier of the Cases domain.</p>
74    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.domain_id = input;
76        self
77    }
78    /// <p>The unique identifier of the Cases domain.</p>
79    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
80        &self.domain_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>A list of unique field identifiers.</p>
87    pub fn fields(mut self, input: crate::types::FieldIdentifier) -> 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>A list of unique field identifiers.</p>
94    pub fn set_fields(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FieldIdentifier>>) -> Self {
95        self.fields = input;
96        self
97    }
98    /// <p>A list of unique field identifiers.</p>
99    pub fn get_fields(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FieldIdentifier>> {
100        &self.fields
101    }
102    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
103    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.next_token = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
108    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.next_token = input;
110        self
111    }
112    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
113    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
114        &self.next_token
115    }
116    /// Consumes the builder and constructs a [`GetCaseInput`](crate::operation::get_case::GetCaseInput).
117    pub fn build(self) -> ::std::result::Result<crate::operation::get_case::GetCaseInput, ::aws_smithy_types::error::operation::BuildError> {
118        ::std::result::Result::Ok(crate::operation::get_case::GetCaseInput {
119            case_id: self.case_id,
120            domain_id: self.domain_id,
121            fields: self.fields,
122            next_token: self.next_token,
123        })
124    }
125}