aws_sdk_glue/operation/update_schema/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_schema::_update_schema_output::UpdateSchemaOutputBuilder;
3
4pub use crate::operation::update_schema::_update_schema_input::UpdateSchemaInputBuilder;
5
6impl crate::operation::update_schema::builders::UpdateSchemaInputBuilder {
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::update_schema::UpdateSchemaOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_schema::UpdateSchemaError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_schema();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateSchema`.
24///
25/// <p>Updates the description, compatibility setting, or version checkpoint for a schema set.</p>
26/// <p>For updating the compatibility setting, the call will not validate compatibility for the entire set of schema versions with the new compatibility setting. If the value for <code>Compatibility</code> is provided, the <code>VersionNumber</code> (a checkpoint) is also required. The API will validate the checkpoint version number for consistency.</p>
27/// <p>If the value for the <code>VersionNumber</code> (checkpoint) is provided, <code>Compatibility</code> is optional and this can be used to set/reset a checkpoint for the schema.</p>
28/// <p>This update will happen only if the schema is in the AVAILABLE state.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct UpdateSchemaFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::update_schema::builders::UpdateSchemaInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::update_schema::UpdateSchemaOutput,
38        crate::operation::update_schema::UpdateSchemaError,
39    > for UpdateSchemaFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::update_schema::UpdateSchemaOutput,
47            crate::operation::update_schema::UpdateSchemaError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl UpdateSchemaFluentBuilder {
54    /// Creates a new `UpdateSchemaFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the UpdateSchema as a reference.
63    pub fn as_input(&self) -> &crate::operation::update_schema::builders::UpdateSchemaInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::update_schema::UpdateSchemaOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::update_schema::UpdateSchemaError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::update_schema::UpdateSchema::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::update_schema::UpdateSchema::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::update_schema::UpdateSchemaOutput,
100        crate::operation::update_schema::UpdateSchemaError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>This is a wrapper structure to contain schema identity fields. The structure contains:</p>
115    /// <ul>
116    /// <li>
117    /// <p>SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema. One of <code>SchemaArn</code> or <code>SchemaName</code> has to be provided.</p></li>
118    /// <li>
119    /// <p>SchemaId$SchemaName: The name of the schema. One of <code>SchemaArn</code> or <code>SchemaName</code> has to be provided.</p></li>
120    /// </ul>
121    pub fn schema_id(mut self, input: crate::types::SchemaId) -> Self {
122        self.inner = self.inner.schema_id(input);
123        self
124    }
125    /// <p>This is a wrapper structure to contain schema identity fields. The structure contains:</p>
126    /// <ul>
127    /// <li>
128    /// <p>SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema. One of <code>SchemaArn</code> or <code>SchemaName</code> has to be provided.</p></li>
129    /// <li>
130    /// <p>SchemaId$SchemaName: The name of the schema. One of <code>SchemaArn</code> or <code>SchemaName</code> has to be provided.</p></li>
131    /// </ul>
132    pub fn set_schema_id(mut self, input: ::std::option::Option<crate::types::SchemaId>) -> Self {
133        self.inner = self.inner.set_schema_id(input);
134        self
135    }
136    /// <p>This is a wrapper structure to contain schema identity fields. The structure contains:</p>
137    /// <ul>
138    /// <li>
139    /// <p>SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema. One of <code>SchemaArn</code> or <code>SchemaName</code> has to be provided.</p></li>
140    /// <li>
141    /// <p>SchemaId$SchemaName: The name of the schema. One of <code>SchemaArn</code> or <code>SchemaName</code> has to be provided.</p></li>
142    /// </ul>
143    pub fn get_schema_id(&self) -> &::std::option::Option<crate::types::SchemaId> {
144        self.inner.get_schema_id()
145    }
146    /// <p>Version number required for check pointing. One of <code>VersionNumber</code> or <code>Compatibility</code> has to be provided.</p>
147    pub fn schema_version_number(mut self, input: crate::types::SchemaVersionNumber) -> Self {
148        self.inner = self.inner.schema_version_number(input);
149        self
150    }
151    /// <p>Version number required for check pointing. One of <code>VersionNumber</code> or <code>Compatibility</code> has to be provided.</p>
152    pub fn set_schema_version_number(mut self, input: ::std::option::Option<crate::types::SchemaVersionNumber>) -> Self {
153        self.inner = self.inner.set_schema_version_number(input);
154        self
155    }
156    /// <p>Version number required for check pointing. One of <code>VersionNumber</code> or <code>Compatibility</code> has to be provided.</p>
157    pub fn get_schema_version_number(&self) -> &::std::option::Option<crate::types::SchemaVersionNumber> {
158        self.inner.get_schema_version_number()
159    }
160    /// <p>The new compatibility setting for the schema.</p>
161    pub fn compatibility(mut self, input: crate::types::Compatibility) -> Self {
162        self.inner = self.inner.compatibility(input);
163        self
164    }
165    /// <p>The new compatibility setting for the schema.</p>
166    pub fn set_compatibility(mut self, input: ::std::option::Option<crate::types::Compatibility>) -> Self {
167        self.inner = self.inner.set_compatibility(input);
168        self
169    }
170    /// <p>The new compatibility setting for the schema.</p>
171    pub fn get_compatibility(&self) -> &::std::option::Option<crate::types::Compatibility> {
172        self.inner.get_compatibility()
173    }
174    /// <p>The new description for the schema.</p>
175    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176        self.inner = self.inner.description(input.into());
177        self
178    }
179    /// <p>The new description for the schema.</p>
180    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.inner = self.inner.set_description(input);
182        self
183    }
184    /// <p>The new description for the schema.</p>
185    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
186        self.inner.get_description()
187    }
188}