aws_sdk_support/operation/describe_cases/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_cases::_describe_cases_output::DescribeCasesOutputBuilder;
3
4pub use crate::operation::describe_cases::_describe_cases_input::DescribeCasesInputBuilder;
5
6impl crate::operation::describe_cases::builders::DescribeCasesInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::describe_cases::DescribeCasesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_cases::DescribeCasesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_cases();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeCases`.
24///
25/// <p>Returns a list of cases that you specify by passing one or more case IDs. You can use the <code>afterTime</code> and <code>beforeTime</code> parameters to filter the cases by date. You can set values for the <code>includeResolvedCases</code> and <code>includeCommunications</code> parameters to specify how much information to return.</p>
26/// <p>The response returns the following in JSON format:</p>
27/// <ul>
28/// <li>
29/// <p>One or more <a href="https://docs.aws.amazon.com/awssupport/latest/APIReference/API_CaseDetails.html">CaseDetails</a> data types.</p></li>
30/// <li>
31/// <p>One or more <code>nextToken</code> values, which specify where to paginate the returned records represented by the <code>CaseDetails</code> objects.</p></li>
32/// </ul>
33/// <p>Case data is available for 12 months after creation. If a case was created more than 12 months ago, a request might return an error.</p><note>
34/// <ul>
35/// <li>
36/// <p>You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support API.</p></li>
37/// <li>
38/// <p>If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp, or Enterprise Support plan, the <code>SubscriptionRequiredException</code> error message appears. For information about changing your support plan, see <a href="http://aws.amazon.com/premiumsupport/">Amazon Web Services Support</a>.</p></li>
39/// </ul>
40/// </note>
41#[derive(::std::clone::Clone, ::std::fmt::Debug)]
42pub struct DescribeCasesFluentBuilder {
43    handle: ::std::sync::Arc<crate::client::Handle>,
44    inner: crate::operation::describe_cases::builders::DescribeCasesInputBuilder,
45    config_override: ::std::option::Option<crate::config::Builder>,
46}
47impl
48    crate::client::customize::internal::CustomizableSend<
49        crate::operation::describe_cases::DescribeCasesOutput,
50        crate::operation::describe_cases::DescribeCasesError,
51    > for DescribeCasesFluentBuilder
52{
53    fn send(
54        self,
55        config_override: crate::config::Builder,
56    ) -> crate::client::customize::internal::BoxFuture<
57        crate::client::customize::internal::SendResult<
58            crate::operation::describe_cases::DescribeCasesOutput,
59            crate::operation::describe_cases::DescribeCasesError,
60        >,
61    > {
62        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
63    }
64}
65impl DescribeCasesFluentBuilder {
66    /// Creates a new `DescribeCasesFluentBuilder`.
67    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
68        Self {
69            handle,
70            inner: ::std::default::Default::default(),
71            config_override: ::std::option::Option::None,
72        }
73    }
74    /// Access the DescribeCases as a reference.
75    pub fn as_input(&self) -> &crate::operation::describe_cases::builders::DescribeCasesInputBuilder {
76        &self.inner
77    }
78    /// Sends the request and returns the response.
79    ///
80    /// If an error occurs, an `SdkError` will be returned with additional details that
81    /// can be matched against.
82    ///
83    /// By default, any retryable failures will be retried twice. Retry behavior
84    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
85    /// set when configuring the client.
86    pub async fn send(
87        self,
88    ) -> ::std::result::Result<
89        crate::operation::describe_cases::DescribeCasesOutput,
90        ::aws_smithy_runtime_api::client::result::SdkError<
91            crate::operation::describe_cases::DescribeCasesError,
92            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
93        >,
94    > {
95        let input = self
96            .inner
97            .build()
98            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
99        let runtime_plugins = crate::operation::describe_cases::DescribeCases::operation_runtime_plugins(
100            self.handle.runtime_plugins.clone(),
101            &self.handle.conf,
102            self.config_override,
103        );
104        crate::operation::describe_cases::DescribeCases::orchestrate(&runtime_plugins, input).await
105    }
106
107    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
108    pub fn customize(
109        self,
110    ) -> crate::client::customize::CustomizableOperation<
111        crate::operation::describe_cases::DescribeCasesOutput,
112        crate::operation::describe_cases::DescribeCasesError,
113        Self,
114    > {
115        crate::client::customize::CustomizableOperation::new(self)
116    }
117    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
118        self.set_config_override(::std::option::Option::Some(config_override.into()));
119        self
120    }
121
122    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
123        self.config_override = config_override;
124        self
125    }
126    /// Create a paginator for this request
127    ///
128    /// Paginators are used by calling [`send().await`](crate::operation::describe_cases::paginator::DescribeCasesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
129    pub fn into_paginator(self) -> crate::operation::describe_cases::paginator::DescribeCasesPaginator {
130        crate::operation::describe_cases::paginator::DescribeCasesPaginator::new(self.handle, self.inner)
131    }
132    ///
133    /// Appends an item to `caseIdList`.
134    ///
135    /// To override the contents of this collection use [`set_case_id_list`](Self::set_case_id_list).
136    ///
137    /// <p>A list of ID numbers of the support cases you want returned. The maximum number of cases is 100.</p>
138    pub fn case_id_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.inner = self.inner.case_id_list(input.into());
140        self
141    }
142    /// <p>A list of ID numbers of the support cases you want returned. The maximum number of cases is 100.</p>
143    pub fn set_case_id_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
144        self.inner = self.inner.set_case_id_list(input);
145        self
146    }
147    /// <p>A list of ID numbers of the support cases you want returned. The maximum number of cases is 100.</p>
148    pub fn get_case_id_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
149        self.inner.get_case_id_list()
150    }
151    /// <p>The ID displayed for a case in the Amazon Web Services Support Center user interface.</p>
152    pub fn display_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.inner = self.inner.display_id(input.into());
154        self
155    }
156    /// <p>The ID displayed for a case in the Amazon Web Services Support Center user interface.</p>
157    pub fn set_display_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.inner = self.inner.set_display_id(input);
159        self
160    }
161    /// <p>The ID displayed for a case in the Amazon Web Services Support Center user interface.</p>
162    pub fn get_display_id(&self) -> &::std::option::Option<::std::string::String> {
163        self.inner.get_display_id()
164    }
165    /// <p>The start date for a filtered date search on support case communications. Case communications are available for 12 months after creation.</p>
166    pub fn after_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.inner = self.inner.after_time(input.into());
168        self
169    }
170    /// <p>The start date for a filtered date search on support case communications. Case communications are available for 12 months after creation.</p>
171    pub fn set_after_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.inner = self.inner.set_after_time(input);
173        self
174    }
175    /// <p>The start date for a filtered date search on support case communications. Case communications are available for 12 months after creation.</p>
176    pub fn get_after_time(&self) -> &::std::option::Option<::std::string::String> {
177        self.inner.get_after_time()
178    }
179    /// <p>The end date for a filtered date search on support case communications. Case communications are available for 12 months after creation.</p>
180    pub fn before_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
181        self.inner = self.inner.before_time(input.into());
182        self
183    }
184    /// <p>The end date for a filtered date search on support case communications. Case communications are available for 12 months after creation.</p>
185    pub fn set_before_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186        self.inner = self.inner.set_before_time(input);
187        self
188    }
189    /// <p>The end date for a filtered date search on support case communications. Case communications are available for 12 months after creation.</p>
190    pub fn get_before_time(&self) -> &::std::option::Option<::std::string::String> {
191        self.inner.get_before_time()
192    }
193    /// <p>Specifies whether to include resolved support cases in the <code>DescribeCases</code> response. By default, resolved cases aren't included.</p>
194    pub fn include_resolved_cases(mut self, input: bool) -> Self {
195        self.inner = self.inner.include_resolved_cases(input);
196        self
197    }
198    /// <p>Specifies whether to include resolved support cases in the <code>DescribeCases</code> response. By default, resolved cases aren't included.</p>
199    pub fn set_include_resolved_cases(mut self, input: ::std::option::Option<bool>) -> Self {
200        self.inner = self.inner.set_include_resolved_cases(input);
201        self
202    }
203    /// <p>Specifies whether to include resolved support cases in the <code>DescribeCases</code> response. By default, resolved cases aren't included.</p>
204    pub fn get_include_resolved_cases(&self) -> &::std::option::Option<bool> {
205        self.inner.get_include_resolved_cases()
206    }
207    /// <p>A resumption point for pagination.</p>
208    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
209        self.inner = self.inner.next_token(input.into());
210        self
211    }
212    /// <p>A resumption point for pagination.</p>
213    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
214        self.inner = self.inner.set_next_token(input);
215        self
216    }
217    /// <p>A resumption point for pagination.</p>
218    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
219        self.inner.get_next_token()
220    }
221    /// <p>The maximum number of results to return before paginating.</p>
222    pub fn max_results(mut self, input: i32) -> Self {
223        self.inner = self.inner.max_results(input);
224        self
225    }
226    /// <p>The maximum number of results to return before paginating.</p>
227    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
228        self.inner = self.inner.set_max_results(input);
229        self
230    }
231    /// <p>The maximum number of results to return before paginating.</p>
232    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
233        self.inner.get_max_results()
234    }
235    /// <p>The language in which Amazon Web Services Support handles the case. Amazon Web Services Support currently supports Chinese (“zh”), English ("en"), Japanese ("ja") and Korean (“ko”). You must specify the ISO 639-1 code for the <code>language</code> parameter if you want support in that language.</p>
236    pub fn language(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
237        self.inner = self.inner.language(input.into());
238        self
239    }
240    /// <p>The language in which Amazon Web Services Support handles the case. Amazon Web Services Support currently supports Chinese (“zh”), English ("en"), Japanese ("ja") and Korean (“ko”). You must specify the ISO 639-1 code for the <code>language</code> parameter if you want support in that language.</p>
241    pub fn set_language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
242        self.inner = self.inner.set_language(input);
243        self
244    }
245    /// <p>The language in which Amazon Web Services Support handles the case. Amazon Web Services Support currently supports Chinese (“zh”), English ("en"), Japanese ("ja") and Korean (“ko”). You must specify the ISO 639-1 code for the <code>language</code> parameter if you want support in that language.</p>
246    pub fn get_language(&self) -> &::std::option::Option<::std::string::String> {
247        self.inner.get_language()
248    }
249    /// <p>Specifies whether to include communications in the <code>DescribeCases</code> response. By default, communications are included.</p>
250    pub fn include_communications(mut self, input: bool) -> Self {
251        self.inner = self.inner.include_communications(input);
252        self
253    }
254    /// <p>Specifies whether to include communications in the <code>DescribeCases</code> response. By default, communications are included.</p>
255    pub fn set_include_communications(mut self, input: ::std::option::Option<bool>) -> Self {
256        self.inner = self.inner.set_include_communications(input);
257        self
258    }
259    /// <p>Specifies whether to include communications in the <code>DescribeCases</code> response. By default, communications are included.</p>
260    pub fn get_include_communications(&self) -> &::std::option::Option<bool> {
261        self.inner.get_include_communications()
262    }
263}