aws_sdk_glue/operation/get_schema_version/
builders.rs

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