aws_sdk_connectcases/operation/delete_field/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_field::_delete_field_output::DeleteFieldOutputBuilder;
3
4pub use crate::operation::delete_field::_delete_field_input::DeleteFieldInputBuilder;
5
6impl crate::operation::delete_field::builders::DeleteFieldInputBuilder {
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::delete_field::DeleteFieldOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::delete_field::DeleteFieldError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.delete_field();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeleteField`.
24///
25/// <p>Deletes a field from a cases template. You can delete up to 100 fields per domain.</p>
26/// <p>After a field is deleted:</p>
27/// <ul>
28/// <li>
29/// <p>You can still retrieve the field by calling <code>BatchGetField</code>.</p></li>
30/// <li>
31/// <p>You cannot update a deleted field by calling <code>UpdateField</code>; it throws a <code>ValidationException</code>.</p></li>
32/// <li>
33/// <p>Deleted fields are not included in the <code>ListFields</code> response.</p></li>
34/// <li>
35/// <p>Calling <code>CreateCase</code> with a deleted field throws a <code>ValidationException</code> denoting which field identifiers in the request have been deleted.</p></li>
36/// <li>
37/// <p>Calling <code>GetCase</code> with a deleted field identifier returns the deleted field's value if one exists.</p></li>
38/// <li>
39/// <p>Calling <code>UpdateCase</code> with a deleted field ID throws a <code>ValidationException</code> if the case does not already contain a value for the deleted field. Otherwise it succeeds, allowing you to update or remove (using <code>emptyValue: {}</code>) the field's value from the case.</p></li>
40/// <li>
41/// <p><code>GetTemplate</code> does not return field IDs for deleted fields.</p></li>
42/// <li>
43/// <p><code>GetLayout</code> does not return field IDs for deleted fields.</p></li>
44/// <li>
45/// <p>Calling <code>SearchCases</code> with the deleted field ID as a filter returns any cases that have a value for the deleted field that matches the filter criteria.</p></li>
46/// <li>
47/// <p>Calling <code>SearchCases</code> with a <code>searchTerm</code> value that matches a deleted field's value on a case returns the case in the response.</p></li>
48/// <li>
49/// <p>Calling <code>BatchPutFieldOptions</code> with a deleted field ID throw a <code>ValidationException</code>.</p></li>
50/// <li>
51/// <p>Calling <code>GetCaseEventConfiguration</code> does not return field IDs for deleted fields.</p></li>
52/// </ul>
53#[derive(::std::clone::Clone, ::std::fmt::Debug)]
54pub struct DeleteFieldFluentBuilder {
55    handle: ::std::sync::Arc<crate::client::Handle>,
56    inner: crate::operation::delete_field::builders::DeleteFieldInputBuilder,
57    config_override: ::std::option::Option<crate::config::Builder>,
58}
59impl
60    crate::client::customize::internal::CustomizableSend<
61        crate::operation::delete_field::DeleteFieldOutput,
62        crate::operation::delete_field::DeleteFieldError,
63    > for DeleteFieldFluentBuilder
64{
65    fn send(
66        self,
67        config_override: crate::config::Builder,
68    ) -> crate::client::customize::internal::BoxFuture<
69        crate::client::customize::internal::SendResult<
70            crate::operation::delete_field::DeleteFieldOutput,
71            crate::operation::delete_field::DeleteFieldError,
72        >,
73    > {
74        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
75    }
76}
77impl DeleteFieldFluentBuilder {
78    /// Creates a new `DeleteFieldFluentBuilder`.
79    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
80        Self {
81            handle,
82            inner: ::std::default::Default::default(),
83            config_override: ::std::option::Option::None,
84        }
85    }
86    /// Access the DeleteField as a reference.
87    pub fn as_input(&self) -> &crate::operation::delete_field::builders::DeleteFieldInputBuilder {
88        &self.inner
89    }
90    /// Sends the request and returns the response.
91    ///
92    /// If an error occurs, an `SdkError` will be returned with additional details that
93    /// can be matched against.
94    ///
95    /// By default, any retryable failures will be retried twice. Retry behavior
96    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
97    /// set when configuring the client.
98    pub async fn send(
99        self,
100    ) -> ::std::result::Result<
101        crate::operation::delete_field::DeleteFieldOutput,
102        ::aws_smithy_runtime_api::client::result::SdkError<
103            crate::operation::delete_field::DeleteFieldError,
104            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
105        >,
106    > {
107        let input = self
108            .inner
109            .build()
110            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
111        let runtime_plugins = crate::operation::delete_field::DeleteField::operation_runtime_plugins(
112            self.handle.runtime_plugins.clone(),
113            &self.handle.conf,
114            self.config_override,
115        );
116        crate::operation::delete_field::DeleteField::orchestrate(&runtime_plugins, input).await
117    }
118
119    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
120    pub fn customize(
121        self,
122    ) -> crate::client::customize::CustomizableOperation<
123        crate::operation::delete_field::DeleteFieldOutput,
124        crate::operation::delete_field::DeleteFieldError,
125        Self,
126    > {
127        crate::client::customize::CustomizableOperation::new(self)
128    }
129    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
130        self.set_config_override(::std::option::Option::Some(config_override.into()));
131        self
132    }
133
134    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
135        self.config_override = config_override;
136        self
137    }
138    /// <p>The unique identifier of the Cases domain.</p>
139    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.inner = self.inner.domain_id(input.into());
141        self
142    }
143    /// <p>The unique identifier of the Cases domain.</p>
144    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.inner = self.inner.set_domain_id(input);
146        self
147    }
148    /// <p>The unique identifier of the Cases domain.</p>
149    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
150        self.inner.get_domain_id()
151    }
152    /// <p>Unique identifier of the field.</p>
153    pub fn field_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.inner = self.inner.field_id(input.into());
155        self
156    }
157    /// <p>Unique identifier of the field.</p>
158    pub fn set_field_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.inner = self.inner.set_field_id(input);
160        self
161    }
162    /// <p>Unique identifier of the field.</p>
163    pub fn get_field_id(&self) -> &::std::option::Option<::std::string::String> {
164        self.inner.get_field_id()
165    }
166}