use std::fmt::Write;
pub mod cancel_order_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) order_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn order_id(mut self, input: impl Into<std::string::String>) -> Self {
self.order_id = Some(input.into());
self
}
pub fn set_order_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.order_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CancelOrderInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CancelOrderInput {
order_id: self.order_id,
})
}
}
}
impl CancelOrderInput {
#[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::CancelOrder,
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::CancelOrderInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_1 = &_input.order_id;
let input_1 = input_1.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"order_id",
"cannot be empty or unset",
)
})?;
let order_id = aws_smithy_http::label::fmt_string(
input_1,
aws_smithy_http::label::EncodingStrategy::Default,
);
if order_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"order_id",
"cannot be empty or unset",
),
);
}
write!(output, "/orders/{OrderId}/cancel", OrderId = order_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CancelOrderInput,
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
};
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::CancelOrder::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CancelOrder",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::cancel_order_input::Builder {
crate::input::cancel_order_input::Builder::default()
}
}
pub mod create_order_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) outpost_identifier: std::option::Option<std::string::String>,
pub(crate) line_items: std::option::Option<std::vec::Vec<crate::model::LineItemRequest>>,
pub(crate) payment_option: std::option::Option<crate::model::PaymentOption>,
pub(crate) payment_term: std::option::Option<crate::model::PaymentTerm>,
}
impl Builder {
pub fn outpost_identifier(mut self, input: impl Into<std::string::String>) -> Self {
self.outpost_identifier = Some(input.into());
self
}
pub fn set_outpost_identifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.outpost_identifier = input;
self
}
pub fn line_items(mut self, input: crate::model::LineItemRequest) -> Self {
let mut v = self.line_items.unwrap_or_default();
v.push(input);
self.line_items = Some(v);
self
}
pub fn set_line_items(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::LineItemRequest>>,
) -> Self {
self.line_items = input;
self
}
pub fn payment_option(mut self, input: crate::model::PaymentOption) -> Self {
self.payment_option = Some(input);
self
}
pub fn set_payment_option(
mut self,
input: std::option::Option<crate::model::PaymentOption>,
) -> Self {
self.payment_option = input;
self
}
pub fn payment_term(mut self, input: crate::model::PaymentTerm) -> Self {
self.payment_term = Some(input);
self
}
pub fn set_payment_term(
mut self,
input: std::option::Option<crate::model::PaymentTerm>,
) -> Self {
self.payment_term = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateOrderInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateOrderInput {
outpost_identifier: self.outpost_identifier,
line_items: self.line_items,
payment_option: self.payment_option,
payment_term: self.payment_term,
})
}
}
}
impl CreateOrderInput {
#[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::CreateOrder,
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::CreateOrderInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/orders").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateOrderInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_order(&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::CreateOrder::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateOrder",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_order_input::Builder {
crate::input::create_order_input::Builder::default()
}
}
pub mod create_outpost_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) site_id: std::option::Option<std::string::String>,
pub(crate) availability_zone: std::option::Option<std::string::String>,
pub(crate) availability_zone_id: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) supported_hardware_type:
std::option::Option<crate::model::SupportedHardwareType>,
}
impl Builder {
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn site_id(mut self, input: impl Into<std::string::String>) -> Self {
self.site_id = Some(input.into());
self
}
pub fn set_site_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.site_id = input;
self
}
pub fn availability_zone(mut self, input: impl Into<std::string::String>) -> Self {
self.availability_zone = Some(input.into());
self
}
pub fn set_availability_zone(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.availability_zone = input;
self
}
pub fn availability_zone_id(mut self, input: impl Into<std::string::String>) -> Self {
self.availability_zone_id = Some(input.into());
self
}
pub fn set_availability_zone_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.availability_zone_id = 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 supported_hardware_type(
mut self,
input: crate::model::SupportedHardwareType,
) -> Self {
self.supported_hardware_type = Some(input);
self
}
pub fn set_supported_hardware_type(
mut self,
input: std::option::Option<crate::model::SupportedHardwareType>,
) -> Self {
self.supported_hardware_type = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateOutpostInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateOutpostInput {
name: self.name,
description: self.description,
site_id: self.site_id,
availability_zone: self.availability_zone,
availability_zone_id: self.availability_zone_id,
tags: self.tags,
supported_hardware_type: self.supported_hardware_type,
})
}
}
}
impl CreateOutpostInput {
#[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::CreateOutpost,
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::CreateOutpostInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/outposts").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateOutpostInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_outpost(&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::CreateOutpost::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateOutpost",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_outpost_input::Builder {
crate::input::create_outpost_input::Builder::default()
}
}
pub mod create_site_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) notes: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) operating_address: std::option::Option<crate::model::Address>,
pub(crate) shipping_address: std::option::Option<crate::model::Address>,
pub(crate) rack_physical_properties:
std::option::Option<crate::model::RackPhysicalProperties>,
}
impl Builder {
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn notes(mut self, input: impl Into<std::string::String>) -> Self {
self.notes = Some(input.into());
self
}
pub fn set_notes(mut self, input: std::option::Option<std::string::String>) -> Self {
self.notes = 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 operating_address(mut self, input: crate::model::Address) -> Self {
self.operating_address = Some(input);
self
}
pub fn set_operating_address(
mut self,
input: std::option::Option<crate::model::Address>,
) -> Self {
self.operating_address = input;
self
}
pub fn shipping_address(mut self, input: crate::model::Address) -> Self {
self.shipping_address = Some(input);
self
}
pub fn set_shipping_address(
mut self,
input: std::option::Option<crate::model::Address>,
) -> Self {
self.shipping_address = input;
self
}
pub fn rack_physical_properties(
mut self,
input: crate::model::RackPhysicalProperties,
) -> Self {
self.rack_physical_properties = Some(input);
self
}
pub fn set_rack_physical_properties(
mut self,
input: std::option::Option<crate::model::RackPhysicalProperties>,
) -> Self {
self.rack_physical_properties = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateSiteInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateSiteInput {
name: self.name,
description: self.description,
notes: self.notes,
tags: self.tags,
operating_address: self.operating_address,
shipping_address: self.shipping_address,
rack_physical_properties: self.rack_physical_properties,
})
}
}
}
impl CreateSiteInput {
#[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::CreateSite,
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::CreateSiteInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/sites").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateSiteInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_site(&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::CreateSite::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateSite",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_site_input::Builder {
crate::input::create_site_input::Builder::default()
}
}
pub mod delete_outpost_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) outpost_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn outpost_id(mut self, input: impl Into<std::string::String>) -> Self {
self.outpost_id = Some(input.into());
self
}
pub fn set_outpost_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.outpost_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteOutpostInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteOutpostInput {
outpost_id: self.outpost_id,
})
}
}
}
impl DeleteOutpostInput {
#[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::DeleteOutpost,
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::DeleteOutpostInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_2 = &_input.outpost_id;
let input_2 = input_2.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"outpost_id",
"cannot be empty or unset",
)
})?;
let outpost_id = aws_smithy_http::label::fmt_string(
input_2,
aws_smithy_http::label::EncodingStrategy::Default,
);
if outpost_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"outpost_id",
"cannot be empty or unset",
),
);
}
write!(output, "/outposts/{OutpostId}", OutpostId = outpost_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteOutpostInput,
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::DeleteOutpost::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteOutpost",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_outpost_input::Builder {
crate::input::delete_outpost_input::Builder::default()
}
}
pub mod delete_site_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) site_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn site_id(mut self, input: impl Into<std::string::String>) -> Self {
self.site_id = Some(input.into());
self
}
pub fn set_site_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.site_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteSiteInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteSiteInput {
site_id: self.site_id,
})
}
}
}
impl DeleteSiteInput {
#[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::DeleteSite,
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::DeleteSiteInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_3 = &_input.site_id;
let input_3 = input_3.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"site_id",
"cannot be empty or unset",
)
})?;
let site_id = aws_smithy_http::label::fmt_string(
input_3,
aws_smithy_http::label::EncodingStrategy::Default,
);
if site_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"site_id",
"cannot be empty or unset",
),
);
}
write!(output, "/sites/{SiteId}", SiteId = site_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteSiteInput,
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::DeleteSite::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteSite",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_site_input::Builder {
crate::input::delete_site_input::Builder::default()
}
}
pub mod get_catalog_item_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) catalog_item_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn catalog_item_id(mut self, input: impl Into<std::string::String>) -> Self {
self.catalog_item_id = Some(input.into());
self
}
pub fn set_catalog_item_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.catalog_item_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetCatalogItemInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetCatalogItemInput {
catalog_item_id: self.catalog_item_id,
})
}
}
}
impl GetCatalogItemInput {
#[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::GetCatalogItem,
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::GetCatalogItemInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_4 = &_input.catalog_item_id;
let input_4 = input_4.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"catalog_item_id",
"cannot be empty or unset",
)
})?;
let catalog_item_id = aws_smithy_http::label::fmt_string(
input_4,
aws_smithy_http::label::EncodingStrategy::Default,
);
if catalog_item_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"catalog_item_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/catalog/item/{CatalogItemId}",
CatalogItemId = catalog_item_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetCatalogItemInput,
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::GetCatalogItem::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetCatalogItem",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_catalog_item_input::Builder {
crate::input::get_catalog_item_input::Builder::default()
}
}
pub mod get_connection_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) connection_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn connection_id(mut self, input: impl Into<std::string::String>) -> Self {
self.connection_id = Some(input.into());
self
}
pub fn set_connection_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.connection_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetConnectionInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetConnectionInput {
connection_id: self.connection_id,
})
}
}
}
impl GetConnectionInput {
#[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::GetConnection,
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::GetConnectionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_5 = &_input.connection_id;
let input_5 = input_5.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"connection_id",
"cannot be empty or unset",
)
})?;
let connection_id = aws_smithy_http::label::fmt_string(
input_5,
aws_smithy_http::label::EncodingStrategy::Default,
);
if connection_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"connection_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/connections/{ConnectionId}",
ConnectionId = connection_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetConnectionInput,
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::GetConnection::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetConnection",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_connection_input::Builder {
crate::input::get_connection_input::Builder::default()
}
}
pub mod get_order_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) order_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn order_id(mut self, input: impl Into<std::string::String>) -> Self {
self.order_id = Some(input.into());
self
}
pub fn set_order_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.order_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetOrderInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetOrderInput {
order_id: self.order_id,
})
}
}
}
impl GetOrderInput {
#[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::GetOrder,
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::GetOrderInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_6 = &_input.order_id;
let input_6 = input_6.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"order_id",
"cannot be empty or unset",
)
})?;
let order_id = aws_smithy_http::label::fmt_string(
input_6,
aws_smithy_http::label::EncodingStrategy::Default,
);
if order_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"order_id",
"cannot be empty or unset",
),
);
}
write!(output, "/orders/{OrderId}", OrderId = order_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetOrderInput,
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::GetOrder::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetOrder", "outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_order_input::Builder {
crate::input::get_order_input::Builder::default()
}
}
pub mod get_outpost_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) outpost_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn outpost_id(mut self, input: impl Into<std::string::String>) -> Self {
self.outpost_id = Some(input.into());
self
}
pub fn set_outpost_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.outpost_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetOutpostInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetOutpostInput {
outpost_id: self.outpost_id,
})
}
}
}
impl GetOutpostInput {
#[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::GetOutpost,
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::GetOutpostInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_7 = &_input.outpost_id;
let input_7 = input_7.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"outpost_id",
"cannot be empty or unset",
)
})?;
let outpost_id = aws_smithy_http::label::fmt_string(
input_7,
aws_smithy_http::label::EncodingStrategy::Default,
);
if outpost_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"outpost_id",
"cannot be empty or unset",
),
);
}
write!(output, "/outposts/{OutpostId}", OutpostId = outpost_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetOutpostInput,
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::GetOutpost::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetOutpost",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_outpost_input::Builder {
crate::input::get_outpost_input::Builder::default()
}
}
pub mod get_outpost_instance_types_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) outpost_id: 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 outpost_id(mut self, input: impl Into<std::string::String>) -> Self {
self.outpost_id = Some(input.into());
self
}
pub fn set_outpost_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.outpost_id = 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::GetOutpostInstanceTypesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetOutpostInstanceTypesInput {
outpost_id: self.outpost_id,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl GetOutpostInstanceTypesInput {
#[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::GetOutpostInstanceTypes,
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::GetOutpostInstanceTypesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_8 = &_input.outpost_id;
let input_8 = input_8.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"outpost_id",
"cannot be empty or unset",
)
})?;
let outpost_id = aws_smithy_http::label::fmt_string(
input_8,
aws_smithy_http::label::EncodingStrategy::Default,
);
if outpost_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"outpost_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/outposts/{OutpostId}/instanceTypes",
OutpostId = outpost_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetOutpostInstanceTypesInput,
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.next_token {
{
query.push_kv("NextToken", &aws_smithy_http::query::fmt_string(&inner_9));
}
}
if let Some(inner_10) = &_input.max_results {
if *inner_10 != 0 {
query.push_kv(
"MaxResults",
aws_smithy_types::primitive::Encoder::from(*inner_10).encode(),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetOutpostInstanceTypesInput,
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::GetOutpostInstanceTypes::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetOutpostInstanceTypes",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_outpost_instance_types_input::Builder {
crate::input::get_outpost_instance_types_input::Builder::default()
}
}
pub mod get_site_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) site_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn site_id(mut self, input: impl Into<std::string::String>) -> Self {
self.site_id = Some(input.into());
self
}
pub fn set_site_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.site_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetSiteInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetSiteInput {
site_id: self.site_id,
})
}
}
}
impl GetSiteInput {
#[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::GetSite,
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::GetSiteInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_11 = &_input.site_id;
let input_11 = input_11.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"site_id",
"cannot be empty or unset",
)
})?;
let site_id = aws_smithy_http::label::fmt_string(
input_11,
aws_smithy_http::label::EncodingStrategy::Default,
);
if site_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"site_id",
"cannot be empty or unset",
),
);
}
write!(output, "/sites/{SiteId}", SiteId = site_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetSiteInput,
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::GetSite::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetSite", "outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_site_input::Builder {
crate::input::get_site_input::Builder::default()
}
}
pub mod get_site_address_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) site_id: std::option::Option<std::string::String>,
pub(crate) address_type: std::option::Option<crate::model::AddressType>,
}
impl Builder {
pub fn site_id(mut self, input: impl Into<std::string::String>) -> Self {
self.site_id = Some(input.into());
self
}
pub fn set_site_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.site_id = input;
self
}
pub fn address_type(mut self, input: crate::model::AddressType) -> Self {
self.address_type = Some(input);
self
}
pub fn set_address_type(
mut self,
input: std::option::Option<crate::model::AddressType>,
) -> Self {
self.address_type = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetSiteAddressInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetSiteAddressInput {
site_id: self.site_id,
address_type: self.address_type,
})
}
}
}
impl GetSiteAddressInput {
#[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::GetSiteAddress,
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::GetSiteAddressInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_12 = &_input.site_id;
let input_12 = input_12.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"site_id",
"cannot be empty or unset",
)
})?;
let site_id = aws_smithy_http::label::fmt_string(
input_12,
aws_smithy_http::label::EncodingStrategy::Default,
);
if site_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"site_id",
"cannot be empty or unset",
),
);
}
write!(output, "/sites/{SiteId}/address", SiteId = site_id)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetSiteAddressInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_13 = &_input.address_type;
let inner_13 = inner_13.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"address_type",
"cannot be empty or unset",
)
})?;
query.push_kv(
"AddressType",
&aws_smithy_http::query::fmt_string(&inner_13),
);
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetSiteAddressInput,
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::GetSiteAddress::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetSiteAddress",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_site_address_input::Builder {
crate::input::get_site_address_input::Builder::default()
}
}
pub mod list_assets_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) outpost_identifier: std::option::Option<std::string::String>,
pub(crate) host_id_filter: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) status_filter: std::option::Option<std::vec::Vec<crate::model::AssetState>>,
}
impl Builder {
pub fn outpost_identifier(mut self, input: impl Into<std::string::String>) -> Self {
self.outpost_identifier = Some(input.into());
self
}
pub fn set_outpost_identifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.outpost_identifier = input;
self
}
pub fn host_id_filter(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.host_id_filter.unwrap_or_default();
v.push(input.into());
self.host_id_filter = Some(v);
self
}
pub fn set_host_id_filter(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.host_id_filter = 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 status_filter(mut self, input: crate::model::AssetState) -> Self {
let mut v = self.status_filter.unwrap_or_default();
v.push(input);
self.status_filter = Some(v);
self
}
pub fn set_status_filter(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::AssetState>>,
) -> Self {
self.status_filter = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListAssetsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListAssetsInput {
outpost_identifier: self.outpost_identifier,
host_id_filter: self.host_id_filter,
max_results: self.max_results,
next_token: self.next_token,
status_filter: self.status_filter,
})
}
}
}
impl ListAssetsInput {
#[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::ListAssets,
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::ListAssetsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_14 = &_input.outpost_identifier;
let input_14 = input_14.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"outpost_identifier",
"cannot be empty or unset",
)
})?;
let outpost_identifier = aws_smithy_http::label::fmt_string(
input_14,
aws_smithy_http::label::EncodingStrategy::Default,
);
if outpost_identifier.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"outpost_identifier",
"cannot be empty or unset",
),
);
}
write!(
output,
"/outposts/{OutpostIdentifier}/assets",
OutpostIdentifier = outpost_identifier
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListAssetsInput,
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_15) = &_input.host_id_filter {
{
for inner_16 in inner_15 {
query.push_kv(
"HostIdFilter",
&aws_smithy_http::query::fmt_string(&inner_16),
);
}
}
}
if let Some(inner_17) = &_input.max_results {
if *inner_17 != 0 {
query.push_kv(
"MaxResults",
aws_smithy_types::primitive::Encoder::from(*inner_17).encode(),
);
}
}
if let Some(inner_18) = &_input.next_token {
{
query.push_kv("NextToken", &aws_smithy_http::query::fmt_string(&inner_18));
}
}
if let Some(inner_19) = &_input.status_filter {
{
for inner_20 in inner_19 {
query.push_kv(
"StatusFilter",
&aws_smithy_http::query::fmt_string(&inner_20),
);
}
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListAssetsInput,
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::ListAssets::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListAssets",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_assets_input::Builder {
crate::input::list_assets_input::Builder::default()
}
}
pub mod list_catalog_items_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) item_class_filter:
std::option::Option<std::vec::Vec<crate::model::CatalogItemClass>>,
pub(crate) supported_storage_filter:
std::option::Option<std::vec::Vec<crate::model::SupportedStorageEnum>>,
pub(crate) ec2_family_filter: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
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 item_class_filter(mut self, input: crate::model::CatalogItemClass) -> Self {
let mut v = self.item_class_filter.unwrap_or_default();
v.push(input);
self.item_class_filter = Some(v);
self
}
pub fn set_item_class_filter(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::CatalogItemClass>>,
) -> Self {
self.item_class_filter = input;
self
}
pub fn supported_storage_filter(
mut self,
input: crate::model::SupportedStorageEnum,
) -> Self {
let mut v = self.supported_storage_filter.unwrap_or_default();
v.push(input);
self.supported_storage_filter = Some(v);
self
}
pub fn set_supported_storage_filter(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::SupportedStorageEnum>>,
) -> Self {
self.supported_storage_filter = input;
self
}
pub fn ec2_family_filter(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.ec2_family_filter.unwrap_or_default();
v.push(input.into());
self.ec2_family_filter = Some(v);
self
}
pub fn set_ec2_family_filter(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.ec2_family_filter = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListCatalogItemsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListCatalogItemsInput {
next_token: self.next_token,
max_results: self.max_results,
item_class_filter: self.item_class_filter,
supported_storage_filter: self.supported_storage_filter,
ec2_family_filter: self.ec2_family_filter,
})
}
}
}
impl ListCatalogItemsInput {
#[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::ListCatalogItems,
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::ListCatalogItemsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/catalog/items").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListCatalogItemsInput,
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_21) = &_input.next_token {
{
query.push_kv("NextToken", &aws_smithy_http::query::fmt_string(&inner_21));
}
}
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.item_class_filter {
{
for inner_24 in inner_23 {
query.push_kv(
"ItemClassFilter",
&aws_smithy_http::query::fmt_string(&inner_24),
);
}
}
}
if let Some(inner_25) = &_input.supported_storage_filter {
{
for inner_26 in inner_25 {
query.push_kv(
"SupportedStorageFilter",
&aws_smithy_http::query::fmt_string(&inner_26),
);
}
}
}
if let Some(inner_27) = &_input.ec2_family_filter {
{
for inner_28 in inner_27 {
query.push_kv(
"EC2FamilyFilter",
&aws_smithy_http::query::fmt_string(&inner_28),
);
}
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListCatalogItemsInput,
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::ListCatalogItems::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListCatalogItems",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_catalog_items_input::Builder {
crate::input::list_catalog_items_input::Builder::default()
}
}
pub mod list_orders_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) outpost_identifier_filter: 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 outpost_identifier_filter(mut self, input: impl Into<std::string::String>) -> Self {
self.outpost_identifier_filter = Some(input.into());
self
}
pub fn set_outpost_identifier_filter(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.outpost_identifier_filter = 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::ListOrdersInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListOrdersInput {
outpost_identifier_filter: self.outpost_identifier_filter,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl ListOrdersInput {
#[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::ListOrders,
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::ListOrdersInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/list-orders").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListOrdersInput,
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_29) = &_input.outpost_identifier_filter {
{
query.push_kv(
"OutpostIdentifierFilter",
&aws_smithy_http::query::fmt_string(&inner_29),
);
}
}
if let Some(inner_30) = &_input.next_token {
{
query.push_kv("NextToken", &aws_smithy_http::query::fmt_string(&inner_30));
}
}
if let Some(inner_31) = &_input.max_results {
if *inner_31 != 0 {
query.push_kv(
"MaxResults",
aws_smithy_types::primitive::Encoder::from(*inner_31).encode(),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListOrdersInput,
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::ListOrders::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListOrders",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_orders_input::Builder {
crate::input::list_orders_input::Builder::default()
}
}
pub mod list_outposts_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) life_cycle_status_filter:
std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) availability_zone_filter:
std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) availability_zone_id_filter:
std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
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 life_cycle_status_filter(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.life_cycle_status_filter.unwrap_or_default();
v.push(input.into());
self.life_cycle_status_filter = Some(v);
self
}
pub fn set_life_cycle_status_filter(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.life_cycle_status_filter = input;
self
}
pub fn availability_zone_filter(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.availability_zone_filter.unwrap_or_default();
v.push(input.into());
self.availability_zone_filter = Some(v);
self
}
pub fn set_availability_zone_filter(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.availability_zone_filter = input;
self
}
pub fn availability_zone_id_filter(
mut self,
input: impl Into<std::string::String>,
) -> Self {
let mut v = self.availability_zone_id_filter.unwrap_or_default();
v.push(input.into());
self.availability_zone_id_filter = Some(v);
self
}
pub fn set_availability_zone_id_filter(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.availability_zone_id_filter = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListOutpostsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListOutpostsInput {
next_token: self.next_token,
max_results: self.max_results,
life_cycle_status_filter: self.life_cycle_status_filter,
availability_zone_filter: self.availability_zone_filter,
availability_zone_id_filter: self.availability_zone_id_filter,
})
}
}
}
impl ListOutpostsInput {
#[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::ListOutposts,
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::ListOutpostsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/outposts").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListOutpostsInput,
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_32) = &_input.next_token {
{
query.push_kv("NextToken", &aws_smithy_http::query::fmt_string(&inner_32));
}
}
if let Some(inner_33) = &_input.max_results {
if *inner_33 != 0 {
query.push_kv(
"MaxResults",
aws_smithy_types::primitive::Encoder::from(*inner_33).encode(),
);
}
}
if let Some(inner_34) = &_input.life_cycle_status_filter {
{
for inner_35 in inner_34 {
query.push_kv(
"LifeCycleStatusFilter",
&aws_smithy_http::query::fmt_string(&inner_35),
);
}
}
}
if let Some(inner_36) = &_input.availability_zone_filter {
{
for inner_37 in inner_36 {
query.push_kv(
"AvailabilityZoneFilter",
&aws_smithy_http::query::fmt_string(&inner_37),
);
}
}
}
if let Some(inner_38) = &_input.availability_zone_id_filter {
{
for inner_39 in inner_38 {
query.push_kv(
"AvailabilityZoneIdFilter",
&aws_smithy_http::query::fmt_string(&inner_39),
);
}
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListOutpostsInput,
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::ListOutposts::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListOutposts",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_outposts_input::Builder {
crate::input::list_outposts_input::Builder::default()
}
}
pub mod list_sites_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) operating_address_country_code_filter:
std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) operating_address_state_or_region_filter:
std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) operating_address_city_filter:
std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
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 operating_address_country_code_filter(
mut self,
input: impl Into<std::string::String>,
) -> Self {
let mut v = self
.operating_address_country_code_filter
.unwrap_or_default();
v.push(input.into());
self.operating_address_country_code_filter = Some(v);
self
}
pub fn set_operating_address_country_code_filter(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.operating_address_country_code_filter = input;
self
}
pub fn operating_address_state_or_region_filter(
mut self,
input: impl Into<std::string::String>,
) -> Self {
let mut v = self
.operating_address_state_or_region_filter
.unwrap_or_default();
v.push(input.into());
self.operating_address_state_or_region_filter = Some(v);
self
}
pub fn set_operating_address_state_or_region_filter(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.operating_address_state_or_region_filter = input;
self
}
pub fn operating_address_city_filter(
mut self,
input: impl Into<std::string::String>,
) -> Self {
let mut v = self.operating_address_city_filter.unwrap_or_default();
v.push(input.into());
self.operating_address_city_filter = Some(v);
self
}
pub fn set_operating_address_city_filter(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.operating_address_city_filter = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListSitesInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListSitesInput {
next_token: self.next_token,
max_results: self.max_results,
operating_address_country_code_filter: self.operating_address_country_code_filter,
operating_address_state_or_region_filter: self
.operating_address_state_or_region_filter,
operating_address_city_filter: self.operating_address_city_filter,
})
}
}
}
impl ListSitesInput {
#[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::ListSites,
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::ListSitesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/sites").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListSitesInput,
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_40) = &_input.next_token {
{
query.push_kv("NextToken", &aws_smithy_http::query::fmt_string(&inner_40));
}
}
if let Some(inner_41) = &_input.max_results {
if *inner_41 != 0 {
query.push_kv(
"MaxResults",
aws_smithy_types::primitive::Encoder::from(*inner_41).encode(),
);
}
}
if let Some(inner_42) = &_input.operating_address_country_code_filter {
{
for inner_43 in inner_42 {
query.push_kv(
"OperatingAddressCountryCodeFilter",
&aws_smithy_http::query::fmt_string(&inner_43),
);
}
}
}
if let Some(inner_44) = &_input.operating_address_state_or_region_filter {
{
for inner_45 in inner_44 {
query.push_kv(
"OperatingAddressStateOrRegionFilter",
&aws_smithy_http::query::fmt_string(&inner_45),
);
}
}
}
if let Some(inner_46) = &_input.operating_address_city_filter {
{
for inner_47 in inner_46 {
query.push_kv(
"OperatingAddressCityFilter",
&aws_smithy_http::query::fmt_string(&inner_47),
);
}
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListSitesInput,
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::ListSites::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListSites",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_sites_input::Builder {
crate::input::list_sites_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_48 = &_input.resource_arn;
let input_48 = input_48.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_48,
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",
"outposts",
));
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 start_connection_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) device_serial_number: std::option::Option<std::string::String>,
pub(crate) asset_id: std::option::Option<std::string::String>,
pub(crate) client_public_key: std::option::Option<std::string::String>,
pub(crate) network_interface_device_index: std::option::Option<i32>,
}
impl Builder {
pub fn device_serial_number(mut self, input: impl Into<std::string::String>) -> Self {
self.device_serial_number = Some(input.into());
self
}
pub fn set_device_serial_number(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.device_serial_number = input;
self
}
pub fn asset_id(mut self, input: impl Into<std::string::String>) -> Self {
self.asset_id = Some(input.into());
self
}
pub fn set_asset_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.asset_id = input;
self
}
pub fn client_public_key(mut self, input: impl Into<std::string::String>) -> Self {
self.client_public_key = Some(input.into());
self
}
pub fn set_client_public_key(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_public_key = input;
self
}
pub fn network_interface_device_index(mut self, input: i32) -> Self {
self.network_interface_device_index = Some(input);
self
}
pub fn set_network_interface_device_index(
mut self,
input: std::option::Option<i32>,
) -> Self {
self.network_interface_device_index = input;
self
}
pub fn build(
self,
) -> Result<crate::input::StartConnectionInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::StartConnectionInput {
device_serial_number: self.device_serial_number,
asset_id: self.asset_id,
client_public_key: self.client_public_key,
network_interface_device_index: self
.network_interface_device_index
.unwrap_or_default(),
})
}
}
}
impl StartConnectionInput {
#[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::StartConnection,
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::StartConnectionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/connections").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::StartConnectionInput,
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_connection(&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::StartConnection::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"StartConnection",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::start_connection_input::Builder {
crate::input::start_connection_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_49 = &_input.resource_arn;
let input_49 = input_49.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_49,
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",
"outposts",
));
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_50 = &_input.resource_arn;
let input_50 = input_50.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_50,
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_51 = &_input.tag_keys;
let inner_51 = inner_51.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"tag_keys",
"cannot be empty or unset",
)
})?;
for inner_52 in inner_51 {
query.push_kv("tagKeys", &aws_smithy_http::query::fmt_string(&inner_52));
}
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",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::untag_resource_input::Builder {
crate::input::untag_resource_input::Builder::default()
}
}
pub mod update_outpost_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) outpost_id: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) supported_hardware_type:
std::option::Option<crate::model::SupportedHardwareType>,
}
impl Builder {
pub fn outpost_id(mut self, input: impl Into<std::string::String>) -> Self {
self.outpost_id = Some(input.into());
self
}
pub fn set_outpost_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.outpost_id = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn supported_hardware_type(
mut self,
input: crate::model::SupportedHardwareType,
) -> Self {
self.supported_hardware_type = Some(input);
self
}
pub fn set_supported_hardware_type(
mut self,
input: std::option::Option<crate::model::SupportedHardwareType>,
) -> Self {
self.supported_hardware_type = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateOutpostInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateOutpostInput {
outpost_id: self.outpost_id,
name: self.name,
description: self.description,
supported_hardware_type: self.supported_hardware_type,
})
}
}
}
impl UpdateOutpostInput {
#[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::UpdateOutpost,
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::UpdateOutpostInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_53 = &_input.outpost_id;
let input_53 = input_53.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"outpost_id",
"cannot be empty or unset",
)
})?;
let outpost_id = aws_smithy_http::label::fmt_string(
input_53,
aws_smithy_http::label::EncodingStrategy::Default,
);
if outpost_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"outpost_id",
"cannot be empty or unset",
),
);
}
write!(output, "/outposts/{OutpostId}", OutpostId = outpost_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateOutpostInput,
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("PATCH").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_outpost(&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::UpdateOutpost::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateOutpost",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_outpost_input::Builder {
crate::input::update_outpost_input::Builder::default()
}
}
pub mod update_site_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) site_id: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) notes: std::option::Option<std::string::String>,
}
impl Builder {
pub fn site_id(mut self, input: impl Into<std::string::String>) -> Self {
self.site_id = Some(input.into());
self
}
pub fn set_site_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.site_id = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn notes(mut self, input: impl Into<std::string::String>) -> Self {
self.notes = Some(input.into());
self
}
pub fn set_notes(mut self, input: std::option::Option<std::string::String>) -> Self {
self.notes = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateSiteInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateSiteInput {
site_id: self.site_id,
name: self.name,
description: self.description,
notes: self.notes,
})
}
}
}
impl UpdateSiteInput {
#[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::UpdateSite,
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::UpdateSiteInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_54 = &_input.site_id;
let input_54 = input_54.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"site_id",
"cannot be empty or unset",
)
})?;
let site_id = aws_smithy_http::label::fmt_string(
input_54,
aws_smithy_http::label::EncodingStrategy::Default,
);
if site_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"site_id",
"cannot be empty or unset",
),
);
}
write!(output, "/sites/{SiteId}", SiteId = site_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateSiteInput,
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("PATCH").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_site(&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::UpdateSite::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateSite",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_site_input::Builder {
crate::input::update_site_input::Builder::default()
}
}
pub mod update_site_address_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) site_id: std::option::Option<std::string::String>,
pub(crate) address_type: std::option::Option<crate::model::AddressType>,
pub(crate) address: std::option::Option<crate::model::Address>,
}
impl Builder {
pub fn site_id(mut self, input: impl Into<std::string::String>) -> Self {
self.site_id = Some(input.into());
self
}
pub fn set_site_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.site_id = input;
self
}
pub fn address_type(mut self, input: crate::model::AddressType) -> Self {
self.address_type = Some(input);
self
}
pub fn set_address_type(
mut self,
input: std::option::Option<crate::model::AddressType>,
) -> Self {
self.address_type = input;
self
}
pub fn address(mut self, input: crate::model::Address) -> Self {
self.address = Some(input);
self
}
pub fn set_address(mut self, input: std::option::Option<crate::model::Address>) -> Self {
self.address = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateSiteAddressInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateSiteAddressInput {
site_id: self.site_id,
address_type: self.address_type,
address: self.address,
})
}
}
}
impl UpdateSiteAddressInput {
#[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::UpdateSiteAddress,
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::UpdateSiteAddressInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_55 = &_input.site_id;
let input_55 = input_55.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"site_id",
"cannot be empty or unset",
)
})?;
let site_id = aws_smithy_http::label::fmt_string(
input_55,
aws_smithy_http::label::EncodingStrategy::Default,
);
if site_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"site_id",
"cannot be empty or unset",
),
);
}
write!(output, "/sites/{SiteId}/address", SiteId = site_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateSiteAddressInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_site_address(&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::UpdateSiteAddress::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateSiteAddress",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_site_address_input::Builder {
crate::input::update_site_address_input::Builder::default()
}
}
pub mod update_site_rack_physical_properties_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) site_id: std::option::Option<std::string::String>,
pub(crate) power_draw_kva: std::option::Option<crate::model::PowerDrawKva>,
pub(crate) power_phase: std::option::Option<crate::model::PowerPhase>,
pub(crate) power_connector: std::option::Option<crate::model::PowerConnector>,
pub(crate) power_feed_drop: std::option::Option<crate::model::PowerFeedDrop>,
pub(crate) uplink_gbps: std::option::Option<crate::model::UplinkGbps>,
pub(crate) uplink_count: std::option::Option<crate::model::UplinkCount>,
pub(crate) fiber_optic_cable_type: std::option::Option<crate::model::FiberOpticCableType>,
pub(crate) optical_standard: std::option::Option<crate::model::OpticalStandard>,
pub(crate) maximum_supported_weight_lbs:
std::option::Option<crate::model::MaximumSupportedWeightLbs>,
}
impl Builder {
pub fn site_id(mut self, input: impl Into<std::string::String>) -> Self {
self.site_id = Some(input.into());
self
}
pub fn set_site_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.site_id = input;
self
}
pub fn power_draw_kva(mut self, input: crate::model::PowerDrawKva) -> Self {
self.power_draw_kva = Some(input);
self
}
pub fn set_power_draw_kva(
mut self,
input: std::option::Option<crate::model::PowerDrawKva>,
) -> Self {
self.power_draw_kva = input;
self
}
pub fn power_phase(mut self, input: crate::model::PowerPhase) -> Self {
self.power_phase = Some(input);
self
}
pub fn set_power_phase(
mut self,
input: std::option::Option<crate::model::PowerPhase>,
) -> Self {
self.power_phase = input;
self
}
pub fn power_connector(mut self, input: crate::model::PowerConnector) -> Self {
self.power_connector = Some(input);
self
}
pub fn set_power_connector(
mut self,
input: std::option::Option<crate::model::PowerConnector>,
) -> Self {
self.power_connector = input;
self
}
pub fn power_feed_drop(mut self, input: crate::model::PowerFeedDrop) -> Self {
self.power_feed_drop = Some(input);
self
}
pub fn set_power_feed_drop(
mut self,
input: std::option::Option<crate::model::PowerFeedDrop>,
) -> Self {
self.power_feed_drop = input;
self
}
pub fn uplink_gbps(mut self, input: crate::model::UplinkGbps) -> Self {
self.uplink_gbps = Some(input);
self
}
pub fn set_uplink_gbps(
mut self,
input: std::option::Option<crate::model::UplinkGbps>,
) -> Self {
self.uplink_gbps = input;
self
}
pub fn uplink_count(mut self, input: crate::model::UplinkCount) -> Self {
self.uplink_count = Some(input);
self
}
pub fn set_uplink_count(
mut self,
input: std::option::Option<crate::model::UplinkCount>,
) -> Self {
self.uplink_count = input;
self
}
pub fn fiber_optic_cable_type(mut self, input: crate::model::FiberOpticCableType) -> Self {
self.fiber_optic_cable_type = Some(input);
self
}
pub fn set_fiber_optic_cable_type(
mut self,
input: std::option::Option<crate::model::FiberOpticCableType>,
) -> Self {
self.fiber_optic_cable_type = input;
self
}
pub fn optical_standard(mut self, input: crate::model::OpticalStandard) -> Self {
self.optical_standard = Some(input);
self
}
pub fn set_optical_standard(
mut self,
input: std::option::Option<crate::model::OpticalStandard>,
) -> Self {
self.optical_standard = input;
self
}
pub fn maximum_supported_weight_lbs(
mut self,
input: crate::model::MaximumSupportedWeightLbs,
) -> Self {
self.maximum_supported_weight_lbs = Some(input);
self
}
pub fn set_maximum_supported_weight_lbs(
mut self,
input: std::option::Option<crate::model::MaximumSupportedWeightLbs>,
) -> Self {
self.maximum_supported_weight_lbs = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateSiteRackPhysicalPropertiesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateSiteRackPhysicalPropertiesInput {
site_id: self.site_id,
power_draw_kva: self.power_draw_kva,
power_phase: self.power_phase,
power_connector: self.power_connector,
power_feed_drop: self.power_feed_drop,
uplink_gbps: self.uplink_gbps,
uplink_count: self.uplink_count,
fiber_optic_cable_type: self.fiber_optic_cable_type,
optical_standard: self.optical_standard,
maximum_supported_weight_lbs: self.maximum_supported_weight_lbs,
})
}
}
}
impl UpdateSiteRackPhysicalPropertiesInput {
#[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::UpdateSiteRackPhysicalProperties,
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::UpdateSiteRackPhysicalPropertiesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_56 = &_input.site_id;
let input_56 = input_56.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"site_id",
"cannot be empty or unset",
)
})?;
let site_id = aws_smithy_http::label::fmt_string(
input_56,
aws_smithy_http::label::EncodingStrategy::Default,
);
if site_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"site_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/sites/{SiteId}/rackPhysicalProperties",
SiteId = site_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateSiteRackPhysicalPropertiesInput,
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("PATCH").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_site_rack_physical_properties(&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::UpdateSiteRackPhysicalProperties::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateSiteRackPhysicalProperties",
"outposts",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_site_rack_physical_properties_input::Builder {
crate::input::update_site_rack_physical_properties_input::Builder::default()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateSiteRackPhysicalPropertiesInput {
#[doc(hidden)]
pub site_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub power_draw_kva: std::option::Option<crate::model::PowerDrawKva>,
#[doc(hidden)]
pub power_phase: std::option::Option<crate::model::PowerPhase>,
#[doc(hidden)]
pub power_connector: std::option::Option<crate::model::PowerConnector>,
#[doc(hidden)]
pub power_feed_drop: std::option::Option<crate::model::PowerFeedDrop>,
#[doc(hidden)]
pub uplink_gbps: std::option::Option<crate::model::UplinkGbps>,
#[doc(hidden)]
pub uplink_count: std::option::Option<crate::model::UplinkCount>,
#[doc(hidden)]
pub fiber_optic_cable_type: std::option::Option<crate::model::FiberOpticCableType>,
#[doc(hidden)]
pub optical_standard: std::option::Option<crate::model::OpticalStandard>,
#[doc(hidden)]
pub maximum_supported_weight_lbs: std::option::Option<crate::model::MaximumSupportedWeightLbs>,
}
impl UpdateSiteRackPhysicalPropertiesInput {
pub fn site_id(&self) -> std::option::Option<&str> {
self.site_id.as_deref()
}
pub fn power_draw_kva(&self) -> std::option::Option<&crate::model::PowerDrawKva> {
self.power_draw_kva.as_ref()
}
pub fn power_phase(&self) -> std::option::Option<&crate::model::PowerPhase> {
self.power_phase.as_ref()
}
pub fn power_connector(&self) -> std::option::Option<&crate::model::PowerConnector> {
self.power_connector.as_ref()
}
pub fn power_feed_drop(&self) -> std::option::Option<&crate::model::PowerFeedDrop> {
self.power_feed_drop.as_ref()
}
pub fn uplink_gbps(&self) -> std::option::Option<&crate::model::UplinkGbps> {
self.uplink_gbps.as_ref()
}
pub fn uplink_count(&self) -> std::option::Option<&crate::model::UplinkCount> {
self.uplink_count.as_ref()
}
pub fn fiber_optic_cable_type(
&self,
) -> std::option::Option<&crate::model::FiberOpticCableType> {
self.fiber_optic_cable_type.as_ref()
}
pub fn optical_standard(&self) -> std::option::Option<&crate::model::OpticalStandard> {
self.optical_standard.as_ref()
}
pub fn maximum_supported_weight_lbs(
&self,
) -> std::option::Option<&crate::model::MaximumSupportedWeightLbs> {
self.maximum_supported_weight_lbs.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateSiteAddressInput {
#[doc(hidden)]
pub site_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub address_type: std::option::Option<crate::model::AddressType>,
#[doc(hidden)]
pub address: std::option::Option<crate::model::Address>,
}
impl UpdateSiteAddressInput {
pub fn site_id(&self) -> std::option::Option<&str> {
self.site_id.as_deref()
}
pub fn address_type(&self) -> std::option::Option<&crate::model::AddressType> {
self.address_type.as_ref()
}
pub fn address(&self) -> std::option::Option<&crate::model::Address> {
self.address.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateSiteInput {
#[doc(hidden)]
pub site_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub notes: std::option::Option<std::string::String>,
}
impl UpdateSiteInput {
pub fn site_id(&self) -> std::option::Option<&str> {
self.site_id.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn notes(&self) -> std::option::Option<&str> {
self.notes.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateOutpostInput {
#[doc(hidden)]
pub outpost_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub supported_hardware_type: std::option::Option<crate::model::SupportedHardwareType>,
}
impl UpdateOutpostInput {
pub fn outpost_id(&self) -> std::option::Option<&str> {
self.outpost_id.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn supported_hardware_type(
&self,
) -> std::option::Option<&crate::model::SupportedHardwareType> {
self.supported_hardware_type.as_ref()
}
}
#[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 StartConnectionInput {
#[doc(hidden)]
pub device_serial_number: std::option::Option<std::string::String>,
#[doc(hidden)]
pub asset_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub client_public_key: std::option::Option<std::string::String>,
#[doc(hidden)]
pub network_interface_device_index: i32,
}
impl StartConnectionInput {
pub fn device_serial_number(&self) -> std::option::Option<&str> {
self.device_serial_number.as_deref()
}
pub fn asset_id(&self) -> std::option::Option<&str> {
self.asset_id.as_deref()
}
pub fn client_public_key(&self) -> std::option::Option<&str> {
self.client_public_key.as_deref()
}
pub fn network_interface_device_index(&self) -> i32 {
self.network_interface_device_index
}
}
#[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 ListSitesInput {
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub operating_address_country_code_filter:
std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub operating_address_state_or_region_filter:
std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub operating_address_city_filter: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl ListSitesInput {
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 operating_address_country_code_filter(
&self,
) -> std::option::Option<&[std::string::String]> {
self.operating_address_country_code_filter.as_deref()
}
pub fn operating_address_state_or_region_filter(
&self,
) -> std::option::Option<&[std::string::String]> {
self.operating_address_state_or_region_filter.as_deref()
}
pub fn operating_address_city_filter(&self) -> std::option::Option<&[std::string::String]> {
self.operating_address_city_filter.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListOutpostsInput {
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub life_cycle_status_filter: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub availability_zone_filter: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub availability_zone_id_filter: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl ListOutpostsInput {
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 life_cycle_status_filter(&self) -> std::option::Option<&[std::string::String]> {
self.life_cycle_status_filter.as_deref()
}
pub fn availability_zone_filter(&self) -> std::option::Option<&[std::string::String]> {
self.availability_zone_filter.as_deref()
}
pub fn availability_zone_id_filter(&self) -> std::option::Option<&[std::string::String]> {
self.availability_zone_id_filter.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListOrdersInput {
#[doc(hidden)]
pub outpost_identifier_filter: 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 ListOrdersInput {
pub fn outpost_identifier_filter(&self) -> std::option::Option<&str> {
self.outpost_identifier_filter.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 ListCatalogItemsInput {
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub item_class_filter: std::option::Option<std::vec::Vec<crate::model::CatalogItemClass>>,
#[doc(hidden)]
pub supported_storage_filter:
std::option::Option<std::vec::Vec<crate::model::SupportedStorageEnum>>,
#[doc(hidden)]
pub ec2_family_filter: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl ListCatalogItemsInput {
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 item_class_filter(&self) -> std::option::Option<&[crate::model::CatalogItemClass]> {
self.item_class_filter.as_deref()
}
pub fn supported_storage_filter(
&self,
) -> std::option::Option<&[crate::model::SupportedStorageEnum]> {
self.supported_storage_filter.as_deref()
}
pub fn ec2_family_filter(&self) -> std::option::Option<&[std::string::String]> {
self.ec2_family_filter.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListAssetsInput {
#[doc(hidden)]
pub outpost_identifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub host_id_filter: std::option::Option<std::vec::Vec<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 status_filter: std::option::Option<std::vec::Vec<crate::model::AssetState>>,
}
impl ListAssetsInput {
pub fn outpost_identifier(&self) -> std::option::Option<&str> {
self.outpost_identifier.as_deref()
}
pub fn host_id_filter(&self) -> std::option::Option<&[std::string::String]> {
self.host_id_filter.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 status_filter(&self) -> std::option::Option<&[crate::model::AssetState]> {
self.status_filter.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetSiteAddressInput {
#[doc(hidden)]
pub site_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub address_type: std::option::Option<crate::model::AddressType>,
}
impl GetSiteAddressInput {
pub fn site_id(&self) -> std::option::Option<&str> {
self.site_id.as_deref()
}
pub fn address_type(&self) -> std::option::Option<&crate::model::AddressType> {
self.address_type.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetSiteInput {
#[doc(hidden)]
pub site_id: std::option::Option<std::string::String>,
}
impl GetSiteInput {
pub fn site_id(&self) -> std::option::Option<&str> {
self.site_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetOutpostInstanceTypesInput {
#[doc(hidden)]
pub outpost_id: 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 GetOutpostInstanceTypesInput {
pub fn outpost_id(&self) -> std::option::Option<&str> {
self.outpost_id.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 GetOutpostInput {
#[doc(hidden)]
pub outpost_id: std::option::Option<std::string::String>,
}
impl GetOutpostInput {
pub fn outpost_id(&self) -> std::option::Option<&str> {
self.outpost_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetOrderInput {
#[doc(hidden)]
pub order_id: std::option::Option<std::string::String>,
}
impl GetOrderInput {
pub fn order_id(&self) -> std::option::Option<&str> {
self.order_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetConnectionInput {
#[doc(hidden)]
pub connection_id: std::option::Option<std::string::String>,
}
impl GetConnectionInput {
pub fn connection_id(&self) -> std::option::Option<&str> {
self.connection_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetCatalogItemInput {
#[doc(hidden)]
pub catalog_item_id: std::option::Option<std::string::String>,
}
impl GetCatalogItemInput {
pub fn catalog_item_id(&self) -> std::option::Option<&str> {
self.catalog_item_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteSiteInput {
#[doc(hidden)]
pub site_id: std::option::Option<std::string::String>,
}
impl DeleteSiteInput {
pub fn site_id(&self) -> std::option::Option<&str> {
self.site_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteOutpostInput {
#[doc(hidden)]
pub outpost_id: std::option::Option<std::string::String>,
}
impl DeleteOutpostInput {
pub fn outpost_id(&self) -> std::option::Option<&str> {
self.outpost_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateSiteInput {
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub notes: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub operating_address: std::option::Option<crate::model::Address>,
#[doc(hidden)]
pub shipping_address: std::option::Option<crate::model::Address>,
#[doc(hidden)]
pub rack_physical_properties: std::option::Option<crate::model::RackPhysicalProperties>,
}
impl CreateSiteInput {
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn notes(&self) -> std::option::Option<&str> {
self.notes.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
pub fn operating_address(&self) -> std::option::Option<&crate::model::Address> {
self.operating_address.as_ref()
}
pub fn shipping_address(&self) -> std::option::Option<&crate::model::Address> {
self.shipping_address.as_ref()
}
pub fn rack_physical_properties(
&self,
) -> std::option::Option<&crate::model::RackPhysicalProperties> {
self.rack_physical_properties.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateOutpostInput {
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub site_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub availability_zone: std::option::Option<std::string::String>,
#[doc(hidden)]
pub availability_zone_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub supported_hardware_type: std::option::Option<crate::model::SupportedHardwareType>,
}
impl CreateOutpostInput {
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn site_id(&self) -> std::option::Option<&str> {
self.site_id.as_deref()
}
pub fn availability_zone(&self) -> std::option::Option<&str> {
self.availability_zone.as_deref()
}
pub fn availability_zone_id(&self) -> std::option::Option<&str> {
self.availability_zone_id.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
pub fn supported_hardware_type(
&self,
) -> std::option::Option<&crate::model::SupportedHardwareType> {
self.supported_hardware_type.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateOrderInput {
#[doc(hidden)]
pub outpost_identifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub line_items: std::option::Option<std::vec::Vec<crate::model::LineItemRequest>>,
#[doc(hidden)]
pub payment_option: std::option::Option<crate::model::PaymentOption>,
#[doc(hidden)]
pub payment_term: std::option::Option<crate::model::PaymentTerm>,
}
impl CreateOrderInput {
pub fn outpost_identifier(&self) -> std::option::Option<&str> {
self.outpost_identifier.as_deref()
}
pub fn line_items(&self) -> std::option::Option<&[crate::model::LineItemRequest]> {
self.line_items.as_deref()
}
pub fn payment_option(&self) -> std::option::Option<&crate::model::PaymentOption> {
self.payment_option.as_ref()
}
pub fn payment_term(&self) -> std::option::Option<&crate::model::PaymentTerm> {
self.payment_term.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CancelOrderInput {
#[doc(hidden)]
pub order_id: std::option::Option<std::string::String>,
}
impl CancelOrderInput {
pub fn order_id(&self) -> std::option::Option<&str> {
self.order_id.as_deref()
}
}