aws_sdk_backupstorage/operation/put_chunk/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::put_chunk::_put_chunk_output::PutChunkOutputBuilder;
3
4pub use crate::operation::put_chunk::_put_chunk_input::PutChunkInputBuilder;
5
6impl crate::operation::put_chunk::builders::PutChunkInputBuilder {
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::put_chunk::PutChunkOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::put_chunk::PutChunkError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.put_chunk();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `PutChunk`.
24///
25/// Upload chunk.
26#[derive(::std::fmt::Debug)]
27pub struct PutChunkFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::put_chunk::builders::PutChunkInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl crate::client::customize::internal::CustomizableSend<crate::operation::put_chunk::PutChunkOutput, crate::operation::put_chunk::PutChunkError>
33    for PutChunkFluentBuilder
34{
35    fn send(
36        self,
37        config_override: crate::config::Builder,
38    ) -> crate::client::customize::internal::BoxFuture<
39        crate::client::customize::internal::SendResult<crate::operation::put_chunk::PutChunkOutput, crate::operation::put_chunk::PutChunkError>,
40    > {
41        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
42    }
43}
44impl PutChunkFluentBuilder {
45    /// Creates a new `PutChunkFluentBuilder`.
46    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
47        Self {
48            handle,
49            inner: ::std::default::Default::default(),
50            config_override: ::std::option::Option::None,
51        }
52    }
53    /// Access the PutChunk as a reference.
54    pub fn as_input(&self) -> &crate::operation::put_chunk::builders::PutChunkInputBuilder {
55        &self.inner
56    }
57    /// Sends the request and returns the response.
58    ///
59    /// If an error occurs, an `SdkError` will be returned with additional details that
60    /// can be matched against.
61    ///
62    /// By default, any retryable failures will be retried twice. Retry behavior
63    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
64    /// set when configuring the client.
65    pub async fn send(
66        self,
67    ) -> ::std::result::Result<
68        crate::operation::put_chunk::PutChunkOutput,
69        ::aws_smithy_runtime_api::client::result::SdkError<
70            crate::operation::put_chunk::PutChunkError,
71            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
72        >,
73    > {
74        let input = self
75            .inner
76            .build()
77            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
78        let runtime_plugins = crate::operation::put_chunk::PutChunk::operation_runtime_plugins(
79            self.handle.runtime_plugins.clone(),
80            &self.handle.conf,
81            self.config_override,
82        );
83        crate::operation::put_chunk::PutChunk::orchestrate(&runtime_plugins, input).await
84    }
85
86    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
87    pub fn customize(
88        self,
89    ) -> crate::client::customize::CustomizableOperation<crate::operation::put_chunk::PutChunkOutput, crate::operation::put_chunk::PutChunkError, Self>
90    {
91        crate::client::customize::CustomizableOperation::new(self)
92    }
93    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
94        self.set_config_override(::std::option::Option::Some(config_override.into()));
95        self
96    }
97
98    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
99        self.config_override = config_override;
100        self
101    }
102    /// Backup job Id for the in-progress backup.
103    pub fn backup_job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.inner = self.inner.backup_job_id(input.into());
105        self
106    }
107    /// Backup job Id for the in-progress backup.
108    pub fn set_backup_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.inner = self.inner.set_backup_job_id(input);
110        self
111    }
112    /// Backup job Id for the in-progress backup.
113    pub fn get_backup_job_id(&self) -> &::std::option::Option<::std::string::String> {
114        self.inner.get_backup_job_id()
115    }
116    /// Upload Id for the in-progress upload.
117    pub fn upload_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.inner = self.inner.upload_id(input.into());
119        self
120    }
121    /// Upload Id for the in-progress upload.
122    pub fn set_upload_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.inner = self.inner.set_upload_id(input);
124        self
125    }
126    /// Upload Id for the in-progress upload.
127    pub fn get_upload_id(&self) -> &::std::option::Option<::std::string::String> {
128        self.inner.get_upload_id()
129    }
130    /// Describes this chunk's position relative to the other chunks
131    pub fn chunk_index(mut self, input: i64) -> Self {
132        self.inner = self.inner.chunk_index(input);
133        self
134    }
135    /// Describes this chunk's position relative to the other chunks
136    pub fn set_chunk_index(mut self, input: ::std::option::Option<i64>) -> Self {
137        self.inner = self.inner.set_chunk_index(input);
138        self
139    }
140    /// Describes this chunk's position relative to the other chunks
141    pub fn get_chunk_index(&self) -> &::std::option::Option<i64> {
142        self.inner.get_chunk_index()
143    }
144    /// Data to be uploaded
145    pub fn data(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
146        self.inner = self.inner.data(input);
147        self
148    }
149    /// Data to be uploaded
150    pub fn set_data(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
151        self.inner = self.inner.set_data(input);
152        self
153    }
154    /// Data to be uploaded
155    pub fn get_data(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
156        self.inner.get_data()
157    }
158    /// Data length
159    pub fn length(mut self, input: i64) -> Self {
160        self.inner = self.inner.length(input);
161        self
162    }
163    /// Data length
164    pub fn set_length(mut self, input: ::std::option::Option<i64>) -> Self {
165        self.inner = self.inner.set_length(input);
166        self
167    }
168    /// Data length
169    pub fn get_length(&self) -> &::std::option::Option<i64> {
170        self.inner.get_length()
171    }
172    /// Data checksum
173    pub fn checksum(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174        self.inner = self.inner.checksum(input.into());
175        self
176    }
177    /// Data checksum
178    pub fn set_checksum(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179        self.inner = self.inner.set_checksum(input);
180        self
181    }
182    /// Data checksum
183    pub fn get_checksum(&self) -> &::std::option::Option<::std::string::String> {
184        self.inner.get_checksum()
185    }
186    /// Checksum algorithm
187    pub fn checksum_algorithm(mut self, input: crate::types::DataChecksumAlgorithm) -> Self {
188        self.inner = self.inner.checksum_algorithm(input);
189        self
190    }
191    /// Checksum algorithm
192    pub fn set_checksum_algorithm(mut self, input: ::std::option::Option<crate::types::DataChecksumAlgorithm>) -> Self {
193        self.inner = self.inner.set_checksum_algorithm(input);
194        self
195    }
196    /// Checksum algorithm
197    pub fn get_checksum_algorithm(&self) -> &::std::option::Option<crate::types::DataChecksumAlgorithm> {
198        self.inner.get_checksum_algorithm()
199    }
200}