aws_sdk_connectcases/operation/get_case/
_get_case_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, ::std::fmt::Debug)]
5pub struct GetCaseOutput {
6    /// <p>A list of detailed field information.</p>
7    pub fields: ::std::vec::Vec<crate::types::FieldValue>,
8    /// <p>A unique identifier of a template.</p>
9    pub template_id: ::std::string::String,
10    /// <p>The token for the next set of results. This is null if there are no more results to return.</p>
11    pub next_token: ::std::option::Option<::std::string::String>,
12    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
13    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
14    _request_id: Option<String>,
15}
16impl GetCaseOutput {
17    /// <p>A list of detailed field information.</p>
18    pub fn fields(&self) -> &[crate::types::FieldValue] {
19        use std::ops::Deref;
20        self.fields.deref()
21    }
22    /// <p>A unique identifier of a template.</p>
23    pub fn template_id(&self) -> &str {
24        use std::ops::Deref;
25        self.template_id.deref()
26    }
27    /// <p>The token for the next set of results. This is null if there are no more results to return.</p>
28    pub fn next_token(&self) -> ::std::option::Option<&str> {
29        self.next_token.as_deref()
30    }
31    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
32    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
33        self.tags.as_ref()
34    }
35}
36impl ::aws_types::request_id::RequestId for GetCaseOutput {
37    fn request_id(&self) -> Option<&str> {
38        self._request_id.as_deref()
39    }
40}
41impl GetCaseOutput {
42    /// Creates a new builder-style object to manufacture [`GetCaseOutput`](crate::operation::get_case::GetCaseOutput).
43    pub fn builder() -> crate::operation::get_case::builders::GetCaseOutputBuilder {
44        crate::operation::get_case::builders::GetCaseOutputBuilder::default()
45    }
46}
47
48/// A builder for [`GetCaseOutput`](crate::operation::get_case::GetCaseOutput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct GetCaseOutputBuilder {
52    pub(crate) fields: ::std::option::Option<::std::vec::Vec<crate::types::FieldValue>>,
53    pub(crate) template_id: ::std::option::Option<::std::string::String>,
54    pub(crate) next_token: ::std::option::Option<::std::string::String>,
55    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
56    _request_id: Option<String>,
57}
58impl GetCaseOutputBuilder {
59    /// Appends an item to `fields`.
60    ///
61    /// To override the contents of this collection use [`set_fields`](Self::set_fields).
62    ///
63    /// <p>A list of detailed field information.</p>
64    pub fn fields(mut self, input: crate::types::FieldValue) -> Self {
65        let mut v = self.fields.unwrap_or_default();
66        v.push(input);
67        self.fields = ::std::option::Option::Some(v);
68        self
69    }
70    /// <p>A list of detailed field information.</p>
71    pub fn set_fields(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FieldValue>>) -> Self {
72        self.fields = input;
73        self
74    }
75    /// <p>A list of detailed field information.</p>
76    pub fn get_fields(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FieldValue>> {
77        &self.fields
78    }
79    /// <p>A unique identifier of a template.</p>
80    /// This field is required.
81    pub fn template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.template_id = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>A unique identifier of a template.</p>
86    pub fn set_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.template_id = input;
88        self
89    }
90    /// <p>A unique identifier of a template.</p>
91    pub fn get_template_id(&self) -> &::std::option::Option<::std::string::String> {
92        &self.template_id
93    }
94    /// <p>The token for the next set of results. This is null if there are no more results to return.</p>
95    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.next_token = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The token for the next set of results. This is null if there are no more results to return.</p>
100    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.next_token = input;
102        self
103    }
104    /// <p>The token for the next set of results. This is null if there are no more results to return.</p>
105    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
106        &self.next_token
107    }
108    /// Adds a key-value pair to `tags`.
109    ///
110    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
111    ///
112    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
113    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self {
114        let mut hash_map = self.tags.unwrap_or_default();
115        hash_map.insert(k.into(), v);
116        self.tags = ::std::option::Option::Some(hash_map);
117        self
118    }
119    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
120    pub fn set_tags(
121        mut self,
122        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
123    ) -> Self {
124        self.tags = input;
125        self
126    }
127    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
128    pub fn get_tags(
129        &self,
130    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
131        &self.tags
132    }
133    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
134        self._request_id = Some(request_id.into());
135        self
136    }
137
138    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
139        self._request_id = request_id;
140        self
141    }
142    /// Consumes the builder and constructs a [`GetCaseOutput`](crate::operation::get_case::GetCaseOutput).
143    /// This method will fail if any of the following fields are not set:
144    /// - [`fields`](crate::operation::get_case::builders::GetCaseOutputBuilder::fields)
145    /// - [`template_id`](crate::operation::get_case::builders::GetCaseOutputBuilder::template_id)
146    pub fn build(self) -> ::std::result::Result<crate::operation::get_case::GetCaseOutput, ::aws_smithy_types::error::operation::BuildError> {
147        ::std::result::Result::Ok(crate::operation::get_case::GetCaseOutput {
148            fields: self.fields.ok_or_else(|| {
149                ::aws_smithy_types::error::operation::BuildError::missing_field(
150                    "fields",
151                    "fields was not specified but it is required when building GetCaseOutput",
152                )
153            })?,
154            template_id: self.template_id.ok_or_else(|| {
155                ::aws_smithy_types::error::operation::BuildError::missing_field(
156                    "template_id",
157                    "template_id was not specified but it is required when building GetCaseOutput",
158                )
159            })?,
160            next_token: self.next_token,
161            tags: self.tags,
162            _request_id: self._request_id,
163        })
164    }
165}