Struct aws_sdk_s3::operation::ListParts
source · pub struct ListParts { /* private fields */ }
Expand description
Operation shape for ListParts
.
This is usually constructed for you using the the fluent builder returned by
list_parts
.
See crate::client::fluent_builders::ListParts
for more details about the operation.
Implementations§
source§impl ListParts
impl ListParts
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture ListPartsInput
.
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new ListParts
operation.
Examples found in repository?
src/input.rs (line 15467)
15310 15311 15312 15313 15314 15315 15316 15317 15318 15319 15320 15321 15322 15323 15324 15325 15326 15327 15328 15329 15330 15331 15332 15333 15334 15335 15336 15337 15338 15339 15340 15341 15342 15343 15344 15345 15346 15347 15348 15349 15350 15351 15352 15353 15354 15355 15356 15357 15358 15359 15360 15361 15362 15363 15364 15365 15366 15367 15368 15369 15370 15371 15372 15373 15374 15375 15376 15377 15378 15379 15380 15381 15382 15383 15384 15385 15386 15387 15388 15389 15390 15391 15392 15393 15394 15395 15396 15397 15398 15399 15400 15401 15402 15403 15404 15405 15406 15407 15408 15409 15410 15411 15412 15413 15414 15415 15416 15417 15418 15419 15420 15421 15422 15423 15424 15425 15426 15427 15428 15429 15430 15431 15432 15433 15434 15435 15436 15437 15438 15439 15440 15441 15442 15443 15444 15445 15446 15447 15448 15449 15450 15451 15452 15453 15454 15455 15456 15457 15458 15459 15460 15461 15462 15463 15464 15465 15466 15467 15468 15469 15470 15471
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListParts,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let mut request = {
fn uri_base(
_input: &crate::input::ListPartsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_136 = &_input.bucket;
let input_136 = input_136.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"bucket",
"cannot be empty or unset",
)
})?;
let bucket = aws_smithy_http::label::fmt_string(
input_136,
aws_smithy_http::label::EncodingStrategy::Default,
);
if bucket.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"bucket",
"cannot be empty or unset",
),
);
}
let input_137 = &_input.key;
let input_137 = input_137.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"key",
"cannot be empty or unset",
)
})?;
let key = aws_smithy_http::label::fmt_string(
input_137,
aws_smithy_http::label::EncodingStrategy::Greedy,
);
if key.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"key",
"cannot be empty or unset",
),
);
}
write!(output, "/{Bucket}/{Key}", Bucket = bucket, Key = key)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListPartsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
query.push_kv("x-id", "ListParts");
if _input.max_parts != 0 {
query.push_kv(
"max-parts",
aws_smithy_types::primitive::Encoder::from(_input.max_parts).encode(),
);
}
if let Some(inner_138) = &_input.part_number_marker {
{
query.push_kv(
"part-number-marker",
&aws_smithy_http::query::fmt_string(&inner_138),
);
}
}
let inner_139 = &_input.upload_id;
let inner_139 = inner_139.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"upload_id",
"cannot be empty or unset",
)
})?;
if inner_139.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"upload_id",
"cannot be empty or unset",
),
);
}
query.push_kv("uploadId", &aws_smithy_http::query::fmt_string(&inner_139));
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListPartsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
let builder = crate::http_serde::add_headers_list_parts(input, builder)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
signing_config.signing_options.content_sha256_header = true;
signing_config.signing_options.double_uri_encode = false;
signing_config.signing_options.normalize_uri_path = false;
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
let endpoint_params = aws_endpoint::Params::new(_config.region.clone());
request
.properties_mut()
.insert::<aws_smithy_http::endpoint::Result>(
_config.endpoint_resolver.resolve_endpoint(&endpoint_params),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::ListParts::new())
.with_metadata(aws_smithy_http::operation::Metadata::new("ListParts", "s3"));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
Trait Implementations§
source§impl ParseStrictResponse for ListParts
impl ParseStrictResponse for ListParts
Auto Trait Implementations§
impl RefUnwindSafe for ListParts
impl Send for ListParts
impl Sync for ListParts
impl Unpin for ListParts
impl UnwindSafe for ListParts
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> ParseHttpResponse for Twhere
T: ParseStrictResponse,
impl<T> ParseHttpResponse for Twhere
T: ParseStrictResponse,
§type Output = <T as ParseStrictResponse>::Output
type Output = <T as ParseStrictResponse>::Output
Output type of the HttpResponse. Read more
source§fn parse_unloaded(
&self,
_response: &mut Response
) -> Option<<T as ParseHttpResponse>::Output>
fn parse_unloaded(
&self,
_response: &mut Response
) -> Option<<T as ParseHttpResponse>::Output>
Parse an HTTP request without reading the body. If the body must be provided to proceed,
return
None
Read moresource§fn parse_loaded(
&self,
response: &Response<Bytes>
) -> <T as ParseHttpResponse>::Output
fn parse_loaded(
&self,
response: &Response<Bytes>
) -> <T as ParseHttpResponse>::Output
Parse an HTTP request from a fully loaded body. This is for standard request/response style
APIs like AwsJson 1.0/1.1 and the error path of most streaming APIs Read more