aws_sdk_apigatewayv2/operation/export_api/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::export_api::_export_api_output::ExportApiOutputBuilder;
3
4pub use crate::operation::export_api::_export_api_input::ExportApiInputBuilder;
5
6impl crate::operation::export_api::builders::ExportApiInputBuilder {
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::export_api::ExportApiOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::export_api::ExportApiError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.export_api();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ExportApi`.
24///
25#[derive(::std::clone::Clone, ::std::fmt::Debug)]
26pub struct ExportApiFluentBuilder {
27    handle: ::std::sync::Arc<crate::client::Handle>,
28    inner: crate::operation::export_api::builders::ExportApiInputBuilder,
29    config_override: ::std::option::Option<crate::config::Builder>,
30}
31impl crate::client::customize::internal::CustomizableSend<crate::operation::export_api::ExportApiOutput, crate::operation::export_api::ExportApiError>
32    for ExportApiFluentBuilder
33{
34    fn send(
35        self,
36        config_override: crate::config::Builder,
37    ) -> crate::client::customize::internal::BoxFuture<
38        crate::client::customize::internal::SendResult<crate::operation::export_api::ExportApiOutput, crate::operation::export_api::ExportApiError>,
39    > {
40        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
41    }
42}
43impl ExportApiFluentBuilder {
44    /// Creates a new `ExportApiFluentBuilder`.
45    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
46        Self {
47            handle,
48            inner: ::std::default::Default::default(),
49            config_override: ::std::option::Option::None,
50        }
51    }
52    /// Access the ExportApi as a reference.
53    pub fn as_input(&self) -> &crate::operation::export_api::builders::ExportApiInputBuilder {
54        &self.inner
55    }
56    /// Sends the request and returns the response.
57    ///
58    /// If an error occurs, an `SdkError` will be returned with additional details that
59    /// can be matched against.
60    ///
61    /// By default, any retryable failures will be retried twice. Retry behavior
62    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
63    /// set when configuring the client.
64    pub async fn send(
65        self,
66    ) -> ::std::result::Result<
67        crate::operation::export_api::ExportApiOutput,
68        ::aws_smithy_runtime_api::client::result::SdkError<
69            crate::operation::export_api::ExportApiError,
70            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
71        >,
72    > {
73        let input = self
74            .inner
75            .build()
76            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
77        let runtime_plugins = crate::operation::export_api::ExportApi::operation_runtime_plugins(
78            self.handle.runtime_plugins.clone(),
79            &self.handle.conf,
80            self.config_override,
81        );
82        crate::operation::export_api::ExportApi::orchestrate(&runtime_plugins, input).await
83    }
84
85    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
86    pub fn customize(
87        self,
88    ) -> crate::client::customize::CustomizableOperation<
89        crate::operation::export_api::ExportApiOutput,
90        crate::operation::export_api::ExportApiError,
91        Self,
92    > {
93        crate::client::customize::CustomizableOperation::new(self)
94    }
95    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
96        self.set_config_override(::std::option::Option::Some(config_override.into()));
97        self
98    }
99
100    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
101        self.config_override = config_override;
102        self
103    }
104    /// <p>The API identifier.</p>
105    pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.inner = self.inner.api_id(input.into());
107        self
108    }
109    /// <p>The API identifier.</p>
110    pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.inner = self.inner.set_api_id(input);
112        self
113    }
114    /// <p>The API identifier.</p>
115    pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
116        self.inner.get_api_id()
117    }
118    /// <p>The version of the API Gateway export algorithm. API Gateway uses the latest version by default. Currently, the only supported version is 1.0.</p>
119    pub fn export_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.export_version(input.into());
121        self
122    }
123    /// <p>The version of the API Gateway export algorithm. API Gateway uses the latest version by default. Currently, the only supported version is 1.0.</p>
124    pub fn set_export_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_export_version(input);
126        self
127    }
128    /// <p>The version of the API Gateway export algorithm. API Gateway uses the latest version by default. Currently, the only supported version is 1.0.</p>
129    pub fn get_export_version(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_export_version()
131    }
132    /// <p>Specifies whether to include <a href="https://docs.aws.amazon.com//apigateway/latest/developerguide/api-gateway-swagger-extensions.html">API Gateway extensions</a> in the exported API definition. API Gateway extensions are included by default.</p>
133    pub fn include_extensions(mut self, input: bool) -> Self {
134        self.inner = self.inner.include_extensions(input);
135        self
136    }
137    /// <p>Specifies whether to include <a href="https://docs.aws.amazon.com//apigateway/latest/developerguide/api-gateway-swagger-extensions.html">API Gateway extensions</a> in the exported API definition. API Gateway extensions are included by default.</p>
138    pub fn set_include_extensions(mut self, input: ::std::option::Option<bool>) -> Self {
139        self.inner = self.inner.set_include_extensions(input);
140        self
141    }
142    /// <p>Specifies whether to include <a href="https://docs.aws.amazon.com//apigateway/latest/developerguide/api-gateway-swagger-extensions.html">API Gateway extensions</a> in the exported API definition. API Gateway extensions are included by default.</p>
143    pub fn get_include_extensions(&self) -> &::std::option::Option<bool> {
144        self.inner.get_include_extensions()
145    }
146    /// <p>The output type of the exported definition file. Valid values are JSON and YAML.</p>
147    pub fn output_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.output_type(input.into());
149        self
150    }
151    /// <p>The output type of the exported definition file. Valid values are JSON and YAML.</p>
152    pub fn set_output_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_output_type(input);
154        self
155    }
156    /// <p>The output type of the exported definition file. Valid values are JSON and YAML.</p>
157    pub fn get_output_type(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_output_type()
159    }
160    /// <p>The version of the API specification to use. OAS30, for OpenAPI 3.0, is the only supported value.</p>
161    pub fn specification(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.inner = self.inner.specification(input.into());
163        self
164    }
165    /// <p>The version of the API specification to use. OAS30, for OpenAPI 3.0, is the only supported value.</p>
166    pub fn set_specification(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.inner = self.inner.set_specification(input);
168        self
169    }
170    /// <p>The version of the API specification to use. OAS30, for OpenAPI 3.0, is the only supported value.</p>
171    pub fn get_specification(&self) -> &::std::option::Option<::std::string::String> {
172        self.inner.get_specification()
173    }
174    /// <p>The name of the API stage to export. If you don't specify this property, a representation of the latest API configuration is exported.</p>
175    pub fn stage_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176        self.inner = self.inner.stage_name(input.into());
177        self
178    }
179    /// <p>The name of the API stage to export. If you don't specify this property, a representation of the latest API configuration is exported.</p>
180    pub fn set_stage_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.inner = self.inner.set_stage_name(input);
182        self
183    }
184    /// <p>The name of the API stage to export. If you don't specify this property, a representation of the latest API configuration is exported.</p>
185    pub fn get_stage_name(&self) -> &::std::option::Option<::std::string::String> {
186        self.inner.get_stage_name()
187    }
188}