use std::fmt::Write;
pub mod add_layer_version_permission_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) layer_name: std::option::Option<std::string::String>,
pub(crate) version_number: std::option::Option<i64>,
pub(crate) statement_id: std::option::Option<std::string::String>,
pub(crate) action: std::option::Option<std::string::String>,
pub(crate) principal: std::option::Option<std::string::String>,
pub(crate) organization_id: std::option::Option<std::string::String>,
pub(crate) revision_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn layer_name(mut self, input: impl Into<std::string::String>) -> Self {
self.layer_name = Some(input.into());
self
}
pub fn set_layer_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.layer_name = input;
self
}
pub fn version_number(mut self, input: i64) -> Self {
self.version_number = Some(input);
self
}
pub fn set_version_number(mut self, input: std::option::Option<i64>) -> Self {
self.version_number = input;
self
}
pub fn statement_id(mut self, input: impl Into<std::string::String>) -> Self {
self.statement_id = Some(input.into());
self
}
pub fn set_statement_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.statement_id = input;
self
}
pub fn action(mut self, input: impl Into<std::string::String>) -> Self {
self.action = Some(input.into());
self
}
pub fn set_action(mut self, input: std::option::Option<std::string::String>) -> Self {
self.action = input;
self
}
pub fn principal(mut self, input: impl Into<std::string::String>) -> Self {
self.principal = Some(input.into());
self
}
pub fn set_principal(mut self, input: std::option::Option<std::string::String>) -> Self {
self.principal = input;
self
}
pub fn organization_id(mut self, input: impl Into<std::string::String>) -> Self {
self.organization_id = Some(input.into());
self
}
pub fn set_organization_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.organization_id = input;
self
}
pub fn revision_id(mut self, input: impl Into<std::string::String>) -> Self {
self.revision_id = Some(input.into());
self
}
pub fn set_revision_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.revision_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::AddLayerVersionPermissionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::AddLayerVersionPermissionInput {
layer_name: self.layer_name,
version_number: self.version_number.unwrap_or_default(),
statement_id: self.statement_id,
action: self.action,
principal: self.principal,
organization_id: self.organization_id,
revision_id: self.revision_id,
})
}
}
}
impl AddLayerVersionPermissionInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::AddLayerVersionPermission,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::AddLayerVersionPermissionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_1 = &_input.layer_name;
let input_1 = input_1.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"layer_name",
"cannot be empty or unset",
)
})?;
let layer_name = aws_smithy_http::label::fmt_string(
input_1,
aws_smithy_http::label::EncodingStrategy::Default,
);
if layer_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"layer_name",
"cannot be empty or unset",
),
);
}
let input_2 = &_input.version_number;
let mut version_number_encoder =
aws_smithy_types::primitive::Encoder::from(*input_2);
let version_number = version_number_encoder.encode();
if version_number.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"version_number",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy",
LayerName = layer_name,
VersionNumber = version_number
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::AddLayerVersionPermissionInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_3) = &_input.revision_id {
{
query.push_kv("RevisionId", &aws_smithy_http::query::fmt_string(&inner_3));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::AddLayerVersionPermissionInput,
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)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_add_layer_version_permission(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::AddLayerVersionPermission::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"AddLayerVersionPermission",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::add_layer_version_permission_input::Builder {
crate::input::add_layer_version_permission_input::Builder::default()
}
}
pub mod add_permission_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) statement_id: std::option::Option<std::string::String>,
pub(crate) action: std::option::Option<std::string::String>,
pub(crate) principal: std::option::Option<std::string::String>,
pub(crate) source_arn: std::option::Option<std::string::String>,
pub(crate) source_account: std::option::Option<std::string::String>,
pub(crate) event_source_token: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
pub(crate) revision_id: std::option::Option<std::string::String>,
pub(crate) principal_org_id: std::option::Option<std::string::String>,
pub(crate) function_url_auth_type: std::option::Option<crate::model::FunctionUrlAuthType>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn statement_id(mut self, input: impl Into<std::string::String>) -> Self {
self.statement_id = Some(input.into());
self
}
pub fn set_statement_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.statement_id = input;
self
}
pub fn action(mut self, input: impl Into<std::string::String>) -> Self {
self.action = Some(input.into());
self
}
pub fn set_action(mut self, input: std::option::Option<std::string::String>) -> Self {
self.action = input;
self
}
pub fn principal(mut self, input: impl Into<std::string::String>) -> Self {
self.principal = Some(input.into());
self
}
pub fn set_principal(mut self, input: std::option::Option<std::string::String>) -> Self {
self.principal = input;
self
}
pub fn source_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.source_arn = Some(input.into());
self
}
pub fn set_source_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.source_arn = input;
self
}
pub fn source_account(mut self, input: impl Into<std::string::String>) -> Self {
self.source_account = Some(input.into());
self
}
pub fn set_source_account(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.source_account = input;
self
}
pub fn event_source_token(mut self, input: impl Into<std::string::String>) -> Self {
self.event_source_token = Some(input.into());
self
}
pub fn set_event_source_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.event_source_token = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn revision_id(mut self, input: impl Into<std::string::String>) -> Self {
self.revision_id = Some(input.into());
self
}
pub fn set_revision_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.revision_id = input;
self
}
pub fn principal_org_id(mut self, input: impl Into<std::string::String>) -> Self {
self.principal_org_id = Some(input.into());
self
}
pub fn set_principal_org_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.principal_org_id = input;
self
}
pub fn function_url_auth_type(mut self, input: crate::model::FunctionUrlAuthType) -> Self {
self.function_url_auth_type = Some(input);
self
}
pub fn set_function_url_auth_type(
mut self,
input: std::option::Option<crate::model::FunctionUrlAuthType>,
) -> Self {
self.function_url_auth_type = input;
self
}
pub fn build(
self,
) -> Result<crate::input::AddPermissionInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::AddPermissionInput {
function_name: self.function_name,
statement_id: self.statement_id,
action: self.action,
principal: self.principal,
source_arn: self.source_arn,
source_account: self.source_account,
event_source_token: self.event_source_token,
qualifier: self.qualifier,
revision_id: self.revision_id,
principal_org_id: self.principal_org_id,
function_url_auth_type: self.function_url_auth_type,
})
}
}
}
impl AddPermissionInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::AddPermission,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::AddPermissionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_4 = &_input.function_name;
let input_4 = input_4.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_4,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/functions/{FunctionName}/policy",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::AddPermissionInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_5) = &_input.qualifier {
{
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_5));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::AddPermissionInput,
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)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_add_permission(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::AddPermission::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"AddPermission",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::add_permission_input::Builder {
crate::input::add_permission_input::Builder::default()
}
}
pub mod create_alias_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) function_version: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) routing_config: std::option::Option<crate::model::AliasRoutingConfiguration>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn function_version(mut self, input: impl Into<std::string::String>) -> Self {
self.function_version = Some(input.into());
self
}
pub fn set_function_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_version = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn routing_config(mut self, input: crate::model::AliasRoutingConfiguration) -> Self {
self.routing_config = Some(input);
self
}
pub fn set_routing_config(
mut self,
input: std::option::Option<crate::model::AliasRoutingConfiguration>,
) -> Self {
self.routing_config = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateAliasInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateAliasInput {
function_name: self.function_name,
name: self.name,
function_version: self.function_version,
description: self.description,
routing_config: self.routing_config,
})
}
}
}
impl CreateAliasInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateAlias,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::CreateAliasInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_6 = &_input.function_name;
let input_6 = input_6.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_6,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/functions/{FunctionName}/aliases",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateAliasInput,
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)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_alias(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateAlias::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateAlias",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_alias_input::Builder {
crate::input::create_alias_input::Builder::default()
}
}
pub mod create_code_signing_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) allowed_publishers: std::option::Option<crate::model::AllowedPublishers>,
pub(crate) code_signing_policies: std::option::Option<crate::model::CodeSigningPolicies>,
}
impl Builder {
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn allowed_publishers(mut self, input: crate::model::AllowedPublishers) -> Self {
self.allowed_publishers = Some(input);
self
}
pub fn set_allowed_publishers(
mut self,
input: std::option::Option<crate::model::AllowedPublishers>,
) -> Self {
self.allowed_publishers = input;
self
}
pub fn code_signing_policies(mut self, input: crate::model::CodeSigningPolicies) -> Self {
self.code_signing_policies = Some(input);
self
}
pub fn set_code_signing_policies(
mut self,
input: std::option::Option<crate::model::CodeSigningPolicies>,
) -> Self {
self.code_signing_policies = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateCodeSigningConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateCodeSigningConfigInput {
description: self.description,
allowed_publishers: self.allowed_publishers,
code_signing_policies: self.code_signing_policies,
})
}
}
}
impl CreateCodeSigningConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateCodeSigningConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::CreateCodeSigningConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/2020-04-22/code-signing-configs")
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateCodeSigningConfigInput,
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)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_code_signing_config(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateCodeSigningConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateCodeSigningConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_code_signing_config_input::Builder {
crate::input::create_code_signing_config_input::Builder::default()
}
}
pub mod create_event_source_mapping_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) event_source_arn: std::option::Option<std::string::String>,
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) enabled: std::option::Option<bool>,
pub(crate) batch_size: std::option::Option<i32>,
pub(crate) filter_criteria: std::option::Option<crate::model::FilterCriteria>,
pub(crate) maximum_batching_window_in_seconds: std::option::Option<i32>,
pub(crate) parallelization_factor: std::option::Option<i32>,
pub(crate) starting_position: std::option::Option<crate::model::EventSourcePosition>,
pub(crate) starting_position_timestamp: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) destination_config: std::option::Option<crate::model::DestinationConfig>,
pub(crate) maximum_record_age_in_seconds: std::option::Option<i32>,
pub(crate) bisect_batch_on_function_error: std::option::Option<bool>,
pub(crate) maximum_retry_attempts: std::option::Option<i32>,
pub(crate) tumbling_window_in_seconds: std::option::Option<i32>,
pub(crate) topics: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) queues: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) source_access_configurations:
std::option::Option<std::vec::Vec<crate::model::SourceAccessConfiguration>>,
pub(crate) self_managed_event_source:
std::option::Option<crate::model::SelfManagedEventSource>,
pub(crate) function_response_types:
std::option::Option<std::vec::Vec<crate::model::FunctionResponseType>>,
pub(crate) amazon_managed_kafka_event_source_config:
std::option::Option<crate::model::AmazonManagedKafkaEventSourceConfig>,
pub(crate) self_managed_kafka_event_source_config:
std::option::Option<crate::model::SelfManagedKafkaEventSourceConfig>,
pub(crate) scaling_config: std::option::Option<crate::model::ScalingConfig>,
}
impl Builder {
pub fn event_source_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.event_source_arn = Some(input.into());
self
}
pub fn set_event_source_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.event_source_arn = input;
self
}
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn enabled(mut self, input: bool) -> Self {
self.enabled = Some(input);
self
}
pub fn set_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.enabled = input;
self
}
pub fn batch_size(mut self, input: i32) -> Self {
self.batch_size = Some(input);
self
}
pub fn set_batch_size(mut self, input: std::option::Option<i32>) -> Self {
self.batch_size = input;
self
}
pub fn filter_criteria(mut self, input: crate::model::FilterCriteria) -> Self {
self.filter_criteria = Some(input);
self
}
pub fn set_filter_criteria(
mut self,
input: std::option::Option<crate::model::FilterCriteria>,
) -> Self {
self.filter_criteria = input;
self
}
pub fn maximum_batching_window_in_seconds(mut self, input: i32) -> Self {
self.maximum_batching_window_in_seconds = Some(input);
self
}
pub fn set_maximum_batching_window_in_seconds(
mut self,
input: std::option::Option<i32>,
) -> Self {
self.maximum_batching_window_in_seconds = input;
self
}
pub fn parallelization_factor(mut self, input: i32) -> Self {
self.parallelization_factor = Some(input);
self
}
pub fn set_parallelization_factor(mut self, input: std::option::Option<i32>) -> Self {
self.parallelization_factor = input;
self
}
pub fn starting_position(mut self, input: crate::model::EventSourcePosition) -> Self {
self.starting_position = Some(input);
self
}
pub fn set_starting_position(
mut self,
input: std::option::Option<crate::model::EventSourcePosition>,
) -> Self {
self.starting_position = input;
self
}
pub fn starting_position_timestamp(mut self, input: aws_smithy_types::DateTime) -> Self {
self.starting_position_timestamp = Some(input);
self
}
pub fn set_starting_position_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.starting_position_timestamp = input;
self
}
pub fn destination_config(mut self, input: crate::model::DestinationConfig) -> Self {
self.destination_config = Some(input);
self
}
pub fn set_destination_config(
mut self,
input: std::option::Option<crate::model::DestinationConfig>,
) -> Self {
self.destination_config = input;
self
}
pub fn maximum_record_age_in_seconds(mut self, input: i32) -> Self {
self.maximum_record_age_in_seconds = Some(input);
self
}
pub fn set_maximum_record_age_in_seconds(
mut self,
input: std::option::Option<i32>,
) -> Self {
self.maximum_record_age_in_seconds = input;
self
}
pub fn bisect_batch_on_function_error(mut self, input: bool) -> Self {
self.bisect_batch_on_function_error = Some(input);
self
}
pub fn set_bisect_batch_on_function_error(
mut self,
input: std::option::Option<bool>,
) -> Self {
self.bisect_batch_on_function_error = input;
self
}
pub fn maximum_retry_attempts(mut self, input: i32) -> Self {
self.maximum_retry_attempts = Some(input);
self
}
pub fn set_maximum_retry_attempts(mut self, input: std::option::Option<i32>) -> Self {
self.maximum_retry_attempts = input;
self
}
pub fn tumbling_window_in_seconds(mut self, input: i32) -> Self {
self.tumbling_window_in_seconds = Some(input);
self
}
pub fn set_tumbling_window_in_seconds(mut self, input: std::option::Option<i32>) -> Self {
self.tumbling_window_in_seconds = input;
self
}
pub fn topics(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.topics.unwrap_or_default();
v.push(input.into());
self.topics = Some(v);
self
}
pub fn set_topics(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.topics = input;
self
}
pub fn queues(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.queues.unwrap_or_default();
v.push(input.into());
self.queues = Some(v);
self
}
pub fn set_queues(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.queues = input;
self
}
pub fn source_access_configurations(
mut self,
input: crate::model::SourceAccessConfiguration,
) -> Self {
let mut v = self.source_access_configurations.unwrap_or_default();
v.push(input);
self.source_access_configurations = Some(v);
self
}
pub fn set_source_access_configurations(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::SourceAccessConfiguration>>,
) -> Self {
self.source_access_configurations = input;
self
}
pub fn self_managed_event_source(
mut self,
input: crate::model::SelfManagedEventSource,
) -> Self {
self.self_managed_event_source = Some(input);
self
}
pub fn set_self_managed_event_source(
mut self,
input: std::option::Option<crate::model::SelfManagedEventSource>,
) -> Self {
self.self_managed_event_source = input;
self
}
pub fn function_response_types(
mut self,
input: crate::model::FunctionResponseType,
) -> Self {
let mut v = self.function_response_types.unwrap_or_default();
v.push(input);
self.function_response_types = Some(v);
self
}
pub fn set_function_response_types(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::FunctionResponseType>>,
) -> Self {
self.function_response_types = input;
self
}
pub fn amazon_managed_kafka_event_source_config(
mut self,
input: crate::model::AmazonManagedKafkaEventSourceConfig,
) -> Self {
self.amazon_managed_kafka_event_source_config = Some(input);
self
}
pub fn set_amazon_managed_kafka_event_source_config(
mut self,
input: std::option::Option<crate::model::AmazonManagedKafkaEventSourceConfig>,
) -> Self {
self.amazon_managed_kafka_event_source_config = input;
self
}
pub fn self_managed_kafka_event_source_config(
mut self,
input: crate::model::SelfManagedKafkaEventSourceConfig,
) -> Self {
self.self_managed_kafka_event_source_config = Some(input);
self
}
pub fn set_self_managed_kafka_event_source_config(
mut self,
input: std::option::Option<crate::model::SelfManagedKafkaEventSourceConfig>,
) -> Self {
self.self_managed_kafka_event_source_config = input;
self
}
pub fn scaling_config(mut self, input: crate::model::ScalingConfig) -> Self {
self.scaling_config = Some(input);
self
}
pub fn set_scaling_config(
mut self,
input: std::option::Option<crate::model::ScalingConfig>,
) -> Self {
self.scaling_config = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateEventSourceMappingInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateEventSourceMappingInput {
event_source_arn: self.event_source_arn,
function_name: self.function_name,
enabled: self.enabled,
batch_size: self.batch_size,
filter_criteria: self.filter_criteria,
maximum_batching_window_in_seconds: self.maximum_batching_window_in_seconds,
parallelization_factor: self.parallelization_factor,
starting_position: self.starting_position,
starting_position_timestamp: self.starting_position_timestamp,
destination_config: self.destination_config,
maximum_record_age_in_seconds: self.maximum_record_age_in_seconds,
bisect_batch_on_function_error: self.bisect_batch_on_function_error,
maximum_retry_attempts: self.maximum_retry_attempts,
tumbling_window_in_seconds: self.tumbling_window_in_seconds,
topics: self.topics,
queues: self.queues,
source_access_configurations: self.source_access_configurations,
self_managed_event_source: self.self_managed_event_source,
function_response_types: self.function_response_types,
amazon_managed_kafka_event_source_config: self
.amazon_managed_kafka_event_source_config,
self_managed_kafka_event_source_config: self.self_managed_kafka_event_source_config,
scaling_config: self.scaling_config,
})
}
}
}
impl CreateEventSourceMappingInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateEventSourceMapping,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::CreateEventSourceMappingInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/2015-03-31/event-source-mappings")
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateEventSourceMappingInput,
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)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_event_source_mapping(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateEventSourceMapping::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateEventSourceMapping",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_event_source_mapping_input::Builder {
crate::input::create_event_source_mapping_input::Builder::default()
}
}
pub mod create_function_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) runtime: std::option::Option<crate::model::Runtime>,
pub(crate) role: std::option::Option<std::string::String>,
pub(crate) handler: std::option::Option<std::string::String>,
pub(crate) code: std::option::Option<crate::model::FunctionCode>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) timeout: std::option::Option<i32>,
pub(crate) memory_size: std::option::Option<i32>,
pub(crate) publish: std::option::Option<bool>,
pub(crate) vpc_config: std::option::Option<crate::model::VpcConfig>,
pub(crate) package_type: std::option::Option<crate::model::PackageType>,
pub(crate) dead_letter_config: std::option::Option<crate::model::DeadLetterConfig>,
pub(crate) environment: std::option::Option<crate::model::Environment>,
pub(crate) kms_key_arn: std::option::Option<std::string::String>,
pub(crate) tracing_config: std::option::Option<crate::model::TracingConfig>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) layers: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) file_system_configs:
std::option::Option<std::vec::Vec<crate::model::FileSystemConfig>>,
pub(crate) image_config: std::option::Option<crate::model::ImageConfig>,
pub(crate) code_signing_config_arn: std::option::Option<std::string::String>,
pub(crate) architectures: std::option::Option<std::vec::Vec<crate::model::Architecture>>,
pub(crate) ephemeral_storage: std::option::Option<crate::model::EphemeralStorage>,
pub(crate) snap_start: std::option::Option<crate::model::SnapStart>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn runtime(mut self, input: crate::model::Runtime) -> Self {
self.runtime = Some(input);
self
}
pub fn set_runtime(mut self, input: std::option::Option<crate::model::Runtime>) -> Self {
self.runtime = input;
self
}
pub fn role(mut self, input: impl Into<std::string::String>) -> Self {
self.role = Some(input.into());
self
}
pub fn set_role(mut self, input: std::option::Option<std::string::String>) -> Self {
self.role = input;
self
}
pub fn handler(mut self, input: impl Into<std::string::String>) -> Self {
self.handler = Some(input.into());
self
}
pub fn set_handler(mut self, input: std::option::Option<std::string::String>) -> Self {
self.handler = input;
self
}
pub fn code(mut self, input: crate::model::FunctionCode) -> Self {
self.code = Some(input);
self
}
pub fn set_code(mut self, input: std::option::Option<crate::model::FunctionCode>) -> Self {
self.code = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn timeout(mut self, input: i32) -> Self {
self.timeout = Some(input);
self
}
pub fn set_timeout(mut self, input: std::option::Option<i32>) -> Self {
self.timeout = input;
self
}
pub fn memory_size(mut self, input: i32) -> Self {
self.memory_size = Some(input);
self
}
pub fn set_memory_size(mut self, input: std::option::Option<i32>) -> Self {
self.memory_size = input;
self
}
pub fn publish(mut self, input: bool) -> Self {
self.publish = Some(input);
self
}
pub fn set_publish(mut self, input: std::option::Option<bool>) -> Self {
self.publish = input;
self
}
pub fn vpc_config(mut self, input: crate::model::VpcConfig) -> Self {
self.vpc_config = Some(input);
self
}
pub fn set_vpc_config(
mut self,
input: std::option::Option<crate::model::VpcConfig>,
) -> Self {
self.vpc_config = input;
self
}
pub fn package_type(mut self, input: crate::model::PackageType) -> Self {
self.package_type = Some(input);
self
}
pub fn set_package_type(
mut self,
input: std::option::Option<crate::model::PackageType>,
) -> Self {
self.package_type = input;
self
}
pub fn dead_letter_config(mut self, input: crate::model::DeadLetterConfig) -> Self {
self.dead_letter_config = Some(input);
self
}
pub fn set_dead_letter_config(
mut self,
input: std::option::Option<crate::model::DeadLetterConfig>,
) -> Self {
self.dead_letter_config = input;
self
}
pub fn environment(mut self, input: crate::model::Environment) -> Self {
self.environment = Some(input);
self
}
pub fn set_environment(
mut self,
input: std::option::Option<crate::model::Environment>,
) -> Self {
self.environment = input;
self
}
pub fn kms_key_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.kms_key_arn = Some(input.into());
self
}
pub fn set_kms_key_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.kms_key_arn = input;
self
}
pub fn tracing_config(mut self, input: crate::model::TracingConfig) -> Self {
self.tracing_config = Some(input);
self
}
pub fn set_tracing_config(
mut self,
input: std::option::Option<crate::model::TracingConfig>,
) -> Self {
self.tracing_config = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn layers(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.layers.unwrap_or_default();
v.push(input.into());
self.layers = Some(v);
self
}
pub fn set_layers(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.layers = input;
self
}
pub fn file_system_configs(mut self, input: crate::model::FileSystemConfig) -> Self {
let mut v = self.file_system_configs.unwrap_or_default();
v.push(input);
self.file_system_configs = Some(v);
self
}
pub fn set_file_system_configs(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::FileSystemConfig>>,
) -> Self {
self.file_system_configs = input;
self
}
pub fn image_config(mut self, input: crate::model::ImageConfig) -> Self {
self.image_config = Some(input);
self
}
pub fn set_image_config(
mut self,
input: std::option::Option<crate::model::ImageConfig>,
) -> Self {
self.image_config = input;
self
}
pub fn code_signing_config_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.code_signing_config_arn = Some(input.into());
self
}
pub fn set_code_signing_config_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.code_signing_config_arn = input;
self
}
pub fn architectures(mut self, input: crate::model::Architecture) -> Self {
let mut v = self.architectures.unwrap_or_default();
v.push(input);
self.architectures = Some(v);
self
}
pub fn set_architectures(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Architecture>>,
) -> Self {
self.architectures = input;
self
}
pub fn ephemeral_storage(mut self, input: crate::model::EphemeralStorage) -> Self {
self.ephemeral_storage = Some(input);
self
}
pub fn set_ephemeral_storage(
mut self,
input: std::option::Option<crate::model::EphemeralStorage>,
) -> Self {
self.ephemeral_storage = input;
self
}
pub fn snap_start(mut self, input: crate::model::SnapStart) -> Self {
self.snap_start = Some(input);
self
}
pub fn set_snap_start(
mut self,
input: std::option::Option<crate::model::SnapStart>,
) -> Self {
self.snap_start = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateFunctionInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateFunctionInput {
function_name: self.function_name,
runtime: self.runtime,
role: self.role,
handler: self.handler,
code: self.code,
description: self.description,
timeout: self.timeout,
memory_size: self.memory_size,
publish: self.publish.unwrap_or_default(),
vpc_config: self.vpc_config,
package_type: self.package_type,
dead_letter_config: self.dead_letter_config,
environment: self.environment,
kms_key_arn: self.kms_key_arn,
tracing_config: self.tracing_config,
tags: self.tags,
layers: self.layers,
file_system_configs: self.file_system_configs,
image_config: self.image_config,
code_signing_config_arn: self.code_signing_config_arn,
architectures: self.architectures,
ephemeral_storage: self.ephemeral_storage,
snap_start: self.snap_start,
})
}
}
}
impl CreateFunctionInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateFunction,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::CreateFunctionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/2015-03-31/functions").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateFunctionInput,
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)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_function(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateFunction::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateFunction",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_function_input::Builder {
crate::input::create_function_input::Builder::default()
}
}
pub mod create_function_url_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
pub(crate) auth_type: std::option::Option<crate::model::FunctionUrlAuthType>,
pub(crate) cors: std::option::Option<crate::model::Cors>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn auth_type(mut self, input: crate::model::FunctionUrlAuthType) -> Self {
self.auth_type = Some(input);
self
}
pub fn set_auth_type(
mut self,
input: std::option::Option<crate::model::FunctionUrlAuthType>,
) -> Self {
self.auth_type = input;
self
}
pub fn cors(mut self, input: crate::model::Cors) -> Self {
self.cors = Some(input);
self
}
pub fn set_cors(mut self, input: std::option::Option<crate::model::Cors>) -> Self {
self.cors = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateFunctionUrlConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateFunctionUrlConfigInput {
function_name: self.function_name,
qualifier: self.qualifier,
auth_type: self.auth_type,
cors: self.cors,
})
}
}
}
impl CreateFunctionUrlConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateFunctionUrlConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::CreateFunctionUrlConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_7 = &_input.function_name;
let input_7 = input_7.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_7,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2021-10-31/functions/{FunctionName}/url",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::CreateFunctionUrlConfigInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_8) = &_input.qualifier {
{
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_8));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateFunctionUrlConfigInput,
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)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_function_url_config(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateFunctionUrlConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateFunctionUrlConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_function_url_config_input::Builder {
crate::input::create_function_url_config_input::Builder::default()
}
}
pub mod delete_alias_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteAliasInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteAliasInput {
function_name: self.function_name,
name: self.name,
})
}
}
}
impl DeleteAliasInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteAlias,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteAliasInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_9 = &_input.function_name;
let input_9 = input_9.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_9,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
let input_10 = &_input.name;
let input_10 = input_10.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"name",
"cannot be empty or unset",
)
})?;
let name = aws_smithy_http::label::fmt_string(
input_10,
aws_smithy_http::label::EncodingStrategy::Default,
);
if name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/functions/{FunctionName}/aliases/{Name}",
FunctionName = function_name,
Name = name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteAliasInput,
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)?;
Ok(builder.method("DELETE").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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteAlias::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteAlias",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_alias_input::Builder {
crate::input::delete_alias_input::Builder::default()
}
}
pub mod delete_code_signing_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) code_signing_config_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn code_signing_config_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.code_signing_config_arn = Some(input.into());
self
}
pub fn set_code_signing_config_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.code_signing_config_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteCodeSigningConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteCodeSigningConfigInput {
code_signing_config_arn: self.code_signing_config_arn,
})
}
}
}
impl DeleteCodeSigningConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteCodeSigningConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteCodeSigningConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_11 = &_input.code_signing_config_arn;
let input_11 = input_11.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"code_signing_config_arn",
"cannot be empty or unset",
)
})?;
let code_signing_config_arn = aws_smithy_http::label::fmt_string(
input_11,
aws_smithy_http::label::EncodingStrategy::Default,
);
if code_signing_config_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"code_signing_config_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2020-04-22/code-signing-configs/{CodeSigningConfigArn}",
CodeSigningConfigArn = code_signing_config_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteCodeSigningConfigInput,
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)?;
Ok(builder.method("DELETE").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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteCodeSigningConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteCodeSigningConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_code_signing_config_input::Builder {
crate::input::delete_code_signing_config_input::Builder::default()
}
}
pub mod delete_event_source_mapping_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) uuid: std::option::Option<std::string::String>,
}
impl Builder {
pub fn uuid(mut self, input: impl Into<std::string::String>) -> Self {
self.uuid = Some(input.into());
self
}
pub fn set_uuid(mut self, input: std::option::Option<std::string::String>) -> Self {
self.uuid = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteEventSourceMappingInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteEventSourceMappingInput { uuid: self.uuid })
}
}
}
impl DeleteEventSourceMappingInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteEventSourceMapping,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteEventSourceMappingInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_12 = &_input.uuid;
let input_12 = input_12.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"uuid",
"cannot be empty or unset",
)
})?;
let uuid = aws_smithy_http::label::fmt_string(
input_12,
aws_smithy_http::label::EncodingStrategy::Default,
);
if uuid.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"uuid",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/event-source-mappings/{UUID}",
UUID = uuid
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteEventSourceMappingInput,
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)?;
Ok(builder.method("DELETE").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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteEventSourceMapping::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteEventSourceMapping",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_event_source_mapping_input::Builder {
crate::input::delete_event_source_mapping_input::Builder::default()
}
}
pub mod delete_function_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteFunctionInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteFunctionInput {
function_name: self.function_name,
qualifier: self.qualifier,
})
}
}
}
impl DeleteFunctionInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteFunction,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteFunctionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_13 = &_input.function_name;
let input_13 = input_13.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_13,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/functions/{FunctionName}",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::DeleteFunctionInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_14) = &_input.qualifier {
{
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_14));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteFunctionInput,
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)?;
Ok(builder.method("DELETE").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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteFunction::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteFunction",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_function_input::Builder {
crate::input::delete_function_input::Builder::default()
}
}
pub mod delete_function_code_signing_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteFunctionCodeSigningConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteFunctionCodeSigningConfigInput {
function_name: self.function_name,
})
}
}
}
impl DeleteFunctionCodeSigningConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteFunctionCodeSigningConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteFunctionCodeSigningConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_15 = &_input.function_name;
let input_15 = input_15.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_15,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2020-06-30/functions/{FunctionName}/code-signing-config",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteFunctionCodeSigningConfigInput,
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)?;
Ok(builder.method("DELETE").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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteFunctionCodeSigningConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteFunctionCodeSigningConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_function_code_signing_config_input::Builder {
crate::input::delete_function_code_signing_config_input::Builder::default()
}
}
pub mod delete_function_concurrency_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteFunctionConcurrencyInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteFunctionConcurrencyInput {
function_name: self.function_name,
})
}
}
}
impl DeleteFunctionConcurrencyInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteFunctionConcurrency,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteFunctionConcurrencyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_16 = &_input.function_name;
let input_16 = input_16.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_16,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2017-10-31/functions/{FunctionName}/concurrency",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteFunctionConcurrencyInput,
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)?;
Ok(builder.method("DELETE").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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteFunctionConcurrency::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteFunctionConcurrency",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_function_concurrency_input::Builder {
crate::input::delete_function_concurrency_input::Builder::default()
}
}
pub mod delete_function_event_invoke_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteFunctionEventInvokeConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteFunctionEventInvokeConfigInput {
function_name: self.function_name,
qualifier: self.qualifier,
})
}
}
}
impl DeleteFunctionEventInvokeConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteFunctionEventInvokeConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteFunctionEventInvokeConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_17 = &_input.function_name;
let input_17 = input_17.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_17,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2019-09-25/functions/{FunctionName}/event-invoke-config",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::DeleteFunctionEventInvokeConfigInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_18) = &_input.qualifier {
{
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_18));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteFunctionEventInvokeConfigInput,
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)?;
Ok(builder.method("DELETE").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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteFunctionEventInvokeConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteFunctionEventInvokeConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_function_event_invoke_config_input::Builder {
crate::input::delete_function_event_invoke_config_input::Builder::default()
}
}
pub mod delete_function_url_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteFunctionUrlConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteFunctionUrlConfigInput {
function_name: self.function_name,
qualifier: self.qualifier,
})
}
}
}
impl DeleteFunctionUrlConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteFunctionUrlConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteFunctionUrlConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_19 = &_input.function_name;
let input_19 = input_19.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_19,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2021-10-31/functions/{FunctionName}/url",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::DeleteFunctionUrlConfigInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_20) = &_input.qualifier {
{
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_20));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteFunctionUrlConfigInput,
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)?;
Ok(builder.method("DELETE").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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteFunctionUrlConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteFunctionUrlConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_function_url_config_input::Builder {
crate::input::delete_function_url_config_input::Builder::default()
}
}
pub mod delete_layer_version_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) layer_name: std::option::Option<std::string::String>,
pub(crate) version_number: std::option::Option<i64>,
}
impl Builder {
pub fn layer_name(mut self, input: impl Into<std::string::String>) -> Self {
self.layer_name = Some(input.into());
self
}
pub fn set_layer_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.layer_name = input;
self
}
pub fn version_number(mut self, input: i64) -> Self {
self.version_number = Some(input);
self
}
pub fn set_version_number(mut self, input: std::option::Option<i64>) -> Self {
self.version_number = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteLayerVersionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteLayerVersionInput {
layer_name: self.layer_name,
version_number: self.version_number.unwrap_or_default(),
})
}
}
}
impl DeleteLayerVersionInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteLayerVersion,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteLayerVersionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_21 = &_input.layer_name;
let input_21 = input_21.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"layer_name",
"cannot be empty or unset",
)
})?;
let layer_name = aws_smithy_http::label::fmt_string(
input_21,
aws_smithy_http::label::EncodingStrategy::Default,
);
if layer_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"layer_name",
"cannot be empty or unset",
),
);
}
let input_22 = &_input.version_number;
let mut version_number_encoder =
aws_smithy_types::primitive::Encoder::from(*input_22);
let version_number = version_number_encoder.encode();
if version_number.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"version_number",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2018-10-31/layers/{LayerName}/versions/{VersionNumber}",
LayerName = layer_name,
VersionNumber = version_number
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteLayerVersionInput,
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)?;
Ok(builder.method("DELETE").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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteLayerVersion::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteLayerVersion",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_layer_version_input::Builder {
crate::input::delete_layer_version_input::Builder::default()
}
}
pub mod delete_provisioned_concurrency_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteProvisionedConcurrencyConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteProvisionedConcurrencyConfigInput {
function_name: self.function_name,
qualifier: self.qualifier,
})
}
}
}
impl DeleteProvisionedConcurrencyConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteProvisionedConcurrencyConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteProvisionedConcurrencyConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_23 = &_input.function_name;
let input_23 = input_23.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_23,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2019-09-30/functions/{FunctionName}/provisioned-concurrency",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::DeleteProvisionedConcurrencyConfigInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_24 = &_input.qualifier;
let inner_24 = inner_24.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"qualifier",
"cannot be empty or unset",
)
})?;
if inner_24.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"qualifier",
"cannot be empty or unset",
),
);
}
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_24));
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteProvisionedConcurrencyConfigInput,
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)?;
Ok(builder.method("DELETE").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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteProvisionedConcurrencyConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteProvisionedConcurrencyConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_provisioned_concurrency_config_input::Builder {
crate::input::delete_provisioned_concurrency_config_input::Builder::default()
}
}
pub mod get_account_settings_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {}
impl Builder {
pub fn build(
self,
) -> Result<
crate::input::GetAccountSettingsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetAccountSettingsInput {})
}
}
}
impl GetAccountSettingsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetAccountSettings,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetAccountSettingsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/2016-08-19/account-settings").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetAccountSettingsInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetAccountSettings::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetAccountSettings",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_account_settings_input::Builder {
crate::input::get_account_settings_input::Builder::default()
}
}
pub mod get_alias_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetAliasInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetAliasInput {
function_name: self.function_name,
name: self.name,
})
}
}
}
impl GetAliasInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetAlias,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetAliasInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_25 = &_input.function_name;
let input_25 = input_25.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_25,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
let input_26 = &_input.name;
let input_26 = input_26.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"name",
"cannot be empty or unset",
)
})?;
let name = aws_smithy_http::label::fmt_string(
input_26,
aws_smithy_http::label::EncodingStrategy::Default,
);
if name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/functions/{FunctionName}/aliases/{Name}",
FunctionName = function_name,
Name = name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetAliasInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::GetAlias::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetAlias", "lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_alias_input::Builder {
crate::input::get_alias_input::Builder::default()
}
}
pub mod get_code_signing_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) code_signing_config_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn code_signing_config_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.code_signing_config_arn = Some(input.into());
self
}
pub fn set_code_signing_config_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.code_signing_config_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetCodeSigningConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetCodeSigningConfigInput {
code_signing_config_arn: self.code_signing_config_arn,
})
}
}
}
impl GetCodeSigningConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetCodeSigningConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetCodeSigningConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_27 = &_input.code_signing_config_arn;
let input_27 = input_27.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"code_signing_config_arn",
"cannot be empty or unset",
)
})?;
let code_signing_config_arn = aws_smithy_http::label::fmt_string(
input_27,
aws_smithy_http::label::EncodingStrategy::Default,
);
if code_signing_config_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"code_signing_config_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2020-04-22/code-signing-configs/{CodeSigningConfigArn}",
CodeSigningConfigArn = code_signing_config_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetCodeSigningConfigInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetCodeSigningConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetCodeSigningConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_code_signing_config_input::Builder {
crate::input::get_code_signing_config_input::Builder::default()
}
}
pub mod get_event_source_mapping_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) uuid: std::option::Option<std::string::String>,
}
impl Builder {
pub fn uuid(mut self, input: impl Into<std::string::String>) -> Self {
self.uuid = Some(input.into());
self
}
pub fn set_uuid(mut self, input: std::option::Option<std::string::String>) -> Self {
self.uuid = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetEventSourceMappingInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetEventSourceMappingInput { uuid: self.uuid })
}
}
}
impl GetEventSourceMappingInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetEventSourceMapping,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetEventSourceMappingInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_28 = &_input.uuid;
let input_28 = input_28.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"uuid",
"cannot be empty or unset",
)
})?;
let uuid = aws_smithy_http::label::fmt_string(
input_28,
aws_smithy_http::label::EncodingStrategy::Default,
);
if uuid.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"uuid",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/event-source-mappings/{UUID}",
UUID = uuid
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetEventSourceMappingInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetEventSourceMapping::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetEventSourceMapping",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_event_source_mapping_input::Builder {
crate::input::get_event_source_mapping_input::Builder::default()
}
}
pub mod get_function_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetFunctionInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetFunctionInput {
function_name: self.function_name,
qualifier: self.qualifier,
})
}
}
}
impl GetFunctionInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetFunction,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetFunctionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_29 = &_input.function_name;
let input_29 = input_29.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_29,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/functions/{FunctionName}",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetFunctionInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_30) = &_input.qualifier {
{
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_30));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetFunctionInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetFunction::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetFunction",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_function_input::Builder {
crate::input::get_function_input::Builder::default()
}
}
pub mod get_function_code_signing_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetFunctionCodeSigningConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetFunctionCodeSigningConfigInput {
function_name: self.function_name,
})
}
}
}
impl GetFunctionCodeSigningConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetFunctionCodeSigningConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetFunctionCodeSigningConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_31 = &_input.function_name;
let input_31 = input_31.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_31,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2020-06-30/functions/{FunctionName}/code-signing-config",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetFunctionCodeSigningConfigInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetFunctionCodeSigningConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetFunctionCodeSigningConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_function_code_signing_config_input::Builder {
crate::input::get_function_code_signing_config_input::Builder::default()
}
}
pub mod get_function_concurrency_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetFunctionConcurrencyInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetFunctionConcurrencyInput {
function_name: self.function_name,
})
}
}
}
impl GetFunctionConcurrencyInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetFunctionConcurrency,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetFunctionConcurrencyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_32 = &_input.function_name;
let input_32 = input_32.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_32,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2019-09-30/functions/{FunctionName}/concurrency",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetFunctionConcurrencyInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetFunctionConcurrency::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetFunctionConcurrency",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_function_concurrency_input::Builder {
crate::input::get_function_concurrency_input::Builder::default()
}
}
pub mod get_function_configuration_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetFunctionConfigurationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetFunctionConfigurationInput {
function_name: self.function_name,
qualifier: self.qualifier,
})
}
}
}
impl GetFunctionConfigurationInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetFunctionConfiguration,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetFunctionConfigurationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_33 = &_input.function_name;
let input_33 = input_33.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_33,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/functions/{FunctionName}/configuration",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetFunctionConfigurationInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_34) = &_input.qualifier {
{
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_34));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetFunctionConfigurationInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetFunctionConfiguration::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetFunctionConfiguration",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_function_configuration_input::Builder {
crate::input::get_function_configuration_input::Builder::default()
}
}
pub mod get_function_event_invoke_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetFunctionEventInvokeConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetFunctionEventInvokeConfigInput {
function_name: self.function_name,
qualifier: self.qualifier,
})
}
}
}
impl GetFunctionEventInvokeConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetFunctionEventInvokeConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetFunctionEventInvokeConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_35 = &_input.function_name;
let input_35 = input_35.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_35,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2019-09-25/functions/{FunctionName}/event-invoke-config",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetFunctionEventInvokeConfigInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_36) = &_input.qualifier {
{
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_36));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetFunctionEventInvokeConfigInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetFunctionEventInvokeConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetFunctionEventInvokeConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_function_event_invoke_config_input::Builder {
crate::input::get_function_event_invoke_config_input::Builder::default()
}
}
pub mod get_function_url_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetFunctionUrlConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetFunctionUrlConfigInput {
function_name: self.function_name,
qualifier: self.qualifier,
})
}
}
}
impl GetFunctionUrlConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetFunctionUrlConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetFunctionUrlConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_37 = &_input.function_name;
let input_37 = input_37.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_37,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2021-10-31/functions/{FunctionName}/url",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetFunctionUrlConfigInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_38) = &_input.qualifier {
{
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_38));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetFunctionUrlConfigInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetFunctionUrlConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetFunctionUrlConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_function_url_config_input::Builder {
crate::input::get_function_url_config_input::Builder::default()
}
}
pub mod get_layer_version_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) layer_name: std::option::Option<std::string::String>,
pub(crate) version_number: std::option::Option<i64>,
}
impl Builder {
pub fn layer_name(mut self, input: impl Into<std::string::String>) -> Self {
self.layer_name = Some(input.into());
self
}
pub fn set_layer_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.layer_name = input;
self
}
pub fn version_number(mut self, input: i64) -> Self {
self.version_number = Some(input);
self
}
pub fn set_version_number(mut self, input: std::option::Option<i64>) -> Self {
self.version_number = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetLayerVersionInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetLayerVersionInput {
layer_name: self.layer_name,
version_number: self.version_number.unwrap_or_default(),
})
}
}
}
impl GetLayerVersionInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetLayerVersion,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetLayerVersionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_39 = &_input.layer_name;
let input_39 = input_39.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"layer_name",
"cannot be empty or unset",
)
})?;
let layer_name = aws_smithy_http::label::fmt_string(
input_39,
aws_smithy_http::label::EncodingStrategy::Default,
);
if layer_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"layer_name",
"cannot be empty or unset",
),
);
}
let input_40 = &_input.version_number;
let mut version_number_encoder =
aws_smithy_types::primitive::Encoder::from(*input_40);
let version_number = version_number_encoder.encode();
if version_number.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"version_number",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2018-10-31/layers/{LayerName}/versions/{VersionNumber}",
LayerName = layer_name,
VersionNumber = version_number
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetLayerVersionInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetLayerVersion::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetLayerVersion",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_layer_version_input::Builder {
crate::input::get_layer_version_input::Builder::default()
}
}
pub mod get_layer_version_by_arn_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.arn = Some(input.into());
self
}
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetLayerVersionByArnInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetLayerVersionByArnInput { arn: self.arn })
}
}
}
impl GetLayerVersionByArnInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetLayerVersionByArn,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetLayerVersionByArnInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/2018-10-31/layers").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetLayerVersionByArnInput,
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("find", "LayerVersion");
let inner_41 = &_input.arn;
let inner_41 = inner_41.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"arn",
"cannot be empty or unset",
)
})?;
if inner_41.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"arn",
"cannot be empty or unset",
),
);
}
query.push_kv("Arn", &aws_smithy_http::query::fmt_string(&inner_41));
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetLayerVersionByArnInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetLayerVersionByArn::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetLayerVersionByArn",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_layer_version_by_arn_input::Builder {
crate::input::get_layer_version_by_arn_input::Builder::default()
}
}
pub mod get_layer_version_policy_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) layer_name: std::option::Option<std::string::String>,
pub(crate) version_number: std::option::Option<i64>,
}
impl Builder {
pub fn layer_name(mut self, input: impl Into<std::string::String>) -> Self {
self.layer_name = Some(input.into());
self
}
pub fn set_layer_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.layer_name = input;
self
}
pub fn version_number(mut self, input: i64) -> Self {
self.version_number = Some(input);
self
}
pub fn set_version_number(mut self, input: std::option::Option<i64>) -> Self {
self.version_number = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetLayerVersionPolicyInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetLayerVersionPolicyInput {
layer_name: self.layer_name,
version_number: self.version_number.unwrap_or_default(),
})
}
}
}
impl GetLayerVersionPolicyInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetLayerVersionPolicy,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetLayerVersionPolicyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_42 = &_input.layer_name;
let input_42 = input_42.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"layer_name",
"cannot be empty or unset",
)
})?;
let layer_name = aws_smithy_http::label::fmt_string(
input_42,
aws_smithy_http::label::EncodingStrategy::Default,
);
if layer_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"layer_name",
"cannot be empty or unset",
),
);
}
let input_43 = &_input.version_number;
let mut version_number_encoder =
aws_smithy_types::primitive::Encoder::from(*input_43);
let version_number = version_number_encoder.encode();
if version_number.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"version_number",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy",
LayerName = layer_name,
VersionNumber = version_number
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetLayerVersionPolicyInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetLayerVersionPolicy::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetLayerVersionPolicy",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_layer_version_policy_input::Builder {
crate::input::get_layer_version_policy_input::Builder::default()
}
}
pub mod get_policy_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetPolicyInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetPolicyInput {
function_name: self.function_name,
qualifier: self.qualifier,
})
}
}
}
impl GetPolicyInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetPolicy,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetPolicyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_44 = &_input.function_name;
let input_44 = input_44.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_44,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/functions/{FunctionName}/policy",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetPolicyInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_45) = &_input.qualifier {
{
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_45));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetPolicyInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::GetPolicy::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetPolicy",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_policy_input::Builder {
crate::input::get_policy_input::Builder::default()
}
}
pub mod get_provisioned_concurrency_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetProvisionedConcurrencyConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetProvisionedConcurrencyConfigInput {
function_name: self.function_name,
qualifier: self.qualifier,
})
}
}
}
impl GetProvisionedConcurrencyConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetProvisionedConcurrencyConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetProvisionedConcurrencyConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_46 = &_input.function_name;
let input_46 = input_46.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_46,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2019-09-30/functions/{FunctionName}/provisioned-concurrency",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetProvisionedConcurrencyConfigInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_47 = &_input.qualifier;
let inner_47 = inner_47.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"qualifier",
"cannot be empty or unset",
)
})?;
if inner_47.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"qualifier",
"cannot be empty or unset",
),
);
}
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_47));
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetProvisionedConcurrencyConfigInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetProvisionedConcurrencyConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetProvisionedConcurrencyConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_provisioned_concurrency_config_input::Builder {
crate::input::get_provisioned_concurrency_config_input::Builder::default()
}
}
pub mod get_runtime_management_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetRuntimeManagementConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetRuntimeManagementConfigInput {
function_name: self.function_name,
qualifier: self.qualifier,
})
}
}
}
impl GetRuntimeManagementConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetRuntimeManagementConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetRuntimeManagementConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_48 = &_input.function_name;
let input_48 = input_48.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_48,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2021-07-20/functions/{FunctionName}/runtime-management-config",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetRuntimeManagementConfigInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_49) = &_input.qualifier {
{
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_49));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetRuntimeManagementConfigInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetRuntimeManagementConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetRuntimeManagementConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_runtime_management_config_input::Builder {
crate::input::get_runtime_management_config_input::Builder::default()
}
}
pub mod invoke_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) invocation_type: std::option::Option<crate::model::InvocationType>,
pub(crate) log_type: std::option::Option<crate::model::LogType>,
pub(crate) client_context: std::option::Option<std::string::String>,
pub(crate) payload: std::option::Option<aws_smithy_types::Blob>,
pub(crate) qualifier: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn invocation_type(mut self, input: crate::model::InvocationType) -> Self {
self.invocation_type = Some(input);
self
}
pub fn set_invocation_type(
mut self,
input: std::option::Option<crate::model::InvocationType>,
) -> Self {
self.invocation_type = input;
self
}
pub fn log_type(mut self, input: crate::model::LogType) -> Self {
self.log_type = Some(input);
self
}
pub fn set_log_type(mut self, input: std::option::Option<crate::model::LogType>) -> Self {
self.log_type = input;
self
}
pub fn client_context(mut self, input: impl Into<std::string::String>) -> Self {
self.client_context = Some(input.into());
self
}
pub fn set_client_context(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_context = input;
self
}
pub fn payload(mut self, input: aws_smithy_types::Blob) -> Self {
self.payload = Some(input);
self
}
pub fn set_payload(mut self, input: std::option::Option<aws_smithy_types::Blob>) -> Self {
self.payload = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn build(
self,
) -> Result<crate::input::InvokeInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::InvokeInput {
function_name: self.function_name,
invocation_type: self.invocation_type,
log_type: self.log_type,
client_context: self.client_context,
payload: self.payload,
qualifier: self.qualifier,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("function_name", &self.function_name);
formatter.field("invocation_type", &self.invocation_type);
formatter.field("log_type", &self.log_type);
formatter.field("client_context", &self.client_context);
formatter.field("payload", &"*** Sensitive Data Redacted ***");
formatter.field("qualifier", &self.qualifier);
formatter.finish()
}
}
}
impl InvokeInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::Invoke,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::InvokeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_50 = &_input.function_name;
let input_50 = input_50.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_50,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/functions/{FunctionName}/invocations",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::InvokeInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_51) = &_input.qualifier {
{
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_51));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::InvokeInput,
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_invoke(input, builder)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/octet-stream",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_payload_invoke_input(self.payload)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::Invoke::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"Invoke", "lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::invoke_input::Builder {
crate::input::invoke_input::Builder::default()
}
}
pub mod invoke_async_input {
#[derive(std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) invoke_args: std::option::Option<aws_smithy_http::byte_stream::ByteStream>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn invoke_args(mut self, input: aws_smithy_http::byte_stream::ByteStream) -> Self {
self.invoke_args = Some(input);
self
}
pub fn set_invoke_args(
mut self,
input: std::option::Option<aws_smithy_http::byte_stream::ByteStream>,
) -> Self {
self.invoke_args = input;
self
}
pub fn build(
self,
) -> Result<crate::input::InvokeAsyncInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::InvokeAsyncInput {
function_name: self.function_name,
invoke_args: self.invoke_args.unwrap_or_default(),
})
}
}
}
impl InvokeAsyncInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::InvokeAsync,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::InvokeAsyncInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_52 = &_input.function_name;
let input_52 = input_52.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_52,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2014-11-13/functions/{FunctionName}/invoke-async",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::InvokeAsyncInput,
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)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/octet-stream",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_payload_invoke_async_input(self.invoke_args)?
.into_inner(),
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::InvokeAsync::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"InvokeAsync",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::invoke_async_input::Builder {
crate::input::invoke_async_input::Builder::default()
}
}
pub mod list_aliases_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) function_version: std::option::Option<std::string::String>,
pub(crate) marker: std::option::Option<std::string::String>,
pub(crate) max_items: std::option::Option<i32>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn function_version(mut self, input: impl Into<std::string::String>) -> Self {
self.function_version = Some(input.into());
self
}
pub fn set_function_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_version = input;
self
}
pub fn marker(mut self, input: impl Into<std::string::String>) -> Self {
self.marker = Some(input.into());
self
}
pub fn set_marker(mut self, input: std::option::Option<std::string::String>) -> Self {
self.marker = input;
self
}
pub fn max_items(mut self, input: i32) -> Self {
self.max_items = Some(input);
self
}
pub fn set_max_items(mut self, input: std::option::Option<i32>) -> Self {
self.max_items = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListAliasesInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListAliasesInput {
function_name: self.function_name,
function_version: self.function_version,
marker: self.marker,
max_items: self.max_items,
})
}
}
}
impl ListAliasesInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListAliases,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListAliasesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_53 = &_input.function_name;
let input_53 = input_53.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_53,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/functions/{FunctionName}/aliases",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListAliasesInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_54) = &_input.function_version {
{
query.push_kv(
"FunctionVersion",
&aws_smithy_http::query::fmt_string(&inner_54),
);
}
}
if let Some(inner_55) = &_input.marker {
{
query.push_kv("Marker", &aws_smithy_http::query::fmt_string(&inner_55));
}
}
if let Some(inner_56) = &_input.max_items {
if *inner_56 != 0 {
query.push_kv(
"MaxItems",
aws_smithy_types::primitive::Encoder::from(*inner_56).encode(),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListAliasesInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListAliases::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListAliases",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_aliases_input::Builder {
crate::input::list_aliases_input::Builder::default()
}
}
pub mod list_code_signing_configs_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) marker: std::option::Option<std::string::String>,
pub(crate) max_items: std::option::Option<i32>,
}
impl Builder {
pub fn marker(mut self, input: impl Into<std::string::String>) -> Self {
self.marker = Some(input.into());
self
}
pub fn set_marker(mut self, input: std::option::Option<std::string::String>) -> Self {
self.marker = input;
self
}
pub fn max_items(mut self, input: i32) -> Self {
self.max_items = Some(input);
self
}
pub fn set_max_items(mut self, input: std::option::Option<i32>) -> Self {
self.max_items = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListCodeSigningConfigsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListCodeSigningConfigsInput {
marker: self.marker,
max_items: self.max_items,
})
}
}
}
impl ListCodeSigningConfigsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListCodeSigningConfigs,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListCodeSigningConfigsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/2020-04-22/code-signing-configs")
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListCodeSigningConfigsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_57) = &_input.marker {
{
query.push_kv("Marker", &aws_smithy_http::query::fmt_string(&inner_57));
}
}
if let Some(inner_58) = &_input.max_items {
if *inner_58 != 0 {
query.push_kv(
"MaxItems",
aws_smithy_types::primitive::Encoder::from(*inner_58).encode(),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListCodeSigningConfigsInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListCodeSigningConfigs::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListCodeSigningConfigs",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_code_signing_configs_input::Builder {
crate::input::list_code_signing_configs_input::Builder::default()
}
}
pub mod list_event_source_mappings_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) event_source_arn: std::option::Option<std::string::String>,
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) marker: std::option::Option<std::string::String>,
pub(crate) max_items: std::option::Option<i32>,
}
impl Builder {
pub fn event_source_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.event_source_arn = Some(input.into());
self
}
pub fn set_event_source_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.event_source_arn = input;
self
}
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn marker(mut self, input: impl Into<std::string::String>) -> Self {
self.marker = Some(input.into());
self
}
pub fn set_marker(mut self, input: std::option::Option<std::string::String>) -> Self {
self.marker = input;
self
}
pub fn max_items(mut self, input: i32) -> Self {
self.max_items = Some(input);
self
}
pub fn set_max_items(mut self, input: std::option::Option<i32>) -> Self {
self.max_items = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListEventSourceMappingsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListEventSourceMappingsInput {
event_source_arn: self.event_source_arn,
function_name: self.function_name,
marker: self.marker,
max_items: self.max_items,
})
}
}
}
impl ListEventSourceMappingsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListEventSourceMappings,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListEventSourceMappingsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/2015-03-31/event-source-mappings")
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListEventSourceMappingsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_59) = &_input.event_source_arn {
{
query.push_kv(
"EventSourceArn",
&aws_smithy_http::query::fmt_string(&inner_59),
);
}
}
if let Some(inner_60) = &_input.function_name {
{
query.push_kv(
"FunctionName",
&aws_smithy_http::query::fmt_string(&inner_60),
);
}
}
if let Some(inner_61) = &_input.marker {
{
query.push_kv("Marker", &aws_smithy_http::query::fmt_string(&inner_61));
}
}
if let Some(inner_62) = &_input.max_items {
if *inner_62 != 0 {
query.push_kv(
"MaxItems",
aws_smithy_types::primitive::Encoder::from(*inner_62).encode(),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListEventSourceMappingsInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListEventSourceMappings::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListEventSourceMappings",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_event_source_mappings_input::Builder {
crate::input::list_event_source_mappings_input::Builder::default()
}
}
pub mod list_function_event_invoke_configs_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) marker: std::option::Option<std::string::String>,
pub(crate) max_items: std::option::Option<i32>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn marker(mut self, input: impl Into<std::string::String>) -> Self {
self.marker = Some(input.into());
self
}
pub fn set_marker(mut self, input: std::option::Option<std::string::String>) -> Self {
self.marker = input;
self
}
pub fn max_items(mut self, input: i32) -> Self {
self.max_items = Some(input);
self
}
pub fn set_max_items(mut self, input: std::option::Option<i32>) -> Self {
self.max_items = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListFunctionEventInvokeConfigsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListFunctionEventInvokeConfigsInput {
function_name: self.function_name,
marker: self.marker,
max_items: self.max_items,
})
}
}
}
impl ListFunctionEventInvokeConfigsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListFunctionEventInvokeConfigs,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListFunctionEventInvokeConfigsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_63 = &_input.function_name;
let input_63 = input_63.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_63,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2019-09-25/functions/{FunctionName}/event-invoke-config/list",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListFunctionEventInvokeConfigsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_64) = &_input.marker {
{
query.push_kv("Marker", &aws_smithy_http::query::fmt_string(&inner_64));
}
}
if let Some(inner_65) = &_input.max_items {
if *inner_65 != 0 {
query.push_kv(
"MaxItems",
aws_smithy_types::primitive::Encoder::from(*inner_65).encode(),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListFunctionEventInvokeConfigsInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListFunctionEventInvokeConfigs::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListFunctionEventInvokeConfigs",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_function_event_invoke_configs_input::Builder {
crate::input::list_function_event_invoke_configs_input::Builder::default()
}
}
pub mod list_functions_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) master_region: std::option::Option<std::string::String>,
pub(crate) function_version: std::option::Option<crate::model::FunctionVersion>,
pub(crate) marker: std::option::Option<std::string::String>,
pub(crate) max_items: std::option::Option<i32>,
}
impl Builder {
pub fn master_region(mut self, input: impl Into<std::string::String>) -> Self {
self.master_region = Some(input.into());
self
}
pub fn set_master_region(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.master_region = input;
self
}
pub fn function_version(mut self, input: crate::model::FunctionVersion) -> Self {
self.function_version = Some(input);
self
}
pub fn set_function_version(
mut self,
input: std::option::Option<crate::model::FunctionVersion>,
) -> Self {
self.function_version = input;
self
}
pub fn marker(mut self, input: impl Into<std::string::String>) -> Self {
self.marker = Some(input.into());
self
}
pub fn set_marker(mut self, input: std::option::Option<std::string::String>) -> Self {
self.marker = input;
self
}
pub fn max_items(mut self, input: i32) -> Self {
self.max_items = Some(input);
self
}
pub fn set_max_items(mut self, input: std::option::Option<i32>) -> Self {
self.max_items = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListFunctionsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListFunctionsInput {
master_region: self.master_region,
function_version: self.function_version,
marker: self.marker,
max_items: self.max_items,
})
}
}
}
impl ListFunctionsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListFunctions,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListFunctionsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/2015-03-31/functions").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListFunctionsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_66) = &_input.master_region {
{
query.push_kv(
"MasterRegion",
&aws_smithy_http::query::fmt_string(&inner_66),
);
}
}
if let Some(inner_67) = &_input.function_version {
{
query.push_kv(
"FunctionVersion",
&aws_smithy_http::query::fmt_string(&inner_67),
);
}
}
if let Some(inner_68) = &_input.marker {
{
query.push_kv("Marker", &aws_smithy_http::query::fmt_string(&inner_68));
}
}
if let Some(inner_69) = &_input.max_items {
if *inner_69 != 0 {
query.push_kv(
"MaxItems",
aws_smithy_types::primitive::Encoder::from(*inner_69).encode(),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListFunctionsInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListFunctions::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListFunctions",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_functions_input::Builder {
crate::input::list_functions_input::Builder::default()
}
}
pub mod list_functions_by_code_signing_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) code_signing_config_arn: std::option::Option<std::string::String>,
pub(crate) marker: std::option::Option<std::string::String>,
pub(crate) max_items: std::option::Option<i32>,
}
impl Builder {
pub fn code_signing_config_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.code_signing_config_arn = Some(input.into());
self
}
pub fn set_code_signing_config_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.code_signing_config_arn = input;
self
}
pub fn marker(mut self, input: impl Into<std::string::String>) -> Self {
self.marker = Some(input.into());
self
}
pub fn set_marker(mut self, input: std::option::Option<std::string::String>) -> Self {
self.marker = input;
self
}
pub fn max_items(mut self, input: i32) -> Self {
self.max_items = Some(input);
self
}
pub fn set_max_items(mut self, input: std::option::Option<i32>) -> Self {
self.max_items = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListFunctionsByCodeSigningConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListFunctionsByCodeSigningConfigInput {
code_signing_config_arn: self.code_signing_config_arn,
marker: self.marker,
max_items: self.max_items,
})
}
}
}
impl ListFunctionsByCodeSigningConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListFunctionsByCodeSigningConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListFunctionsByCodeSigningConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_70 = &_input.code_signing_config_arn;
let input_70 = input_70.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"code_signing_config_arn",
"cannot be empty or unset",
)
})?;
let code_signing_config_arn = aws_smithy_http::label::fmt_string(
input_70,
aws_smithy_http::label::EncodingStrategy::Default,
);
if code_signing_config_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"code_signing_config_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2020-04-22/code-signing-configs/{CodeSigningConfigArn}/functions",
CodeSigningConfigArn = code_signing_config_arn
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListFunctionsByCodeSigningConfigInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_71) = &_input.marker {
{
query.push_kv("Marker", &aws_smithy_http::query::fmt_string(&inner_71));
}
}
if let Some(inner_72) = &_input.max_items {
if *inner_72 != 0 {
query.push_kv(
"MaxItems",
aws_smithy_types::primitive::Encoder::from(*inner_72).encode(),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListFunctionsByCodeSigningConfigInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListFunctionsByCodeSigningConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListFunctionsByCodeSigningConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_functions_by_code_signing_config_input::Builder {
crate::input::list_functions_by_code_signing_config_input::Builder::default()
}
}
pub mod list_function_url_configs_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) marker: std::option::Option<std::string::String>,
pub(crate) max_items: std::option::Option<i32>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn marker(mut self, input: impl Into<std::string::String>) -> Self {
self.marker = Some(input.into());
self
}
pub fn set_marker(mut self, input: std::option::Option<std::string::String>) -> Self {
self.marker = input;
self
}
pub fn max_items(mut self, input: i32) -> Self {
self.max_items = Some(input);
self
}
pub fn set_max_items(mut self, input: std::option::Option<i32>) -> Self {
self.max_items = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListFunctionUrlConfigsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListFunctionUrlConfigsInput {
function_name: self.function_name,
marker: self.marker,
max_items: self.max_items,
})
}
}
}
impl ListFunctionUrlConfigsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListFunctionUrlConfigs,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListFunctionUrlConfigsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_73 = &_input.function_name;
let input_73 = input_73.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_73,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2021-10-31/functions/{FunctionName}/urls",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListFunctionUrlConfigsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_74) = &_input.marker {
{
query.push_kv("Marker", &aws_smithy_http::query::fmt_string(&inner_74));
}
}
if let Some(inner_75) = &_input.max_items {
if *inner_75 != 0 {
query.push_kv(
"MaxItems",
aws_smithy_types::primitive::Encoder::from(*inner_75).encode(),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListFunctionUrlConfigsInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListFunctionUrlConfigs::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListFunctionUrlConfigs",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_function_url_configs_input::Builder {
crate::input::list_function_url_configs_input::Builder::default()
}
}
pub mod list_layers_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) compatible_runtime: std::option::Option<crate::model::Runtime>,
pub(crate) marker: std::option::Option<std::string::String>,
pub(crate) max_items: std::option::Option<i32>,
pub(crate) compatible_architecture: std::option::Option<crate::model::Architecture>,
}
impl Builder {
pub fn compatible_runtime(mut self, input: crate::model::Runtime) -> Self {
self.compatible_runtime = Some(input);
self
}
pub fn set_compatible_runtime(
mut self,
input: std::option::Option<crate::model::Runtime>,
) -> Self {
self.compatible_runtime = input;
self
}
pub fn marker(mut self, input: impl Into<std::string::String>) -> Self {
self.marker = Some(input.into());
self
}
pub fn set_marker(mut self, input: std::option::Option<std::string::String>) -> Self {
self.marker = input;
self
}
pub fn max_items(mut self, input: i32) -> Self {
self.max_items = Some(input);
self
}
pub fn set_max_items(mut self, input: std::option::Option<i32>) -> Self {
self.max_items = input;
self
}
pub fn compatible_architecture(mut self, input: crate::model::Architecture) -> Self {
self.compatible_architecture = Some(input);
self
}
pub fn set_compatible_architecture(
mut self,
input: std::option::Option<crate::model::Architecture>,
) -> Self {
self.compatible_architecture = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListLayersInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListLayersInput {
compatible_runtime: self.compatible_runtime,
marker: self.marker,
max_items: self.max_items,
compatible_architecture: self.compatible_architecture,
})
}
}
}
impl ListLayersInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListLayers,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListLayersInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/2018-10-31/layers").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListLayersInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_76) = &_input.compatible_runtime {
{
query.push_kv(
"CompatibleRuntime",
&aws_smithy_http::query::fmt_string(&inner_76),
);
}
}
if let Some(inner_77) = &_input.marker {
{
query.push_kv("Marker", &aws_smithy_http::query::fmt_string(&inner_77));
}
}
if let Some(inner_78) = &_input.max_items {
if *inner_78 != 0 {
query.push_kv(
"MaxItems",
aws_smithy_types::primitive::Encoder::from(*inner_78).encode(),
);
}
}
if let Some(inner_79) = &_input.compatible_architecture {
{
query.push_kv(
"CompatibleArchitecture",
&aws_smithy_http::query::fmt_string(&inner_79),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListLayersInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListLayers::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListLayers",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_layers_input::Builder {
crate::input::list_layers_input::Builder::default()
}
}
pub mod list_layer_versions_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) compatible_runtime: std::option::Option<crate::model::Runtime>,
pub(crate) layer_name: std::option::Option<std::string::String>,
pub(crate) marker: std::option::Option<std::string::String>,
pub(crate) max_items: std::option::Option<i32>,
pub(crate) compatible_architecture: std::option::Option<crate::model::Architecture>,
}
impl Builder {
pub fn compatible_runtime(mut self, input: crate::model::Runtime) -> Self {
self.compatible_runtime = Some(input);
self
}
pub fn set_compatible_runtime(
mut self,
input: std::option::Option<crate::model::Runtime>,
) -> Self {
self.compatible_runtime = input;
self
}
pub fn layer_name(mut self, input: impl Into<std::string::String>) -> Self {
self.layer_name = Some(input.into());
self
}
pub fn set_layer_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.layer_name = input;
self
}
pub fn marker(mut self, input: impl Into<std::string::String>) -> Self {
self.marker = Some(input.into());
self
}
pub fn set_marker(mut self, input: std::option::Option<std::string::String>) -> Self {
self.marker = input;
self
}
pub fn max_items(mut self, input: i32) -> Self {
self.max_items = Some(input);
self
}
pub fn set_max_items(mut self, input: std::option::Option<i32>) -> Self {
self.max_items = input;
self
}
pub fn compatible_architecture(mut self, input: crate::model::Architecture) -> Self {
self.compatible_architecture = Some(input);
self
}
pub fn set_compatible_architecture(
mut self,
input: std::option::Option<crate::model::Architecture>,
) -> Self {
self.compatible_architecture = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListLayerVersionsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListLayerVersionsInput {
compatible_runtime: self.compatible_runtime,
layer_name: self.layer_name,
marker: self.marker,
max_items: self.max_items,
compatible_architecture: self.compatible_architecture,
})
}
}
}
impl ListLayerVersionsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListLayerVersions,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListLayerVersionsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_80 = &_input.layer_name;
let input_80 = input_80.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"layer_name",
"cannot be empty or unset",
)
})?;
let layer_name = aws_smithy_http::label::fmt_string(
input_80,
aws_smithy_http::label::EncodingStrategy::Default,
);
if layer_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"layer_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2018-10-31/layers/{LayerName}/versions",
LayerName = layer_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListLayerVersionsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_81) = &_input.compatible_runtime {
{
query.push_kv(
"CompatibleRuntime",
&aws_smithy_http::query::fmt_string(&inner_81),
);
}
}
if let Some(inner_82) = &_input.marker {
{
query.push_kv("Marker", &aws_smithy_http::query::fmt_string(&inner_82));
}
}
if let Some(inner_83) = &_input.max_items {
if *inner_83 != 0 {
query.push_kv(
"MaxItems",
aws_smithy_types::primitive::Encoder::from(*inner_83).encode(),
);
}
}
if let Some(inner_84) = &_input.compatible_architecture {
{
query.push_kv(
"CompatibleArchitecture",
&aws_smithy_http::query::fmt_string(&inner_84),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListLayerVersionsInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListLayerVersions::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListLayerVersions",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_layer_versions_input::Builder {
crate::input::list_layer_versions_input::Builder::default()
}
}
pub mod list_provisioned_concurrency_configs_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) marker: std::option::Option<std::string::String>,
pub(crate) max_items: std::option::Option<i32>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn marker(mut self, input: impl Into<std::string::String>) -> Self {
self.marker = Some(input.into());
self
}
pub fn set_marker(mut self, input: std::option::Option<std::string::String>) -> Self {
self.marker = input;
self
}
pub fn max_items(mut self, input: i32) -> Self {
self.max_items = Some(input);
self
}
pub fn set_max_items(mut self, input: std::option::Option<i32>) -> Self {
self.max_items = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListProvisionedConcurrencyConfigsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListProvisionedConcurrencyConfigsInput {
function_name: self.function_name,
marker: self.marker,
max_items: self.max_items,
})
}
}
}
impl ListProvisionedConcurrencyConfigsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListProvisionedConcurrencyConfigs,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListProvisionedConcurrencyConfigsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_85 = &_input.function_name;
let input_85 = input_85.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_85,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2019-09-30/functions/{FunctionName}/provisioned-concurrency",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListProvisionedConcurrencyConfigsInput,
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", "ALL");
if let Some(inner_86) = &_input.marker {
{
query.push_kv("Marker", &aws_smithy_http::query::fmt_string(&inner_86));
}
}
if let Some(inner_87) = &_input.max_items {
if *inner_87 != 0 {
query.push_kv(
"MaxItems",
aws_smithy_types::primitive::Encoder::from(*inner_87).encode(),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListProvisionedConcurrencyConfigsInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListProvisionedConcurrencyConfigs::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListProvisionedConcurrencyConfigs",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_provisioned_concurrency_configs_input::Builder {
crate::input::list_provisioned_concurrency_configs_input::Builder::default()
}
}
pub mod list_tags_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource: std::option::Option<std::string::String>,
}
impl Builder {
pub fn resource(mut self, input: impl Into<std::string::String>) -> Self {
self.resource = Some(input.into());
self
}
pub fn set_resource(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListTagsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListTagsInput {
resource: self.resource,
})
}
}
}
impl ListTagsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListTags,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListTagsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_88 = &_input.resource;
let input_88 = input_88.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource",
"cannot be empty or unset",
)
})?;
let resource = aws_smithy_http::label::fmt_string(
input_88,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource",
"cannot be empty or unset",
),
);
}
write!(output, "/2017-03-31/tags/{Resource}", Resource = resource)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListTagsInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::ListTags::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListTags", "lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_tags_input::Builder {
crate::input::list_tags_input::Builder::default()
}
}
pub mod list_versions_by_function_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) marker: std::option::Option<std::string::String>,
pub(crate) max_items: std::option::Option<i32>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn marker(mut self, input: impl Into<std::string::String>) -> Self {
self.marker = Some(input.into());
self
}
pub fn set_marker(mut self, input: std::option::Option<std::string::String>) -> Self {
self.marker = input;
self
}
pub fn max_items(mut self, input: i32) -> Self {
self.max_items = Some(input);
self
}
pub fn set_max_items(mut self, input: std::option::Option<i32>) -> Self {
self.max_items = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListVersionsByFunctionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListVersionsByFunctionInput {
function_name: self.function_name,
marker: self.marker,
max_items: self.max_items,
})
}
}
}
impl ListVersionsByFunctionInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListVersionsByFunction,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListVersionsByFunctionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_89 = &_input.function_name;
let input_89 = input_89.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_89,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/functions/{FunctionName}/versions",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListVersionsByFunctionInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_90) = &_input.marker {
{
query.push_kv("Marker", &aws_smithy_http::query::fmt_string(&inner_90));
}
}
if let Some(inner_91) = &_input.max_items {
if *inner_91 != 0 {
query.push_kv(
"MaxItems",
aws_smithy_types::primitive::Encoder::from(*inner_91).encode(),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListVersionsByFunctionInput,
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)?;
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListVersionsByFunction::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListVersionsByFunction",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_versions_by_function_input::Builder {
crate::input::list_versions_by_function_input::Builder::default()
}
}
pub mod publish_layer_version_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) layer_name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) content: std::option::Option<crate::model::LayerVersionContentInput>,
pub(crate) compatible_runtimes: std::option::Option<std::vec::Vec<crate::model::Runtime>>,
pub(crate) license_info: std::option::Option<std::string::String>,
pub(crate) compatible_architectures:
std::option::Option<std::vec::Vec<crate::model::Architecture>>,
}
impl Builder {
pub fn layer_name(mut self, input: impl Into<std::string::String>) -> Self {
self.layer_name = Some(input.into());
self
}
pub fn set_layer_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.layer_name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn content(mut self, input: crate::model::LayerVersionContentInput) -> Self {
self.content = Some(input);
self
}
pub fn set_content(
mut self,
input: std::option::Option<crate::model::LayerVersionContentInput>,
) -> Self {
self.content = input;
self
}
pub fn compatible_runtimes(mut self, input: crate::model::Runtime) -> Self {
let mut v = self.compatible_runtimes.unwrap_or_default();
v.push(input);
self.compatible_runtimes = Some(v);
self
}
pub fn set_compatible_runtimes(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Runtime>>,
) -> Self {
self.compatible_runtimes = input;
self
}
pub fn license_info(mut self, input: impl Into<std::string::String>) -> Self {
self.license_info = Some(input.into());
self
}
pub fn set_license_info(mut self, input: std::option::Option<std::string::String>) -> Self {
self.license_info = input;
self
}
pub fn compatible_architectures(mut self, input: crate::model::Architecture) -> Self {
let mut v = self.compatible_architectures.unwrap_or_default();
v.push(input);
self.compatible_architectures = Some(v);
self
}
pub fn set_compatible_architectures(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Architecture>>,
) -> Self {
self.compatible_architectures = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::PublishLayerVersionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::PublishLayerVersionInput {
layer_name: self.layer_name,
description: self.description,
content: self.content,
compatible_runtimes: self.compatible_runtimes,
license_info: self.license_info,
compatible_architectures: self.compatible_architectures,
})
}
}
}
impl PublishLayerVersionInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::PublishLayerVersion,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::PublishLayerVersionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_92 = &_input.layer_name;
let input_92 = input_92.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"layer_name",
"cannot be empty or unset",
)
})?;
let layer_name = aws_smithy_http::label::fmt_string(
input_92,
aws_smithy_http::label::EncodingStrategy::Default,
);
if layer_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"layer_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2018-10-31/layers/{LayerName}/versions",
LayerName = layer_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PublishLayerVersionInput,
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)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_publish_layer_version(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::PublishLayerVersion::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PublishLayerVersion",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::publish_layer_version_input::Builder {
crate::input::publish_layer_version_input::Builder::default()
}
}
pub mod publish_version_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) code_sha256: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) revision_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn code_sha256(mut self, input: impl Into<std::string::String>) -> Self {
self.code_sha256 = Some(input.into());
self
}
pub fn set_code_sha256(mut self, input: std::option::Option<std::string::String>) -> Self {
self.code_sha256 = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn revision_id(mut self, input: impl Into<std::string::String>) -> Self {
self.revision_id = Some(input.into());
self
}
pub fn set_revision_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.revision_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::PublishVersionInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::PublishVersionInput {
function_name: self.function_name,
code_sha256: self.code_sha256,
description: self.description,
revision_id: self.revision_id,
})
}
}
}
impl PublishVersionInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::PublishVersion,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::PublishVersionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_93 = &_input.function_name;
let input_93 = input_93.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_93,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/functions/{FunctionName}/versions",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PublishVersionInput,
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)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_publish_version(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::PublishVersion::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PublishVersion",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::publish_version_input::Builder {
crate::input::publish_version_input::Builder::default()
}
}
pub mod put_function_code_signing_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) code_signing_config_arn: std::option::Option<std::string::String>,
pub(crate) function_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn code_signing_config_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.code_signing_config_arn = Some(input.into());
self
}
pub fn set_code_signing_config_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.code_signing_config_arn = input;
self
}
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::PutFunctionCodeSigningConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::PutFunctionCodeSigningConfigInput {
code_signing_config_arn: self.code_signing_config_arn,
function_name: self.function_name,
})
}
}
}
impl PutFunctionCodeSigningConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::PutFunctionCodeSigningConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::PutFunctionCodeSigningConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_94 = &_input.function_name;
let input_94 = input_94.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_94,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2020-06-30/functions/{FunctionName}/code-signing-config",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PutFunctionCodeSigningConfigInput,
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)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_put_function_code_signing_config(&self)?
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::PutFunctionCodeSigningConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PutFunctionCodeSigningConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::put_function_code_signing_config_input::Builder {
crate::input::put_function_code_signing_config_input::Builder::default()
}
}
pub mod put_function_concurrency_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) reserved_concurrent_executions: std::option::Option<i32>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn reserved_concurrent_executions(mut self, input: i32) -> Self {
self.reserved_concurrent_executions = Some(input);
self
}
pub fn set_reserved_concurrent_executions(
mut self,
input: std::option::Option<i32>,
) -> Self {
self.reserved_concurrent_executions = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::PutFunctionConcurrencyInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::PutFunctionConcurrencyInput {
function_name: self.function_name,
reserved_concurrent_executions: self.reserved_concurrent_executions,
})
}
}
}
impl PutFunctionConcurrencyInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::PutFunctionConcurrency,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::PutFunctionConcurrencyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_95 = &_input.function_name;
let input_95 = input_95.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_95,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2017-10-31/functions/{FunctionName}/concurrency",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PutFunctionConcurrencyInput,
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)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_put_function_concurrency(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::PutFunctionConcurrency::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PutFunctionConcurrency",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::put_function_concurrency_input::Builder {
crate::input::put_function_concurrency_input::Builder::default()
}
}
pub mod put_function_event_invoke_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
pub(crate) maximum_retry_attempts: std::option::Option<i32>,
pub(crate) maximum_event_age_in_seconds: std::option::Option<i32>,
pub(crate) destination_config: std::option::Option<crate::model::DestinationConfig>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn maximum_retry_attempts(mut self, input: i32) -> Self {
self.maximum_retry_attempts = Some(input);
self
}
pub fn set_maximum_retry_attempts(mut self, input: std::option::Option<i32>) -> Self {
self.maximum_retry_attempts = input;
self
}
pub fn maximum_event_age_in_seconds(mut self, input: i32) -> Self {
self.maximum_event_age_in_seconds = Some(input);
self
}
pub fn set_maximum_event_age_in_seconds(mut self, input: std::option::Option<i32>) -> Self {
self.maximum_event_age_in_seconds = input;
self
}
pub fn destination_config(mut self, input: crate::model::DestinationConfig) -> Self {
self.destination_config = Some(input);
self
}
pub fn set_destination_config(
mut self,
input: std::option::Option<crate::model::DestinationConfig>,
) -> Self {
self.destination_config = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::PutFunctionEventInvokeConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::PutFunctionEventInvokeConfigInput {
function_name: self.function_name,
qualifier: self.qualifier,
maximum_retry_attempts: self.maximum_retry_attempts,
maximum_event_age_in_seconds: self.maximum_event_age_in_seconds,
destination_config: self.destination_config,
})
}
}
}
impl PutFunctionEventInvokeConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::PutFunctionEventInvokeConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::PutFunctionEventInvokeConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_96 = &_input.function_name;
let input_96 = input_96.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_96,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2019-09-25/functions/{FunctionName}/event-invoke-config",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::PutFunctionEventInvokeConfigInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_97) = &_input.qualifier {
{
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_97));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PutFunctionEventInvokeConfigInput,
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)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_put_function_event_invoke_config(&self)?
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::PutFunctionEventInvokeConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PutFunctionEventInvokeConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::put_function_event_invoke_config_input::Builder {
crate::input::put_function_event_invoke_config_input::Builder::default()
}
}
pub mod put_provisioned_concurrency_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
pub(crate) provisioned_concurrent_executions: std::option::Option<i32>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn provisioned_concurrent_executions(mut self, input: i32) -> Self {
self.provisioned_concurrent_executions = Some(input);
self
}
pub fn set_provisioned_concurrent_executions(
mut self,
input: std::option::Option<i32>,
) -> Self {
self.provisioned_concurrent_executions = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::PutProvisionedConcurrencyConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::PutProvisionedConcurrencyConfigInput {
function_name: self.function_name,
qualifier: self.qualifier,
provisioned_concurrent_executions: self.provisioned_concurrent_executions,
})
}
}
}
impl PutProvisionedConcurrencyConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::PutProvisionedConcurrencyConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::PutProvisionedConcurrencyConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_98 = &_input.function_name;
let input_98 = input_98.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_98,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2019-09-30/functions/{FunctionName}/provisioned-concurrency",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::PutProvisionedConcurrencyConfigInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_99 = &_input.qualifier;
let inner_99 = inner_99.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"qualifier",
"cannot be empty or unset",
)
})?;
if inner_99.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"qualifier",
"cannot be empty or unset",
),
);
}
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_99));
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PutProvisionedConcurrencyConfigInput,
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)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_put_provisioned_concurrency_config(&self)?
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::PutProvisionedConcurrencyConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PutProvisionedConcurrencyConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::put_provisioned_concurrency_config_input::Builder {
crate::input::put_provisioned_concurrency_config_input::Builder::default()
}
}
pub mod put_runtime_management_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
pub(crate) update_runtime_on: std::option::Option<crate::model::UpdateRuntimeOn>,
pub(crate) runtime_version_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn update_runtime_on(mut self, input: crate::model::UpdateRuntimeOn) -> Self {
self.update_runtime_on = Some(input);
self
}
pub fn set_update_runtime_on(
mut self,
input: std::option::Option<crate::model::UpdateRuntimeOn>,
) -> Self {
self.update_runtime_on = input;
self
}
pub fn runtime_version_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.runtime_version_arn = Some(input.into());
self
}
pub fn set_runtime_version_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.runtime_version_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::PutRuntimeManagementConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::PutRuntimeManagementConfigInput {
function_name: self.function_name,
qualifier: self.qualifier,
update_runtime_on: self.update_runtime_on,
runtime_version_arn: self.runtime_version_arn,
})
}
}
}
impl PutRuntimeManagementConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::PutRuntimeManagementConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::PutRuntimeManagementConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_100 = &_input.function_name;
let input_100 = input_100.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_100,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2021-07-20/functions/{FunctionName}/runtime-management-config",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::PutRuntimeManagementConfigInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_101) = &_input.qualifier {
{
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_101));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PutRuntimeManagementConfigInput,
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)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_put_runtime_management_config(&self)?
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::PutRuntimeManagementConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PutRuntimeManagementConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::put_runtime_management_config_input::Builder {
crate::input::put_runtime_management_config_input::Builder::default()
}
}
pub mod remove_layer_version_permission_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) layer_name: std::option::Option<std::string::String>,
pub(crate) version_number: std::option::Option<i64>,
pub(crate) statement_id: std::option::Option<std::string::String>,
pub(crate) revision_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn layer_name(mut self, input: impl Into<std::string::String>) -> Self {
self.layer_name = Some(input.into());
self
}
pub fn set_layer_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.layer_name = input;
self
}
pub fn version_number(mut self, input: i64) -> Self {
self.version_number = Some(input);
self
}
pub fn set_version_number(mut self, input: std::option::Option<i64>) -> Self {
self.version_number = input;
self
}
pub fn statement_id(mut self, input: impl Into<std::string::String>) -> Self {
self.statement_id = Some(input.into());
self
}
pub fn set_statement_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.statement_id = input;
self
}
pub fn revision_id(mut self, input: impl Into<std::string::String>) -> Self {
self.revision_id = Some(input.into());
self
}
pub fn set_revision_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.revision_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::RemoveLayerVersionPermissionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::RemoveLayerVersionPermissionInput {
layer_name: self.layer_name,
version_number: self.version_number.unwrap_or_default(),
statement_id: self.statement_id,
revision_id: self.revision_id,
})
}
}
}
impl RemoveLayerVersionPermissionInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::RemoveLayerVersionPermission,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::RemoveLayerVersionPermissionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_102 = &_input.layer_name;
let input_102 = input_102.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"layer_name",
"cannot be empty or unset",
)
})?;
let layer_name = aws_smithy_http::label::fmt_string(
input_102,
aws_smithy_http::label::EncodingStrategy::Default,
);
if layer_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"layer_name",
"cannot be empty or unset",
),
);
}
let input_103 = &_input.version_number;
let mut version_number_encoder =
aws_smithy_types::primitive::Encoder::from(*input_103);
let version_number = version_number_encoder.encode();
if version_number.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"version_number",
"cannot be empty or unset",
),
);
}
let input_104 = &_input.statement_id;
let input_104 = input_104.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"statement_id",
"cannot be empty or unset",
)
})?;
let statement_id = aws_smithy_http::label::fmt_string(
input_104,
aws_smithy_http::label::EncodingStrategy::Default,
);
if statement_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"statement_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy/{StatementId}",
LayerName = layer_name,
VersionNumber = version_number,
StatementId = statement_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::RemoveLayerVersionPermissionInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_105) = &_input.revision_id {
{
query.push_kv(
"RevisionId",
&aws_smithy_http::query::fmt_string(&inner_105),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RemoveLayerVersionPermissionInput,
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)?;
Ok(builder.method("DELETE").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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::RemoveLayerVersionPermission::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RemoveLayerVersionPermission",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::remove_layer_version_permission_input::Builder {
crate::input::remove_layer_version_permission_input::Builder::default()
}
}
pub mod remove_permission_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) statement_id: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
pub(crate) revision_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn statement_id(mut self, input: impl Into<std::string::String>) -> Self {
self.statement_id = Some(input.into());
self
}
pub fn set_statement_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.statement_id = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn revision_id(mut self, input: impl Into<std::string::String>) -> Self {
self.revision_id = Some(input.into());
self
}
pub fn set_revision_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.revision_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::RemovePermissionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::RemovePermissionInput {
function_name: self.function_name,
statement_id: self.statement_id,
qualifier: self.qualifier,
revision_id: self.revision_id,
})
}
}
}
impl RemovePermissionInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::RemovePermission,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::RemovePermissionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_106 = &_input.function_name;
let input_106 = input_106.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_106,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
let input_107 = &_input.statement_id;
let input_107 = input_107.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"statement_id",
"cannot be empty or unset",
)
})?;
let statement_id = aws_smithy_http::label::fmt_string(
input_107,
aws_smithy_http::label::EncodingStrategy::Default,
);
if statement_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"statement_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/functions/{FunctionName}/policy/{StatementId}",
FunctionName = function_name,
StatementId = statement_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::RemovePermissionInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_108) = &_input.qualifier {
{
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_108));
}
}
if let Some(inner_109) = &_input.revision_id {
{
query.push_kv(
"RevisionId",
&aws_smithy_http::query::fmt_string(&inner_109),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RemovePermissionInput,
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)?;
Ok(builder.method("DELETE").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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::RemovePermission::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RemovePermission",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::remove_permission_input::Builder {
crate::input::remove_permission_input::Builder::default()
}
}
pub mod tag_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn resource(mut self, input: impl Into<std::string::String>) -> Self {
self.resource = Some(input.into());
self
}
pub fn set_resource(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> Result<crate::input::TagResourceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::TagResourceInput {
resource: self.resource,
tags: self.tags,
})
}
}
}
impl TagResourceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::TagResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::TagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_110 = &_input.resource;
let input_110 = input_110.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource",
"cannot be empty or unset",
)
})?;
let resource = aws_smithy_http::label::fmt_string(
input_110,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource",
"cannot be empty or unset",
),
);
}
write!(output, "/2017-03-31/tags/{Resource}", Resource = resource)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::TagResourceInput,
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)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_tag_resource(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::TagResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"TagResource",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::tag_resource_input::Builder {
crate::input::tag_resource_input::Builder::default()
}
}
pub mod untag_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource: std::option::Option<std::string::String>,
pub(crate) tag_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
pub fn resource(mut self, input: impl Into<std::string::String>) -> Self {
self.resource = Some(input.into());
self
}
pub fn set_resource(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource = input;
self
}
pub fn tag_keys(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.tag_keys.unwrap_or_default();
v.push(input.into());
self.tag_keys = Some(v);
self
}
pub fn set_tag_keys(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.tag_keys = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UntagResourceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UntagResourceInput {
resource: self.resource,
tag_keys: self.tag_keys,
})
}
}
}
impl UntagResourceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UntagResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UntagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_111 = &_input.resource;
let input_111 = input_111.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource",
"cannot be empty or unset",
)
})?;
let resource = aws_smithy_http::label::fmt_string(
input_111,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource",
"cannot be empty or unset",
),
);
}
write!(output, "/2017-03-31/tags/{Resource}", Resource = resource)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::UntagResourceInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_112 = &_input.tag_keys;
let inner_112 = inner_112.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"tag_keys",
"cannot be empty or unset",
)
})?;
for inner_113 in inner_112 {
query.push_kv("tagKeys", &aws_smithy_http::query::fmt_string(&inner_113));
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UntagResourceInput,
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)?;
Ok(builder.method("DELETE").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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UntagResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UntagResource",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::untag_resource_input::Builder {
crate::input::untag_resource_input::Builder::default()
}
}
pub mod update_alias_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) function_version: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) routing_config: std::option::Option<crate::model::AliasRoutingConfiguration>,
pub(crate) revision_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn function_version(mut self, input: impl Into<std::string::String>) -> Self {
self.function_version = Some(input.into());
self
}
pub fn set_function_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_version = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn routing_config(mut self, input: crate::model::AliasRoutingConfiguration) -> Self {
self.routing_config = Some(input);
self
}
pub fn set_routing_config(
mut self,
input: std::option::Option<crate::model::AliasRoutingConfiguration>,
) -> Self {
self.routing_config = input;
self
}
pub fn revision_id(mut self, input: impl Into<std::string::String>) -> Self {
self.revision_id = Some(input.into());
self
}
pub fn set_revision_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.revision_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateAliasInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateAliasInput {
function_name: self.function_name,
name: self.name,
function_version: self.function_version,
description: self.description,
routing_config: self.routing_config,
revision_id: self.revision_id,
})
}
}
}
impl UpdateAliasInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateAlias,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateAliasInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_114 = &_input.function_name;
let input_114 = input_114.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_114,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
let input_115 = &_input.name;
let input_115 = input_115.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"name",
"cannot be empty or unset",
)
})?;
let name = aws_smithy_http::label::fmt_string(
input_115,
aws_smithy_http::label::EncodingStrategy::Default,
);
if name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/functions/{FunctionName}/aliases/{Name}",
FunctionName = function_name,
Name = name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateAliasInput,
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)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_alias(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateAlias::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateAlias",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_alias_input::Builder {
crate::input::update_alias_input::Builder::default()
}
}
pub mod update_code_signing_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) code_signing_config_arn: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) allowed_publishers: std::option::Option<crate::model::AllowedPublishers>,
pub(crate) code_signing_policies: std::option::Option<crate::model::CodeSigningPolicies>,
}
impl Builder {
pub fn code_signing_config_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.code_signing_config_arn = Some(input.into());
self
}
pub fn set_code_signing_config_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.code_signing_config_arn = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn allowed_publishers(mut self, input: crate::model::AllowedPublishers) -> Self {
self.allowed_publishers = Some(input);
self
}
pub fn set_allowed_publishers(
mut self,
input: std::option::Option<crate::model::AllowedPublishers>,
) -> Self {
self.allowed_publishers = input;
self
}
pub fn code_signing_policies(mut self, input: crate::model::CodeSigningPolicies) -> Self {
self.code_signing_policies = Some(input);
self
}
pub fn set_code_signing_policies(
mut self,
input: std::option::Option<crate::model::CodeSigningPolicies>,
) -> Self {
self.code_signing_policies = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateCodeSigningConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateCodeSigningConfigInput {
code_signing_config_arn: self.code_signing_config_arn,
description: self.description,
allowed_publishers: self.allowed_publishers,
code_signing_policies: self.code_signing_policies,
})
}
}
}
impl UpdateCodeSigningConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateCodeSigningConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateCodeSigningConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_116 = &_input.code_signing_config_arn;
let input_116 = input_116.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"code_signing_config_arn",
"cannot be empty or unset",
)
})?;
let code_signing_config_arn = aws_smithy_http::label::fmt_string(
input_116,
aws_smithy_http::label::EncodingStrategy::Default,
);
if code_signing_config_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"code_signing_config_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2020-04-22/code-signing-configs/{CodeSigningConfigArn}",
CodeSigningConfigArn = code_signing_config_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateCodeSigningConfigInput,
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)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_code_signing_config(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateCodeSigningConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateCodeSigningConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_code_signing_config_input::Builder {
crate::input::update_code_signing_config_input::Builder::default()
}
}
pub mod update_event_source_mapping_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) uuid: std::option::Option<std::string::String>,
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) enabled: std::option::Option<bool>,
pub(crate) batch_size: std::option::Option<i32>,
pub(crate) filter_criteria: std::option::Option<crate::model::FilterCriteria>,
pub(crate) maximum_batching_window_in_seconds: std::option::Option<i32>,
pub(crate) destination_config: std::option::Option<crate::model::DestinationConfig>,
pub(crate) maximum_record_age_in_seconds: std::option::Option<i32>,
pub(crate) bisect_batch_on_function_error: std::option::Option<bool>,
pub(crate) maximum_retry_attempts: std::option::Option<i32>,
pub(crate) parallelization_factor: std::option::Option<i32>,
pub(crate) source_access_configurations:
std::option::Option<std::vec::Vec<crate::model::SourceAccessConfiguration>>,
pub(crate) tumbling_window_in_seconds: std::option::Option<i32>,
pub(crate) function_response_types:
std::option::Option<std::vec::Vec<crate::model::FunctionResponseType>>,
pub(crate) scaling_config: std::option::Option<crate::model::ScalingConfig>,
}
impl Builder {
pub fn uuid(mut self, input: impl Into<std::string::String>) -> Self {
self.uuid = Some(input.into());
self
}
pub fn set_uuid(mut self, input: std::option::Option<std::string::String>) -> Self {
self.uuid = input;
self
}
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn enabled(mut self, input: bool) -> Self {
self.enabled = Some(input);
self
}
pub fn set_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.enabled = input;
self
}
pub fn batch_size(mut self, input: i32) -> Self {
self.batch_size = Some(input);
self
}
pub fn set_batch_size(mut self, input: std::option::Option<i32>) -> Self {
self.batch_size = input;
self
}
pub fn filter_criteria(mut self, input: crate::model::FilterCriteria) -> Self {
self.filter_criteria = Some(input);
self
}
pub fn set_filter_criteria(
mut self,
input: std::option::Option<crate::model::FilterCriteria>,
) -> Self {
self.filter_criteria = input;
self
}
pub fn maximum_batching_window_in_seconds(mut self, input: i32) -> Self {
self.maximum_batching_window_in_seconds = Some(input);
self
}
pub fn set_maximum_batching_window_in_seconds(
mut self,
input: std::option::Option<i32>,
) -> Self {
self.maximum_batching_window_in_seconds = input;
self
}
pub fn destination_config(mut self, input: crate::model::DestinationConfig) -> Self {
self.destination_config = Some(input);
self
}
pub fn set_destination_config(
mut self,
input: std::option::Option<crate::model::DestinationConfig>,
) -> Self {
self.destination_config = input;
self
}
pub fn maximum_record_age_in_seconds(mut self, input: i32) -> Self {
self.maximum_record_age_in_seconds = Some(input);
self
}
pub fn set_maximum_record_age_in_seconds(
mut self,
input: std::option::Option<i32>,
) -> Self {
self.maximum_record_age_in_seconds = input;
self
}
pub fn bisect_batch_on_function_error(mut self, input: bool) -> Self {
self.bisect_batch_on_function_error = Some(input);
self
}
pub fn set_bisect_batch_on_function_error(
mut self,
input: std::option::Option<bool>,
) -> Self {
self.bisect_batch_on_function_error = input;
self
}
pub fn maximum_retry_attempts(mut self, input: i32) -> Self {
self.maximum_retry_attempts = Some(input);
self
}
pub fn set_maximum_retry_attempts(mut self, input: std::option::Option<i32>) -> Self {
self.maximum_retry_attempts = input;
self
}
pub fn parallelization_factor(mut self, input: i32) -> Self {
self.parallelization_factor = Some(input);
self
}
pub fn set_parallelization_factor(mut self, input: std::option::Option<i32>) -> Self {
self.parallelization_factor = input;
self
}
pub fn source_access_configurations(
mut self,
input: crate::model::SourceAccessConfiguration,
) -> Self {
let mut v = self.source_access_configurations.unwrap_or_default();
v.push(input);
self.source_access_configurations = Some(v);
self
}
pub fn set_source_access_configurations(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::SourceAccessConfiguration>>,
) -> Self {
self.source_access_configurations = input;
self
}
pub fn tumbling_window_in_seconds(mut self, input: i32) -> Self {
self.tumbling_window_in_seconds = Some(input);
self
}
pub fn set_tumbling_window_in_seconds(mut self, input: std::option::Option<i32>) -> Self {
self.tumbling_window_in_seconds = input;
self
}
pub fn function_response_types(
mut self,
input: crate::model::FunctionResponseType,
) -> Self {
let mut v = self.function_response_types.unwrap_or_default();
v.push(input);
self.function_response_types = Some(v);
self
}
pub fn set_function_response_types(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::FunctionResponseType>>,
) -> Self {
self.function_response_types = input;
self
}
pub fn scaling_config(mut self, input: crate::model::ScalingConfig) -> Self {
self.scaling_config = Some(input);
self
}
pub fn set_scaling_config(
mut self,
input: std::option::Option<crate::model::ScalingConfig>,
) -> Self {
self.scaling_config = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateEventSourceMappingInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateEventSourceMappingInput {
uuid: self.uuid,
function_name: self.function_name,
enabled: self.enabled,
batch_size: self.batch_size,
filter_criteria: self.filter_criteria,
maximum_batching_window_in_seconds: self.maximum_batching_window_in_seconds,
destination_config: self.destination_config,
maximum_record_age_in_seconds: self.maximum_record_age_in_seconds,
bisect_batch_on_function_error: self.bisect_batch_on_function_error,
maximum_retry_attempts: self.maximum_retry_attempts,
parallelization_factor: self.parallelization_factor,
source_access_configurations: self.source_access_configurations,
tumbling_window_in_seconds: self.tumbling_window_in_seconds,
function_response_types: self.function_response_types,
scaling_config: self.scaling_config,
})
}
}
}
impl UpdateEventSourceMappingInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateEventSourceMapping,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateEventSourceMappingInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_117 = &_input.uuid;
let input_117 = input_117.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"uuid",
"cannot be empty or unset",
)
})?;
let uuid = aws_smithy_http::label::fmt_string(
input_117,
aws_smithy_http::label::EncodingStrategy::Default,
);
if uuid.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"uuid",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/event-source-mappings/{UUID}",
UUID = uuid
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateEventSourceMappingInput,
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)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_event_source_mapping(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateEventSourceMapping::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateEventSourceMapping",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_event_source_mapping_input::Builder {
crate::input::update_event_source_mapping_input::Builder::default()
}
}
pub mod update_function_code_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) zip_file: std::option::Option<aws_smithy_types::Blob>,
pub(crate) s3_bucket: std::option::Option<std::string::String>,
pub(crate) s3_key: std::option::Option<std::string::String>,
pub(crate) s3_object_version: std::option::Option<std::string::String>,
pub(crate) image_uri: std::option::Option<std::string::String>,
pub(crate) publish: std::option::Option<bool>,
pub(crate) dry_run: std::option::Option<bool>,
pub(crate) revision_id: std::option::Option<std::string::String>,
pub(crate) architectures: std::option::Option<std::vec::Vec<crate::model::Architecture>>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn zip_file(mut self, input: aws_smithy_types::Blob) -> Self {
self.zip_file = Some(input);
self
}
pub fn set_zip_file(mut self, input: std::option::Option<aws_smithy_types::Blob>) -> Self {
self.zip_file = input;
self
}
pub fn s3_bucket(mut self, input: impl Into<std::string::String>) -> Self {
self.s3_bucket = Some(input.into());
self
}
pub fn set_s3_bucket(mut self, input: std::option::Option<std::string::String>) -> Self {
self.s3_bucket = input;
self
}
pub fn s3_key(mut self, input: impl Into<std::string::String>) -> Self {
self.s3_key = Some(input.into());
self
}
pub fn set_s3_key(mut self, input: std::option::Option<std::string::String>) -> Self {
self.s3_key = input;
self
}
pub fn s3_object_version(mut self, input: impl Into<std::string::String>) -> Self {
self.s3_object_version = Some(input.into());
self
}
pub fn set_s3_object_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.s3_object_version = input;
self
}
pub fn image_uri(mut self, input: impl Into<std::string::String>) -> Self {
self.image_uri = Some(input.into());
self
}
pub fn set_image_uri(mut self, input: std::option::Option<std::string::String>) -> Self {
self.image_uri = input;
self
}
pub fn publish(mut self, input: bool) -> Self {
self.publish = Some(input);
self
}
pub fn set_publish(mut self, input: std::option::Option<bool>) -> Self {
self.publish = input;
self
}
pub fn dry_run(mut self, input: bool) -> Self {
self.dry_run = Some(input);
self
}
pub fn set_dry_run(mut self, input: std::option::Option<bool>) -> Self {
self.dry_run = input;
self
}
pub fn revision_id(mut self, input: impl Into<std::string::String>) -> Self {
self.revision_id = Some(input.into());
self
}
pub fn set_revision_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.revision_id = input;
self
}
pub fn architectures(mut self, input: crate::model::Architecture) -> Self {
let mut v = self.architectures.unwrap_or_default();
v.push(input);
self.architectures = Some(v);
self
}
pub fn set_architectures(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Architecture>>,
) -> Self {
self.architectures = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateFunctionCodeInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateFunctionCodeInput {
function_name: self.function_name,
zip_file: self.zip_file,
s3_bucket: self.s3_bucket,
s3_key: self.s3_key,
s3_object_version: self.s3_object_version,
image_uri: self.image_uri,
publish: self.publish.unwrap_or_default(),
dry_run: self.dry_run.unwrap_or_default(),
revision_id: self.revision_id,
architectures: self.architectures,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("function_name", &self.function_name);
formatter.field("zip_file", &"*** Sensitive Data Redacted ***");
formatter.field("s3_bucket", &self.s3_bucket);
formatter.field("s3_key", &self.s3_key);
formatter.field("s3_object_version", &self.s3_object_version);
formatter.field("image_uri", &self.image_uri);
formatter.field("publish", &self.publish);
formatter.field("dry_run", &self.dry_run);
formatter.field("revision_id", &self.revision_id);
formatter.field("architectures", &self.architectures);
formatter.finish()
}
}
}
impl UpdateFunctionCodeInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateFunctionCode,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateFunctionCodeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_118 = &_input.function_name;
let input_118 = input_118.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_118,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/functions/{FunctionName}/code",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateFunctionCodeInput,
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)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_function_code(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateFunctionCode::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateFunctionCode",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_function_code_input::Builder {
crate::input::update_function_code_input::Builder::default()
}
}
pub mod update_function_configuration_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) role: std::option::Option<std::string::String>,
pub(crate) handler: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) timeout: std::option::Option<i32>,
pub(crate) memory_size: std::option::Option<i32>,
pub(crate) vpc_config: std::option::Option<crate::model::VpcConfig>,
pub(crate) environment: std::option::Option<crate::model::Environment>,
pub(crate) runtime: std::option::Option<crate::model::Runtime>,
pub(crate) dead_letter_config: std::option::Option<crate::model::DeadLetterConfig>,
pub(crate) kms_key_arn: std::option::Option<std::string::String>,
pub(crate) tracing_config: std::option::Option<crate::model::TracingConfig>,
pub(crate) revision_id: std::option::Option<std::string::String>,
pub(crate) layers: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) file_system_configs:
std::option::Option<std::vec::Vec<crate::model::FileSystemConfig>>,
pub(crate) image_config: std::option::Option<crate::model::ImageConfig>,
pub(crate) ephemeral_storage: std::option::Option<crate::model::EphemeralStorage>,
pub(crate) snap_start: std::option::Option<crate::model::SnapStart>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn role(mut self, input: impl Into<std::string::String>) -> Self {
self.role = Some(input.into());
self
}
pub fn set_role(mut self, input: std::option::Option<std::string::String>) -> Self {
self.role = input;
self
}
pub fn handler(mut self, input: impl Into<std::string::String>) -> Self {
self.handler = Some(input.into());
self
}
pub fn set_handler(mut self, input: std::option::Option<std::string::String>) -> Self {
self.handler = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn timeout(mut self, input: i32) -> Self {
self.timeout = Some(input);
self
}
pub fn set_timeout(mut self, input: std::option::Option<i32>) -> Self {
self.timeout = input;
self
}
pub fn memory_size(mut self, input: i32) -> Self {
self.memory_size = Some(input);
self
}
pub fn set_memory_size(mut self, input: std::option::Option<i32>) -> Self {
self.memory_size = input;
self
}
pub fn vpc_config(mut self, input: crate::model::VpcConfig) -> Self {
self.vpc_config = Some(input);
self
}
pub fn set_vpc_config(
mut self,
input: std::option::Option<crate::model::VpcConfig>,
) -> Self {
self.vpc_config = input;
self
}
pub fn environment(mut self, input: crate::model::Environment) -> Self {
self.environment = Some(input);
self
}
pub fn set_environment(
mut self,
input: std::option::Option<crate::model::Environment>,
) -> Self {
self.environment = input;
self
}
pub fn runtime(mut self, input: crate::model::Runtime) -> Self {
self.runtime = Some(input);
self
}
pub fn set_runtime(mut self, input: std::option::Option<crate::model::Runtime>) -> Self {
self.runtime = input;
self
}
pub fn dead_letter_config(mut self, input: crate::model::DeadLetterConfig) -> Self {
self.dead_letter_config = Some(input);
self
}
pub fn set_dead_letter_config(
mut self,
input: std::option::Option<crate::model::DeadLetterConfig>,
) -> Self {
self.dead_letter_config = input;
self
}
pub fn kms_key_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.kms_key_arn = Some(input.into());
self
}
pub fn set_kms_key_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.kms_key_arn = input;
self
}
pub fn tracing_config(mut self, input: crate::model::TracingConfig) -> Self {
self.tracing_config = Some(input);
self
}
pub fn set_tracing_config(
mut self,
input: std::option::Option<crate::model::TracingConfig>,
) -> Self {
self.tracing_config = input;
self
}
pub fn revision_id(mut self, input: impl Into<std::string::String>) -> Self {
self.revision_id = Some(input.into());
self
}
pub fn set_revision_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.revision_id = input;
self
}
pub fn layers(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.layers.unwrap_or_default();
v.push(input.into());
self.layers = Some(v);
self
}
pub fn set_layers(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.layers = input;
self
}
pub fn file_system_configs(mut self, input: crate::model::FileSystemConfig) -> Self {
let mut v = self.file_system_configs.unwrap_or_default();
v.push(input);
self.file_system_configs = Some(v);
self
}
pub fn set_file_system_configs(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::FileSystemConfig>>,
) -> Self {
self.file_system_configs = input;
self
}
pub fn image_config(mut self, input: crate::model::ImageConfig) -> Self {
self.image_config = Some(input);
self
}
pub fn set_image_config(
mut self,
input: std::option::Option<crate::model::ImageConfig>,
) -> Self {
self.image_config = input;
self
}
pub fn ephemeral_storage(mut self, input: crate::model::EphemeralStorage) -> Self {
self.ephemeral_storage = Some(input);
self
}
pub fn set_ephemeral_storage(
mut self,
input: std::option::Option<crate::model::EphemeralStorage>,
) -> Self {
self.ephemeral_storage = input;
self
}
pub fn snap_start(mut self, input: crate::model::SnapStart) -> Self {
self.snap_start = Some(input);
self
}
pub fn set_snap_start(
mut self,
input: std::option::Option<crate::model::SnapStart>,
) -> Self {
self.snap_start = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateFunctionConfigurationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateFunctionConfigurationInput {
function_name: self.function_name,
role: self.role,
handler: self.handler,
description: self.description,
timeout: self.timeout,
memory_size: self.memory_size,
vpc_config: self.vpc_config,
environment: self.environment,
runtime: self.runtime,
dead_letter_config: self.dead_letter_config,
kms_key_arn: self.kms_key_arn,
tracing_config: self.tracing_config,
revision_id: self.revision_id,
layers: self.layers,
file_system_configs: self.file_system_configs,
image_config: self.image_config,
ephemeral_storage: self.ephemeral_storage,
snap_start: self.snap_start,
})
}
}
}
impl UpdateFunctionConfigurationInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateFunctionConfiguration,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateFunctionConfigurationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_119 = &_input.function_name;
let input_119 = input_119.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_119,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2015-03-31/functions/{FunctionName}/configuration",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateFunctionConfigurationInput,
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)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_function_configuration(&self)?
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateFunctionConfiguration::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateFunctionConfiguration",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_function_configuration_input::Builder {
crate::input::update_function_configuration_input::Builder::default()
}
}
pub mod update_function_event_invoke_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
pub(crate) maximum_retry_attempts: std::option::Option<i32>,
pub(crate) maximum_event_age_in_seconds: std::option::Option<i32>,
pub(crate) destination_config: std::option::Option<crate::model::DestinationConfig>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn maximum_retry_attempts(mut self, input: i32) -> Self {
self.maximum_retry_attempts = Some(input);
self
}
pub fn set_maximum_retry_attempts(mut self, input: std::option::Option<i32>) -> Self {
self.maximum_retry_attempts = input;
self
}
pub fn maximum_event_age_in_seconds(mut self, input: i32) -> Self {
self.maximum_event_age_in_seconds = Some(input);
self
}
pub fn set_maximum_event_age_in_seconds(mut self, input: std::option::Option<i32>) -> Self {
self.maximum_event_age_in_seconds = input;
self
}
pub fn destination_config(mut self, input: crate::model::DestinationConfig) -> Self {
self.destination_config = Some(input);
self
}
pub fn set_destination_config(
mut self,
input: std::option::Option<crate::model::DestinationConfig>,
) -> Self {
self.destination_config = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateFunctionEventInvokeConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateFunctionEventInvokeConfigInput {
function_name: self.function_name,
qualifier: self.qualifier,
maximum_retry_attempts: self.maximum_retry_attempts,
maximum_event_age_in_seconds: self.maximum_event_age_in_seconds,
destination_config: self.destination_config,
})
}
}
}
impl UpdateFunctionEventInvokeConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateFunctionEventInvokeConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateFunctionEventInvokeConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_120 = &_input.function_name;
let input_120 = input_120.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_120,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2019-09-25/functions/{FunctionName}/event-invoke-config",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::UpdateFunctionEventInvokeConfigInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_121) = &_input.qualifier {
{
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_121));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateFunctionEventInvokeConfigInput,
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)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_function_event_invoke_config(&self)?
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateFunctionEventInvokeConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateFunctionEventInvokeConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_function_event_invoke_config_input::Builder {
crate::input::update_function_event_invoke_config_input::Builder::default()
}
}
pub mod update_function_url_config_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) function_name: std::option::Option<std::string::String>,
pub(crate) qualifier: std::option::Option<std::string::String>,
pub(crate) auth_type: std::option::Option<crate::model::FunctionUrlAuthType>,
pub(crate) cors: std::option::Option<crate::model::Cors>,
}
impl Builder {
pub fn function_name(mut self, input: impl Into<std::string::String>) -> Self {
self.function_name = Some(input.into());
self
}
pub fn set_function_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_name = input;
self
}
pub fn qualifier(mut self, input: impl Into<std::string::String>) -> Self {
self.qualifier = Some(input.into());
self
}
pub fn set_qualifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.qualifier = input;
self
}
pub fn auth_type(mut self, input: crate::model::FunctionUrlAuthType) -> Self {
self.auth_type = Some(input);
self
}
pub fn set_auth_type(
mut self,
input: std::option::Option<crate::model::FunctionUrlAuthType>,
) -> Self {
self.auth_type = input;
self
}
pub fn cors(mut self, input: crate::model::Cors) -> Self {
self.cors = Some(input);
self
}
pub fn set_cors(mut self, input: std::option::Option<crate::model::Cors>) -> Self {
self.cors = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateFunctionUrlConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateFunctionUrlConfigInput {
function_name: self.function_name,
qualifier: self.qualifier,
auth_type: self.auth_type,
cors: self.cors,
})
}
}
}
impl UpdateFunctionUrlConfigInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateFunctionUrlConfig,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateFunctionUrlConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_122 = &_input.function_name;
let input_122 = input_122.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
)
})?;
let function_name = aws_smithy_http::label::fmt_string(
input_122,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/2021-10-31/functions/{FunctionName}/url",
FunctionName = function_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::UpdateFunctionUrlConfigInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_123) = &_input.qualifier {
{
query.push_kv("Qualifier", &aws_smithy_http::query::fmt_string(&inner_123));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateFunctionUrlConfigInput,
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)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_function_url_config(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
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(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
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();
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()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateFunctionUrlConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateFunctionUrlConfig",
"lambda",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_function_url_config_input::Builder {
crate::input::update_function_url_config_input::Builder::default()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateFunctionUrlConfigInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub auth_type: std::option::Option<crate::model::FunctionUrlAuthType>,
#[doc(hidden)]
pub cors: std::option::Option<crate::model::Cors>,
}
impl UpdateFunctionUrlConfigInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
pub fn auth_type(&self) -> std::option::Option<&crate::model::FunctionUrlAuthType> {
self.auth_type.as_ref()
}
pub fn cors(&self) -> std::option::Option<&crate::model::Cors> {
self.cors.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateFunctionEventInvokeConfigInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub maximum_retry_attempts: std::option::Option<i32>,
#[doc(hidden)]
pub maximum_event_age_in_seconds: std::option::Option<i32>,
#[doc(hidden)]
pub destination_config: std::option::Option<crate::model::DestinationConfig>,
}
impl UpdateFunctionEventInvokeConfigInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
pub fn maximum_retry_attempts(&self) -> std::option::Option<i32> {
self.maximum_retry_attempts
}
pub fn maximum_event_age_in_seconds(&self) -> std::option::Option<i32> {
self.maximum_event_age_in_seconds
}
pub fn destination_config(&self) -> std::option::Option<&crate::model::DestinationConfig> {
self.destination_config.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateFunctionConfigurationInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub role: std::option::Option<std::string::String>,
#[doc(hidden)]
pub handler: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub timeout: std::option::Option<i32>,
#[doc(hidden)]
pub memory_size: std::option::Option<i32>,
#[doc(hidden)]
pub vpc_config: std::option::Option<crate::model::VpcConfig>,
#[doc(hidden)]
pub environment: std::option::Option<crate::model::Environment>,
#[doc(hidden)]
pub runtime: std::option::Option<crate::model::Runtime>,
#[doc(hidden)]
pub dead_letter_config: std::option::Option<crate::model::DeadLetterConfig>,
#[doc(hidden)]
pub kms_key_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tracing_config: std::option::Option<crate::model::TracingConfig>,
#[doc(hidden)]
pub revision_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub layers: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub file_system_configs: std::option::Option<std::vec::Vec<crate::model::FileSystemConfig>>,
#[doc(hidden)]
pub image_config: std::option::Option<crate::model::ImageConfig>,
#[doc(hidden)]
pub ephemeral_storage: std::option::Option<crate::model::EphemeralStorage>,
#[doc(hidden)]
pub snap_start: std::option::Option<crate::model::SnapStart>,
}
impl UpdateFunctionConfigurationInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn role(&self) -> std::option::Option<&str> {
self.role.as_deref()
}
pub fn handler(&self) -> std::option::Option<&str> {
self.handler.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn timeout(&self) -> std::option::Option<i32> {
self.timeout
}
pub fn memory_size(&self) -> std::option::Option<i32> {
self.memory_size
}
pub fn vpc_config(&self) -> std::option::Option<&crate::model::VpcConfig> {
self.vpc_config.as_ref()
}
pub fn environment(&self) -> std::option::Option<&crate::model::Environment> {
self.environment.as_ref()
}
pub fn runtime(&self) -> std::option::Option<&crate::model::Runtime> {
self.runtime.as_ref()
}
pub fn dead_letter_config(&self) -> std::option::Option<&crate::model::DeadLetterConfig> {
self.dead_letter_config.as_ref()
}
pub fn kms_key_arn(&self) -> std::option::Option<&str> {
self.kms_key_arn.as_deref()
}
pub fn tracing_config(&self) -> std::option::Option<&crate::model::TracingConfig> {
self.tracing_config.as_ref()
}
pub fn revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
pub fn layers(&self) -> std::option::Option<&[std::string::String]> {
self.layers.as_deref()
}
pub fn file_system_configs(&self) -> std::option::Option<&[crate::model::FileSystemConfig]> {
self.file_system_configs.as_deref()
}
pub fn image_config(&self) -> std::option::Option<&crate::model::ImageConfig> {
self.image_config.as_ref()
}
pub fn ephemeral_storage(&self) -> std::option::Option<&crate::model::EphemeralStorage> {
self.ephemeral_storage.as_ref()
}
pub fn snap_start(&self) -> std::option::Option<&crate::model::SnapStart> {
self.snap_start.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UpdateFunctionCodeInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub zip_file: std::option::Option<aws_smithy_types::Blob>,
#[doc(hidden)]
pub s3_bucket: std::option::Option<std::string::String>,
#[doc(hidden)]
pub s3_key: std::option::Option<std::string::String>,
#[doc(hidden)]
pub s3_object_version: std::option::Option<std::string::String>,
#[doc(hidden)]
pub image_uri: std::option::Option<std::string::String>,
#[doc(hidden)]
pub publish: bool,
#[doc(hidden)]
pub dry_run: bool,
#[doc(hidden)]
pub revision_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub architectures: std::option::Option<std::vec::Vec<crate::model::Architecture>>,
}
impl UpdateFunctionCodeInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn zip_file(&self) -> std::option::Option<&aws_smithy_types::Blob> {
self.zip_file.as_ref()
}
pub fn s3_bucket(&self) -> std::option::Option<&str> {
self.s3_bucket.as_deref()
}
pub fn s3_key(&self) -> std::option::Option<&str> {
self.s3_key.as_deref()
}
pub fn s3_object_version(&self) -> std::option::Option<&str> {
self.s3_object_version.as_deref()
}
pub fn image_uri(&self) -> std::option::Option<&str> {
self.image_uri.as_deref()
}
pub fn publish(&self) -> bool {
self.publish
}
pub fn dry_run(&self) -> bool {
self.dry_run
}
pub fn revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
pub fn architectures(&self) -> std::option::Option<&[crate::model::Architecture]> {
self.architectures.as_deref()
}
}
impl std::fmt::Debug for UpdateFunctionCodeInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UpdateFunctionCodeInput");
formatter.field("function_name", &self.function_name);
formatter.field("zip_file", &"*** Sensitive Data Redacted ***");
formatter.field("s3_bucket", &self.s3_bucket);
formatter.field("s3_key", &self.s3_key);
formatter.field("s3_object_version", &self.s3_object_version);
formatter.field("image_uri", &self.image_uri);
formatter.field("publish", &self.publish);
formatter.field("dry_run", &self.dry_run);
formatter.field("revision_id", &self.revision_id);
formatter.field("architectures", &self.architectures);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateEventSourceMappingInput {
#[doc(hidden)]
pub uuid: std::option::Option<std::string::String>,
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub enabled: std::option::Option<bool>,
#[doc(hidden)]
pub batch_size: std::option::Option<i32>,
#[doc(hidden)]
pub filter_criteria: std::option::Option<crate::model::FilterCriteria>,
#[doc(hidden)]
pub maximum_batching_window_in_seconds: std::option::Option<i32>,
#[doc(hidden)]
pub destination_config: std::option::Option<crate::model::DestinationConfig>,
#[doc(hidden)]
pub maximum_record_age_in_seconds: std::option::Option<i32>,
#[doc(hidden)]
pub bisect_batch_on_function_error: std::option::Option<bool>,
#[doc(hidden)]
pub maximum_retry_attempts: std::option::Option<i32>,
#[doc(hidden)]
pub parallelization_factor: std::option::Option<i32>,
#[doc(hidden)]
pub source_access_configurations:
std::option::Option<std::vec::Vec<crate::model::SourceAccessConfiguration>>,
#[doc(hidden)]
pub tumbling_window_in_seconds: std::option::Option<i32>,
#[doc(hidden)]
pub function_response_types:
std::option::Option<std::vec::Vec<crate::model::FunctionResponseType>>,
#[doc(hidden)]
pub scaling_config: std::option::Option<crate::model::ScalingConfig>,
}
impl UpdateEventSourceMappingInput {
pub fn uuid(&self) -> std::option::Option<&str> {
self.uuid.as_deref()
}
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn enabled(&self) -> std::option::Option<bool> {
self.enabled
}
pub fn batch_size(&self) -> std::option::Option<i32> {
self.batch_size
}
pub fn filter_criteria(&self) -> std::option::Option<&crate::model::FilterCriteria> {
self.filter_criteria.as_ref()
}
pub fn maximum_batching_window_in_seconds(&self) -> std::option::Option<i32> {
self.maximum_batching_window_in_seconds
}
pub fn destination_config(&self) -> std::option::Option<&crate::model::DestinationConfig> {
self.destination_config.as_ref()
}
pub fn maximum_record_age_in_seconds(&self) -> std::option::Option<i32> {
self.maximum_record_age_in_seconds
}
pub fn bisect_batch_on_function_error(&self) -> std::option::Option<bool> {
self.bisect_batch_on_function_error
}
pub fn maximum_retry_attempts(&self) -> std::option::Option<i32> {
self.maximum_retry_attempts
}
pub fn parallelization_factor(&self) -> std::option::Option<i32> {
self.parallelization_factor
}
pub fn source_access_configurations(
&self,
) -> std::option::Option<&[crate::model::SourceAccessConfiguration]> {
self.source_access_configurations.as_deref()
}
pub fn tumbling_window_in_seconds(&self) -> std::option::Option<i32> {
self.tumbling_window_in_seconds
}
pub fn function_response_types(
&self,
) -> std::option::Option<&[crate::model::FunctionResponseType]> {
self.function_response_types.as_deref()
}
pub fn scaling_config(&self) -> std::option::Option<&crate::model::ScalingConfig> {
self.scaling_config.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateCodeSigningConfigInput {
#[doc(hidden)]
pub code_signing_config_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub allowed_publishers: std::option::Option<crate::model::AllowedPublishers>,
#[doc(hidden)]
pub code_signing_policies: std::option::Option<crate::model::CodeSigningPolicies>,
}
impl UpdateCodeSigningConfigInput {
pub fn code_signing_config_arn(&self) -> std::option::Option<&str> {
self.code_signing_config_arn.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn allowed_publishers(&self) -> std::option::Option<&crate::model::AllowedPublishers> {
self.allowed_publishers.as_ref()
}
pub fn code_signing_policies(&self) -> std::option::Option<&crate::model::CodeSigningPolicies> {
self.code_signing_policies.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateAliasInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub function_version: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub routing_config: std::option::Option<crate::model::AliasRoutingConfiguration>,
#[doc(hidden)]
pub revision_id: std::option::Option<std::string::String>,
}
impl UpdateAliasInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn function_version(&self) -> std::option::Option<&str> {
self.function_version.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn routing_config(&self) -> std::option::Option<&crate::model::AliasRoutingConfiguration> {
self.routing_config.as_ref()
}
pub fn revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UntagResourceInput {
#[doc(hidden)]
pub resource: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tag_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl UntagResourceInput {
pub fn resource(&self) -> std::option::Option<&str> {
self.resource.as_deref()
}
pub fn tag_keys(&self) -> std::option::Option<&[std::string::String]> {
self.tag_keys.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct TagResourceInput {
#[doc(hidden)]
pub resource: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl TagResourceInput {
pub fn resource(&self) -> std::option::Option<&str> {
self.resource.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RemovePermissionInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub statement_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub revision_id: std::option::Option<std::string::String>,
}
impl RemovePermissionInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn statement_id(&self) -> std::option::Option<&str> {
self.statement_id.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
pub fn revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RemoveLayerVersionPermissionInput {
#[doc(hidden)]
pub layer_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub version_number: i64,
#[doc(hidden)]
pub statement_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub revision_id: std::option::Option<std::string::String>,
}
impl RemoveLayerVersionPermissionInput {
pub fn layer_name(&self) -> std::option::Option<&str> {
self.layer_name.as_deref()
}
pub fn version_number(&self) -> i64 {
self.version_number
}
pub fn statement_id(&self) -> std::option::Option<&str> {
self.statement_id.as_deref()
}
pub fn revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PutRuntimeManagementConfigInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub update_runtime_on: std::option::Option<crate::model::UpdateRuntimeOn>,
#[doc(hidden)]
pub runtime_version_arn: std::option::Option<std::string::String>,
}
impl PutRuntimeManagementConfigInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
pub fn update_runtime_on(&self) -> std::option::Option<&crate::model::UpdateRuntimeOn> {
self.update_runtime_on.as_ref()
}
pub fn runtime_version_arn(&self) -> std::option::Option<&str> {
self.runtime_version_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PutProvisionedConcurrencyConfigInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub provisioned_concurrent_executions: std::option::Option<i32>,
}
impl PutProvisionedConcurrencyConfigInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
pub fn provisioned_concurrent_executions(&self) -> std::option::Option<i32> {
self.provisioned_concurrent_executions
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PutFunctionEventInvokeConfigInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub maximum_retry_attempts: std::option::Option<i32>,
#[doc(hidden)]
pub maximum_event_age_in_seconds: std::option::Option<i32>,
#[doc(hidden)]
pub destination_config: std::option::Option<crate::model::DestinationConfig>,
}
impl PutFunctionEventInvokeConfigInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
pub fn maximum_retry_attempts(&self) -> std::option::Option<i32> {
self.maximum_retry_attempts
}
pub fn maximum_event_age_in_seconds(&self) -> std::option::Option<i32> {
self.maximum_event_age_in_seconds
}
pub fn destination_config(&self) -> std::option::Option<&crate::model::DestinationConfig> {
self.destination_config.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PutFunctionConcurrencyInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub reserved_concurrent_executions: std::option::Option<i32>,
}
impl PutFunctionConcurrencyInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn reserved_concurrent_executions(&self) -> std::option::Option<i32> {
self.reserved_concurrent_executions
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PutFunctionCodeSigningConfigInput {
#[doc(hidden)]
pub code_signing_config_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
}
impl PutFunctionCodeSigningConfigInput {
pub fn code_signing_config_arn(&self) -> std::option::Option<&str> {
self.code_signing_config_arn.as_deref()
}
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PublishVersionInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub code_sha256: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub revision_id: std::option::Option<std::string::String>,
}
impl PublishVersionInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn code_sha256(&self) -> std::option::Option<&str> {
self.code_sha256.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PublishLayerVersionInput {
#[doc(hidden)]
pub layer_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub content: std::option::Option<crate::model::LayerVersionContentInput>,
#[doc(hidden)]
pub compatible_runtimes: std::option::Option<std::vec::Vec<crate::model::Runtime>>,
#[doc(hidden)]
pub license_info: std::option::Option<std::string::String>,
#[doc(hidden)]
pub compatible_architectures: std::option::Option<std::vec::Vec<crate::model::Architecture>>,
}
impl PublishLayerVersionInput {
pub fn layer_name(&self) -> std::option::Option<&str> {
self.layer_name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn content(&self) -> std::option::Option<&crate::model::LayerVersionContentInput> {
self.content.as_ref()
}
pub fn compatible_runtimes(&self) -> std::option::Option<&[crate::model::Runtime]> {
self.compatible_runtimes.as_deref()
}
pub fn license_info(&self) -> std::option::Option<&str> {
self.license_info.as_deref()
}
pub fn compatible_architectures(&self) -> std::option::Option<&[crate::model::Architecture]> {
self.compatible_architectures.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListVersionsByFunctionInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub marker: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_items: std::option::Option<i32>,
}
impl ListVersionsByFunctionInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn marker(&self) -> std::option::Option<&str> {
self.marker.as_deref()
}
pub fn max_items(&self) -> std::option::Option<i32> {
self.max_items
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListTagsInput {
#[doc(hidden)]
pub resource: std::option::Option<std::string::String>,
}
impl ListTagsInput {
pub fn resource(&self) -> std::option::Option<&str> {
self.resource.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListProvisionedConcurrencyConfigsInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub marker: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_items: std::option::Option<i32>,
}
impl ListProvisionedConcurrencyConfigsInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn marker(&self) -> std::option::Option<&str> {
self.marker.as_deref()
}
pub fn max_items(&self) -> std::option::Option<i32> {
self.max_items
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListLayerVersionsInput {
#[doc(hidden)]
pub compatible_runtime: std::option::Option<crate::model::Runtime>,
#[doc(hidden)]
pub layer_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub marker: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_items: std::option::Option<i32>,
#[doc(hidden)]
pub compatible_architecture: std::option::Option<crate::model::Architecture>,
}
impl ListLayerVersionsInput {
pub fn compatible_runtime(&self) -> std::option::Option<&crate::model::Runtime> {
self.compatible_runtime.as_ref()
}
pub fn layer_name(&self) -> std::option::Option<&str> {
self.layer_name.as_deref()
}
pub fn marker(&self) -> std::option::Option<&str> {
self.marker.as_deref()
}
pub fn max_items(&self) -> std::option::Option<i32> {
self.max_items
}
pub fn compatible_architecture(&self) -> std::option::Option<&crate::model::Architecture> {
self.compatible_architecture.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListLayersInput {
#[doc(hidden)]
pub compatible_runtime: std::option::Option<crate::model::Runtime>,
#[doc(hidden)]
pub marker: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_items: std::option::Option<i32>,
#[doc(hidden)]
pub compatible_architecture: std::option::Option<crate::model::Architecture>,
}
impl ListLayersInput {
pub fn compatible_runtime(&self) -> std::option::Option<&crate::model::Runtime> {
self.compatible_runtime.as_ref()
}
pub fn marker(&self) -> std::option::Option<&str> {
self.marker.as_deref()
}
pub fn max_items(&self) -> std::option::Option<i32> {
self.max_items
}
pub fn compatible_architecture(&self) -> std::option::Option<&crate::model::Architecture> {
self.compatible_architecture.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListFunctionUrlConfigsInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub marker: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_items: std::option::Option<i32>,
}
impl ListFunctionUrlConfigsInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn marker(&self) -> std::option::Option<&str> {
self.marker.as_deref()
}
pub fn max_items(&self) -> std::option::Option<i32> {
self.max_items
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListFunctionsByCodeSigningConfigInput {
#[doc(hidden)]
pub code_signing_config_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub marker: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_items: std::option::Option<i32>,
}
impl ListFunctionsByCodeSigningConfigInput {
pub fn code_signing_config_arn(&self) -> std::option::Option<&str> {
self.code_signing_config_arn.as_deref()
}
pub fn marker(&self) -> std::option::Option<&str> {
self.marker.as_deref()
}
pub fn max_items(&self) -> std::option::Option<i32> {
self.max_items
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListFunctionsInput {
#[doc(hidden)]
pub master_region: std::option::Option<std::string::String>,
#[doc(hidden)]
pub function_version: std::option::Option<crate::model::FunctionVersion>,
#[doc(hidden)]
pub marker: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_items: std::option::Option<i32>,
}
impl ListFunctionsInput {
pub fn master_region(&self) -> std::option::Option<&str> {
self.master_region.as_deref()
}
pub fn function_version(&self) -> std::option::Option<&crate::model::FunctionVersion> {
self.function_version.as_ref()
}
pub fn marker(&self) -> std::option::Option<&str> {
self.marker.as_deref()
}
pub fn max_items(&self) -> std::option::Option<i32> {
self.max_items
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListFunctionEventInvokeConfigsInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub marker: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_items: std::option::Option<i32>,
}
impl ListFunctionEventInvokeConfigsInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn marker(&self) -> std::option::Option<&str> {
self.marker.as_deref()
}
pub fn max_items(&self) -> std::option::Option<i32> {
self.max_items
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListEventSourceMappingsInput {
#[doc(hidden)]
pub event_source_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub marker: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_items: std::option::Option<i32>,
}
impl ListEventSourceMappingsInput {
pub fn event_source_arn(&self) -> std::option::Option<&str> {
self.event_source_arn.as_deref()
}
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn marker(&self) -> std::option::Option<&str> {
self.marker.as_deref()
}
pub fn max_items(&self) -> std::option::Option<i32> {
self.max_items
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListCodeSigningConfigsInput {
#[doc(hidden)]
pub marker: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_items: std::option::Option<i32>,
}
impl ListCodeSigningConfigsInput {
pub fn marker(&self) -> std::option::Option<&str> {
self.marker.as_deref()
}
pub fn max_items(&self) -> std::option::Option<i32> {
self.max_items
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListAliasesInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub function_version: std::option::Option<std::string::String>,
#[doc(hidden)]
pub marker: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_items: std::option::Option<i32>,
}
impl ListAliasesInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn function_version(&self) -> std::option::Option<&str> {
self.function_version.as_deref()
}
pub fn marker(&self) -> std::option::Option<&str> {
self.marker.as_deref()
}
pub fn max_items(&self) -> std::option::Option<i32> {
self.max_items
}
}
#[allow(missing_docs)] #[deprecated]
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct InvokeAsyncInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
pub invoke_args: aws_smithy_http::byte_stream::ByteStream,
}
impl InvokeAsyncInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn invoke_args(&self) -> &aws_smithy_http::byte_stream::ByteStream {
&self.invoke_args
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InvokeInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub invocation_type: std::option::Option<crate::model::InvocationType>,
#[doc(hidden)]
pub log_type: std::option::Option<crate::model::LogType>,
#[doc(hidden)]
pub client_context: std::option::Option<std::string::String>,
#[doc(hidden)]
pub payload: std::option::Option<aws_smithy_types::Blob>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
}
impl InvokeInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn invocation_type(&self) -> std::option::Option<&crate::model::InvocationType> {
self.invocation_type.as_ref()
}
pub fn log_type(&self) -> std::option::Option<&crate::model::LogType> {
self.log_type.as_ref()
}
pub fn client_context(&self) -> std::option::Option<&str> {
self.client_context.as_deref()
}
pub fn payload(&self) -> std::option::Option<&aws_smithy_types::Blob> {
self.payload.as_ref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
}
impl std::fmt::Debug for InvokeInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InvokeInput");
formatter.field("function_name", &self.function_name);
formatter.field("invocation_type", &self.invocation_type);
formatter.field("log_type", &self.log_type);
formatter.field("client_context", &self.client_context);
formatter.field("payload", &"*** Sensitive Data Redacted ***");
formatter.field("qualifier", &self.qualifier);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetRuntimeManagementConfigInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
}
impl GetRuntimeManagementConfigInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetProvisionedConcurrencyConfigInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
}
impl GetProvisionedConcurrencyConfigInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetPolicyInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
}
impl GetPolicyInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetLayerVersionPolicyInput {
#[doc(hidden)]
pub layer_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub version_number: i64,
}
impl GetLayerVersionPolicyInput {
pub fn layer_name(&self) -> std::option::Option<&str> {
self.layer_name.as_deref()
}
pub fn version_number(&self) -> i64 {
self.version_number
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetLayerVersionByArnInput {
#[doc(hidden)]
pub arn: std::option::Option<std::string::String>,
}
impl GetLayerVersionByArnInput {
pub fn arn(&self) -> std::option::Option<&str> {
self.arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetLayerVersionInput {
#[doc(hidden)]
pub layer_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub version_number: i64,
}
impl GetLayerVersionInput {
pub fn layer_name(&self) -> std::option::Option<&str> {
self.layer_name.as_deref()
}
pub fn version_number(&self) -> i64 {
self.version_number
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetFunctionUrlConfigInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
}
impl GetFunctionUrlConfigInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetFunctionEventInvokeConfigInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
}
impl GetFunctionEventInvokeConfigInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetFunctionConfigurationInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
}
impl GetFunctionConfigurationInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetFunctionConcurrencyInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
}
impl GetFunctionConcurrencyInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetFunctionCodeSigningConfigInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
}
impl GetFunctionCodeSigningConfigInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetFunctionInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
}
impl GetFunctionInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetEventSourceMappingInput {
#[doc(hidden)]
pub uuid: std::option::Option<std::string::String>,
}
impl GetEventSourceMappingInput {
pub fn uuid(&self) -> std::option::Option<&str> {
self.uuid.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetCodeSigningConfigInput {
#[doc(hidden)]
pub code_signing_config_arn: std::option::Option<std::string::String>,
}
impl GetCodeSigningConfigInput {
pub fn code_signing_config_arn(&self) -> std::option::Option<&str> {
self.code_signing_config_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetAliasInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
}
impl GetAliasInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetAccountSettingsInput {}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteProvisionedConcurrencyConfigInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
}
impl DeleteProvisionedConcurrencyConfigInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteLayerVersionInput {
#[doc(hidden)]
pub layer_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub version_number: i64,
}
impl DeleteLayerVersionInput {
pub fn layer_name(&self) -> std::option::Option<&str> {
self.layer_name.as_deref()
}
pub fn version_number(&self) -> i64 {
self.version_number
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteFunctionUrlConfigInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
}
impl DeleteFunctionUrlConfigInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteFunctionEventInvokeConfigInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
}
impl DeleteFunctionEventInvokeConfigInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteFunctionConcurrencyInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
}
impl DeleteFunctionConcurrencyInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteFunctionCodeSigningConfigInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
}
impl DeleteFunctionCodeSigningConfigInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteFunctionInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
}
impl DeleteFunctionInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteEventSourceMappingInput {
#[doc(hidden)]
pub uuid: std::option::Option<std::string::String>,
}
impl DeleteEventSourceMappingInput {
pub fn uuid(&self) -> std::option::Option<&str> {
self.uuid.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteCodeSigningConfigInput {
#[doc(hidden)]
pub code_signing_config_arn: std::option::Option<std::string::String>,
}
impl DeleteCodeSigningConfigInput {
pub fn code_signing_config_arn(&self) -> std::option::Option<&str> {
self.code_signing_config_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteAliasInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
}
impl DeleteAliasInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateFunctionUrlConfigInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub auth_type: std::option::Option<crate::model::FunctionUrlAuthType>,
#[doc(hidden)]
pub cors: std::option::Option<crate::model::Cors>,
}
impl CreateFunctionUrlConfigInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
pub fn auth_type(&self) -> std::option::Option<&crate::model::FunctionUrlAuthType> {
self.auth_type.as_ref()
}
pub fn cors(&self) -> std::option::Option<&crate::model::Cors> {
self.cors.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateFunctionInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub runtime: std::option::Option<crate::model::Runtime>,
#[doc(hidden)]
pub role: std::option::Option<std::string::String>,
#[doc(hidden)]
pub handler: std::option::Option<std::string::String>,
#[doc(hidden)]
pub code: std::option::Option<crate::model::FunctionCode>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub timeout: std::option::Option<i32>,
#[doc(hidden)]
pub memory_size: std::option::Option<i32>,
#[doc(hidden)]
pub publish: bool,
#[doc(hidden)]
pub vpc_config: std::option::Option<crate::model::VpcConfig>,
#[doc(hidden)]
pub package_type: std::option::Option<crate::model::PackageType>,
#[doc(hidden)]
pub dead_letter_config: std::option::Option<crate::model::DeadLetterConfig>,
#[doc(hidden)]
pub environment: std::option::Option<crate::model::Environment>,
#[doc(hidden)]
pub kms_key_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tracing_config: std::option::Option<crate::model::TracingConfig>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub layers: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub file_system_configs: std::option::Option<std::vec::Vec<crate::model::FileSystemConfig>>,
#[doc(hidden)]
pub image_config: std::option::Option<crate::model::ImageConfig>,
#[doc(hidden)]
pub code_signing_config_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub architectures: std::option::Option<std::vec::Vec<crate::model::Architecture>>,
#[doc(hidden)]
pub ephemeral_storage: std::option::Option<crate::model::EphemeralStorage>,
#[doc(hidden)]
pub snap_start: std::option::Option<crate::model::SnapStart>,
}
impl CreateFunctionInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn runtime(&self) -> std::option::Option<&crate::model::Runtime> {
self.runtime.as_ref()
}
pub fn role(&self) -> std::option::Option<&str> {
self.role.as_deref()
}
pub fn handler(&self) -> std::option::Option<&str> {
self.handler.as_deref()
}
pub fn code(&self) -> std::option::Option<&crate::model::FunctionCode> {
self.code.as_ref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn timeout(&self) -> std::option::Option<i32> {
self.timeout
}
pub fn memory_size(&self) -> std::option::Option<i32> {
self.memory_size
}
pub fn publish(&self) -> bool {
self.publish
}
pub fn vpc_config(&self) -> std::option::Option<&crate::model::VpcConfig> {
self.vpc_config.as_ref()
}
pub fn package_type(&self) -> std::option::Option<&crate::model::PackageType> {
self.package_type.as_ref()
}
pub fn dead_letter_config(&self) -> std::option::Option<&crate::model::DeadLetterConfig> {
self.dead_letter_config.as_ref()
}
pub fn environment(&self) -> std::option::Option<&crate::model::Environment> {
self.environment.as_ref()
}
pub fn kms_key_arn(&self) -> std::option::Option<&str> {
self.kms_key_arn.as_deref()
}
pub fn tracing_config(&self) -> std::option::Option<&crate::model::TracingConfig> {
self.tracing_config.as_ref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
pub fn layers(&self) -> std::option::Option<&[std::string::String]> {
self.layers.as_deref()
}
pub fn file_system_configs(&self) -> std::option::Option<&[crate::model::FileSystemConfig]> {
self.file_system_configs.as_deref()
}
pub fn image_config(&self) -> std::option::Option<&crate::model::ImageConfig> {
self.image_config.as_ref()
}
pub fn code_signing_config_arn(&self) -> std::option::Option<&str> {
self.code_signing_config_arn.as_deref()
}
pub fn architectures(&self) -> std::option::Option<&[crate::model::Architecture]> {
self.architectures.as_deref()
}
pub fn ephemeral_storage(&self) -> std::option::Option<&crate::model::EphemeralStorage> {
self.ephemeral_storage.as_ref()
}
pub fn snap_start(&self) -> std::option::Option<&crate::model::SnapStart> {
self.snap_start.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateEventSourceMappingInput {
#[doc(hidden)]
pub event_source_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub enabled: std::option::Option<bool>,
#[doc(hidden)]
pub batch_size: std::option::Option<i32>,
#[doc(hidden)]
pub filter_criteria: std::option::Option<crate::model::FilterCriteria>,
#[doc(hidden)]
pub maximum_batching_window_in_seconds: std::option::Option<i32>,
#[doc(hidden)]
pub parallelization_factor: std::option::Option<i32>,
#[doc(hidden)]
pub starting_position: std::option::Option<crate::model::EventSourcePosition>,
#[doc(hidden)]
pub starting_position_timestamp: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub destination_config: std::option::Option<crate::model::DestinationConfig>,
#[doc(hidden)]
pub maximum_record_age_in_seconds: std::option::Option<i32>,
#[doc(hidden)]
pub bisect_batch_on_function_error: std::option::Option<bool>,
#[doc(hidden)]
pub maximum_retry_attempts: std::option::Option<i32>,
#[doc(hidden)]
pub tumbling_window_in_seconds: std::option::Option<i32>,
#[doc(hidden)]
pub topics: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub queues: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub source_access_configurations:
std::option::Option<std::vec::Vec<crate::model::SourceAccessConfiguration>>,
#[doc(hidden)]
pub self_managed_event_source: std::option::Option<crate::model::SelfManagedEventSource>,
#[doc(hidden)]
pub function_response_types:
std::option::Option<std::vec::Vec<crate::model::FunctionResponseType>>,
#[doc(hidden)]
pub amazon_managed_kafka_event_source_config:
std::option::Option<crate::model::AmazonManagedKafkaEventSourceConfig>,
#[doc(hidden)]
pub self_managed_kafka_event_source_config:
std::option::Option<crate::model::SelfManagedKafkaEventSourceConfig>,
#[doc(hidden)]
pub scaling_config: std::option::Option<crate::model::ScalingConfig>,
}
impl CreateEventSourceMappingInput {
pub fn event_source_arn(&self) -> std::option::Option<&str> {
self.event_source_arn.as_deref()
}
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn enabled(&self) -> std::option::Option<bool> {
self.enabled
}
pub fn batch_size(&self) -> std::option::Option<i32> {
self.batch_size
}
pub fn filter_criteria(&self) -> std::option::Option<&crate::model::FilterCriteria> {
self.filter_criteria.as_ref()
}
pub fn maximum_batching_window_in_seconds(&self) -> std::option::Option<i32> {
self.maximum_batching_window_in_seconds
}
pub fn parallelization_factor(&self) -> std::option::Option<i32> {
self.parallelization_factor
}
pub fn starting_position(&self) -> std::option::Option<&crate::model::EventSourcePosition> {
self.starting_position.as_ref()
}
pub fn starting_position_timestamp(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.starting_position_timestamp.as_ref()
}
pub fn destination_config(&self) -> std::option::Option<&crate::model::DestinationConfig> {
self.destination_config.as_ref()
}
pub fn maximum_record_age_in_seconds(&self) -> std::option::Option<i32> {
self.maximum_record_age_in_seconds
}
pub fn bisect_batch_on_function_error(&self) -> std::option::Option<bool> {
self.bisect_batch_on_function_error
}
pub fn maximum_retry_attempts(&self) -> std::option::Option<i32> {
self.maximum_retry_attempts
}
pub fn tumbling_window_in_seconds(&self) -> std::option::Option<i32> {
self.tumbling_window_in_seconds
}
pub fn topics(&self) -> std::option::Option<&[std::string::String]> {
self.topics.as_deref()
}
pub fn queues(&self) -> std::option::Option<&[std::string::String]> {
self.queues.as_deref()
}
pub fn source_access_configurations(
&self,
) -> std::option::Option<&[crate::model::SourceAccessConfiguration]> {
self.source_access_configurations.as_deref()
}
pub fn self_managed_event_source(
&self,
) -> std::option::Option<&crate::model::SelfManagedEventSource> {
self.self_managed_event_source.as_ref()
}
pub fn function_response_types(
&self,
) -> std::option::Option<&[crate::model::FunctionResponseType]> {
self.function_response_types.as_deref()
}
pub fn amazon_managed_kafka_event_source_config(
&self,
) -> std::option::Option<&crate::model::AmazonManagedKafkaEventSourceConfig> {
self.amazon_managed_kafka_event_source_config.as_ref()
}
pub fn self_managed_kafka_event_source_config(
&self,
) -> std::option::Option<&crate::model::SelfManagedKafkaEventSourceConfig> {
self.self_managed_kafka_event_source_config.as_ref()
}
pub fn scaling_config(&self) -> std::option::Option<&crate::model::ScalingConfig> {
self.scaling_config.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateCodeSigningConfigInput {
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub allowed_publishers: std::option::Option<crate::model::AllowedPublishers>,
#[doc(hidden)]
pub code_signing_policies: std::option::Option<crate::model::CodeSigningPolicies>,
}
impl CreateCodeSigningConfigInput {
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn allowed_publishers(&self) -> std::option::Option<&crate::model::AllowedPublishers> {
self.allowed_publishers.as_ref()
}
pub fn code_signing_policies(&self) -> std::option::Option<&crate::model::CodeSigningPolicies> {
self.code_signing_policies.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateAliasInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub function_version: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub routing_config: std::option::Option<crate::model::AliasRoutingConfiguration>,
}
impl CreateAliasInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn function_version(&self) -> std::option::Option<&str> {
self.function_version.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn routing_config(&self) -> std::option::Option<&crate::model::AliasRoutingConfiguration> {
self.routing_config.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AddPermissionInput {
#[doc(hidden)]
pub function_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub statement_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub action: std::option::Option<std::string::String>,
#[doc(hidden)]
pub principal: std::option::Option<std::string::String>,
#[doc(hidden)]
pub source_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub source_account: std::option::Option<std::string::String>,
#[doc(hidden)]
pub event_source_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub qualifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub revision_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub principal_org_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub function_url_auth_type: std::option::Option<crate::model::FunctionUrlAuthType>,
}
impl AddPermissionInput {
pub fn function_name(&self) -> std::option::Option<&str> {
self.function_name.as_deref()
}
pub fn statement_id(&self) -> std::option::Option<&str> {
self.statement_id.as_deref()
}
pub fn action(&self) -> std::option::Option<&str> {
self.action.as_deref()
}
pub fn principal(&self) -> std::option::Option<&str> {
self.principal.as_deref()
}
pub fn source_arn(&self) -> std::option::Option<&str> {
self.source_arn.as_deref()
}
pub fn source_account(&self) -> std::option::Option<&str> {
self.source_account.as_deref()
}
pub fn event_source_token(&self) -> std::option::Option<&str> {
self.event_source_token.as_deref()
}
pub fn qualifier(&self) -> std::option::Option<&str> {
self.qualifier.as_deref()
}
pub fn revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
pub fn principal_org_id(&self) -> std::option::Option<&str> {
self.principal_org_id.as_deref()
}
pub fn function_url_auth_type(
&self,
) -> std::option::Option<&crate::model::FunctionUrlAuthType> {
self.function_url_auth_type.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AddLayerVersionPermissionInput {
#[doc(hidden)]
pub layer_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub version_number: i64,
#[doc(hidden)]
pub statement_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub action: std::option::Option<std::string::String>,
#[doc(hidden)]
pub principal: std::option::Option<std::string::String>,
#[doc(hidden)]
pub organization_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub revision_id: std::option::Option<std::string::String>,
}
impl AddLayerVersionPermissionInput {
pub fn layer_name(&self) -> std::option::Option<&str> {
self.layer_name.as_deref()
}
pub fn version_number(&self) -> i64 {
self.version_number
}
pub fn statement_id(&self) -> std::option::Option<&str> {
self.statement_id.as_deref()
}
pub fn action(&self) -> std::option::Option<&str> {
self.action.as_deref()
}
pub fn principal(&self) -> std::option::Option<&str> {
self.principal.as_deref()
}
pub fn organization_id(&self) -> std::option::Option<&str> {
self.organization_id.as_deref()
}
pub fn revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
}