use std::fmt::Write;
pub mod add_attachments_to_set_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) attachment_set_id: std::option::Option<std::string::String>,
pub(crate) attachments: std::option::Option<std::vec::Vec<crate::model::Attachment>>,
}
impl Builder {
pub fn attachment_set_id(mut self, input: impl Into<std::string::String>) -> Self {
self.attachment_set_id = Some(input.into());
self
}
pub fn set_attachment_set_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.attachment_set_id = input;
self
}
pub fn attachments(mut self, input: crate::model::Attachment) -> Self {
let mut v = self.attachments.unwrap_or_default();
v.push(input);
self.attachments = Some(v);
self
}
pub fn set_attachments(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Attachment>>,
) -> Self {
self.attachments = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::AddAttachmentsToSetInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::AddAttachmentsToSetInput {
attachment_set_id: self.attachment_set_id,
attachments: self.attachments,
})
}
}
}
impl AddAttachmentsToSetInput {
#[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::AddAttachmentsToSet,
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::AddAttachmentsToSetInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::AddAttachmentsToSetInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSSupport_20130415.AddAttachmentsToSet",
);
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_attachments_to_set(
&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::AddAttachmentsToSet::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"AddAttachmentsToSet",
"support",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::add_attachments_to_set_input::Builder {
crate::input::add_attachments_to_set_input::Builder::default()
}
}
pub mod add_communication_to_case_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) case_id: std::option::Option<std::string::String>,
pub(crate) communication_body: std::option::Option<std::string::String>,
pub(crate) cc_email_addresses: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) attachment_set_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn case_id(mut self, input: impl Into<std::string::String>) -> Self {
self.case_id = Some(input.into());
self
}
pub fn set_case_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.case_id = input;
self
}
pub fn communication_body(mut self, input: impl Into<std::string::String>) -> Self {
self.communication_body = Some(input.into());
self
}
pub fn set_communication_body(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.communication_body = input;
self
}
pub fn cc_email_addresses(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.cc_email_addresses.unwrap_or_default();
v.push(input.into());
self.cc_email_addresses = Some(v);
self
}
pub fn set_cc_email_addresses(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.cc_email_addresses = input;
self
}
pub fn attachment_set_id(mut self, input: impl Into<std::string::String>) -> Self {
self.attachment_set_id = Some(input.into());
self
}
pub fn set_attachment_set_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.attachment_set_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::AddCommunicationToCaseInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::AddCommunicationToCaseInput {
case_id: self.case_id,
communication_body: self.communication_body,
cc_email_addresses: self.cc_email_addresses,
attachment_set_id: self.attachment_set_id,
})
}
}
}
impl AddCommunicationToCaseInput {
#[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::AddCommunicationToCase,
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::AddCommunicationToCaseInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::AddCommunicationToCaseInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSSupport_20130415.AddCommunicationToCase",
);
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_communication_to_case(
&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::AddCommunicationToCase::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"AddCommunicationToCase",
"support",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::add_communication_to_case_input::Builder {
crate::input::add_communication_to_case_input::Builder::default()
}
}
pub mod create_case_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) subject: std::option::Option<std::string::String>,
pub(crate) service_code: std::option::Option<std::string::String>,
pub(crate) severity_code: std::option::Option<std::string::String>,
pub(crate) category_code: std::option::Option<std::string::String>,
pub(crate) communication_body: std::option::Option<std::string::String>,
pub(crate) cc_email_addresses: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) language: std::option::Option<std::string::String>,
pub(crate) issue_type: std::option::Option<std::string::String>,
pub(crate) attachment_set_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn subject(mut self, input: impl Into<std::string::String>) -> Self {
self.subject = Some(input.into());
self
}
pub fn set_subject(mut self, input: std::option::Option<std::string::String>) -> Self {
self.subject = input;
self
}
pub fn service_code(mut self, input: impl Into<std::string::String>) -> Self {
self.service_code = Some(input.into());
self
}
pub fn set_service_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.service_code = input;
self
}
pub fn severity_code(mut self, input: impl Into<std::string::String>) -> Self {
self.severity_code = Some(input.into());
self
}
pub fn set_severity_code(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.severity_code = input;
self
}
pub fn category_code(mut self, input: impl Into<std::string::String>) -> Self {
self.category_code = Some(input.into());
self
}
pub fn set_category_code(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.category_code = input;
self
}
pub fn communication_body(mut self, input: impl Into<std::string::String>) -> Self {
self.communication_body = Some(input.into());
self
}
pub fn set_communication_body(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.communication_body = input;
self
}
pub fn cc_email_addresses(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.cc_email_addresses.unwrap_or_default();
v.push(input.into());
self.cc_email_addresses = Some(v);
self
}
pub fn set_cc_email_addresses(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.cc_email_addresses = input;
self
}
pub fn language(mut self, input: impl Into<std::string::String>) -> Self {
self.language = Some(input.into());
self
}
pub fn set_language(mut self, input: std::option::Option<std::string::String>) -> Self {
self.language = input;
self
}
pub fn issue_type(mut self, input: impl Into<std::string::String>) -> Self {
self.issue_type = Some(input.into());
self
}
pub fn set_issue_type(mut self, input: std::option::Option<std::string::String>) -> Self {
self.issue_type = input;
self
}
pub fn attachment_set_id(mut self, input: impl Into<std::string::String>) -> Self {
self.attachment_set_id = Some(input.into());
self
}
pub fn set_attachment_set_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.attachment_set_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateCaseInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateCaseInput {
subject: self.subject,
service_code: self.service_code,
severity_code: self.severity_code,
category_code: self.category_code,
communication_body: self.communication_body,
cc_email_addresses: self.cc_email_addresses,
language: self.language,
issue_type: self.issue_type,
attachment_set_id: self.attachment_set_id,
})
}
}
}
impl CreateCaseInput {
#[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::CreateCase,
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::CreateCaseInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateCaseInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSSupport_20130415.CreateCase",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_case(&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::CreateCase::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateCase",
"support",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_case_input::Builder {
crate::input::create_case_input::Builder::default()
}
}
pub mod describe_attachment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) attachment_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn attachment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.attachment_id = Some(input.into());
self
}
pub fn set_attachment_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.attachment_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeAttachmentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeAttachmentInput {
attachment_id: self.attachment_id,
})
}
}
}
impl DescribeAttachmentInput {
#[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::DescribeAttachment,
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::DescribeAttachmentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeAttachmentInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSSupport_20130415.DescribeAttachment",
);
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_describe_attachment(&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::DescribeAttachment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeAttachment",
"support",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_attachment_input::Builder {
crate::input::describe_attachment_input::Builder::default()
}
}
pub mod describe_cases_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) case_id_list: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) display_id: std::option::Option<std::string::String>,
pub(crate) after_time: std::option::Option<std::string::String>,
pub(crate) before_time: std::option::Option<std::string::String>,
pub(crate) include_resolved_cases: std::option::Option<bool>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) language: std::option::Option<std::string::String>,
pub(crate) include_communications: std::option::Option<bool>,
}
impl Builder {
pub fn case_id_list(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.case_id_list.unwrap_or_default();
v.push(input.into());
self.case_id_list = Some(v);
self
}
pub fn set_case_id_list(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.case_id_list = input;
self
}
pub fn display_id(mut self, input: impl Into<std::string::String>) -> Self {
self.display_id = Some(input.into());
self
}
pub fn set_display_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.display_id = input;
self
}
pub fn after_time(mut self, input: impl Into<std::string::String>) -> Self {
self.after_time = Some(input.into());
self
}
pub fn set_after_time(mut self, input: std::option::Option<std::string::String>) -> Self {
self.after_time = input;
self
}
pub fn before_time(mut self, input: impl Into<std::string::String>) -> Self {
self.before_time = Some(input.into());
self
}
pub fn set_before_time(mut self, input: std::option::Option<std::string::String>) -> Self {
self.before_time = input;
self
}
pub fn include_resolved_cases(mut self, input: bool) -> Self {
self.include_resolved_cases = Some(input);
self
}
pub fn set_include_resolved_cases(mut self, input: std::option::Option<bool>) -> Self {
self.include_resolved_cases = 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 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 language(mut self, input: impl Into<std::string::String>) -> Self {
self.language = Some(input.into());
self
}
pub fn set_language(mut self, input: std::option::Option<std::string::String>) -> Self {
self.language = input;
self
}
pub fn include_communications(mut self, input: bool) -> Self {
self.include_communications = Some(input);
self
}
pub fn set_include_communications(mut self, input: std::option::Option<bool>) -> Self {
self.include_communications = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DescribeCasesInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DescribeCasesInput {
case_id_list: self.case_id_list,
display_id: self.display_id,
after_time: self.after_time,
before_time: self.before_time,
include_resolved_cases: self.include_resolved_cases.unwrap_or_default(),
next_token: self.next_token,
max_results: self.max_results,
language: self.language,
include_communications: self.include_communications,
})
}
}
}
impl DescribeCasesInput {
#[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::DescribeCases,
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::DescribeCasesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeCasesInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSSupport_20130415.DescribeCases",
);
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_describe_cases(&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::DescribeCases::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeCases",
"support",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_cases_input::Builder {
crate::input::describe_cases_input::Builder::default()
}
}
pub mod describe_communications_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) case_id: std::option::Option<std::string::String>,
pub(crate) before_time: std::option::Option<std::string::String>,
pub(crate) after_time: std::option::Option<std::string::String>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn case_id(mut self, input: impl Into<std::string::String>) -> Self {
self.case_id = Some(input.into());
self
}
pub fn set_case_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.case_id = input;
self
}
pub fn before_time(mut self, input: impl Into<std::string::String>) -> Self {
self.before_time = Some(input.into());
self
}
pub fn set_before_time(mut self, input: std::option::Option<std::string::String>) -> Self {
self.before_time = input;
self
}
pub fn after_time(mut self, input: impl Into<std::string::String>) -> Self {
self.after_time = Some(input.into());
self
}
pub fn set_after_time(mut self, input: std::option::Option<std::string::String>) -> Self {
self.after_time = 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 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 build(
self,
) -> Result<
crate::input::DescribeCommunicationsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeCommunicationsInput {
case_id: self.case_id,
before_time: self.before_time,
after_time: self.after_time,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl DescribeCommunicationsInput {
#[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::DescribeCommunications,
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::DescribeCommunicationsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeCommunicationsInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSSupport_20130415.DescribeCommunications",
);
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_describe_communications(
&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::DescribeCommunications::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeCommunications",
"support",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_communications_input::Builder {
crate::input::describe_communications_input::Builder::default()
}
}
pub mod describe_services_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) service_code_list: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) language: std::option::Option<std::string::String>,
}
impl Builder {
pub fn service_code_list(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.service_code_list.unwrap_or_default();
v.push(input.into());
self.service_code_list = Some(v);
self
}
pub fn set_service_code_list(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.service_code_list = input;
self
}
pub fn language(mut self, input: impl Into<std::string::String>) -> Self {
self.language = Some(input.into());
self
}
pub fn set_language(mut self, input: std::option::Option<std::string::String>) -> Self {
self.language = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeServicesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeServicesInput {
service_code_list: self.service_code_list,
language: self.language,
})
}
}
}
impl DescribeServicesInput {
#[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::DescribeServices,
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::DescribeServicesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeServicesInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSSupport_20130415.DescribeServices",
);
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_describe_services(&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::DescribeServices::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeServices",
"support",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_services_input::Builder {
crate::input::describe_services_input::Builder::default()
}
}
pub mod describe_severity_levels_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) language: std::option::Option<std::string::String>,
}
impl Builder {
pub fn language(mut self, input: impl Into<std::string::String>) -> Self {
self.language = Some(input.into());
self
}
pub fn set_language(mut self, input: std::option::Option<std::string::String>) -> Self {
self.language = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeSeverityLevelsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeSeverityLevelsInput {
language: self.language,
})
}
}
}
impl DescribeSeverityLevelsInput {
#[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::DescribeSeverityLevels,
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::DescribeSeverityLevelsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeSeverityLevelsInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSSupport_20130415.DescribeSeverityLevels",
);
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_describe_severity_levels(
&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::DescribeSeverityLevels::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeSeverityLevels",
"support",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_severity_levels_input::Builder {
crate::input::describe_severity_levels_input::Builder::default()
}
}
pub mod describe_trusted_advisor_check_refresh_statuses_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) check_ids: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
pub fn check_ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.check_ids.unwrap_or_default();
v.push(input.into());
self.check_ids = Some(v);
self
}
pub fn set_check_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.check_ids = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeTrustedAdvisorCheckRefreshStatusesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(
crate::input::DescribeTrustedAdvisorCheckRefreshStatusesInput {
check_ids: self.check_ids,
},
)
}
}
}
impl DescribeTrustedAdvisorCheckRefreshStatusesInput {
#[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::DescribeTrustedAdvisorCheckRefreshStatuses,
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::DescribeTrustedAdvisorCheckRefreshStatusesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeTrustedAdvisorCheckRefreshStatusesInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSSupport_20130415.DescribeTrustedAdvisorCheckRefreshStatuses",
);
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_describe_trusted_advisor_check_refresh_statuses(&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::DescribeTrustedAdvisorCheckRefreshStatuses::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeTrustedAdvisorCheckRefreshStatuses",
"support",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_trusted_advisor_check_refresh_statuses_input::Builder
{
crate::input::describe_trusted_advisor_check_refresh_statuses_input::Builder::default()
}
}
pub mod describe_trusted_advisor_check_result_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) check_id: std::option::Option<std::string::String>,
pub(crate) language: std::option::Option<std::string::String>,
}
impl Builder {
pub fn check_id(mut self, input: impl Into<std::string::String>) -> Self {
self.check_id = Some(input.into());
self
}
pub fn set_check_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.check_id = input;
self
}
pub fn language(mut self, input: impl Into<std::string::String>) -> Self {
self.language = Some(input.into());
self
}
pub fn set_language(mut self, input: std::option::Option<std::string::String>) -> Self {
self.language = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeTrustedAdvisorCheckResultInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeTrustedAdvisorCheckResultInput {
check_id: self.check_id,
language: self.language,
})
}
}
}
impl DescribeTrustedAdvisorCheckResultInput {
#[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::DescribeTrustedAdvisorCheckResult,
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::DescribeTrustedAdvisorCheckResultInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeTrustedAdvisorCheckResultInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSSupport_20130415.DescribeTrustedAdvisorCheckResult",
);
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_describe_trusted_advisor_check_result(&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::DescribeTrustedAdvisorCheckResult::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeTrustedAdvisorCheckResult",
"support",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_trusted_advisor_check_result_input::Builder {
crate::input::describe_trusted_advisor_check_result_input::Builder::default()
}
}
pub mod describe_trusted_advisor_checks_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) language: std::option::Option<std::string::String>,
}
impl Builder {
pub fn language(mut self, input: impl Into<std::string::String>) -> Self {
self.language = Some(input.into());
self
}
pub fn set_language(mut self, input: std::option::Option<std::string::String>) -> Self {
self.language = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeTrustedAdvisorChecksInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeTrustedAdvisorChecksInput {
language: self.language,
})
}
}
}
impl DescribeTrustedAdvisorChecksInput {
#[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::DescribeTrustedAdvisorChecks,
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::DescribeTrustedAdvisorChecksInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeTrustedAdvisorChecksInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSSupport_20130415.DescribeTrustedAdvisorChecks",
);
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_describe_trusted_advisor_checks(&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::DescribeTrustedAdvisorChecks::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeTrustedAdvisorChecks",
"support",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_trusted_advisor_checks_input::Builder {
crate::input::describe_trusted_advisor_checks_input::Builder::default()
}
}
pub mod describe_trusted_advisor_check_summaries_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) check_ids: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
pub fn check_ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.check_ids.unwrap_or_default();
v.push(input.into());
self.check_ids = Some(v);
self
}
pub fn set_check_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.check_ids = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeTrustedAdvisorCheckSummariesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeTrustedAdvisorCheckSummariesInput {
check_ids: self.check_ids,
})
}
}
}
impl DescribeTrustedAdvisorCheckSummariesInput {
#[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::DescribeTrustedAdvisorCheckSummaries,
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::DescribeTrustedAdvisorCheckSummariesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeTrustedAdvisorCheckSummariesInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSSupport_20130415.DescribeTrustedAdvisorCheckSummaries",
);
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_describe_trusted_advisor_check_summaries(&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::DescribeTrustedAdvisorCheckSummaries::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeTrustedAdvisorCheckSummaries",
"support",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_trusted_advisor_check_summaries_input::Builder {
crate::input::describe_trusted_advisor_check_summaries_input::Builder::default()
}
}
pub mod refresh_trusted_advisor_check_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) check_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn check_id(mut self, input: impl Into<std::string::String>) -> Self {
self.check_id = Some(input.into());
self
}
pub fn set_check_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.check_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::RefreshTrustedAdvisorCheckInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::RefreshTrustedAdvisorCheckInput {
check_id: self.check_id,
})
}
}
}
impl RefreshTrustedAdvisorCheckInput {
#[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::RefreshTrustedAdvisorCheck,
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::RefreshTrustedAdvisorCheckInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RefreshTrustedAdvisorCheckInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSSupport_20130415.RefreshTrustedAdvisorCheck",
);
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_refresh_trusted_advisor_check(&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::RefreshTrustedAdvisorCheck::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RefreshTrustedAdvisorCheck",
"support",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::refresh_trusted_advisor_check_input::Builder {
crate::input::refresh_trusted_advisor_check_input::Builder::default()
}
}
pub mod resolve_case_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) case_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn case_id(mut self, input: impl Into<std::string::String>) -> Self {
self.case_id = Some(input.into());
self
}
pub fn set_case_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.case_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ResolveCaseInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ResolveCaseInput {
case_id: self.case_id,
})
}
}
}
impl ResolveCaseInput {
#[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::ResolveCase,
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::ResolveCaseInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ResolveCaseInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSSupport_20130415.ResolveCase",
);
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_resolve_case(&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::ResolveCase::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ResolveCase",
"support",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::resolve_case_input::Builder {
crate::input::resolve_case_input::Builder::default()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ResolveCaseInput {
#[doc(hidden)]
pub case_id: std::option::Option<std::string::String>,
}
impl ResolveCaseInput {
pub fn case_id(&self) -> std::option::Option<&str> {
self.case_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RefreshTrustedAdvisorCheckInput {
#[doc(hidden)]
pub check_id: std::option::Option<std::string::String>,
}
impl RefreshTrustedAdvisorCheckInput {
pub fn check_id(&self) -> std::option::Option<&str> {
self.check_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeTrustedAdvisorCheckSummariesInput {
#[doc(hidden)]
pub check_ids: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl DescribeTrustedAdvisorCheckSummariesInput {
pub fn check_ids(&self) -> std::option::Option<&[std::string::String]> {
self.check_ids.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeTrustedAdvisorChecksInput {
#[doc(hidden)]
pub language: std::option::Option<std::string::String>,
}
impl DescribeTrustedAdvisorChecksInput {
pub fn language(&self) -> std::option::Option<&str> {
self.language.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeTrustedAdvisorCheckResultInput {
#[doc(hidden)]
pub check_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub language: std::option::Option<std::string::String>,
}
impl DescribeTrustedAdvisorCheckResultInput {
pub fn check_id(&self) -> std::option::Option<&str> {
self.check_id.as_deref()
}
pub fn language(&self) -> std::option::Option<&str> {
self.language.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeTrustedAdvisorCheckRefreshStatusesInput {
#[doc(hidden)]
pub check_ids: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl DescribeTrustedAdvisorCheckRefreshStatusesInput {
pub fn check_ids(&self) -> std::option::Option<&[std::string::String]> {
self.check_ids.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeSeverityLevelsInput {
#[doc(hidden)]
pub language: std::option::Option<std::string::String>,
}
impl DescribeSeverityLevelsInput {
pub fn language(&self) -> std::option::Option<&str> {
self.language.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeServicesInput {
#[doc(hidden)]
pub service_code_list: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub language: std::option::Option<std::string::String>,
}
impl DescribeServicesInput {
pub fn service_code_list(&self) -> std::option::Option<&[std::string::String]> {
self.service_code_list.as_deref()
}
pub fn language(&self) -> std::option::Option<&str> {
self.language.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeCommunicationsInput {
#[doc(hidden)]
pub case_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub before_time: std::option::Option<std::string::String>,
#[doc(hidden)]
pub after_time: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl DescribeCommunicationsInput {
pub fn case_id(&self) -> std::option::Option<&str> {
self.case_id.as_deref()
}
pub fn before_time(&self) -> std::option::Option<&str> {
self.before_time.as_deref()
}
pub fn after_time(&self) -> std::option::Option<&str> {
self.after_time.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeCasesInput {
#[doc(hidden)]
pub case_id_list: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub display_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub after_time: std::option::Option<std::string::String>,
#[doc(hidden)]
pub before_time: std::option::Option<std::string::String>,
#[doc(hidden)]
pub include_resolved_cases: bool,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub language: std::option::Option<std::string::String>,
#[doc(hidden)]
pub include_communications: std::option::Option<bool>,
}
impl DescribeCasesInput {
pub fn case_id_list(&self) -> std::option::Option<&[std::string::String]> {
self.case_id_list.as_deref()
}
pub fn display_id(&self) -> std::option::Option<&str> {
self.display_id.as_deref()
}
pub fn after_time(&self) -> std::option::Option<&str> {
self.after_time.as_deref()
}
pub fn before_time(&self) -> std::option::Option<&str> {
self.before_time.as_deref()
}
pub fn include_resolved_cases(&self) -> bool {
self.include_resolved_cases
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn language(&self) -> std::option::Option<&str> {
self.language.as_deref()
}
pub fn include_communications(&self) -> std::option::Option<bool> {
self.include_communications
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeAttachmentInput {
#[doc(hidden)]
pub attachment_id: std::option::Option<std::string::String>,
}
impl DescribeAttachmentInput {
pub fn attachment_id(&self) -> std::option::Option<&str> {
self.attachment_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateCaseInput {
#[doc(hidden)]
pub subject: std::option::Option<std::string::String>,
#[doc(hidden)]
pub service_code: std::option::Option<std::string::String>,
#[doc(hidden)]
pub severity_code: std::option::Option<std::string::String>,
#[doc(hidden)]
pub category_code: std::option::Option<std::string::String>,
#[doc(hidden)]
pub communication_body: std::option::Option<std::string::String>,
#[doc(hidden)]
pub cc_email_addresses: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub language: std::option::Option<std::string::String>,
#[doc(hidden)]
pub issue_type: std::option::Option<std::string::String>,
#[doc(hidden)]
pub attachment_set_id: std::option::Option<std::string::String>,
}
impl CreateCaseInput {
pub fn subject(&self) -> std::option::Option<&str> {
self.subject.as_deref()
}
pub fn service_code(&self) -> std::option::Option<&str> {
self.service_code.as_deref()
}
pub fn severity_code(&self) -> std::option::Option<&str> {
self.severity_code.as_deref()
}
pub fn category_code(&self) -> std::option::Option<&str> {
self.category_code.as_deref()
}
pub fn communication_body(&self) -> std::option::Option<&str> {
self.communication_body.as_deref()
}
pub fn cc_email_addresses(&self) -> std::option::Option<&[std::string::String]> {
self.cc_email_addresses.as_deref()
}
pub fn language(&self) -> std::option::Option<&str> {
self.language.as_deref()
}
pub fn issue_type(&self) -> std::option::Option<&str> {
self.issue_type.as_deref()
}
pub fn attachment_set_id(&self) -> std::option::Option<&str> {
self.attachment_set_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AddCommunicationToCaseInput {
#[doc(hidden)]
pub case_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub communication_body: std::option::Option<std::string::String>,
#[doc(hidden)]
pub cc_email_addresses: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub attachment_set_id: std::option::Option<std::string::String>,
}
impl AddCommunicationToCaseInput {
pub fn case_id(&self) -> std::option::Option<&str> {
self.case_id.as_deref()
}
pub fn communication_body(&self) -> std::option::Option<&str> {
self.communication_body.as_deref()
}
pub fn cc_email_addresses(&self) -> std::option::Option<&[std::string::String]> {
self.cc_email_addresses.as_deref()
}
pub fn attachment_set_id(&self) -> std::option::Option<&str> {
self.attachment_set_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AddAttachmentsToSetInput {
#[doc(hidden)]
pub attachment_set_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub attachments: std::option::Option<std::vec::Vec<crate::model::Attachment>>,
}
impl AddAttachmentsToSetInput {
pub fn attachment_set_id(&self) -> std::option::Option<&str> {
self.attachment_set_id.as_deref()
}
pub fn attachments(&self) -> std::option::Option<&[crate::model::Attachment]> {
self.attachments.as_deref()
}
}