Struct aws_sdk_s3::operation::ListObjectsV2
source · pub struct ListObjectsV2 { /* private fields */ }
Expand description
Operation shape for ListObjectsV2
.
This is usually constructed for you using the the fluent builder returned by
list_objects_v2
.
See crate::client::fluent_builders::ListObjectsV2
for more details about the operation.
Implementations§
source§impl ListObjectsV2
impl ListObjectsV2
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture ListObjectsV2Input
.
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new ListObjectsV2
operation.
Examples found in repository?
src/input.rs (line 14817)
14663 14664 14665 14666 14667 14668 14669 14670 14671 14672 14673 14674 14675 14676 14677 14678 14679 14680 14681 14682 14683 14684 14685 14686 14687 14688 14689 14690 14691 14692 14693 14694 14695 14696 14697 14698 14699 14700 14701 14702 14703 14704 14705 14706 14707 14708 14709 14710 14711 14712 14713 14714 14715 14716 14717 14718 14719 14720 14721 14722 14723 14724 14725 14726 14727 14728 14729 14730 14731 14732 14733 14734 14735 14736 14737 14738 14739 14740 14741 14742 14743 14744 14745 14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 14762 14763 14764 14765 14766 14767 14768 14769 14770 14771 14772 14773 14774 14775 14776 14777 14778 14779 14780 14781 14782 14783 14784 14785 14786 14787 14788 14789 14790 14791 14792 14793 14794 14795 14796 14797 14798 14799 14800 14801 14802 14803 14804 14805 14806 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 14818 14819 14820 14821 14822 14823 14824 14825
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListObjectsV2,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let mut request = {
fn uri_base(
_input: &crate::input::ListObjectsV2Input,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_124 = &_input.bucket;
let input_124 = input_124.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_124,
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",
),
);
}
write!(output, "/{Bucket}", Bucket = bucket).expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListObjectsV2Input,
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("list-type", "2");
if let Some(inner_125) = &_input.delimiter {
{
query.push_kv("delimiter", &aws_smithy_http::query::fmt_string(&inner_125));
}
}
if let Some(inner_126) = &_input.encoding_type {
{
query.push_kv(
"encoding-type",
&aws_smithy_http::query::fmt_string(&inner_126),
);
}
}
if _input.max_keys != 0 {
query.push_kv(
"max-keys",
aws_smithy_types::primitive::Encoder::from(_input.max_keys).encode(),
);
}
if let Some(inner_127) = &_input.prefix {
{
query.push_kv("prefix", &aws_smithy_http::query::fmt_string(&inner_127));
}
}
if let Some(inner_128) = &_input.continuation_token {
{
query.push_kv(
"continuation-token",
&aws_smithy_http::query::fmt_string(&inner_128),
);
}
}
if _input.fetch_owner {
query.push_kv(
"fetch-owner",
aws_smithy_types::primitive::Encoder::from(_input.fetch_owner).encode(),
);
}
if let Some(inner_129) = &_input.start_after {
{
query.push_kv(
"start-after",
&aws_smithy_http::query::fmt_string(&inner_129),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListObjectsV2Input,
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_objects_v2(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::ListObjectsV2::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListObjectsV2",
"s3",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
Trait Implementations§
source§impl Clone for ListObjectsV2
impl Clone for ListObjectsV2
source§fn clone(&self) -> ListObjectsV2
fn clone(&self) -> ListObjectsV2
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ListObjectsV2
impl Debug for ListObjectsV2
source§impl Default for ListObjectsV2
impl Default for ListObjectsV2
source§fn default() -> ListObjectsV2
fn default() -> ListObjectsV2
Returns the “default value” for a type. Read more
source§impl ParseStrictResponse for ListObjectsV2
impl ParseStrictResponse for ListObjectsV2
Auto Trait Implementations§
impl RefUnwindSafe for ListObjectsV2
impl Send for ListObjectsV2
impl Sync for ListObjectsV2
impl Unpin for ListObjectsV2
impl UnwindSafe for ListObjectsV2
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