use std::fmt::Write;
pub mod add_profile_permission_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profile_name: std::option::Option<std::string::String>,
pub(crate) profile_version: 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) revision_id: std::option::Option<std::string::String>,
pub(crate) statement_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profile_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profile_name = Some(input.into());
self
}
pub fn set_profile_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.profile_name = input;
self
}
pub fn profile_version(mut self, input: impl Into<std::string::String>) -> Self {
self.profile_version = Some(input.into());
self
}
pub fn set_profile_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profile_version = 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 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 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 build(
self,
) -> Result<
crate::input::AddProfilePermissionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::AddProfilePermissionInput {
profile_name: self.profile_name,
profile_version: self.profile_version,
action: self.action,
principal: self.principal,
revision_id: self.revision_id,
statement_id: self.statement_id,
})
}
}
}
impl AddProfilePermissionInput {
#[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::AddProfilePermission,
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::AddProfilePermissionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_1 = &_input.profile_name;
let input_1 = input_1.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profile_name",
"cannot be empty or unset",
)
})?;
let profile_name = aws_smithy_http::label::fmt_string(
input_1,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profile_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profile_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/signing-profiles/{profileName}/permissions",
profileName = profile_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::AddProfilePermissionInput,
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_add_profile_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::AddProfilePermission::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"AddProfilePermission",
"signer",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::add_profile_permission_input::Builder {
crate::input::add_profile_permission_input::Builder::default()
}
}
pub mod cancel_signing_profile_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profile_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profile_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profile_name = Some(input.into());
self
}
pub fn set_profile_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.profile_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CancelSigningProfileInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CancelSigningProfileInput {
profile_name: self.profile_name,
})
}
}
}
impl CancelSigningProfileInput {
#[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::CancelSigningProfile,
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::CancelSigningProfileInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_2 = &_input.profile_name;
let input_2 = input_2.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profile_name",
"cannot be empty or unset",
)
})?;
let profile_name = aws_smithy_http::label::fmt_string(
input_2,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profile_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profile_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/signing-profiles/{profileName}",
profileName = profile_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CancelSigningProfileInput,
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::CancelSigningProfile::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CancelSigningProfile",
"signer",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::cancel_signing_profile_input::Builder {
crate::input::cancel_signing_profile_input::Builder::default()
}
}
pub mod describe_signing_job_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) job_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.job_id = Some(input.into());
self
}
pub fn set_job_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.job_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeSigningJobInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeSigningJobInput {
job_id: self.job_id,
})
}
}
}
impl DescribeSigningJobInput {
#[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::DescribeSigningJob,
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::DescribeSigningJobInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_3 = &_input.job_id;
let input_3 = input_3.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"job_id",
"cannot be empty or unset",
)
})?;
let job_id = aws_smithy_http::label::fmt_string(
input_3,
aws_smithy_http::label::EncodingStrategy::Default,
);
if job_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"job_id",
"cannot be empty or unset",
),
);
}
write!(output, "/signing-jobs/{jobId}", jobId = job_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeSigningJobInput,
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::DescribeSigningJob::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeSigningJob",
"signer",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_signing_job_input::Builder {
crate::input::describe_signing_job_input::Builder::default()
}
}
pub mod get_signing_platform_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) platform_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn platform_id(mut self, input: impl Into<std::string::String>) -> Self {
self.platform_id = Some(input.into());
self
}
pub fn set_platform_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.platform_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetSigningPlatformInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetSigningPlatformInput {
platform_id: self.platform_id,
})
}
}
}
impl GetSigningPlatformInput {
#[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::GetSigningPlatform,
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::GetSigningPlatformInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_4 = &_input.platform_id;
let input_4 = input_4.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"platform_id",
"cannot be empty or unset",
)
})?;
let platform_id = aws_smithy_http::label::fmt_string(
input_4,
aws_smithy_http::label::EncodingStrategy::Default,
);
if platform_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"platform_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/signing-platforms/{platformId}",
platformId = platform_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetSigningPlatformInput,
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::GetSigningPlatform::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetSigningPlatform",
"signer",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_signing_platform_input::Builder {
crate::input::get_signing_platform_input::Builder::default()
}
}
pub mod get_signing_profile_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profile_name: std::option::Option<std::string::String>,
pub(crate) profile_owner: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profile_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profile_name = Some(input.into());
self
}
pub fn set_profile_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.profile_name = input;
self
}
pub fn profile_owner(mut self, input: impl Into<std::string::String>) -> Self {
self.profile_owner = Some(input.into());
self
}
pub fn set_profile_owner(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profile_owner = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetSigningProfileInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetSigningProfileInput {
profile_name: self.profile_name,
profile_owner: self.profile_owner,
})
}
}
}
impl GetSigningProfileInput {
#[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::GetSigningProfile,
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::GetSigningProfileInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_5 = &_input.profile_name;
let input_5 = input_5.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profile_name",
"cannot be empty or unset",
)
})?;
let profile_name = aws_smithy_http::label::fmt_string(
input_5,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profile_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profile_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/signing-profiles/{profileName}",
profileName = profile_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetSigningProfileInput,
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_6) = &_input.profile_owner {
{
query.push_kv(
"profileOwner",
&aws_smithy_http::query::fmt_string(&inner_6),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetSigningProfileInput,
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::GetSigningProfile::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetSigningProfile",
"signer",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_signing_profile_input::Builder {
crate::input::get_signing_profile_input::Builder::default()
}
}
pub mod list_profile_permissions_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profile_name: std::option::Option<std::string::String>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profile_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profile_name = Some(input.into());
self
}
pub fn set_profile_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.profile_name = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListProfilePermissionsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListProfilePermissionsInput {
profile_name: self.profile_name,
next_token: self.next_token,
})
}
}
}
impl ListProfilePermissionsInput {
#[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::ListProfilePermissions,
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::ListProfilePermissionsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_7 = &_input.profile_name;
let input_7 = input_7.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profile_name",
"cannot be empty or unset",
)
})?;
let profile_name = aws_smithy_http::label::fmt_string(
input_7,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profile_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profile_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/signing-profiles/{profileName}/permissions",
profileName = profile_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListProfilePermissionsInput,
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.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_8));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListProfilePermissionsInput,
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::ListProfilePermissions::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListProfilePermissions",
"signer",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_profile_permissions_input::Builder {
crate::input::list_profile_permissions_input::Builder::default()
}
}
pub mod list_signing_jobs_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) status: std::option::Option<crate::model::SigningStatus>,
pub(crate) platform_id: std::option::Option<std::string::String>,
pub(crate) requested_by: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) is_revoked: std::option::Option<bool>,
pub(crate) signature_expires_before: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) signature_expires_after: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) job_invoker: std::option::Option<std::string::String>,
}
impl Builder {
pub fn status(mut self, input: crate::model::SigningStatus) -> Self {
self.status = Some(input);
self
}
pub fn set_status(
mut self,
input: std::option::Option<crate::model::SigningStatus>,
) -> Self {
self.status = input;
self
}
pub fn platform_id(mut self, input: impl Into<std::string::String>) -> Self {
self.platform_id = Some(input.into());
self
}
pub fn set_platform_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.platform_id = input;
self
}
pub fn requested_by(mut self, input: impl Into<std::string::String>) -> Self {
self.requested_by = Some(input.into());
self
}
pub fn set_requested_by(mut self, input: std::option::Option<std::string::String>) -> Self {
self.requested_by = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn is_revoked(mut self, input: bool) -> Self {
self.is_revoked = Some(input);
self
}
pub fn set_is_revoked(mut self, input: std::option::Option<bool>) -> Self {
self.is_revoked = input;
self
}
pub fn signature_expires_before(mut self, input: aws_smithy_types::DateTime) -> Self {
self.signature_expires_before = Some(input);
self
}
pub fn set_signature_expires_before(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.signature_expires_before = input;
self
}
pub fn signature_expires_after(mut self, input: aws_smithy_types::DateTime) -> Self {
self.signature_expires_after = Some(input);
self
}
pub fn set_signature_expires_after(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.signature_expires_after = input;
self
}
pub fn job_invoker(mut self, input: impl Into<std::string::String>) -> Self {
self.job_invoker = Some(input.into());
self
}
pub fn set_job_invoker(mut self, input: std::option::Option<std::string::String>) -> Self {
self.job_invoker = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListSigningJobsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListSigningJobsInput {
status: self.status,
platform_id: self.platform_id,
requested_by: self.requested_by,
max_results: self.max_results,
next_token: self.next_token,
is_revoked: self.is_revoked.unwrap_or_default(),
signature_expires_before: self.signature_expires_before,
signature_expires_after: self.signature_expires_after,
job_invoker: self.job_invoker,
})
}
}
}
impl ListSigningJobsInput {
#[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::ListSigningJobs,
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::ListSigningJobsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/signing-jobs").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListSigningJobsInput,
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_9) = &_input.status {
{
query.push_kv("status", &aws_smithy_http::query::fmt_string(&inner_9));
}
}
if let Some(inner_10) = &_input.platform_id {
{
query.push_kv("platformId", &aws_smithy_http::query::fmt_string(&inner_10));
}
}
if let Some(inner_11) = &_input.requested_by {
{
query.push_kv(
"requestedBy",
&aws_smithy_http::query::fmt_string(&inner_11),
);
}
}
if let Some(inner_12) = &_input.max_results {
if *inner_12 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_12).encode(),
);
}
}
if let Some(inner_13) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_13));
}
}
if _input.is_revoked {
query.push_kv(
"isRevoked",
aws_smithy_types::primitive::Encoder::from(_input.is_revoked).encode(),
);
}
if let Some(inner_14) = &_input.signature_expires_before {
{
query.push_kv(
"signatureExpiresBefore",
&aws_smithy_http::query::fmt_timestamp(
inner_14,
aws_smithy_types::date_time::Format::DateTime,
)?,
);
}
}
if let Some(inner_15) = &_input.signature_expires_after {
{
query.push_kv(
"signatureExpiresAfter",
&aws_smithy_http::query::fmt_timestamp(
inner_15,
aws_smithy_types::date_time::Format::DateTime,
)?,
);
}
}
if let Some(inner_16) = &_input.job_invoker {
{
query.push_kv("jobInvoker", &aws_smithy_http::query::fmt_string(&inner_16));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListSigningJobsInput,
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::ListSigningJobs::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListSigningJobs",
"signer",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_signing_jobs_input::Builder {
crate::input::list_signing_jobs_input::Builder::default()
}
}
pub mod list_signing_platforms_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) category: std::option::Option<std::string::String>,
pub(crate) partner: std::option::Option<std::string::String>,
pub(crate) target: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn category(mut self, input: impl Into<std::string::String>) -> Self {
self.category = Some(input.into());
self
}
pub fn set_category(mut self, input: std::option::Option<std::string::String>) -> Self {
self.category = input;
self
}
pub fn partner(mut self, input: impl Into<std::string::String>) -> Self {
self.partner = Some(input.into());
self
}
pub fn set_partner(mut self, input: std::option::Option<std::string::String>) -> Self {
self.partner = input;
self
}
pub fn target(mut self, input: impl Into<std::string::String>) -> Self {
self.target = Some(input.into());
self
}
pub fn set_target(mut self, input: std::option::Option<std::string::String>) -> Self {
self.target = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListSigningPlatformsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListSigningPlatformsInput {
category: self.category,
partner: self.partner,
target: self.target,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl ListSigningPlatformsInput {
#[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::ListSigningPlatforms,
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::ListSigningPlatformsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/signing-platforms").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListSigningPlatformsInput,
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_17) = &_input.category {
{
query.push_kv("category", &aws_smithy_http::query::fmt_string(&inner_17));
}
}
if let Some(inner_18) = &_input.partner {
{
query.push_kv("partner", &aws_smithy_http::query::fmt_string(&inner_18));
}
}
if let Some(inner_19) = &_input.target {
{
query.push_kv("target", &aws_smithy_http::query::fmt_string(&inner_19));
}
}
if let Some(inner_20) = &_input.max_results {
if *inner_20 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_20).encode(),
);
}
}
if let Some(inner_21) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_21));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListSigningPlatformsInput,
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::ListSigningPlatforms::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListSigningPlatforms",
"signer",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_signing_platforms_input::Builder {
crate::input::list_signing_platforms_input::Builder::default()
}
}
pub mod list_signing_profiles_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) include_canceled: std::option::Option<bool>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) platform_id: std::option::Option<std::string::String>,
pub(crate) statuses: std::option::Option<std::vec::Vec<crate::model::SigningProfileStatus>>,
}
impl Builder {
pub fn include_canceled(mut self, input: bool) -> Self {
self.include_canceled = Some(input);
self
}
pub fn set_include_canceled(mut self, input: std::option::Option<bool>) -> Self {
self.include_canceled = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn platform_id(mut self, input: impl Into<std::string::String>) -> Self {
self.platform_id = Some(input.into());
self
}
pub fn set_platform_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.platform_id = input;
self
}
pub fn statuses(mut self, input: crate::model::SigningProfileStatus) -> Self {
let mut v = self.statuses.unwrap_or_default();
v.push(input);
self.statuses = Some(v);
self
}
pub fn set_statuses(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::SigningProfileStatus>>,
) -> Self {
self.statuses = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListSigningProfilesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListSigningProfilesInput {
include_canceled: self.include_canceled.unwrap_or_default(),
max_results: self.max_results,
next_token: self.next_token,
platform_id: self.platform_id,
statuses: self.statuses,
})
}
}
}
impl ListSigningProfilesInput {
#[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::ListSigningProfiles,
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::ListSigningProfilesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/signing-profiles").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListSigningProfilesInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if _input.include_canceled {
query.push_kv(
"includeCanceled",
aws_smithy_types::primitive::Encoder::from(_input.include_canceled)
.encode(),
);
}
if let Some(inner_22) = &_input.max_results {
if *inner_22 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_22).encode(),
);
}
}
if let Some(inner_23) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_23));
}
}
if let Some(inner_24) = &_input.platform_id {
{
query.push_kv("platformId", &aws_smithy_http::query::fmt_string(&inner_24));
}
}
if let Some(inner_25) = &_input.statuses {
{
for inner_26 in inner_25 {
query.push_kv(
"statuses",
&aws_smithy_http::query::fmt_string(&inner_26),
);
}
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListSigningProfilesInput,
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::ListSigningProfiles::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListSigningProfiles",
"signer",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_signing_profiles_input::Builder {
crate::input::list_signing_profiles_input::Builder::default()
}
}
pub mod list_tags_for_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListTagsForResourceInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListTagsForResourceInput {
resource_arn: self.resource_arn,
})
}
}
}
impl ListTagsForResourceInput {
#[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::ListTagsForResource,
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::ListTagsForResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_27 = &_input.resource_arn;
let input_27 = input_27.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
)
})?;
let resource_arn = aws_smithy_http::label::fmt_string(
input_27,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/tags/{resourceArn}", resourceArn = resource_arn)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListTagsForResourceInput,
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::ListTagsForResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListTagsForResource",
"signer",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_tags_for_resource_input::Builder {
crate::input::list_tags_for_resource_input::Builder::default()
}
}
pub mod put_signing_profile_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profile_name: std::option::Option<std::string::String>,
pub(crate) signing_material: std::option::Option<crate::model::SigningMaterial>,
pub(crate) signature_validity_period:
std::option::Option<crate::model::SignatureValidityPeriod>,
pub(crate) platform_id: std::option::Option<std::string::String>,
pub(crate) overrides: std::option::Option<crate::model::SigningPlatformOverrides>,
pub(crate) signing_parameters: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn profile_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profile_name = Some(input.into());
self
}
pub fn set_profile_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.profile_name = input;
self
}
pub fn signing_material(mut self, input: crate::model::SigningMaterial) -> Self {
self.signing_material = Some(input);
self
}
pub fn set_signing_material(
mut self,
input: std::option::Option<crate::model::SigningMaterial>,
) -> Self {
self.signing_material = input;
self
}
pub fn signature_validity_period(
mut self,
input: crate::model::SignatureValidityPeriod,
) -> Self {
self.signature_validity_period = Some(input);
self
}
pub fn set_signature_validity_period(
mut self,
input: std::option::Option<crate::model::SignatureValidityPeriod>,
) -> Self {
self.signature_validity_period = input;
self
}
pub fn platform_id(mut self, input: impl Into<std::string::String>) -> Self {
self.platform_id = Some(input.into());
self
}
pub fn set_platform_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.platform_id = input;
self
}
pub fn overrides(mut self, input: crate::model::SigningPlatformOverrides) -> Self {
self.overrides = Some(input);
self
}
pub fn set_overrides(
mut self,
input: std::option::Option<crate::model::SigningPlatformOverrides>,
) -> Self {
self.overrides = input;
self
}
pub fn signing_parameters(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.signing_parameters.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.signing_parameters = Some(hash_map);
self
}
pub fn set_signing_parameters(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.signing_parameters = 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::PutSigningProfileInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::PutSigningProfileInput {
profile_name: self.profile_name,
signing_material: self.signing_material,
signature_validity_period: self.signature_validity_period,
platform_id: self.platform_id,
overrides: self.overrides,
signing_parameters: self.signing_parameters,
tags: self.tags,
})
}
}
}
impl PutSigningProfileInput {
#[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::PutSigningProfile,
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::PutSigningProfileInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_28 = &_input.profile_name;
let input_28 = input_28.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profile_name",
"cannot be empty or unset",
)
})?;
let profile_name = aws_smithy_http::label::fmt_string(
input_28,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profile_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profile_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/signing-profiles/{profileName}",
profileName = profile_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PutSigningProfileInput,
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_signing_profile(&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::PutSigningProfile::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PutSigningProfile",
"signer",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::put_signing_profile_input::Builder {
crate::input::put_signing_profile_input::Builder::default()
}
}
pub mod remove_profile_permission_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profile_name: std::option::Option<std::string::String>,
pub(crate) revision_id: std::option::Option<std::string::String>,
pub(crate) statement_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profile_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profile_name = Some(input.into());
self
}
pub fn set_profile_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.profile_name = 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 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 build(
self,
) -> Result<
crate::input::RemoveProfilePermissionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::RemoveProfilePermissionInput {
profile_name: self.profile_name,
revision_id: self.revision_id,
statement_id: self.statement_id,
})
}
}
}
impl RemoveProfilePermissionInput {
#[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::RemoveProfilePermission,
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::RemoveProfilePermissionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_29 = &_input.profile_name;
let input_29 = input_29.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profile_name",
"cannot be empty or unset",
)
})?;
let profile_name = aws_smithy_http::label::fmt_string(
input_29,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profile_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profile_name",
"cannot be empty or unset",
),
);
}
let input_30 = &_input.statement_id;
let input_30 = input_30.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_30,
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,
"/signing-profiles/{profileName}/permissions/{statementId}",
profileName = profile_name,
statementId = statement_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::RemoveProfilePermissionInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_31 = &_input.revision_id;
let inner_31 = inner_31.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"revision_id",
"cannot be empty or unset",
)
})?;
if inner_31.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"revision_id",
"cannot be empty or unset",
),
);
}
query.push_kv("revisionId", &aws_smithy_http::query::fmt_string(&inner_31));
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RemoveProfilePermissionInput,
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::RemoveProfilePermission::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RemoveProfilePermission",
"signer",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::remove_profile_permission_input::Builder {
crate::input::remove_profile_permission_input::Builder::default()
}
}
pub mod revoke_signature_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) job_id: std::option::Option<std::string::String>,
pub(crate) job_owner: std::option::Option<std::string::String>,
pub(crate) reason: std::option::Option<std::string::String>,
}
impl Builder {
pub fn job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.job_id = Some(input.into());
self
}
pub fn set_job_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.job_id = input;
self
}
pub fn job_owner(mut self, input: impl Into<std::string::String>) -> Self {
self.job_owner = Some(input.into());
self
}
pub fn set_job_owner(mut self, input: std::option::Option<std::string::String>) -> Self {
self.job_owner = input;
self
}
pub fn reason(mut self, input: impl Into<std::string::String>) -> Self {
self.reason = Some(input.into());
self
}
pub fn set_reason(mut self, input: std::option::Option<std::string::String>) -> Self {
self.reason = input;
self
}
pub fn build(
self,
) -> Result<crate::input::RevokeSignatureInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::RevokeSignatureInput {
job_id: self.job_id,
job_owner: self.job_owner,
reason: self.reason,
})
}
}
}
impl RevokeSignatureInput {
#[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::RevokeSignature,
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::RevokeSignatureInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_32 = &_input.job_id;
let input_32 = input_32.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"job_id",
"cannot be empty or unset",
)
})?;
let job_id = aws_smithy_http::label::fmt_string(
input_32,
aws_smithy_http::label::EncodingStrategy::Default,
);
if job_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"job_id",
"cannot be empty or unset",
),
);
}
write!(output, "/signing-jobs/{jobId}/revoke", jobId = job_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RevokeSignatureInput,
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_revoke_signature(&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::RevokeSignature::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RevokeSignature",
"signer",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::revoke_signature_input::Builder {
crate::input::revoke_signature_input::Builder::default()
}
}
pub mod revoke_signing_profile_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profile_name: std::option::Option<std::string::String>,
pub(crate) profile_version: std::option::Option<std::string::String>,
pub(crate) reason: std::option::Option<std::string::String>,
pub(crate) effective_time: std::option::Option<aws_smithy_types::DateTime>,
}
impl Builder {
pub fn profile_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profile_name = Some(input.into());
self
}
pub fn set_profile_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.profile_name = input;
self
}
pub fn profile_version(mut self, input: impl Into<std::string::String>) -> Self {
self.profile_version = Some(input.into());
self
}
pub fn set_profile_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profile_version = input;
self
}
pub fn reason(mut self, input: impl Into<std::string::String>) -> Self {
self.reason = Some(input.into());
self
}
pub fn set_reason(mut self, input: std::option::Option<std::string::String>) -> Self {
self.reason = input;
self
}
pub fn effective_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.effective_time = Some(input);
self
}
pub fn set_effective_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.effective_time = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::RevokeSigningProfileInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::RevokeSigningProfileInput {
profile_name: self.profile_name,
profile_version: self.profile_version,
reason: self.reason,
effective_time: self.effective_time,
})
}
}
}
impl RevokeSigningProfileInput {
#[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::RevokeSigningProfile,
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::RevokeSigningProfileInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_33 = &_input.profile_name;
let input_33 = input_33.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profile_name",
"cannot be empty or unset",
)
})?;
let profile_name = aws_smithy_http::label::fmt_string(
input_33,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profile_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profile_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/signing-profiles/{profileName}/revoke",
profileName = profile_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RevokeSigningProfileInput,
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_revoke_signing_profile(
&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::RevokeSigningProfile::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RevokeSigningProfile",
"signer",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::revoke_signing_profile_input::Builder {
crate::input::revoke_signing_profile_input::Builder::default()
}
}
pub mod start_signing_job_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) source: std::option::Option<crate::model::Source>,
pub(crate) destination: std::option::Option<crate::model::Destination>,
pub(crate) profile_name: std::option::Option<std::string::String>,
pub(crate) client_request_token: std::option::Option<std::string::String>,
pub(crate) profile_owner: std::option::Option<std::string::String>,
}
impl Builder {
pub fn source(mut self, input: crate::model::Source) -> Self {
self.source = Some(input);
self
}
pub fn set_source(mut self, input: std::option::Option<crate::model::Source>) -> Self {
self.source = input;
self
}
pub fn destination(mut self, input: crate::model::Destination) -> Self {
self.destination = Some(input);
self
}
pub fn set_destination(
mut self,
input: std::option::Option<crate::model::Destination>,
) -> Self {
self.destination = input;
self
}
pub fn profile_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profile_name = Some(input.into());
self
}
pub fn set_profile_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.profile_name = input;
self
}
pub fn client_request_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_request_token = Some(input.into());
self
}
pub fn set_client_request_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_request_token = input;
self
}
pub fn profile_owner(mut self, input: impl Into<std::string::String>) -> Self {
self.profile_owner = Some(input.into());
self
}
pub fn set_profile_owner(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profile_owner = input;
self
}
pub fn build(
self,
) -> Result<crate::input::StartSigningJobInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::StartSigningJobInput {
source: self.source,
destination: self.destination,
profile_name: self.profile_name,
client_request_token: self.client_request_token,
profile_owner: self.profile_owner,
})
}
}
}
impl StartSigningJobInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::StartSigningJob,
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),
};
if self.client_request_token.is_none() {
self.client_request_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::StartSigningJobInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/signing-jobs").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::StartSigningJobInput,
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_start_signing_job(&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::StartSigningJob::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"StartSigningJob",
"signer",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::start_signing_job_input::Builder {
crate::input::start_signing_job_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_arn: 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_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = 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_arn: self.resource_arn,
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_34 = &_input.resource_arn;
let input_34 = input_34.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
)
})?;
let resource_arn = aws_smithy_http::label::fmt_string(
input_34,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/tags/{resourceArn}", resourceArn = resource_arn)
.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",
"signer",
));
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_arn: std::option::Option<std::string::String>,
pub(crate) tag_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = 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_arn: self.resource_arn,
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_35 = &_input.resource_arn;
let input_35 = input_35.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
)
})?;
let resource_arn = aws_smithy_http::label::fmt_string(
input_35,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/tags/{resourceArn}", resourceArn = resource_arn)
.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_36 = &_input.tag_keys;
let inner_36 = inner_36.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"tag_keys",
"cannot be empty or unset",
)
})?;
for inner_37 in inner_36 {
query.push_kv("tagKeys", &aws_smithy_http::query::fmt_string(&inner_37));
}
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",
"signer",
));
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()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UntagResourceInput {
#[doc(hidden)]
pub resource_arn: 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_arn(&self) -> std::option::Option<&str> {
self.resource_arn.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_arn: 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_arn(&self) -> std::option::Option<&str> {
self.resource_arn.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 StartSigningJobInput {
#[doc(hidden)]
pub source: std::option::Option<crate::model::Source>,
#[doc(hidden)]
pub destination: std::option::Option<crate::model::Destination>,
#[doc(hidden)]
pub profile_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub client_request_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub profile_owner: std::option::Option<std::string::String>,
}
impl StartSigningJobInput {
pub fn source(&self) -> std::option::Option<&crate::model::Source> {
self.source.as_ref()
}
pub fn destination(&self) -> std::option::Option<&crate::model::Destination> {
self.destination.as_ref()
}
pub fn profile_name(&self) -> std::option::Option<&str> {
self.profile_name.as_deref()
}
pub fn client_request_token(&self) -> std::option::Option<&str> {
self.client_request_token.as_deref()
}
pub fn profile_owner(&self) -> std::option::Option<&str> {
self.profile_owner.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RevokeSigningProfileInput {
#[doc(hidden)]
pub profile_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub profile_version: std::option::Option<std::string::String>,
#[doc(hidden)]
pub reason: std::option::Option<std::string::String>,
#[doc(hidden)]
pub effective_time: std::option::Option<aws_smithy_types::DateTime>,
}
impl RevokeSigningProfileInput {
pub fn profile_name(&self) -> std::option::Option<&str> {
self.profile_name.as_deref()
}
pub fn profile_version(&self) -> std::option::Option<&str> {
self.profile_version.as_deref()
}
pub fn reason(&self) -> std::option::Option<&str> {
self.reason.as_deref()
}
pub fn effective_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.effective_time.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RevokeSignatureInput {
#[doc(hidden)]
pub job_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub job_owner: std::option::Option<std::string::String>,
#[doc(hidden)]
pub reason: std::option::Option<std::string::String>,
}
impl RevokeSignatureInput {
pub fn job_id(&self) -> std::option::Option<&str> {
self.job_id.as_deref()
}
pub fn job_owner(&self) -> std::option::Option<&str> {
self.job_owner.as_deref()
}
pub fn reason(&self) -> std::option::Option<&str> {
self.reason.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RemoveProfilePermissionInput {
#[doc(hidden)]
pub profile_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub revision_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub statement_id: std::option::Option<std::string::String>,
}
impl RemoveProfilePermissionInput {
pub fn profile_name(&self) -> std::option::Option<&str> {
self.profile_name.as_deref()
}
pub fn revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
pub fn statement_id(&self) -> std::option::Option<&str> {
self.statement_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PutSigningProfileInput {
#[doc(hidden)]
pub profile_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub signing_material: std::option::Option<crate::model::SigningMaterial>,
#[doc(hidden)]
pub signature_validity_period: std::option::Option<crate::model::SignatureValidityPeriod>,
#[doc(hidden)]
pub platform_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub overrides: std::option::Option<crate::model::SigningPlatformOverrides>,
#[doc(hidden)]
pub signing_parameters:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl PutSigningProfileInput {
pub fn profile_name(&self) -> std::option::Option<&str> {
self.profile_name.as_deref()
}
pub fn signing_material(&self) -> std::option::Option<&crate::model::SigningMaterial> {
self.signing_material.as_ref()
}
pub fn signature_validity_period(
&self,
) -> std::option::Option<&crate::model::SignatureValidityPeriod> {
self.signature_validity_period.as_ref()
}
pub fn platform_id(&self) -> std::option::Option<&str> {
self.platform_id.as_deref()
}
pub fn overrides(&self) -> std::option::Option<&crate::model::SigningPlatformOverrides> {
self.overrides.as_ref()
}
pub fn signing_parameters(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.signing_parameters.as_ref()
}
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 ListTagsForResourceInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
}
impl ListTagsForResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListSigningProfilesInput {
#[doc(hidden)]
pub include_canceled: bool,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub platform_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub statuses: std::option::Option<std::vec::Vec<crate::model::SigningProfileStatus>>,
}
impl ListSigningProfilesInput {
pub fn include_canceled(&self) -> bool {
self.include_canceled
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn platform_id(&self) -> std::option::Option<&str> {
self.platform_id.as_deref()
}
pub fn statuses(&self) -> std::option::Option<&[crate::model::SigningProfileStatus]> {
self.statuses.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListSigningPlatformsInput {
#[doc(hidden)]
pub category: std::option::Option<std::string::String>,
#[doc(hidden)]
pub partner: std::option::Option<std::string::String>,
#[doc(hidden)]
pub target: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListSigningPlatformsInput {
pub fn category(&self) -> std::option::Option<&str> {
self.category.as_deref()
}
pub fn partner(&self) -> std::option::Option<&str> {
self.partner.as_deref()
}
pub fn target(&self) -> std::option::Option<&str> {
self.target.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListSigningJobsInput {
#[doc(hidden)]
pub status: std::option::Option<crate::model::SigningStatus>,
#[doc(hidden)]
pub platform_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub requested_by: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub is_revoked: bool,
#[doc(hidden)]
pub signature_expires_before: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub signature_expires_after: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub job_invoker: std::option::Option<std::string::String>,
}
impl ListSigningJobsInput {
pub fn status(&self) -> std::option::Option<&crate::model::SigningStatus> {
self.status.as_ref()
}
pub fn platform_id(&self) -> std::option::Option<&str> {
self.platform_id.as_deref()
}
pub fn requested_by(&self) -> std::option::Option<&str> {
self.requested_by.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn is_revoked(&self) -> bool {
self.is_revoked
}
pub fn signature_expires_before(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.signature_expires_before.as_ref()
}
pub fn signature_expires_after(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.signature_expires_after.as_ref()
}
pub fn job_invoker(&self) -> std::option::Option<&str> {
self.job_invoker.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListProfilePermissionsInput {
#[doc(hidden)]
pub profile_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListProfilePermissionsInput {
pub fn profile_name(&self) -> std::option::Option<&str> {
self.profile_name.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetSigningProfileInput {
#[doc(hidden)]
pub profile_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub profile_owner: std::option::Option<std::string::String>,
}
impl GetSigningProfileInput {
pub fn profile_name(&self) -> std::option::Option<&str> {
self.profile_name.as_deref()
}
pub fn profile_owner(&self) -> std::option::Option<&str> {
self.profile_owner.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetSigningPlatformInput {
#[doc(hidden)]
pub platform_id: std::option::Option<std::string::String>,
}
impl GetSigningPlatformInput {
pub fn platform_id(&self) -> std::option::Option<&str> {
self.platform_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeSigningJobInput {
#[doc(hidden)]
pub job_id: std::option::Option<std::string::String>,
}
impl DescribeSigningJobInput {
pub fn job_id(&self) -> std::option::Option<&str> {
self.job_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CancelSigningProfileInput {
#[doc(hidden)]
pub profile_name: std::option::Option<std::string::String>,
}
impl CancelSigningProfileInput {
pub fn profile_name(&self) -> std::option::Option<&str> {
self.profile_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AddProfilePermissionInput {
#[doc(hidden)]
pub profile_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub profile_version: 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 revision_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub statement_id: std::option::Option<std::string::String>,
}
impl AddProfilePermissionInput {
pub fn profile_name(&self) -> std::option::Option<&str> {
self.profile_name.as_deref()
}
pub fn profile_version(&self) -> std::option::Option<&str> {
self.profile_version.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 revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
pub fn statement_id(&self) -> std::option::Option<&str> {
self.statement_id.as_deref()
}
}