use std::fmt::Write;
pub mod accept_attachment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) attachment_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn attachment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.attachment_id = Some(input.into());
self
}
pub fn set_attachment_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.attachment_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::AcceptAttachmentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::AcceptAttachmentInput {
attachment_id: self.attachment_id,
})
}
}
}
impl AcceptAttachmentInput {
#[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::AcceptAttachment,
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::AcceptAttachmentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_1 = &_input.attachment_id;
let input_1 = input_1.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"attachment_id",
"cannot be empty or unset",
)
})?;
let attachment_id = aws_smithy_http::label::fmt_string(
input_1,
aws_smithy_http::label::EncodingStrategy::Default,
);
if attachment_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"attachment_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/attachments/{AttachmentId}/accept",
AttachmentId = attachment_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::AcceptAttachmentInput,
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::AcceptAttachment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"AcceptAttachment",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::accept_attachment_input::Builder {
crate::input::accept_attachment_input::Builder::default()
}
}
pub mod associate_connect_peer_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) connect_peer_id: std::option::Option<std::string::String>,
pub(crate) device_id: std::option::Option<std::string::String>,
pub(crate) link_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn connect_peer_id(mut self, input: impl Into<std::string::String>) -> Self {
self.connect_peer_id = Some(input.into());
self
}
pub fn set_connect_peer_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.connect_peer_id = input;
self
}
pub fn device_id(mut self, input: impl Into<std::string::String>) -> Self {
self.device_id = Some(input.into());
self
}
pub fn set_device_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.device_id = input;
self
}
pub fn link_id(mut self, input: impl Into<std::string::String>) -> Self {
self.link_id = Some(input.into());
self
}
pub fn set_link_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.link_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::AssociateConnectPeerInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::AssociateConnectPeerInput {
global_network_id: self.global_network_id,
connect_peer_id: self.connect_peer_id,
device_id: self.device_id,
link_id: self.link_id,
})
}
}
}
impl AssociateConnectPeerInput {
#[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::AssociateConnectPeer,
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::AssociateConnectPeerInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_2 = &_input.global_network_id;
let input_2 = input_2.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_2,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/connect-peer-associations",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::AssociateConnectPeerInput,
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_associate_connect_peer(
&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::AssociateConnectPeer::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"AssociateConnectPeer",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::associate_connect_peer_input::Builder {
crate::input::associate_connect_peer_input::Builder::default()
}
}
pub mod associate_customer_gateway_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) customer_gateway_arn: std::option::Option<std::string::String>,
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) device_id: std::option::Option<std::string::String>,
pub(crate) link_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn customer_gateway_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.customer_gateway_arn = Some(input.into());
self
}
pub fn set_customer_gateway_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.customer_gateway_arn = input;
self
}
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn device_id(mut self, input: impl Into<std::string::String>) -> Self {
self.device_id = Some(input.into());
self
}
pub fn set_device_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.device_id = input;
self
}
pub fn link_id(mut self, input: impl Into<std::string::String>) -> Self {
self.link_id = Some(input.into());
self
}
pub fn set_link_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.link_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::AssociateCustomerGatewayInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::AssociateCustomerGatewayInput {
customer_gateway_arn: self.customer_gateway_arn,
global_network_id: self.global_network_id,
device_id: self.device_id,
link_id: self.link_id,
})
}
}
}
impl AssociateCustomerGatewayInput {
#[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::AssociateCustomerGateway,
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::AssociateCustomerGatewayInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_3 = &_input.global_network_id;
let input_3 = input_3.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_3,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/customer-gateway-associations",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::AssociateCustomerGatewayInput,
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_associate_customer_gateway(
&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::AssociateCustomerGateway::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"AssociateCustomerGateway",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::associate_customer_gateway_input::Builder {
crate::input::associate_customer_gateway_input::Builder::default()
}
}
pub mod associate_link_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) device_id: std::option::Option<std::string::String>,
pub(crate) link_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn device_id(mut self, input: impl Into<std::string::String>) -> Self {
self.device_id = Some(input.into());
self
}
pub fn set_device_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.device_id = input;
self
}
pub fn link_id(mut self, input: impl Into<std::string::String>) -> Self {
self.link_id = Some(input.into());
self
}
pub fn set_link_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.link_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::AssociateLinkInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::AssociateLinkInput {
global_network_id: self.global_network_id,
device_id: self.device_id,
link_id: self.link_id,
})
}
}
}
impl AssociateLinkInput {
#[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::AssociateLink,
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::AssociateLinkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_4 = &_input.global_network_id;
let input_4 = input_4.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_4,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/link-associations",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::AssociateLinkInput,
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_associate_link(&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::AssociateLink::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"AssociateLink",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::associate_link_input::Builder {
crate::input::associate_link_input::Builder::default()
}
}
pub mod associate_transit_gateway_connect_peer_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) transit_gateway_connect_peer_arn: std::option::Option<std::string::String>,
pub(crate) device_id: std::option::Option<std::string::String>,
pub(crate) link_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn transit_gateway_connect_peer_arn(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.transit_gateway_connect_peer_arn = Some(input.into());
self
}
pub fn set_transit_gateway_connect_peer_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.transit_gateway_connect_peer_arn = input;
self
}
pub fn device_id(mut self, input: impl Into<std::string::String>) -> Self {
self.device_id = Some(input.into());
self
}
pub fn set_device_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.device_id = input;
self
}
pub fn link_id(mut self, input: impl Into<std::string::String>) -> Self {
self.link_id = Some(input.into());
self
}
pub fn set_link_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.link_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::AssociateTransitGatewayConnectPeerInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::AssociateTransitGatewayConnectPeerInput {
global_network_id: self.global_network_id,
transit_gateway_connect_peer_arn: self.transit_gateway_connect_peer_arn,
device_id: self.device_id,
link_id: self.link_id,
})
}
}
}
impl AssociateTransitGatewayConnectPeerInput {
#[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::AssociateTransitGatewayConnectPeer,
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::AssociateTransitGatewayConnectPeerInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_5 = &_input.global_network_id;
let input_5 = input_5.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_5,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/transit-gateway-connect-peer-associations",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::AssociateTransitGatewayConnectPeerInput,
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_associate_transit_gateway_connect_peer(&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::AssociateTransitGatewayConnectPeer::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"AssociateTransitGatewayConnectPeer",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::associate_transit_gateway_connect_peer_input::Builder {
crate::input::associate_transit_gateway_connect_peer_input::Builder::default()
}
}
pub mod create_connect_attachment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) edge_location: std::option::Option<std::string::String>,
pub(crate) transport_attachment_id: std::option::Option<std::string::String>,
pub(crate) options: std::option::Option<crate::model::ConnectAttachmentOptions>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn edge_location(mut self, input: impl Into<std::string::String>) -> Self {
self.edge_location = Some(input.into());
self
}
pub fn set_edge_location(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.edge_location = input;
self
}
pub fn transport_attachment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.transport_attachment_id = Some(input.into());
self
}
pub fn set_transport_attachment_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.transport_attachment_id = input;
self
}
pub fn options(mut self, input: crate::model::ConnectAttachmentOptions) -> Self {
self.options = Some(input);
self
}
pub fn set_options(
mut self,
input: std::option::Option<crate::model::ConnectAttachmentOptions>,
) -> Self {
self.options = input;
self
}
pub fn tags(mut self, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.tags = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateConnectAttachmentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateConnectAttachmentInput {
core_network_id: self.core_network_id,
edge_location: self.edge_location,
transport_attachment_id: self.transport_attachment_id,
options: self.options,
tags: self.tags,
client_token: self.client_token,
})
}
}
}
impl CreateConnectAttachmentInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateConnectAttachment,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
if self.client_token.is_none() {
self.client_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::CreateConnectAttachmentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/connect-attachments").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateConnectAttachmentInput,
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_connect_attachment(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateConnectAttachment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateConnectAttachment",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_connect_attachment_input::Builder {
crate::input::create_connect_attachment_input::Builder::default()
}
}
pub mod create_connection_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) device_id: std::option::Option<std::string::String>,
pub(crate) connected_device_id: std::option::Option<std::string::String>,
pub(crate) link_id: std::option::Option<std::string::String>,
pub(crate) connected_link_id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn device_id(mut self, input: impl Into<std::string::String>) -> Self {
self.device_id = Some(input.into());
self
}
pub fn set_device_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.device_id = input;
self
}
pub fn connected_device_id(mut self, input: impl Into<std::string::String>) -> Self {
self.connected_device_id = Some(input.into());
self
}
pub fn set_connected_device_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.connected_device_id = input;
self
}
pub fn link_id(mut self, input: impl Into<std::string::String>) -> Self {
self.link_id = Some(input.into());
self
}
pub fn set_link_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.link_id = input;
self
}
pub fn connected_link_id(mut self, input: impl Into<std::string::String>) -> Self {
self.connected_link_id = Some(input.into());
self
}
pub fn set_connected_link_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.connected_link_id = 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 tags(mut self, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateConnectionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateConnectionInput {
global_network_id: self.global_network_id,
device_id: self.device_id,
connected_device_id: self.connected_device_id,
link_id: self.link_id,
connected_link_id: self.connected_link_id,
description: self.description,
tags: self.tags,
})
}
}
}
impl CreateConnectionInput {
#[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::CreateConnection,
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::CreateConnectionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_6 = &_input.global_network_id;
let input_6 = input_6.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_6,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/connections",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateConnectionInput,
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_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::CreateConnection::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateConnection",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_connection_input::Builder {
crate::input::create_connection_input::Builder::default()
}
}
pub mod create_connect_peer_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) connect_attachment_id: std::option::Option<std::string::String>,
pub(crate) core_network_address: std::option::Option<std::string::String>,
pub(crate) peer_address: std::option::Option<std::string::String>,
pub(crate) bgp_options: std::option::Option<crate::model::BgpOptions>,
pub(crate) inside_cidr_blocks: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn connect_attachment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.connect_attachment_id = Some(input.into());
self
}
pub fn set_connect_attachment_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.connect_attachment_id = input;
self
}
pub fn core_network_address(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_address = Some(input.into());
self
}
pub fn set_core_network_address(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_address = input;
self
}
pub fn peer_address(mut self, input: impl Into<std::string::String>) -> Self {
self.peer_address = Some(input.into());
self
}
pub fn set_peer_address(mut self, input: std::option::Option<std::string::String>) -> Self {
self.peer_address = input;
self
}
pub fn bgp_options(mut self, input: crate::model::BgpOptions) -> Self {
self.bgp_options = Some(input);
self
}
pub fn set_bgp_options(
mut self,
input: std::option::Option<crate::model::BgpOptions>,
) -> Self {
self.bgp_options = input;
self
}
pub fn inside_cidr_blocks(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.inside_cidr_blocks.unwrap_or_default();
v.push(input.into());
self.inside_cidr_blocks = Some(v);
self
}
pub fn set_inside_cidr_blocks(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inside_cidr_blocks = input;
self
}
pub fn tags(mut self, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.tags = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateConnectPeerInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateConnectPeerInput {
connect_attachment_id: self.connect_attachment_id,
core_network_address: self.core_network_address,
peer_address: self.peer_address,
bgp_options: self.bgp_options,
inside_cidr_blocks: self.inside_cidr_blocks,
tags: self.tags,
client_token: self.client_token,
})
}
}
}
impl CreateConnectPeerInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateConnectPeer,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
if self.client_token.is_none() {
self.client_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::CreateConnectPeerInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/connect-peers").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateConnectPeerInput,
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_connect_peer(&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::CreateConnectPeer::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateConnectPeer",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_connect_peer_input::Builder {
crate::input::create_connect_peer_input::Builder::default()
}
}
pub mod create_core_network_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
pub(crate) policy_document: std::option::Option<std::string::String>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = 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 tags(mut self, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.tags = input;
self
}
pub fn policy_document(mut self, input: impl Into<std::string::String>) -> Self {
self.policy_document = Some(input.into());
self
}
pub fn set_policy_document(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.policy_document = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateCoreNetworkInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateCoreNetworkInput {
global_network_id: self.global_network_id,
description: self.description,
tags: self.tags,
policy_document: self.policy_document,
client_token: self.client_token,
})
}
}
}
impl CreateCoreNetworkInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateCoreNetwork,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
if self.client_token.is_none() {
self.client_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::CreateCoreNetworkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/core-networks").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateCoreNetworkInput,
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_core_network(&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::CreateCoreNetwork::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateCoreNetwork",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_core_network_input::Builder {
crate::input::create_core_network_input::Builder::default()
}
}
pub mod create_device_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) aws_location: std::option::Option<crate::model::AwsLocation>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) r#type: std::option::Option<std::string::String>,
pub(crate) vendor: std::option::Option<std::string::String>,
pub(crate) model: std::option::Option<std::string::String>,
pub(crate) serial_number: std::option::Option<std::string::String>,
pub(crate) location: std::option::Option<crate::model::Location>,
pub(crate) site_id: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn aws_location(mut self, input: crate::model::AwsLocation) -> Self {
self.aws_location = Some(input);
self
}
pub fn set_aws_location(
mut self,
input: std::option::Option<crate::model::AwsLocation>,
) -> Self {
self.aws_location = 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 r#type(mut self, input: impl Into<std::string::String>) -> Self {
self.r#type = Some(input.into());
self
}
pub fn set_type(mut self, input: std::option::Option<std::string::String>) -> Self {
self.r#type = input;
self
}
pub fn vendor(mut self, input: impl Into<std::string::String>) -> Self {
self.vendor = Some(input.into());
self
}
pub fn set_vendor(mut self, input: std::option::Option<std::string::String>) -> Self {
self.vendor = input;
self
}
pub fn model(mut self, input: impl Into<std::string::String>) -> Self {
self.model = Some(input.into());
self
}
pub fn set_model(mut self, input: std::option::Option<std::string::String>) -> Self {
self.model = input;
self
}
pub fn serial_number(mut self, input: impl Into<std::string::String>) -> Self {
self.serial_number = Some(input.into());
self
}
pub fn set_serial_number(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.serial_number = input;
self
}
pub fn location(mut self, input: crate::model::Location) -> Self {
self.location = Some(input);
self
}
pub fn set_location(mut self, input: std::option::Option<crate::model::Location>) -> Self {
self.location = 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 tags(mut self, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateDeviceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateDeviceInput {
global_network_id: self.global_network_id,
aws_location: self.aws_location,
description: self.description,
r#type: self.r#type,
vendor: self.vendor,
model: self.model,
serial_number: self.serial_number,
location: self.location,
site_id: self.site_id,
tags: self.tags,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("aws_location", &self.aws_location);
formatter.field("description", &self.description);
formatter.field("r#type", &self.r#type);
formatter.field("vendor", &self.vendor);
formatter.field("model", &self.model);
formatter.field("serial_number", &self.serial_number);
formatter.field("location", &"*** Sensitive Data Redacted ***");
formatter.field("site_id", &self.site_id);
formatter.field("tags", &self.tags);
formatter.finish()
}
}
}
impl CreateDeviceInput {
#[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::CreateDevice,
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::CreateDeviceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_7 = &_input.global_network_id;
let input_7 = input_7.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_7,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/devices",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateDeviceInput,
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_device(&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::CreateDevice::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateDevice",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_device_input::Builder {
crate::input::create_device_input::Builder::default()
}
}
pub mod create_global_network_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
impl Builder {
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn tags(mut self, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateGlobalNetworkInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateGlobalNetworkInput {
description: self.description,
tags: self.tags,
})
}
}
}
impl CreateGlobalNetworkInput {
#[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::CreateGlobalNetwork,
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::CreateGlobalNetworkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/global-networks").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateGlobalNetworkInput,
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_global_network(&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::CreateGlobalNetwork::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateGlobalNetwork",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_global_network_input::Builder {
crate::input::create_global_network_input::Builder::default()
}
}
pub mod create_link_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) r#type: std::option::Option<std::string::String>,
pub(crate) bandwidth: std::option::Option<crate::model::Bandwidth>,
pub(crate) provider: std::option::Option<std::string::String>,
pub(crate) site_id: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = 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 r#type(mut self, input: impl Into<std::string::String>) -> Self {
self.r#type = Some(input.into());
self
}
pub fn set_type(mut self, input: std::option::Option<std::string::String>) -> Self {
self.r#type = input;
self
}
pub fn bandwidth(mut self, input: crate::model::Bandwidth) -> Self {
self.bandwidth = Some(input);
self
}
pub fn set_bandwidth(
mut self,
input: std::option::Option<crate::model::Bandwidth>,
) -> Self {
self.bandwidth = input;
self
}
pub fn provider(mut self, input: impl Into<std::string::String>) -> Self {
self.provider = Some(input.into());
self
}
pub fn set_provider(mut self, input: std::option::Option<std::string::String>) -> Self {
self.provider = 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 tags(mut self, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateLinkInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateLinkInput {
global_network_id: self.global_network_id,
description: self.description,
r#type: self.r#type,
bandwidth: self.bandwidth,
provider: self.provider,
site_id: self.site_id,
tags: self.tags,
})
}
}
}
impl CreateLinkInput {
#[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::CreateLink,
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::CreateLinkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_8 = &_input.global_network_id;
let input_8 = input_8.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_8,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/links",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateLinkInput,
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_link(&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::CreateLink::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateLink",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_link_input::Builder {
crate::input::create_link_input::Builder::default()
}
}
pub mod create_site_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) location: std::option::Option<crate::model::Location>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = 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 location(mut self, input: crate::model::Location) -> Self {
self.location = Some(input);
self
}
pub fn set_location(mut self, input: std::option::Option<crate::model::Location>) -> Self {
self.location = input;
self
}
pub fn tags(mut self, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateSiteInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateSiteInput {
global_network_id: self.global_network_id,
description: self.description,
location: self.location,
tags: self.tags,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("description", &self.description);
formatter.field("location", &"*** Sensitive Data Redacted ***");
formatter.field("tags", &self.tags);
formatter.finish()
}
}
}
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> {
let input_9 = &_input.global_network_id;
let input_9 = input_9.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_9,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/sites",
GlobalNetworkId = global_network_id
)
.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",
"networkmanager",
));
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 create_site_to_site_vpn_attachment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) vpn_connection_arn: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn vpn_connection_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.vpn_connection_arn = Some(input.into());
self
}
pub fn set_vpn_connection_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.vpn_connection_arn = input;
self
}
pub fn tags(mut self, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.tags = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateSiteToSiteVpnAttachmentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateSiteToSiteVpnAttachmentInput {
core_network_id: self.core_network_id,
vpn_connection_arn: self.vpn_connection_arn,
tags: self.tags,
client_token: self.client_token,
})
}
}
}
impl CreateSiteToSiteVpnAttachmentInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateSiteToSiteVpnAttachment,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
if self.client_token.is_none() {
self.client_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::CreateSiteToSiteVpnAttachmentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/site-to-site-vpn-attachments").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateSiteToSiteVpnAttachmentInput,
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_to_site_vpn_attachment(&self)?
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateSiteToSiteVpnAttachment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateSiteToSiteVpnAttachment",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_site_to_site_vpn_attachment_input::Builder {
crate::input::create_site_to_site_vpn_attachment_input::Builder::default()
}
}
pub mod create_transit_gateway_peering_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) transit_gateway_arn: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn transit_gateway_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.transit_gateway_arn = Some(input.into());
self
}
pub fn set_transit_gateway_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.transit_gateway_arn = input;
self
}
pub fn tags(mut self, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.tags = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateTransitGatewayPeeringInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateTransitGatewayPeeringInput {
core_network_id: self.core_network_id,
transit_gateway_arn: self.transit_gateway_arn,
tags: self.tags,
client_token: self.client_token,
})
}
}
}
impl CreateTransitGatewayPeeringInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateTransitGatewayPeering,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
if self.client_token.is_none() {
self.client_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::CreateTransitGatewayPeeringInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/transit-gateway-peerings").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateTransitGatewayPeeringInput,
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_transit_gateway_peering(&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::CreateTransitGatewayPeering::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateTransitGatewayPeering",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_transit_gateway_peering_input::Builder {
crate::input::create_transit_gateway_peering_input::Builder::default()
}
}
pub mod create_transit_gateway_route_table_attachment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) peering_id: std::option::Option<std::string::String>,
pub(crate) transit_gateway_route_table_arn: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn peering_id(mut self, input: impl Into<std::string::String>) -> Self {
self.peering_id = Some(input.into());
self
}
pub fn set_peering_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.peering_id = input;
self
}
pub fn transit_gateway_route_table_arn(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.transit_gateway_route_table_arn = Some(input.into());
self
}
pub fn set_transit_gateway_route_table_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.transit_gateway_route_table_arn = input;
self
}
pub fn tags(mut self, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.tags = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateTransitGatewayRouteTableAttachmentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(
crate::input::CreateTransitGatewayRouteTableAttachmentInput {
peering_id: self.peering_id,
transit_gateway_route_table_arn: self.transit_gateway_route_table_arn,
tags: self.tags,
client_token: self.client_token,
},
)
}
}
}
impl CreateTransitGatewayRouteTableAttachmentInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateTransitGatewayRouteTableAttachment,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
if self.client_token.is_none() {
self.client_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::CreateTransitGatewayRouteTableAttachmentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/transit-gateway-route-table-attachments")
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateTransitGatewayRouteTableAttachmentInput,
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_transit_gateway_route_table_attachment(&self)?
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateTransitGatewayRouteTableAttachment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateTransitGatewayRouteTableAttachment",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_transit_gateway_route_table_attachment_input::Builder {
crate::input::create_transit_gateway_route_table_attachment_input::Builder::default()
}
}
pub mod create_vpc_attachment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) vpc_arn: std::option::Option<std::string::String>,
pub(crate) subnet_arns: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) options: std::option::Option<crate::model::VpcOptions>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn vpc_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.vpc_arn = Some(input.into());
self
}
pub fn set_vpc_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.vpc_arn = input;
self
}
pub fn subnet_arns(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.subnet_arns.unwrap_or_default();
v.push(input.into());
self.subnet_arns = Some(v);
self
}
pub fn set_subnet_arns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.subnet_arns = input;
self
}
pub fn options(mut self, input: crate::model::VpcOptions) -> Self {
self.options = Some(input);
self
}
pub fn set_options(mut self, input: std::option::Option<crate::model::VpcOptions>) -> Self {
self.options = input;
self
}
pub fn tags(mut self, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.tags = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateVpcAttachmentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateVpcAttachmentInput {
core_network_id: self.core_network_id,
vpc_arn: self.vpc_arn,
subnet_arns: self.subnet_arns,
options: self.options,
tags: self.tags,
client_token: self.client_token,
})
}
}
}
impl CreateVpcAttachmentInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateVpcAttachment,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
if self.client_token.is_none() {
self.client_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::CreateVpcAttachmentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/vpc-attachments").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateVpcAttachmentInput,
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_vpc_attachment(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateVpcAttachment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateVpcAttachment",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_vpc_attachment_input::Builder {
crate::input::create_vpc_attachment_input::Builder::default()
}
}
pub mod delete_attachment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) attachment_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn attachment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.attachment_id = Some(input.into());
self
}
pub fn set_attachment_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.attachment_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteAttachmentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteAttachmentInput {
attachment_id: self.attachment_id,
})
}
}
}
impl DeleteAttachmentInput {
#[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::DeleteAttachment,
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::DeleteAttachmentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_10 = &_input.attachment_id;
let input_10 = input_10.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"attachment_id",
"cannot be empty or unset",
)
})?;
let attachment_id = aws_smithy_http::label::fmt_string(
input_10,
aws_smithy_http::label::EncodingStrategy::Default,
);
if attachment_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"attachment_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/attachments/{AttachmentId}",
AttachmentId = attachment_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteAttachmentInput,
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::DeleteAttachment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteAttachment",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_attachment_input::Builder {
crate::input::delete_attachment_input::Builder::default()
}
}
pub mod delete_connection_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) connection_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
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::DeleteConnectionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteConnectionInput {
global_network_id: self.global_network_id,
connection_id: self.connection_id,
})
}
}
}
impl DeleteConnectionInput {
#[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::DeleteConnection,
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::DeleteConnectionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_11 = &_input.global_network_id;
let input_11 = input_11.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_11,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
let input_12 = &_input.connection_id;
let input_12 = input_12.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_12,
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,
"/global-networks/{GlobalNetworkId}/connections/{ConnectionId}",
GlobalNetworkId = global_network_id,
ConnectionId = connection_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteConnectionInput,
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::DeleteConnection::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteConnection",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_connection_input::Builder {
crate::input::delete_connection_input::Builder::default()
}
}
pub mod delete_connect_peer_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) connect_peer_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn connect_peer_id(mut self, input: impl Into<std::string::String>) -> Self {
self.connect_peer_id = Some(input.into());
self
}
pub fn set_connect_peer_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.connect_peer_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteConnectPeerInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteConnectPeerInput {
connect_peer_id: self.connect_peer_id,
})
}
}
}
impl DeleteConnectPeerInput {
#[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::DeleteConnectPeer,
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::DeleteConnectPeerInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_13 = &_input.connect_peer_id;
let input_13 = input_13.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"connect_peer_id",
"cannot be empty or unset",
)
})?;
let connect_peer_id = aws_smithy_http::label::fmt_string(
input_13,
aws_smithy_http::label::EncodingStrategy::Default,
);
if connect_peer_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"connect_peer_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/connect-peers/{ConnectPeerId}",
ConnectPeerId = connect_peer_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteConnectPeerInput,
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::DeleteConnectPeer::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteConnectPeer",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_connect_peer_input::Builder {
crate::input::delete_connect_peer_input::Builder::default()
}
}
pub mod delete_core_network_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteCoreNetworkInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteCoreNetworkInput {
core_network_id: self.core_network_id,
})
}
}
}
impl DeleteCoreNetworkInput {
#[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::DeleteCoreNetwork,
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::DeleteCoreNetworkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_14 = &_input.core_network_id;
let input_14 = input_14.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
)
})?;
let core_network_id = aws_smithy_http::label::fmt_string(
input_14,
aws_smithy_http::label::EncodingStrategy::Default,
);
if core_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/core-networks/{CoreNetworkId}",
CoreNetworkId = core_network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteCoreNetworkInput,
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::DeleteCoreNetwork::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteCoreNetwork",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_core_network_input::Builder {
crate::input::delete_core_network_input::Builder::default()
}
}
pub mod delete_core_network_policy_version_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) policy_version_id: std::option::Option<i32>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn policy_version_id(mut self, input: i32) -> Self {
self.policy_version_id = Some(input);
self
}
pub fn set_policy_version_id(mut self, input: std::option::Option<i32>) -> Self {
self.policy_version_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteCoreNetworkPolicyVersionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteCoreNetworkPolicyVersionInput {
core_network_id: self.core_network_id,
policy_version_id: self.policy_version_id,
})
}
}
}
impl DeleteCoreNetworkPolicyVersionInput {
#[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::DeleteCoreNetworkPolicyVersion,
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::DeleteCoreNetworkPolicyVersionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_15 = &_input.core_network_id;
let input_15 = input_15.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
)
})?;
let core_network_id = aws_smithy_http::label::fmt_string(
input_15,
aws_smithy_http::label::EncodingStrategy::Default,
);
if core_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
),
);
}
let input_16 = &_input.policy_version_id;
let input_16 = input_16.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"policy_version_id",
"cannot be empty or unset",
)
})?;
let mut policy_version_id_encoder =
aws_smithy_types::primitive::Encoder::from(*input_16);
let policy_version_id = policy_version_id_encoder.encode();
if policy_version_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"policy_version_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/core-networks/{CoreNetworkId}/core-network-policy-versions/{PolicyVersionId}",
CoreNetworkId = core_network_id,
PolicyVersionId = policy_version_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteCoreNetworkPolicyVersionInput,
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::DeleteCoreNetworkPolicyVersion::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteCoreNetworkPolicyVersion",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_core_network_policy_version_input::Builder {
crate::input::delete_core_network_policy_version_input::Builder::default()
}
}
pub mod delete_device_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) device_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn device_id(mut self, input: impl Into<std::string::String>) -> Self {
self.device_id = Some(input.into());
self
}
pub fn set_device_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.device_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteDeviceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteDeviceInput {
global_network_id: self.global_network_id,
device_id: self.device_id,
})
}
}
}
impl DeleteDeviceInput {
#[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::DeleteDevice,
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::DeleteDeviceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_17 = &_input.global_network_id;
let input_17 = input_17.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_17,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
let input_18 = &_input.device_id;
let input_18 = input_18.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"device_id",
"cannot be empty or unset",
)
})?;
let device_id = aws_smithy_http::label::fmt_string(
input_18,
aws_smithy_http::label::EncodingStrategy::Default,
);
if device_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"device_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/devices/{DeviceId}",
GlobalNetworkId = global_network_id,
DeviceId = device_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteDeviceInput,
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::DeleteDevice::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteDevice",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_device_input::Builder {
crate::input::delete_device_input::Builder::default()
}
}
pub mod delete_global_network_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteGlobalNetworkInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteGlobalNetworkInput {
global_network_id: self.global_network_id,
})
}
}
}
impl DeleteGlobalNetworkInput {
#[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::DeleteGlobalNetwork,
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::DeleteGlobalNetworkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_19 = &_input.global_network_id;
let input_19 = input_19.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_19,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteGlobalNetworkInput,
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::DeleteGlobalNetwork::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteGlobalNetwork",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_global_network_input::Builder {
crate::input::delete_global_network_input::Builder::default()
}
}
pub mod delete_link_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) link_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn link_id(mut self, input: impl Into<std::string::String>) -> Self {
self.link_id = Some(input.into());
self
}
pub fn set_link_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.link_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteLinkInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteLinkInput {
global_network_id: self.global_network_id,
link_id: self.link_id,
})
}
}
}
impl DeleteLinkInput {
#[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::DeleteLink,
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::DeleteLinkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_20 = &_input.global_network_id;
let input_20 = input_20.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_20,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
let input_21 = &_input.link_id;
let input_21 = input_21.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"link_id",
"cannot be empty or unset",
)
})?;
let link_id = aws_smithy_http::label::fmt_string(
input_21,
aws_smithy_http::label::EncodingStrategy::Default,
);
if link_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"link_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/links/{LinkId}",
GlobalNetworkId = global_network_id,
LinkId = link_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteLinkInput,
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::DeleteLink::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteLink",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_link_input::Builder {
crate::input::delete_link_input::Builder::default()
}
}
pub mod delete_peering_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) peering_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn peering_id(mut self, input: impl Into<std::string::String>) -> Self {
self.peering_id = Some(input.into());
self
}
pub fn set_peering_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.peering_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeletePeeringInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeletePeeringInput {
peering_id: self.peering_id,
})
}
}
}
impl DeletePeeringInput {
#[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::DeletePeering,
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::DeletePeeringInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_22 = &_input.peering_id;
let input_22 = input_22.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"peering_id",
"cannot be empty or unset",
)
})?;
let peering_id = aws_smithy_http::label::fmt_string(
input_22,
aws_smithy_http::label::EncodingStrategy::Default,
);
if peering_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"peering_id",
"cannot be empty or unset",
),
);
}
write!(output, "/peerings/{PeeringId}", PeeringId = peering_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeletePeeringInput,
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::DeletePeering::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeletePeering",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_peering_input::Builder {
crate::input::delete_peering_input::Builder::default()
}
}
pub mod delete_resource_policy_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::DeleteResourcePolicyInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteResourcePolicyInput {
resource_arn: self.resource_arn,
})
}
}
}
impl DeleteResourcePolicyInput {
#[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::DeleteResourcePolicy,
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::DeleteResourcePolicyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_23 = &_input.resource_arn;
let input_23 = input_23.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_23,
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,
"/resource-policy/{ResourceArn}",
ResourceArn = resource_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteResourcePolicyInput,
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::DeleteResourcePolicy::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteResourcePolicy",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_resource_policy_input::Builder {
crate::input::delete_resource_policy_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) global_network_id: std::option::Option<std::string::String>,
pub(crate) site_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = 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 build(
self,
) -> Result<crate::input::DeleteSiteInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteSiteInput {
global_network_id: self.global_network_id,
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_24 = &_input.global_network_id;
let input_24 = input_24.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_24,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
let input_25 = &_input.site_id;
let input_25 = input_25.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_25,
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,
"/global-networks/{GlobalNetworkId}/sites/{SiteId}",
GlobalNetworkId = global_network_id,
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",
"networkmanager",
));
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 deregister_transit_gateway_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) transit_gateway_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn transit_gateway_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.transit_gateway_arn = Some(input.into());
self
}
pub fn set_transit_gateway_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.transit_gateway_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeregisterTransitGatewayInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeregisterTransitGatewayInput {
global_network_id: self.global_network_id,
transit_gateway_arn: self.transit_gateway_arn,
})
}
}
}
impl DeregisterTransitGatewayInput {
#[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::DeregisterTransitGateway,
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::DeregisterTransitGatewayInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_26 = &_input.global_network_id;
let input_26 = input_26.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_26,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
let input_27 = &_input.transit_gateway_arn;
let input_27 = input_27.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"transit_gateway_arn",
"cannot be empty or unset",
)
})?;
let transit_gateway_arn = aws_smithy_http::label::fmt_string(
input_27,
aws_smithy_http::label::EncodingStrategy::Default,
);
if transit_gateway_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"transit_gateway_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/global-networks/{GlobalNetworkId}/transit-gateway-registrations/{TransitGatewayArn}", GlobalNetworkId = global_network_id, TransitGatewayArn = transit_gateway_arn).expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeregisterTransitGatewayInput,
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::DeregisterTransitGateway::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeregisterTransitGateway",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::deregister_transit_gateway_input::Builder {
crate::input::deregister_transit_gateway_input::Builder::default()
}
}
pub mod describe_global_networks_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_ids: 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>,
}
impl Builder {
pub fn global_network_ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.global_network_ids.unwrap_or_default();
v.push(input.into());
self.global_network_ids = Some(v);
self
}
pub fn set_global_network_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.global_network_ids = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeGlobalNetworksInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeGlobalNetworksInput {
global_network_ids: self.global_network_ids,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl DescribeGlobalNetworksInput {
#[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::DescribeGlobalNetworks,
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::DescribeGlobalNetworksInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/global-networks").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::DescribeGlobalNetworksInput,
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_28) = &_input.global_network_ids {
{
for inner_29 in inner_28 {
query.push_kv(
"globalNetworkIds",
&aws_smithy_http::query::fmt_string(&inner_29),
);
}
}
}
if let Some(inner_30) = &_input.max_results {
if *inner_30 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_30).encode(),
);
}
}
if let Some(inner_31) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_31));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeGlobalNetworksInput,
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::DescribeGlobalNetworks::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeGlobalNetworks",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_global_networks_input::Builder {
crate::input::describe_global_networks_input::Builder::default()
}
}
pub mod disassociate_connect_peer_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) connect_peer_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn connect_peer_id(mut self, input: impl Into<std::string::String>) -> Self {
self.connect_peer_id = Some(input.into());
self
}
pub fn set_connect_peer_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.connect_peer_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DisassociateConnectPeerInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DisassociateConnectPeerInput {
global_network_id: self.global_network_id,
connect_peer_id: self.connect_peer_id,
})
}
}
}
impl DisassociateConnectPeerInput {
#[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::DisassociateConnectPeer,
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::DisassociateConnectPeerInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_32 = &_input.global_network_id;
let input_32 = input_32.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_32,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
let input_33 = &_input.connect_peer_id;
let input_33 = input_33.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"connect_peer_id",
"cannot be empty or unset",
)
})?;
let connect_peer_id = aws_smithy_http::label::fmt_string(
input_33,
aws_smithy_http::label::EncodingStrategy::Default,
);
if connect_peer_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"connect_peer_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/connect-peer-associations/{ConnectPeerId}",
GlobalNetworkId = global_network_id,
ConnectPeerId = connect_peer_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DisassociateConnectPeerInput,
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::DisassociateConnectPeer::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DisassociateConnectPeer",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::disassociate_connect_peer_input::Builder {
crate::input::disassociate_connect_peer_input::Builder::default()
}
}
pub mod disassociate_customer_gateway_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) customer_gateway_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn customer_gateway_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.customer_gateway_arn = Some(input.into());
self
}
pub fn set_customer_gateway_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.customer_gateway_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DisassociateCustomerGatewayInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DisassociateCustomerGatewayInput {
global_network_id: self.global_network_id,
customer_gateway_arn: self.customer_gateway_arn,
})
}
}
}
impl DisassociateCustomerGatewayInput {
#[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::DisassociateCustomerGateway,
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::DisassociateCustomerGatewayInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_34 = &_input.global_network_id;
let input_34 = input_34.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_34,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
let input_35 = &_input.customer_gateway_arn;
let input_35 = input_35.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"customer_gateway_arn",
"cannot be empty or unset",
)
})?;
let customer_gateway_arn = aws_smithy_http::label::fmt_string(
input_35,
aws_smithy_http::label::EncodingStrategy::Default,
);
if customer_gateway_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"customer_gateway_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/global-networks/{GlobalNetworkId}/customer-gateway-associations/{CustomerGatewayArn}", GlobalNetworkId = global_network_id, CustomerGatewayArn = customer_gateway_arn).expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DisassociateCustomerGatewayInput,
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::DisassociateCustomerGateway::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DisassociateCustomerGateway",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::disassociate_customer_gateway_input::Builder {
crate::input::disassociate_customer_gateway_input::Builder::default()
}
}
pub mod disassociate_link_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) device_id: std::option::Option<std::string::String>,
pub(crate) link_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn device_id(mut self, input: impl Into<std::string::String>) -> Self {
self.device_id = Some(input.into());
self
}
pub fn set_device_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.device_id = input;
self
}
pub fn link_id(mut self, input: impl Into<std::string::String>) -> Self {
self.link_id = Some(input.into());
self
}
pub fn set_link_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.link_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DisassociateLinkInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DisassociateLinkInput {
global_network_id: self.global_network_id,
device_id: self.device_id,
link_id: self.link_id,
})
}
}
}
impl DisassociateLinkInput {
#[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::DisassociateLink,
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::DisassociateLinkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_36 = &_input.global_network_id;
let input_36 = input_36.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_36,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/link-associations",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::DisassociateLinkInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_37 = &_input.device_id;
let inner_37 = inner_37.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"device_id",
"cannot be empty or unset",
)
})?;
if inner_37.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"device_id",
"cannot be empty or unset",
),
);
}
query.push_kv("deviceId", &aws_smithy_http::query::fmt_string(&inner_37));
let inner_38 = &_input.link_id;
let inner_38 = inner_38.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"link_id",
"cannot be empty or unset",
)
})?;
if inner_38.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"link_id",
"cannot be empty or unset",
),
);
}
query.push_kv("linkId", &aws_smithy_http::query::fmt_string(&inner_38));
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DisassociateLinkInput,
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::DisassociateLink::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DisassociateLink",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::disassociate_link_input::Builder {
crate::input::disassociate_link_input::Builder::default()
}
}
pub mod disassociate_transit_gateway_connect_peer_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) transit_gateway_connect_peer_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn transit_gateway_connect_peer_arn(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.transit_gateway_connect_peer_arn = Some(input.into());
self
}
pub fn set_transit_gateway_connect_peer_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.transit_gateway_connect_peer_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DisassociateTransitGatewayConnectPeerInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DisassociateTransitGatewayConnectPeerInput {
global_network_id: self.global_network_id,
transit_gateway_connect_peer_arn: self.transit_gateway_connect_peer_arn,
})
}
}
}
impl DisassociateTransitGatewayConnectPeerInput {
#[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::DisassociateTransitGatewayConnectPeer,
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::DisassociateTransitGatewayConnectPeerInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_39 = &_input.global_network_id;
let input_39 = input_39.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_39,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
let input_40 = &_input.transit_gateway_connect_peer_arn;
let input_40 = input_40.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"transit_gateway_connect_peer_arn",
"cannot be empty or unset",
)
})?;
let transit_gateway_connect_peer_arn = aws_smithy_http::label::fmt_string(
input_40,
aws_smithy_http::label::EncodingStrategy::Default,
);
if transit_gateway_connect_peer_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"transit_gateway_connect_peer_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/global-networks/{GlobalNetworkId}/transit-gateway-connect-peer-associations/{TransitGatewayConnectPeerArn}", GlobalNetworkId = global_network_id, TransitGatewayConnectPeerArn = transit_gateway_connect_peer_arn).expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DisassociateTransitGatewayConnectPeerInput,
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::DisassociateTransitGatewayConnectPeer::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DisassociateTransitGatewayConnectPeer",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::disassociate_transit_gateway_connect_peer_input::Builder {
crate::input::disassociate_transit_gateway_connect_peer_input::Builder::default()
}
}
pub mod execute_core_network_change_set_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) policy_version_id: std::option::Option<i32>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn policy_version_id(mut self, input: i32) -> Self {
self.policy_version_id = Some(input);
self
}
pub fn set_policy_version_id(mut self, input: std::option::Option<i32>) -> Self {
self.policy_version_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ExecuteCoreNetworkChangeSetInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ExecuteCoreNetworkChangeSetInput {
core_network_id: self.core_network_id,
policy_version_id: self.policy_version_id,
})
}
}
}
impl ExecuteCoreNetworkChangeSetInput {
#[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::ExecuteCoreNetworkChangeSet,
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::ExecuteCoreNetworkChangeSetInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_41 = &_input.core_network_id;
let input_41 = input_41.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
)
})?;
let core_network_id = aws_smithy_http::label::fmt_string(
input_41,
aws_smithy_http::label::EncodingStrategy::Default,
);
if core_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
),
);
}
let input_42 = &_input.policy_version_id;
let input_42 = input_42.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"policy_version_id",
"cannot be empty or unset",
)
})?;
let mut policy_version_id_encoder =
aws_smithy_types::primitive::Encoder::from(*input_42);
let policy_version_id = policy_version_id_encoder.encode();
if policy_version_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"policy_version_id",
"cannot be empty or unset",
),
);
}
write!(output, "/core-networks/{CoreNetworkId}/core-network-change-sets/{PolicyVersionId}/execute", CoreNetworkId = core_network_id, PolicyVersionId = policy_version_id).expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ExecuteCoreNetworkChangeSetInput,
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::ExecuteCoreNetworkChangeSet::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ExecuteCoreNetworkChangeSet",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::execute_core_network_change_set_input::Builder {
crate::input::execute_core_network_change_set_input::Builder::default()
}
}
pub mod get_connect_attachment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) attachment_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn attachment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.attachment_id = Some(input.into());
self
}
pub fn set_attachment_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.attachment_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetConnectAttachmentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetConnectAttachmentInput {
attachment_id: self.attachment_id,
})
}
}
}
impl GetConnectAttachmentInput {
#[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::GetConnectAttachment,
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::GetConnectAttachmentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_43 = &_input.attachment_id;
let input_43 = input_43.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"attachment_id",
"cannot be empty or unset",
)
})?;
let attachment_id = aws_smithy_http::label::fmt_string(
input_43,
aws_smithy_http::label::EncodingStrategy::Default,
);
if attachment_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"attachment_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/connect-attachments/{AttachmentId}",
AttachmentId = attachment_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetConnectAttachmentInput,
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::GetConnectAttachment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetConnectAttachment",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_connect_attachment_input::Builder {
crate::input::get_connect_attachment_input::Builder::default()
}
}
pub mod get_connections_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) connection_ids: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) device_id: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn connection_ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.connection_ids.unwrap_or_default();
v.push(input.into());
self.connection_ids = Some(v);
self
}
pub fn set_connection_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.connection_ids = input;
self
}
pub fn device_id(mut self, input: impl Into<std::string::String>) -> Self {
self.device_id = Some(input.into());
self
}
pub fn set_device_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.device_id = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetConnectionsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetConnectionsInput {
global_network_id: self.global_network_id,
connection_ids: self.connection_ids,
device_id: self.device_id,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl GetConnectionsInput {
#[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::GetConnections,
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::GetConnectionsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_44 = &_input.global_network_id;
let input_44 = input_44.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_44,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/connections",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetConnectionsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_45) = &_input.connection_ids {
{
for inner_46 in inner_45 {
query.push_kv(
"connectionIds",
&aws_smithy_http::query::fmt_string(&inner_46),
);
}
}
}
if let Some(inner_47) = &_input.device_id {
{
query.push_kv("deviceId", &aws_smithy_http::query::fmt_string(&inner_47));
}
}
if let Some(inner_48) = &_input.max_results {
if *inner_48 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_48).encode(),
);
}
}
if let Some(inner_49) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_49));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetConnectionsInput,
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::GetConnections::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetConnections",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_connections_input::Builder {
crate::input::get_connections_input::Builder::default()
}
}
pub mod get_connect_peer_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) connect_peer_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn connect_peer_id(mut self, input: impl Into<std::string::String>) -> Self {
self.connect_peer_id = Some(input.into());
self
}
pub fn set_connect_peer_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.connect_peer_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetConnectPeerInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetConnectPeerInput {
connect_peer_id: self.connect_peer_id,
})
}
}
}
impl GetConnectPeerInput {
#[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::GetConnectPeer,
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::GetConnectPeerInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_50 = &_input.connect_peer_id;
let input_50 = input_50.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"connect_peer_id",
"cannot be empty or unset",
)
})?;
let connect_peer_id = aws_smithy_http::label::fmt_string(
input_50,
aws_smithy_http::label::EncodingStrategy::Default,
);
if connect_peer_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"connect_peer_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/connect-peers/{ConnectPeerId}",
ConnectPeerId = connect_peer_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetConnectPeerInput,
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::GetConnectPeer::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetConnectPeer",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_connect_peer_input::Builder {
crate::input::get_connect_peer_input::Builder::default()
}
}
pub mod get_connect_peer_associations_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) connect_peer_ids: 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>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn connect_peer_ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.connect_peer_ids.unwrap_or_default();
v.push(input.into());
self.connect_peer_ids = Some(v);
self
}
pub fn set_connect_peer_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.connect_peer_ids = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetConnectPeerAssociationsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetConnectPeerAssociationsInput {
global_network_id: self.global_network_id,
connect_peer_ids: self.connect_peer_ids,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl GetConnectPeerAssociationsInput {
#[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::GetConnectPeerAssociations,
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::GetConnectPeerAssociationsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_51 = &_input.global_network_id;
let input_51 = input_51.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_51,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/connect-peer-associations",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetConnectPeerAssociationsInput,
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_52) = &_input.connect_peer_ids {
{
for inner_53 in inner_52 {
query.push_kv(
"connectPeerIds",
&aws_smithy_http::query::fmt_string(&inner_53),
);
}
}
}
if let Some(inner_54) = &_input.max_results {
if *inner_54 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_54).encode(),
);
}
}
if let Some(inner_55) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_55));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetConnectPeerAssociationsInput,
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::GetConnectPeerAssociations::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetConnectPeerAssociations",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_connect_peer_associations_input::Builder {
crate::input::get_connect_peer_associations_input::Builder::default()
}
}
pub mod get_core_network_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetCoreNetworkInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetCoreNetworkInput {
core_network_id: self.core_network_id,
})
}
}
}
impl GetCoreNetworkInput {
#[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::GetCoreNetwork,
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::GetCoreNetworkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_56 = &_input.core_network_id;
let input_56 = input_56.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
)
})?;
let core_network_id = aws_smithy_http::label::fmt_string(
input_56,
aws_smithy_http::label::EncodingStrategy::Default,
);
if core_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/core-networks/{CoreNetworkId}",
CoreNetworkId = core_network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetCoreNetworkInput,
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::GetCoreNetwork::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetCoreNetwork",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_core_network_input::Builder {
crate::input::get_core_network_input::Builder::default()
}
}
pub mod get_core_network_change_events_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) policy_version_id: std::option::Option<i32>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn policy_version_id(mut self, input: i32) -> Self {
self.policy_version_id = Some(input);
self
}
pub fn set_policy_version_id(mut self, input: std::option::Option<i32>) -> Self {
self.policy_version_id = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetCoreNetworkChangeEventsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetCoreNetworkChangeEventsInput {
core_network_id: self.core_network_id,
policy_version_id: self.policy_version_id,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl GetCoreNetworkChangeEventsInput {
#[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::GetCoreNetworkChangeEvents,
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::GetCoreNetworkChangeEventsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_57 = &_input.core_network_id;
let input_57 = input_57.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
)
})?;
let core_network_id = aws_smithy_http::label::fmt_string(
input_57,
aws_smithy_http::label::EncodingStrategy::Default,
);
if core_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
),
);
}
let input_58 = &_input.policy_version_id;
let input_58 = input_58.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"policy_version_id",
"cannot be empty or unset",
)
})?;
let mut policy_version_id_encoder =
aws_smithy_types::primitive::Encoder::from(*input_58);
let policy_version_id = policy_version_id_encoder.encode();
if policy_version_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"policy_version_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/core-networks/{CoreNetworkId}/core-network-change-events/{PolicyVersionId}",
CoreNetworkId = core_network_id,
PolicyVersionId = policy_version_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetCoreNetworkChangeEventsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_59) = &_input.max_results {
if *inner_59 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_59).encode(),
);
}
}
if let Some(inner_60) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_60));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetCoreNetworkChangeEventsInput,
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::GetCoreNetworkChangeEvents::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetCoreNetworkChangeEvents",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_core_network_change_events_input::Builder {
crate::input::get_core_network_change_events_input::Builder::default()
}
}
pub mod get_core_network_change_set_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) policy_version_id: std::option::Option<i32>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn policy_version_id(mut self, input: i32) -> Self {
self.policy_version_id = Some(input);
self
}
pub fn set_policy_version_id(mut self, input: std::option::Option<i32>) -> Self {
self.policy_version_id = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetCoreNetworkChangeSetInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetCoreNetworkChangeSetInput {
core_network_id: self.core_network_id,
policy_version_id: self.policy_version_id,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl GetCoreNetworkChangeSetInput {
#[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::GetCoreNetworkChangeSet,
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::GetCoreNetworkChangeSetInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_61 = &_input.core_network_id;
let input_61 = input_61.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
)
})?;
let core_network_id = aws_smithy_http::label::fmt_string(
input_61,
aws_smithy_http::label::EncodingStrategy::Default,
);
if core_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
),
);
}
let input_62 = &_input.policy_version_id;
let input_62 = input_62.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"policy_version_id",
"cannot be empty or unset",
)
})?;
let mut policy_version_id_encoder =
aws_smithy_types::primitive::Encoder::from(*input_62);
let policy_version_id = policy_version_id_encoder.encode();
if policy_version_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"policy_version_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/core-networks/{CoreNetworkId}/core-network-change-sets/{PolicyVersionId}",
CoreNetworkId = core_network_id,
PolicyVersionId = policy_version_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetCoreNetworkChangeSetInput,
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_63) = &_input.max_results {
if *inner_63 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_63).encode(),
);
}
}
if let Some(inner_64) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_64));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetCoreNetworkChangeSetInput,
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::GetCoreNetworkChangeSet::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetCoreNetworkChangeSet",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_core_network_change_set_input::Builder {
crate::input::get_core_network_change_set_input::Builder::default()
}
}
pub mod get_core_network_policy_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) policy_version_id: std::option::Option<i32>,
pub(crate) alias: std::option::Option<crate::model::CoreNetworkPolicyAlias>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn policy_version_id(mut self, input: i32) -> Self {
self.policy_version_id = Some(input);
self
}
pub fn set_policy_version_id(mut self, input: std::option::Option<i32>) -> Self {
self.policy_version_id = input;
self
}
pub fn alias(mut self, input: crate::model::CoreNetworkPolicyAlias) -> Self {
self.alias = Some(input);
self
}
pub fn set_alias(
mut self,
input: std::option::Option<crate::model::CoreNetworkPolicyAlias>,
) -> Self {
self.alias = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetCoreNetworkPolicyInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetCoreNetworkPolicyInput {
core_network_id: self.core_network_id,
policy_version_id: self.policy_version_id,
alias: self.alias,
})
}
}
}
impl GetCoreNetworkPolicyInput {
#[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::GetCoreNetworkPolicy,
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::GetCoreNetworkPolicyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_65 = &_input.core_network_id;
let input_65 = input_65.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
)
})?;
let core_network_id = aws_smithy_http::label::fmt_string(
input_65,
aws_smithy_http::label::EncodingStrategy::Default,
);
if core_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/core-networks/{CoreNetworkId}/core-network-policy",
CoreNetworkId = core_network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetCoreNetworkPolicyInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_66) = &_input.policy_version_id {
if *inner_66 != 0 {
query.push_kv(
"policyVersionId",
aws_smithy_types::primitive::Encoder::from(*inner_66).encode(),
);
}
}
if let Some(inner_67) = &_input.alias {
{
query.push_kv("alias", &aws_smithy_http::query::fmt_string(&inner_67));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetCoreNetworkPolicyInput,
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::GetCoreNetworkPolicy::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetCoreNetworkPolicy",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_core_network_policy_input::Builder {
crate::input::get_core_network_policy_input::Builder::default()
}
}
pub mod get_customer_gateway_associations_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) customer_gateway_arns: 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>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn customer_gateway_arns(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.customer_gateway_arns.unwrap_or_default();
v.push(input.into());
self.customer_gateway_arns = Some(v);
self
}
pub fn set_customer_gateway_arns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.customer_gateway_arns = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetCustomerGatewayAssociationsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetCustomerGatewayAssociationsInput {
global_network_id: self.global_network_id,
customer_gateway_arns: self.customer_gateway_arns,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl GetCustomerGatewayAssociationsInput {
#[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::GetCustomerGatewayAssociations,
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::GetCustomerGatewayAssociationsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_68 = &_input.global_network_id;
let input_68 = input_68.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_68,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/customer-gateway-associations",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetCustomerGatewayAssociationsInput,
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_69) = &_input.customer_gateway_arns {
{
for inner_70 in inner_69 {
query.push_kv(
"customerGatewayArns",
&aws_smithy_http::query::fmt_string(&inner_70),
);
}
}
}
if let Some(inner_71) = &_input.max_results {
if *inner_71 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_71).encode(),
);
}
}
if let Some(inner_72) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_72));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetCustomerGatewayAssociationsInput,
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::GetCustomerGatewayAssociations::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetCustomerGatewayAssociations",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_customer_gateway_associations_input::Builder {
crate::input::get_customer_gateway_associations_input::Builder::default()
}
}
pub mod get_devices_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) device_ids: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) site_id: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn device_ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.device_ids.unwrap_or_default();
v.push(input.into());
self.device_ids = Some(v);
self
}
pub fn set_device_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.device_ids = 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 max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetDevicesInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetDevicesInput {
global_network_id: self.global_network_id,
device_ids: self.device_ids,
site_id: self.site_id,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl GetDevicesInput {
#[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::GetDevices,
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::GetDevicesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_73 = &_input.global_network_id;
let input_73 = input_73.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_73,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/devices",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetDevicesInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_74) = &_input.device_ids {
{
for inner_75 in inner_74 {
query.push_kv(
"deviceIds",
&aws_smithy_http::query::fmt_string(&inner_75),
);
}
}
}
if let Some(inner_76) = &_input.site_id {
{
query.push_kv("siteId", &aws_smithy_http::query::fmt_string(&inner_76));
}
}
if let Some(inner_77) = &_input.max_results {
if *inner_77 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_77).encode(),
);
}
}
if let Some(inner_78) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_78));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetDevicesInput,
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::GetDevices::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetDevices",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_devices_input::Builder {
crate::input::get_devices_input::Builder::default()
}
}
pub mod get_link_associations_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) device_id: std::option::Option<std::string::String>,
pub(crate) link_id: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn device_id(mut self, input: impl Into<std::string::String>) -> Self {
self.device_id = Some(input.into());
self
}
pub fn set_device_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.device_id = input;
self
}
pub fn link_id(mut self, input: impl Into<std::string::String>) -> Self {
self.link_id = Some(input.into());
self
}
pub fn set_link_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.link_id = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetLinkAssociationsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetLinkAssociationsInput {
global_network_id: self.global_network_id,
device_id: self.device_id,
link_id: self.link_id,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl GetLinkAssociationsInput {
#[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::GetLinkAssociations,
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::GetLinkAssociationsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_79 = &_input.global_network_id;
let input_79 = input_79.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_79,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/link-associations",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetLinkAssociationsInput,
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_80) = &_input.device_id {
{
query.push_kv("deviceId", &aws_smithy_http::query::fmt_string(&inner_80));
}
}
if let Some(inner_81) = &_input.link_id {
{
query.push_kv("linkId", &aws_smithy_http::query::fmt_string(&inner_81));
}
}
if let Some(inner_82) = &_input.max_results {
if *inner_82 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_82).encode(),
);
}
}
if let Some(inner_83) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_83));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetLinkAssociationsInput,
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::GetLinkAssociations::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetLinkAssociations",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_link_associations_input::Builder {
crate::input::get_link_associations_input::Builder::default()
}
}
pub mod get_links_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) link_ids: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) site_id: std::option::Option<std::string::String>,
pub(crate) r#type: std::option::Option<std::string::String>,
pub(crate) provider: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn link_ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.link_ids.unwrap_or_default();
v.push(input.into());
self.link_ids = Some(v);
self
}
pub fn set_link_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.link_ids = 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 r#type(mut self, input: impl Into<std::string::String>) -> Self {
self.r#type = Some(input.into());
self
}
pub fn set_type(mut self, input: std::option::Option<std::string::String>) -> Self {
self.r#type = input;
self
}
pub fn provider(mut self, input: impl Into<std::string::String>) -> Self {
self.provider = Some(input.into());
self
}
pub fn set_provider(mut self, input: std::option::Option<std::string::String>) -> Self {
self.provider = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetLinksInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetLinksInput {
global_network_id: self.global_network_id,
link_ids: self.link_ids,
site_id: self.site_id,
r#type: self.r#type,
provider: self.provider,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl GetLinksInput {
#[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::GetLinks,
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::GetLinksInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_84 = &_input.global_network_id;
let input_84 = input_84.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_84,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/links",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetLinksInput,
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_85) = &_input.link_ids {
{
for inner_86 in inner_85 {
query
.push_kv("linkIds", &aws_smithy_http::query::fmt_string(&inner_86));
}
}
}
if let Some(inner_87) = &_input.site_id {
{
query.push_kv("siteId", &aws_smithy_http::query::fmt_string(&inner_87));
}
}
if let Some(inner_88) = &_input.r#type {
{
query.push_kv("type", &aws_smithy_http::query::fmt_string(&inner_88));
}
}
if let Some(inner_89) = &_input.provider {
{
query.push_kv("provider", &aws_smithy_http::query::fmt_string(&inner_89));
}
}
if let Some(inner_90) = &_input.max_results {
if *inner_90 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_90).encode(),
);
}
}
if let Some(inner_91) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_91));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetLinksInput,
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::GetLinks::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetLinks",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_links_input::Builder {
crate::input::get_links_input::Builder::default()
}
}
pub mod get_network_resource_counts_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) resource_type: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn resource_type(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_type = Some(input.into());
self
}
pub fn set_resource_type(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_type = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetNetworkResourceCountsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetNetworkResourceCountsInput {
global_network_id: self.global_network_id,
resource_type: self.resource_type,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl GetNetworkResourceCountsInput {
#[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::GetNetworkResourceCounts,
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::GetNetworkResourceCountsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_92 = &_input.global_network_id;
let input_92 = input_92.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_92,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/network-resource-count",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetNetworkResourceCountsInput,
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_93) = &_input.resource_type {
{
query.push_kv(
"resourceType",
&aws_smithy_http::query::fmt_string(&inner_93),
);
}
}
if let Some(inner_94) = &_input.max_results {
if *inner_94 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_94).encode(),
);
}
}
if let Some(inner_95) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_95));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetNetworkResourceCountsInput,
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::GetNetworkResourceCounts::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetNetworkResourceCounts",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_network_resource_counts_input::Builder {
crate::input::get_network_resource_counts_input::Builder::default()
}
}
pub mod get_network_resource_relationships_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) registered_gateway_arn: std::option::Option<std::string::String>,
pub(crate) aws_region: std::option::Option<std::string::String>,
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) resource_type: std::option::Option<std::string::String>,
pub(crate) resource_arn: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn registered_gateway_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.registered_gateway_arn = Some(input.into());
self
}
pub fn set_registered_gateway_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.registered_gateway_arn = input;
self
}
pub fn aws_region(mut self, input: impl Into<std::string::String>) -> Self {
self.aws_region = Some(input.into());
self
}
pub fn set_aws_region(mut self, input: std::option::Option<std::string::String>) -> Self {
self.aws_region = input;
self
}
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn resource_type(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_type = Some(input.into());
self
}
pub fn set_resource_type(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_type = input;
self
}
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 max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetNetworkResourceRelationshipsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetNetworkResourceRelationshipsInput {
global_network_id: self.global_network_id,
core_network_id: self.core_network_id,
registered_gateway_arn: self.registered_gateway_arn,
aws_region: self.aws_region,
account_id: self.account_id,
resource_type: self.resource_type,
resource_arn: self.resource_arn,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl GetNetworkResourceRelationshipsInput {
#[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::GetNetworkResourceRelationships,
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::GetNetworkResourceRelationshipsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_96 = &_input.global_network_id;
let input_96 = input_96.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_96,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/network-resource-relationships",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetNetworkResourceRelationshipsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_97) = &_input.core_network_id {
{
query.push_kv(
"coreNetworkId",
&aws_smithy_http::query::fmt_string(&inner_97),
);
}
}
if let Some(inner_98) = &_input.registered_gateway_arn {
{
query.push_kv(
"registeredGatewayArn",
&aws_smithy_http::query::fmt_string(&inner_98),
);
}
}
if let Some(inner_99) = &_input.aws_region {
{
query.push_kv("awsRegion", &aws_smithy_http::query::fmt_string(&inner_99));
}
}
if let Some(inner_100) = &_input.account_id {
{
query.push_kv("accountId", &aws_smithy_http::query::fmt_string(&inner_100));
}
}
if let Some(inner_101) = &_input.resource_type {
{
query.push_kv(
"resourceType",
&aws_smithy_http::query::fmt_string(&inner_101),
);
}
}
if let Some(inner_102) = &_input.resource_arn {
{
query.push_kv(
"resourceArn",
&aws_smithy_http::query::fmt_string(&inner_102),
);
}
}
if let Some(inner_103) = &_input.max_results {
if *inner_103 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_103).encode(),
);
}
}
if let Some(inner_104) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_104));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetNetworkResourceRelationshipsInput,
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::GetNetworkResourceRelationships::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetNetworkResourceRelationships",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_network_resource_relationships_input::Builder {
crate::input::get_network_resource_relationships_input::Builder::default()
}
}
pub mod get_network_resources_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) registered_gateway_arn: std::option::Option<std::string::String>,
pub(crate) aws_region: std::option::Option<std::string::String>,
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) resource_type: std::option::Option<std::string::String>,
pub(crate) resource_arn: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn registered_gateway_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.registered_gateway_arn = Some(input.into());
self
}
pub fn set_registered_gateway_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.registered_gateway_arn = input;
self
}
pub fn aws_region(mut self, input: impl Into<std::string::String>) -> Self {
self.aws_region = Some(input.into());
self
}
pub fn set_aws_region(mut self, input: std::option::Option<std::string::String>) -> Self {
self.aws_region = input;
self
}
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn resource_type(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_type = Some(input.into());
self
}
pub fn set_resource_type(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_type = input;
self
}
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 max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetNetworkResourcesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetNetworkResourcesInput {
global_network_id: self.global_network_id,
core_network_id: self.core_network_id,
registered_gateway_arn: self.registered_gateway_arn,
aws_region: self.aws_region,
account_id: self.account_id,
resource_type: self.resource_type,
resource_arn: self.resource_arn,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl GetNetworkResourcesInput {
#[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::GetNetworkResources,
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::GetNetworkResourcesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_105 = &_input.global_network_id;
let input_105 = input_105.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_105,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/network-resources",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetNetworkResourcesInput,
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_106) = &_input.core_network_id {
{
query.push_kv(
"coreNetworkId",
&aws_smithy_http::query::fmt_string(&inner_106),
);
}
}
if let Some(inner_107) = &_input.registered_gateway_arn {
{
query.push_kv(
"registeredGatewayArn",
&aws_smithy_http::query::fmt_string(&inner_107),
);
}
}
if let Some(inner_108) = &_input.aws_region {
{
query.push_kv("awsRegion", &aws_smithy_http::query::fmt_string(&inner_108));
}
}
if let Some(inner_109) = &_input.account_id {
{
query.push_kv("accountId", &aws_smithy_http::query::fmt_string(&inner_109));
}
}
if let Some(inner_110) = &_input.resource_type {
{
query.push_kv(
"resourceType",
&aws_smithy_http::query::fmt_string(&inner_110),
);
}
}
if let Some(inner_111) = &_input.resource_arn {
{
query.push_kv(
"resourceArn",
&aws_smithy_http::query::fmt_string(&inner_111),
);
}
}
if let Some(inner_112) = &_input.max_results {
if *inner_112 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_112).encode(),
);
}
}
if let Some(inner_113) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_113));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetNetworkResourcesInput,
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::GetNetworkResources::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetNetworkResources",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_network_resources_input::Builder {
crate::input::get_network_resources_input::Builder::default()
}
}
pub mod get_network_routes_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) route_table_identifier: std::option::Option<crate::model::RouteTableIdentifier>,
pub(crate) exact_cidr_matches: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) longest_prefix_matches: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) subnet_of_matches: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) supernet_of_matches: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) prefix_list_ids: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) states: std::option::Option<std::vec::Vec<crate::model::RouteState>>,
pub(crate) types: std::option::Option<std::vec::Vec<crate::model::RouteType>>,
pub(crate) destination_filters: std::option::Option<
std::collections::HashMap<std::string::String, std::vec::Vec<std::string::String>>,
>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn route_table_identifier(mut self, input: crate::model::RouteTableIdentifier) -> Self {
self.route_table_identifier = Some(input);
self
}
pub fn set_route_table_identifier(
mut self,
input: std::option::Option<crate::model::RouteTableIdentifier>,
) -> Self {
self.route_table_identifier = input;
self
}
pub fn exact_cidr_matches(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.exact_cidr_matches.unwrap_or_default();
v.push(input.into());
self.exact_cidr_matches = Some(v);
self
}
pub fn set_exact_cidr_matches(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.exact_cidr_matches = input;
self
}
pub fn longest_prefix_matches(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.longest_prefix_matches.unwrap_or_default();
v.push(input.into());
self.longest_prefix_matches = Some(v);
self
}
pub fn set_longest_prefix_matches(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.longest_prefix_matches = input;
self
}
pub fn subnet_of_matches(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.subnet_of_matches.unwrap_or_default();
v.push(input.into());
self.subnet_of_matches = Some(v);
self
}
pub fn set_subnet_of_matches(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.subnet_of_matches = input;
self
}
pub fn supernet_of_matches(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.supernet_of_matches.unwrap_or_default();
v.push(input.into());
self.supernet_of_matches = Some(v);
self
}
pub fn set_supernet_of_matches(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.supernet_of_matches = input;
self
}
pub fn prefix_list_ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.prefix_list_ids.unwrap_or_default();
v.push(input.into());
self.prefix_list_ids = Some(v);
self
}
pub fn set_prefix_list_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.prefix_list_ids = input;
self
}
pub fn states(mut self, input: crate::model::RouteState) -> Self {
let mut v = self.states.unwrap_or_default();
v.push(input);
self.states = Some(v);
self
}
pub fn set_states(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::RouteState>>,
) -> Self {
self.states = input;
self
}
pub fn types(mut self, input: crate::model::RouteType) -> Self {
let mut v = self.types.unwrap_or_default();
v.push(input);
self.types = Some(v);
self
}
pub fn set_types(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::RouteType>>,
) -> Self {
self.types = input;
self
}
pub fn destination_filters(
mut self,
k: impl Into<std::string::String>,
v: std::vec::Vec<std::string::String>,
) -> Self {
let mut hash_map = self.destination_filters.unwrap_or_default();
hash_map.insert(k.into(), v);
self.destination_filters = Some(hash_map);
self
}
pub fn set_destination_filters(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::vec::Vec<std::string::String>>,
>,
) -> Self {
self.destination_filters = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetNetworkRoutesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetNetworkRoutesInput {
global_network_id: self.global_network_id,
route_table_identifier: self.route_table_identifier,
exact_cidr_matches: self.exact_cidr_matches,
longest_prefix_matches: self.longest_prefix_matches,
subnet_of_matches: self.subnet_of_matches,
supernet_of_matches: self.supernet_of_matches,
prefix_list_ids: self.prefix_list_ids,
states: self.states,
types: self.types,
destination_filters: self.destination_filters,
})
}
}
}
impl GetNetworkRoutesInput {
#[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::GetNetworkRoutes,
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::GetNetworkRoutesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_114 = &_input.global_network_id;
let input_114 = input_114.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_114,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/network-routes",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetNetworkRoutesInput,
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_get_network_routes(&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::GetNetworkRoutes::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetNetworkRoutes",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_network_routes_input::Builder {
crate::input::get_network_routes_input::Builder::default()
}
}
pub mod get_network_telemetry_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) registered_gateway_arn: std::option::Option<std::string::String>,
pub(crate) aws_region: std::option::Option<std::string::String>,
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) resource_type: std::option::Option<std::string::String>,
pub(crate) resource_arn: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn registered_gateway_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.registered_gateway_arn = Some(input.into());
self
}
pub fn set_registered_gateway_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.registered_gateway_arn = input;
self
}
pub fn aws_region(mut self, input: impl Into<std::string::String>) -> Self {
self.aws_region = Some(input.into());
self
}
pub fn set_aws_region(mut self, input: std::option::Option<std::string::String>) -> Self {
self.aws_region = input;
self
}
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn resource_type(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_type = Some(input.into());
self
}
pub fn set_resource_type(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_type = input;
self
}
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 max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetNetworkTelemetryInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetNetworkTelemetryInput {
global_network_id: self.global_network_id,
core_network_id: self.core_network_id,
registered_gateway_arn: self.registered_gateway_arn,
aws_region: self.aws_region,
account_id: self.account_id,
resource_type: self.resource_type,
resource_arn: self.resource_arn,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl GetNetworkTelemetryInput {
#[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::GetNetworkTelemetry,
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::GetNetworkTelemetryInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_115 = &_input.global_network_id;
let input_115 = input_115.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_115,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/network-telemetry",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetNetworkTelemetryInput,
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_116) = &_input.core_network_id {
{
query.push_kv(
"coreNetworkId",
&aws_smithy_http::query::fmt_string(&inner_116),
);
}
}
if let Some(inner_117) = &_input.registered_gateway_arn {
{
query.push_kv(
"registeredGatewayArn",
&aws_smithy_http::query::fmt_string(&inner_117),
);
}
}
if let Some(inner_118) = &_input.aws_region {
{
query.push_kv("awsRegion", &aws_smithy_http::query::fmt_string(&inner_118));
}
}
if let Some(inner_119) = &_input.account_id {
{
query.push_kv("accountId", &aws_smithy_http::query::fmt_string(&inner_119));
}
}
if let Some(inner_120) = &_input.resource_type {
{
query.push_kv(
"resourceType",
&aws_smithy_http::query::fmt_string(&inner_120),
);
}
}
if let Some(inner_121) = &_input.resource_arn {
{
query.push_kv(
"resourceArn",
&aws_smithy_http::query::fmt_string(&inner_121),
);
}
}
if let Some(inner_122) = &_input.max_results {
if *inner_122 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_122).encode(),
);
}
}
if let Some(inner_123) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_123));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetNetworkTelemetryInput,
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::GetNetworkTelemetry::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetNetworkTelemetry",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_network_telemetry_input::Builder {
crate::input::get_network_telemetry_input::Builder::default()
}
}
pub mod get_resource_policy_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::GetResourcePolicyInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetResourcePolicyInput {
resource_arn: self.resource_arn,
})
}
}
}
impl GetResourcePolicyInput {
#[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::GetResourcePolicy,
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::GetResourcePolicyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_124 = &_input.resource_arn;
let input_124 = input_124.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_124,
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,
"/resource-policy/{ResourceArn}",
ResourceArn = resource_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetResourcePolicyInput,
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::GetResourcePolicy::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetResourcePolicy",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_resource_policy_input::Builder {
crate::input::get_resource_policy_input::Builder::default()
}
}
pub mod get_route_analysis_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) route_analysis_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn route_analysis_id(mut self, input: impl Into<std::string::String>) -> Self {
self.route_analysis_id = Some(input.into());
self
}
pub fn set_route_analysis_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.route_analysis_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetRouteAnalysisInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetRouteAnalysisInput {
global_network_id: self.global_network_id,
route_analysis_id: self.route_analysis_id,
})
}
}
}
impl GetRouteAnalysisInput {
#[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::GetRouteAnalysis,
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::GetRouteAnalysisInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_125 = &_input.global_network_id;
let input_125 = input_125.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_125,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
let input_126 = &_input.route_analysis_id;
let input_126 = input_126.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"route_analysis_id",
"cannot be empty or unset",
)
})?;
let route_analysis_id = aws_smithy_http::label::fmt_string(
input_126,
aws_smithy_http::label::EncodingStrategy::Default,
);
if route_analysis_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"route_analysis_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/route-analyses/{RouteAnalysisId}",
GlobalNetworkId = global_network_id,
RouteAnalysisId = route_analysis_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetRouteAnalysisInput,
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::GetRouteAnalysis::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetRouteAnalysis",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_route_analysis_input::Builder {
crate::input::get_route_analysis_input::Builder::default()
}
}
pub mod get_sites_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) site_ids: 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>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn site_ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.site_ids.unwrap_or_default();
v.push(input.into());
self.site_ids = Some(v);
self
}
pub fn set_site_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.site_ids = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetSitesInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetSitesInput {
global_network_id: self.global_network_id,
site_ids: self.site_ids,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl GetSitesInput {
#[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::GetSites,
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::GetSitesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_127 = &_input.global_network_id;
let input_127 = input_127.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_127,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/sites",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetSitesInput,
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_128) = &_input.site_ids {
{
for inner_129 in inner_128 {
query.push_kv(
"siteIds",
&aws_smithy_http::query::fmt_string(&inner_129),
);
}
}
}
if let Some(inner_130) = &_input.max_results {
if *inner_130 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_130).encode(),
);
}
}
if let Some(inner_131) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_131));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetSitesInput,
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::GetSites::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetSites",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_sites_input::Builder {
crate::input::get_sites_input::Builder::default()
}
}
pub mod get_site_to_site_vpn_attachment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) attachment_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn attachment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.attachment_id = Some(input.into());
self
}
pub fn set_attachment_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.attachment_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetSiteToSiteVpnAttachmentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetSiteToSiteVpnAttachmentInput {
attachment_id: self.attachment_id,
})
}
}
}
impl GetSiteToSiteVpnAttachmentInput {
#[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::GetSiteToSiteVpnAttachment,
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::GetSiteToSiteVpnAttachmentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_132 = &_input.attachment_id;
let input_132 = input_132.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"attachment_id",
"cannot be empty or unset",
)
})?;
let attachment_id = aws_smithy_http::label::fmt_string(
input_132,
aws_smithy_http::label::EncodingStrategy::Default,
);
if attachment_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"attachment_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/site-to-site-vpn-attachments/{AttachmentId}",
AttachmentId = attachment_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetSiteToSiteVpnAttachmentInput,
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::GetSiteToSiteVpnAttachment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetSiteToSiteVpnAttachment",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_site_to_site_vpn_attachment_input::Builder {
crate::input::get_site_to_site_vpn_attachment_input::Builder::default()
}
}
pub mod get_transit_gateway_connect_peer_associations_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) transit_gateway_connect_peer_arns:
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>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn transit_gateway_connect_peer_arns(
mut self,
input: impl Into<std::string::String>,
) -> Self {
let mut v = self.transit_gateway_connect_peer_arns.unwrap_or_default();
v.push(input.into());
self.transit_gateway_connect_peer_arns = Some(v);
self
}
pub fn set_transit_gateway_connect_peer_arns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.transit_gateway_connect_peer_arns = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetTransitGatewayConnectPeerAssociationsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(
crate::input::GetTransitGatewayConnectPeerAssociationsInput {
global_network_id: self.global_network_id,
transit_gateway_connect_peer_arns: self.transit_gateway_connect_peer_arns,
max_results: self.max_results,
next_token: self.next_token,
},
)
}
}
}
impl GetTransitGatewayConnectPeerAssociationsInput {
#[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::GetTransitGatewayConnectPeerAssociations,
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::GetTransitGatewayConnectPeerAssociationsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_133 = &_input.global_network_id;
let input_133 = input_133.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_133,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/transit-gateway-connect-peer-associations",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetTransitGatewayConnectPeerAssociationsInput,
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_134) = &_input.transit_gateway_connect_peer_arns {
{
for inner_135 in inner_134 {
query.push_kv(
"transitGatewayConnectPeerArns",
&aws_smithy_http::query::fmt_string(&inner_135),
);
}
}
}
if let Some(inner_136) = &_input.max_results {
if *inner_136 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_136).encode(),
);
}
}
if let Some(inner_137) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_137));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetTransitGatewayConnectPeerAssociationsInput,
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::GetTransitGatewayConnectPeerAssociations::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetTransitGatewayConnectPeerAssociations",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_transit_gateway_connect_peer_associations_input::Builder {
crate::input::get_transit_gateway_connect_peer_associations_input::Builder::default()
}
}
pub mod get_transit_gateway_peering_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) peering_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn peering_id(mut self, input: impl Into<std::string::String>) -> Self {
self.peering_id = Some(input.into());
self
}
pub fn set_peering_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.peering_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetTransitGatewayPeeringInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetTransitGatewayPeeringInput {
peering_id: self.peering_id,
})
}
}
}
impl GetTransitGatewayPeeringInput {
#[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::GetTransitGatewayPeering,
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::GetTransitGatewayPeeringInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_138 = &_input.peering_id;
let input_138 = input_138.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"peering_id",
"cannot be empty or unset",
)
})?;
let peering_id = aws_smithy_http::label::fmt_string(
input_138,
aws_smithy_http::label::EncodingStrategy::Default,
);
if peering_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"peering_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/transit-gateway-peerings/{PeeringId}",
PeeringId = peering_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetTransitGatewayPeeringInput,
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::GetTransitGatewayPeering::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetTransitGatewayPeering",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_transit_gateway_peering_input::Builder {
crate::input::get_transit_gateway_peering_input::Builder::default()
}
}
pub mod get_transit_gateway_registrations_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) transit_gateway_arns: 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>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn transit_gateway_arns(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.transit_gateway_arns.unwrap_or_default();
v.push(input.into());
self.transit_gateway_arns = Some(v);
self
}
pub fn set_transit_gateway_arns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.transit_gateway_arns = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetTransitGatewayRegistrationsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetTransitGatewayRegistrationsInput {
global_network_id: self.global_network_id,
transit_gateway_arns: self.transit_gateway_arns,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl GetTransitGatewayRegistrationsInput {
#[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::GetTransitGatewayRegistrations,
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::GetTransitGatewayRegistrationsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_139 = &_input.global_network_id;
let input_139 = input_139.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_139,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/transit-gateway-registrations",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetTransitGatewayRegistrationsInput,
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_140) = &_input.transit_gateway_arns {
{
for inner_141 in inner_140 {
query.push_kv(
"transitGatewayArns",
&aws_smithy_http::query::fmt_string(&inner_141),
);
}
}
}
if let Some(inner_142) = &_input.max_results {
if *inner_142 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_142).encode(),
);
}
}
if let Some(inner_143) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_143));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetTransitGatewayRegistrationsInput,
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::GetTransitGatewayRegistrations::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetTransitGatewayRegistrations",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_transit_gateway_registrations_input::Builder {
crate::input::get_transit_gateway_registrations_input::Builder::default()
}
}
pub mod get_transit_gateway_route_table_attachment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) attachment_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn attachment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.attachment_id = Some(input.into());
self
}
pub fn set_attachment_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.attachment_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetTransitGatewayRouteTableAttachmentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetTransitGatewayRouteTableAttachmentInput {
attachment_id: self.attachment_id,
})
}
}
}
impl GetTransitGatewayRouteTableAttachmentInput {
#[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::GetTransitGatewayRouteTableAttachment,
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::GetTransitGatewayRouteTableAttachmentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_144 = &_input.attachment_id;
let input_144 = input_144.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"attachment_id",
"cannot be empty or unset",
)
})?;
let attachment_id = aws_smithy_http::label::fmt_string(
input_144,
aws_smithy_http::label::EncodingStrategy::Default,
);
if attachment_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"attachment_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/transit-gateway-route-table-attachments/{AttachmentId}",
AttachmentId = attachment_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetTransitGatewayRouteTableAttachmentInput,
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::GetTransitGatewayRouteTableAttachment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetTransitGatewayRouteTableAttachment",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_transit_gateway_route_table_attachment_input::Builder {
crate::input::get_transit_gateway_route_table_attachment_input::Builder::default()
}
}
pub mod get_vpc_attachment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) attachment_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn attachment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.attachment_id = Some(input.into());
self
}
pub fn set_attachment_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.attachment_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetVpcAttachmentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetVpcAttachmentInput {
attachment_id: self.attachment_id,
})
}
}
}
impl GetVpcAttachmentInput {
#[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::GetVpcAttachment,
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::GetVpcAttachmentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_145 = &_input.attachment_id;
let input_145 = input_145.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"attachment_id",
"cannot be empty or unset",
)
})?;
let attachment_id = aws_smithy_http::label::fmt_string(
input_145,
aws_smithy_http::label::EncodingStrategy::Default,
);
if attachment_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"attachment_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/vpc-attachments/{AttachmentId}",
AttachmentId = attachment_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetVpcAttachmentInput,
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::GetVpcAttachment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetVpcAttachment",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_vpc_attachment_input::Builder {
crate::input::get_vpc_attachment_input::Builder::default()
}
}
pub mod list_attachments_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) attachment_type: std::option::Option<crate::model::AttachmentType>,
pub(crate) edge_location: std::option::Option<std::string::String>,
pub(crate) state: std::option::Option<crate::model::AttachmentState>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn attachment_type(mut self, input: crate::model::AttachmentType) -> Self {
self.attachment_type = Some(input);
self
}
pub fn set_attachment_type(
mut self,
input: std::option::Option<crate::model::AttachmentType>,
) -> Self {
self.attachment_type = input;
self
}
pub fn edge_location(mut self, input: impl Into<std::string::String>) -> Self {
self.edge_location = Some(input.into());
self
}
pub fn set_edge_location(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.edge_location = input;
self
}
pub fn state(mut self, input: crate::model::AttachmentState) -> Self {
self.state = Some(input);
self
}
pub fn set_state(
mut self,
input: std::option::Option<crate::model::AttachmentState>,
) -> Self {
self.state = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListAttachmentsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListAttachmentsInput {
core_network_id: self.core_network_id,
attachment_type: self.attachment_type,
edge_location: self.edge_location,
state: self.state,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl ListAttachmentsInput {
#[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::ListAttachments,
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::ListAttachmentsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/attachments").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListAttachmentsInput,
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_146) = &_input.core_network_id {
{
query.push_kv(
"coreNetworkId",
&aws_smithy_http::query::fmt_string(&inner_146),
);
}
}
if let Some(inner_147) = &_input.attachment_type {
{
query.push_kv(
"attachmentType",
&aws_smithy_http::query::fmt_string(&inner_147),
);
}
}
if let Some(inner_148) = &_input.edge_location {
{
query.push_kv(
"edgeLocation",
&aws_smithy_http::query::fmt_string(&inner_148),
);
}
}
if let Some(inner_149) = &_input.state {
{
query.push_kv("state", &aws_smithy_http::query::fmt_string(&inner_149));
}
}
if let Some(inner_150) = &_input.max_results {
if *inner_150 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_150).encode(),
);
}
}
if let Some(inner_151) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_151));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListAttachmentsInput,
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::ListAttachments::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListAttachments",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_attachments_input::Builder {
crate::input::list_attachments_input::Builder::default()
}
}
pub mod list_connect_peers_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) connect_attachment_id: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn connect_attachment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.connect_attachment_id = Some(input.into());
self
}
pub fn set_connect_attachment_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.connect_attachment_id = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListConnectPeersInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListConnectPeersInput {
core_network_id: self.core_network_id,
connect_attachment_id: self.connect_attachment_id,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl ListConnectPeersInput {
#[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::ListConnectPeers,
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::ListConnectPeersInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/connect-peers").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListConnectPeersInput,
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_152) = &_input.core_network_id {
{
query.push_kv(
"coreNetworkId",
&aws_smithy_http::query::fmt_string(&inner_152),
);
}
}
if let Some(inner_153) = &_input.connect_attachment_id {
{
query.push_kv(
"connectAttachmentId",
&aws_smithy_http::query::fmt_string(&inner_153),
);
}
}
if let Some(inner_154) = &_input.max_results {
if *inner_154 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_154).encode(),
);
}
}
if let Some(inner_155) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_155));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListConnectPeersInput,
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::ListConnectPeers::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListConnectPeers",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_connect_peers_input::Builder {
crate::input::list_connect_peers_input::Builder::default()
}
}
pub mod list_core_network_policy_versions_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListCoreNetworkPolicyVersionsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListCoreNetworkPolicyVersionsInput {
core_network_id: self.core_network_id,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl ListCoreNetworkPolicyVersionsInput {
#[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::ListCoreNetworkPolicyVersions,
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::ListCoreNetworkPolicyVersionsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_156 = &_input.core_network_id;
let input_156 = input_156.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
)
})?;
let core_network_id = aws_smithy_http::label::fmt_string(
input_156,
aws_smithy_http::label::EncodingStrategy::Default,
);
if core_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/core-networks/{CoreNetworkId}/core-network-policy-versions",
CoreNetworkId = core_network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListCoreNetworkPolicyVersionsInput,
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_157) = &_input.max_results {
if *inner_157 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_157).encode(),
);
}
}
if let Some(inner_158) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_158));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListCoreNetworkPolicyVersionsInput,
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::ListCoreNetworkPolicyVersions::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListCoreNetworkPolicyVersions",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_core_network_policy_versions_input::Builder {
crate::input::list_core_network_policy_versions_input::Builder::default()
}
}
pub mod list_core_networks_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListCoreNetworksInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListCoreNetworksInput {
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl ListCoreNetworksInput {
#[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::ListCoreNetworks,
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::ListCoreNetworksInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/core-networks").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListCoreNetworksInput,
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_159) = &_input.max_results {
if *inner_159 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_159).encode(),
);
}
}
if let Some(inner_160) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_160));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListCoreNetworksInput,
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::ListCoreNetworks::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListCoreNetworks",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_core_networks_input::Builder {
crate::input::list_core_networks_input::Builder::default()
}
}
pub mod list_organization_service_access_status_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListOrganizationServiceAccessStatusInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListOrganizationServiceAccessStatusInput {
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl ListOrganizationServiceAccessStatusInput {
#[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::ListOrganizationServiceAccessStatus,
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::ListOrganizationServiceAccessStatusInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/organizations/service-access").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListOrganizationServiceAccessStatusInput,
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_161) = &_input.max_results {
if *inner_161 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_161).encode(),
);
}
}
if let Some(inner_162) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_162));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListOrganizationServiceAccessStatusInput,
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::ListOrganizationServiceAccessStatus::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListOrganizationServiceAccessStatus",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_organization_service_access_status_input::Builder {
crate::input::list_organization_service_access_status_input::Builder::default()
}
}
pub mod list_peerings_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) peering_type: std::option::Option<crate::model::PeeringType>,
pub(crate) edge_location: std::option::Option<std::string::String>,
pub(crate) state: std::option::Option<crate::model::PeeringState>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn peering_type(mut self, input: crate::model::PeeringType) -> Self {
self.peering_type = Some(input);
self
}
pub fn set_peering_type(
mut self,
input: std::option::Option<crate::model::PeeringType>,
) -> Self {
self.peering_type = input;
self
}
pub fn edge_location(mut self, input: impl Into<std::string::String>) -> Self {
self.edge_location = Some(input.into());
self
}
pub fn set_edge_location(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.edge_location = input;
self
}
pub fn state(mut self, input: crate::model::PeeringState) -> Self {
self.state = Some(input);
self
}
pub fn set_state(mut self, input: std::option::Option<crate::model::PeeringState>) -> Self {
self.state = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListPeeringsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListPeeringsInput {
core_network_id: self.core_network_id,
peering_type: self.peering_type,
edge_location: self.edge_location,
state: self.state,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl ListPeeringsInput {
#[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::ListPeerings,
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::ListPeeringsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/peerings").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListPeeringsInput,
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_163) = &_input.core_network_id {
{
query.push_kv(
"coreNetworkId",
&aws_smithy_http::query::fmt_string(&inner_163),
);
}
}
if let Some(inner_164) = &_input.peering_type {
{
query.push_kv(
"peeringType",
&aws_smithy_http::query::fmt_string(&inner_164),
);
}
}
if let Some(inner_165) = &_input.edge_location {
{
query.push_kv(
"edgeLocation",
&aws_smithy_http::query::fmt_string(&inner_165),
);
}
}
if let Some(inner_166) = &_input.state {
{
query.push_kv("state", &aws_smithy_http::query::fmt_string(&inner_166));
}
}
if let Some(inner_167) = &_input.max_results {
if *inner_167 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_167).encode(),
);
}
}
if let Some(inner_168) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_168));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListPeeringsInput,
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::ListPeerings::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListPeerings",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_peerings_input::Builder {
crate::input::list_peerings_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_169 = &_input.resource_arn;
let input_169 = input_169.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_169,
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",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_tags_for_resource_input::Builder {
crate::input::list_tags_for_resource_input::Builder::default()
}
}
pub mod put_core_network_policy_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) policy_document: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) latest_version_id: std::option::Option<i32>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn policy_document(mut self, input: impl Into<std::string::String>) -> Self {
self.policy_document = Some(input.into());
self
}
pub fn set_policy_document(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.policy_document = 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 latest_version_id(mut self, input: i32) -> Self {
self.latest_version_id = Some(input);
self
}
pub fn set_latest_version_id(mut self, input: std::option::Option<i32>) -> Self {
self.latest_version_id = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::PutCoreNetworkPolicyInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::PutCoreNetworkPolicyInput {
core_network_id: self.core_network_id,
policy_document: self.policy_document,
description: self.description,
latest_version_id: self.latest_version_id,
client_token: self.client_token,
})
}
}
}
impl PutCoreNetworkPolicyInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::PutCoreNetworkPolicy,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
if self.client_token.is_none() {
self.client_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::PutCoreNetworkPolicyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_170 = &_input.core_network_id;
let input_170 = input_170.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
)
})?;
let core_network_id = aws_smithy_http::label::fmt_string(
input_170,
aws_smithy_http::label::EncodingStrategy::Default,
);
if core_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/core-networks/{CoreNetworkId}/core-network-policy",
CoreNetworkId = core_network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PutCoreNetworkPolicyInput,
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_put_core_network_policy(
&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::PutCoreNetworkPolicy::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PutCoreNetworkPolicy",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::put_core_network_policy_input::Builder {
crate::input::put_core_network_policy_input::Builder::default()
}
}
pub mod put_resource_policy_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) policy_document: std::option::Option<std::string::String>,
pub(crate) resource_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn policy_document(mut self, input: impl Into<std::string::String>) -> Self {
self.policy_document = Some(input.into());
self
}
pub fn set_policy_document(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.policy_document = input;
self
}
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::PutResourcePolicyInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::PutResourcePolicyInput {
policy_document: self.policy_document,
resource_arn: self.resource_arn,
})
}
}
}
impl PutResourcePolicyInput {
#[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::PutResourcePolicy,
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::PutResourcePolicyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_171 = &_input.resource_arn;
let input_171 = input_171.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_171,
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,
"/resource-policy/{ResourceArn}",
ResourceArn = resource_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PutResourcePolicyInput,
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_put_resource_policy(&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::PutResourcePolicy::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PutResourcePolicy",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::put_resource_policy_input::Builder {
crate::input::put_resource_policy_input::Builder::default()
}
}
pub mod register_transit_gateway_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) transit_gateway_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn transit_gateway_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.transit_gateway_arn = Some(input.into());
self
}
pub fn set_transit_gateway_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.transit_gateway_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::RegisterTransitGatewayInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::RegisterTransitGatewayInput {
global_network_id: self.global_network_id,
transit_gateway_arn: self.transit_gateway_arn,
})
}
}
}
impl RegisterTransitGatewayInput {
#[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::RegisterTransitGateway,
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::RegisterTransitGatewayInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_172 = &_input.global_network_id;
let input_172 = input_172.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_172,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/transit-gateway-registrations",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RegisterTransitGatewayInput,
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_register_transit_gateway(
&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::RegisterTransitGateway::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RegisterTransitGateway",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::register_transit_gateway_input::Builder {
crate::input::register_transit_gateway_input::Builder::default()
}
}
pub mod reject_attachment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) attachment_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn attachment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.attachment_id = Some(input.into());
self
}
pub fn set_attachment_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.attachment_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::RejectAttachmentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::RejectAttachmentInput {
attachment_id: self.attachment_id,
})
}
}
}
impl RejectAttachmentInput {
#[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::RejectAttachment,
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::RejectAttachmentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_173 = &_input.attachment_id;
let input_173 = input_173.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"attachment_id",
"cannot be empty or unset",
)
})?;
let attachment_id = aws_smithy_http::label::fmt_string(
input_173,
aws_smithy_http::label::EncodingStrategy::Default,
);
if attachment_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"attachment_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/attachments/{AttachmentId}/reject",
AttachmentId = attachment_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RejectAttachmentInput,
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::RejectAttachment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RejectAttachment",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::reject_attachment_input::Builder {
crate::input::reject_attachment_input::Builder::default()
}
}
pub mod restore_core_network_policy_version_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) policy_version_id: std::option::Option<i32>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = input;
self
}
pub fn policy_version_id(mut self, input: i32) -> Self {
self.policy_version_id = Some(input);
self
}
pub fn set_policy_version_id(mut self, input: std::option::Option<i32>) -> Self {
self.policy_version_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::RestoreCoreNetworkPolicyVersionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::RestoreCoreNetworkPolicyVersionInput {
core_network_id: self.core_network_id,
policy_version_id: self.policy_version_id,
})
}
}
}
impl RestoreCoreNetworkPolicyVersionInput {
#[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::RestoreCoreNetworkPolicyVersion,
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::RestoreCoreNetworkPolicyVersionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_174 = &_input.core_network_id;
let input_174 = input_174.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
)
})?;
let core_network_id = aws_smithy_http::label::fmt_string(
input_174,
aws_smithy_http::label::EncodingStrategy::Default,
);
if core_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
),
);
}
let input_175 = &_input.policy_version_id;
let input_175 = input_175.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"policy_version_id",
"cannot be empty or unset",
)
})?;
let mut policy_version_id_encoder =
aws_smithy_types::primitive::Encoder::from(*input_175);
let policy_version_id = policy_version_id_encoder.encode();
if policy_version_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"policy_version_id",
"cannot be empty or unset",
),
);
}
write!(output, "/core-networks/{CoreNetworkId}/core-network-policy-versions/{PolicyVersionId}/restore", CoreNetworkId = core_network_id, PolicyVersionId = policy_version_id).expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RestoreCoreNetworkPolicyVersionInput,
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::RestoreCoreNetworkPolicyVersion::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RestoreCoreNetworkPolicyVersion",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::restore_core_network_policy_version_input::Builder {
crate::input::restore_core_network_policy_version_input::Builder::default()
}
}
pub mod start_organization_service_access_update_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) action: std::option::Option<std::string::String>,
}
impl Builder {
pub fn action(mut self, input: impl Into<std::string::String>) -> Self {
self.action = Some(input.into());
self
}
pub fn set_action(mut self, input: std::option::Option<std::string::String>) -> Self {
self.action = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::StartOrganizationServiceAccessUpdateInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::StartOrganizationServiceAccessUpdateInput {
action: self.action,
})
}
}
}
impl StartOrganizationServiceAccessUpdateInput {
#[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::StartOrganizationServiceAccessUpdate,
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::StartOrganizationServiceAccessUpdateInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/organizations/service-access").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::StartOrganizationServiceAccessUpdateInput,
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_organization_service_access_update(&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::StartOrganizationServiceAccessUpdate::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"StartOrganizationServiceAccessUpdate",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::start_organization_service_access_update_input::Builder {
crate::input::start_organization_service_access_update_input::Builder::default()
}
}
pub mod start_route_analysis_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) source:
std::option::Option<crate::model::RouteAnalysisEndpointOptionsSpecification>,
pub(crate) destination:
std::option::Option<crate::model::RouteAnalysisEndpointOptionsSpecification>,
pub(crate) include_return_path: std::option::Option<bool>,
pub(crate) use_middleboxes: std::option::Option<bool>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn source(
mut self,
input: crate::model::RouteAnalysisEndpointOptionsSpecification,
) -> Self {
self.source = Some(input);
self
}
pub fn set_source(
mut self,
input: std::option::Option<crate::model::RouteAnalysisEndpointOptionsSpecification>,
) -> Self {
self.source = input;
self
}
pub fn destination(
mut self,
input: crate::model::RouteAnalysisEndpointOptionsSpecification,
) -> Self {
self.destination = Some(input);
self
}
pub fn set_destination(
mut self,
input: std::option::Option<crate::model::RouteAnalysisEndpointOptionsSpecification>,
) -> Self {
self.destination = input;
self
}
pub fn include_return_path(mut self, input: bool) -> Self {
self.include_return_path = Some(input);
self
}
pub fn set_include_return_path(mut self, input: std::option::Option<bool>) -> Self {
self.include_return_path = input;
self
}
pub fn use_middleboxes(mut self, input: bool) -> Self {
self.use_middleboxes = Some(input);
self
}
pub fn set_use_middleboxes(mut self, input: std::option::Option<bool>) -> Self {
self.use_middleboxes = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::StartRouteAnalysisInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::StartRouteAnalysisInput {
global_network_id: self.global_network_id,
source: self.source,
destination: self.destination,
include_return_path: self.include_return_path.unwrap_or_default(),
use_middleboxes: self.use_middleboxes.unwrap_or_default(),
})
}
}
}
impl StartRouteAnalysisInput {
#[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::StartRouteAnalysis,
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::StartRouteAnalysisInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_176 = &_input.global_network_id;
let input_176 = input_176.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_176,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/route-analyses",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::StartRouteAnalysisInput,
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_route_analysis(&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::StartRouteAnalysis::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"StartRouteAnalysis",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::start_route_analysis_input::Builder {
crate::input::start_route_analysis_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::vec::Vec<crate::model::Tag>>,
}
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, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> 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_177 = &_input.resource_arn;
let input_177 = input_177.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_177,
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",
"networkmanager",
));
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_178 = &_input.resource_arn;
let input_178 = input_178.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_178,
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_179 = &_input.tag_keys;
let inner_179 = inner_179.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"tag_keys",
"cannot be empty or unset",
)
})?;
for inner_180 in inner_179 {
query.push_kv("tagKeys", &aws_smithy_http::query::fmt_string(&inner_180));
}
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",
"networkmanager",
));
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_connection_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) connection_id: std::option::Option<std::string::String>,
pub(crate) link_id: std::option::Option<std::string::String>,
pub(crate) connected_link_id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
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 link_id(mut self, input: impl Into<std::string::String>) -> Self {
self.link_id = Some(input.into());
self
}
pub fn set_link_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.link_id = input;
self
}
pub fn connected_link_id(mut self, input: impl Into<std::string::String>) -> Self {
self.connected_link_id = Some(input.into());
self
}
pub fn set_connected_link_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.connected_link_id = 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 build(
self,
) -> Result<
crate::input::UpdateConnectionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateConnectionInput {
global_network_id: self.global_network_id,
connection_id: self.connection_id,
link_id: self.link_id,
connected_link_id: self.connected_link_id,
description: self.description,
})
}
}
}
impl UpdateConnectionInput {
#[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::UpdateConnection,
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::UpdateConnectionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_181 = &_input.global_network_id;
let input_181 = input_181.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_181,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
let input_182 = &_input.connection_id;
let input_182 = input_182.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_182,
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,
"/global-networks/{GlobalNetworkId}/connections/{ConnectionId}",
GlobalNetworkId = global_network_id,
ConnectionId = connection_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateConnectionInput,
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_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::UpdateConnection::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateConnection",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_connection_input::Builder {
crate::input::update_connection_input::Builder::default()
}
}
pub mod update_core_network_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) core_network_id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
}
impl Builder {
pub fn core_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.core_network_id = Some(input.into());
self
}
pub fn set_core_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.core_network_id = 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 build(
self,
) -> Result<
crate::input::UpdateCoreNetworkInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateCoreNetworkInput {
core_network_id: self.core_network_id,
description: self.description,
})
}
}
}
impl UpdateCoreNetworkInput {
#[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::UpdateCoreNetwork,
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::UpdateCoreNetworkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_183 = &_input.core_network_id;
let input_183 = input_183.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
)
})?;
let core_network_id = aws_smithy_http::label::fmt_string(
input_183,
aws_smithy_http::label::EncodingStrategy::Default,
);
if core_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"core_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/core-networks/{CoreNetworkId}",
CoreNetworkId = core_network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateCoreNetworkInput,
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_core_network(&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::UpdateCoreNetwork::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateCoreNetwork",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_core_network_input::Builder {
crate::input::update_core_network_input::Builder::default()
}
}
pub mod update_device_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) device_id: std::option::Option<std::string::String>,
pub(crate) aws_location: std::option::Option<crate::model::AwsLocation>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) r#type: std::option::Option<std::string::String>,
pub(crate) vendor: std::option::Option<std::string::String>,
pub(crate) model: std::option::Option<std::string::String>,
pub(crate) serial_number: std::option::Option<std::string::String>,
pub(crate) location: std::option::Option<crate::model::Location>,
pub(crate) site_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn device_id(mut self, input: impl Into<std::string::String>) -> Self {
self.device_id = Some(input.into());
self
}
pub fn set_device_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.device_id = input;
self
}
pub fn aws_location(mut self, input: crate::model::AwsLocation) -> Self {
self.aws_location = Some(input);
self
}
pub fn set_aws_location(
mut self,
input: std::option::Option<crate::model::AwsLocation>,
) -> Self {
self.aws_location = 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 r#type(mut self, input: impl Into<std::string::String>) -> Self {
self.r#type = Some(input.into());
self
}
pub fn set_type(mut self, input: std::option::Option<std::string::String>) -> Self {
self.r#type = input;
self
}
pub fn vendor(mut self, input: impl Into<std::string::String>) -> Self {
self.vendor = Some(input.into());
self
}
pub fn set_vendor(mut self, input: std::option::Option<std::string::String>) -> Self {
self.vendor = input;
self
}
pub fn model(mut self, input: impl Into<std::string::String>) -> Self {
self.model = Some(input.into());
self
}
pub fn set_model(mut self, input: std::option::Option<std::string::String>) -> Self {
self.model = input;
self
}
pub fn serial_number(mut self, input: impl Into<std::string::String>) -> Self {
self.serial_number = Some(input.into());
self
}
pub fn set_serial_number(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.serial_number = input;
self
}
pub fn location(mut self, input: crate::model::Location) -> Self {
self.location = Some(input);
self
}
pub fn set_location(mut self, input: std::option::Option<crate::model::Location>) -> Self {
self.location = 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 build(
self,
) -> Result<crate::input::UpdateDeviceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateDeviceInput {
global_network_id: self.global_network_id,
device_id: self.device_id,
aws_location: self.aws_location,
description: self.description,
r#type: self.r#type,
vendor: self.vendor,
model: self.model,
serial_number: self.serial_number,
location: self.location,
site_id: self.site_id,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("device_id", &self.device_id);
formatter.field("aws_location", &self.aws_location);
formatter.field("description", &self.description);
formatter.field("r#type", &self.r#type);
formatter.field("vendor", &self.vendor);
formatter.field("model", &self.model);
formatter.field("serial_number", &self.serial_number);
formatter.field("location", &"*** Sensitive Data Redacted ***");
formatter.field("site_id", &self.site_id);
formatter.finish()
}
}
}
impl UpdateDeviceInput {
#[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::UpdateDevice,
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::UpdateDeviceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_184 = &_input.global_network_id;
let input_184 = input_184.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_184,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
let input_185 = &_input.device_id;
let input_185 = input_185.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"device_id",
"cannot be empty or unset",
)
})?;
let device_id = aws_smithy_http::label::fmt_string(
input_185,
aws_smithy_http::label::EncodingStrategy::Default,
);
if device_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"device_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/devices/{DeviceId}",
GlobalNetworkId = global_network_id,
DeviceId = device_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateDeviceInput,
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_device(&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::UpdateDevice::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateDevice",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_device_input::Builder {
crate::input::update_device_input::Builder::default()
}
}
pub mod update_global_network_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = 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 build(
self,
) -> Result<
crate::input::UpdateGlobalNetworkInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateGlobalNetworkInput {
global_network_id: self.global_network_id,
description: self.description,
})
}
}
}
impl UpdateGlobalNetworkInput {
#[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::UpdateGlobalNetwork,
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::UpdateGlobalNetworkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_186 = &_input.global_network_id;
let input_186 = input_186.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_186,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}",
GlobalNetworkId = global_network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateGlobalNetworkInput,
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_global_network(&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::UpdateGlobalNetwork::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateGlobalNetwork",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_global_network_input::Builder {
crate::input::update_global_network_input::Builder::default()
}
}
pub mod update_link_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) link_id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) r#type: std::option::Option<std::string::String>,
pub(crate) bandwidth: std::option::Option<crate::model::Bandwidth>,
pub(crate) provider: std::option::Option<std::string::String>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
pub fn link_id(mut self, input: impl Into<std::string::String>) -> Self {
self.link_id = Some(input.into());
self
}
pub fn set_link_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.link_id = 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 r#type(mut self, input: impl Into<std::string::String>) -> Self {
self.r#type = Some(input.into());
self
}
pub fn set_type(mut self, input: std::option::Option<std::string::String>) -> Self {
self.r#type = input;
self
}
pub fn bandwidth(mut self, input: crate::model::Bandwidth) -> Self {
self.bandwidth = Some(input);
self
}
pub fn set_bandwidth(
mut self,
input: std::option::Option<crate::model::Bandwidth>,
) -> Self {
self.bandwidth = input;
self
}
pub fn provider(mut self, input: impl Into<std::string::String>) -> Self {
self.provider = Some(input.into());
self
}
pub fn set_provider(mut self, input: std::option::Option<std::string::String>) -> Self {
self.provider = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateLinkInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateLinkInput {
global_network_id: self.global_network_id,
link_id: self.link_id,
description: self.description,
r#type: self.r#type,
bandwidth: self.bandwidth,
provider: self.provider,
})
}
}
}
impl UpdateLinkInput {
#[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::UpdateLink,
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::UpdateLinkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_187 = &_input.global_network_id;
let input_187 = input_187.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_187,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
let input_188 = &_input.link_id;
let input_188 = input_188.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"link_id",
"cannot be empty or unset",
)
})?;
let link_id = aws_smithy_http::label::fmt_string(
input_188,
aws_smithy_http::label::EncodingStrategy::Default,
);
if link_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"link_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/global-networks/{GlobalNetworkId}/links/{LinkId}",
GlobalNetworkId = global_network_id,
LinkId = link_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateLinkInput,
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_link(&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::UpdateLink::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateLink",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_link_input::Builder {
crate::input::update_link_input::Builder::default()
}
}
pub mod update_network_resource_metadata_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) resource_arn: std::option::Option<std::string::String>,
pub(crate) metadata: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = input;
self
}
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 metadata(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.metadata.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.metadata = Some(hash_map);
self
}
pub fn set_metadata(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.metadata = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateNetworkResourceMetadataInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateNetworkResourceMetadataInput {
global_network_id: self.global_network_id,
resource_arn: self.resource_arn,
metadata: self.metadata,
})
}
}
}
impl UpdateNetworkResourceMetadataInput {
#[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::UpdateNetworkResourceMetadata,
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::UpdateNetworkResourceMetadataInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_189 = &_input.global_network_id;
let input_189 = input_189.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_189,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
let input_190 = &_input.resource_arn;
let input_190 = input_190.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_190,
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,
"/global-networks/{GlobalNetworkId}/network-resources/{ResourceArn}/metadata",
GlobalNetworkId = global_network_id,
ResourceArn = resource_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateNetworkResourceMetadataInput,
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_network_resource_metadata(&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::UpdateNetworkResourceMetadata::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateNetworkResourceMetadata",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_network_resource_metadata_input::Builder {
crate::input::update_network_resource_metadata_input::Builder::default()
}
}
pub mod update_site_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) global_network_id: std::option::Option<std::string::String>,
pub(crate) site_id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) location: std::option::Option<crate::model::Location>,
}
impl Builder {
pub fn global_network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.global_network_id = Some(input.into());
self
}
pub fn set_global_network_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.global_network_id = 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 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 location(mut self, input: crate::model::Location) -> Self {
self.location = Some(input);
self
}
pub fn set_location(mut self, input: std::option::Option<crate::model::Location>) -> Self {
self.location = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateSiteInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateSiteInput {
global_network_id: self.global_network_id,
site_id: self.site_id,
description: self.description,
location: self.location,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("site_id", &self.site_id);
formatter.field("description", &self.description);
formatter.field("location", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
}
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_191 = &_input.global_network_id;
let input_191 = input_191.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
)
})?;
let global_network_id = aws_smithy_http::label::fmt_string(
input_191,
aws_smithy_http::label::EncodingStrategy::Default,
);
if global_network_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"global_network_id",
"cannot be empty or unset",
),
);
}
let input_192 = &_input.site_id;
let input_192 = input_192.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_192,
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,
"/global-networks/{GlobalNetworkId}/sites/{SiteId}",
GlobalNetworkId = global_network_id,
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",
"networkmanager",
));
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_vpc_attachment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) attachment_id: std::option::Option<std::string::String>,
pub(crate) add_subnet_arns: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) remove_subnet_arns: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) options: std::option::Option<crate::model::VpcOptions>,
}
impl Builder {
pub fn attachment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.attachment_id = Some(input.into());
self
}
pub fn set_attachment_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.attachment_id = input;
self
}
pub fn add_subnet_arns(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.add_subnet_arns.unwrap_or_default();
v.push(input.into());
self.add_subnet_arns = Some(v);
self
}
pub fn set_add_subnet_arns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.add_subnet_arns = input;
self
}
pub fn remove_subnet_arns(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.remove_subnet_arns.unwrap_or_default();
v.push(input.into());
self.remove_subnet_arns = Some(v);
self
}
pub fn set_remove_subnet_arns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.remove_subnet_arns = input;
self
}
pub fn options(mut self, input: crate::model::VpcOptions) -> Self {
self.options = Some(input);
self
}
pub fn set_options(mut self, input: std::option::Option<crate::model::VpcOptions>) -> Self {
self.options = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateVpcAttachmentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateVpcAttachmentInput {
attachment_id: self.attachment_id,
add_subnet_arns: self.add_subnet_arns,
remove_subnet_arns: self.remove_subnet_arns,
options: self.options,
})
}
}
}
impl UpdateVpcAttachmentInput {
#[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::UpdateVpcAttachment,
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::UpdateVpcAttachmentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_193 = &_input.attachment_id;
let input_193 = input_193.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"attachment_id",
"cannot be empty or unset",
)
})?;
let attachment_id = aws_smithy_http::label::fmt_string(
input_193,
aws_smithy_http::label::EncodingStrategy::Default,
);
if attachment_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"attachment_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/vpc-attachments/{AttachmentId}",
AttachmentId = attachment_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateVpcAttachmentInput,
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_vpc_attachment(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateVpcAttachment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateVpcAttachment",
"networkmanager",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_vpc_attachment_input::Builder {
crate::input::update_vpc_attachment_input::Builder::default()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateVpcAttachmentInput {
#[doc(hidden)]
pub attachment_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub add_subnet_arns: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub remove_subnet_arns: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub options: std::option::Option<crate::model::VpcOptions>,
}
impl UpdateVpcAttachmentInput {
pub fn attachment_id(&self) -> std::option::Option<&str> {
self.attachment_id.as_deref()
}
pub fn add_subnet_arns(&self) -> std::option::Option<&[std::string::String]> {
self.add_subnet_arns.as_deref()
}
pub fn remove_subnet_arns(&self) -> std::option::Option<&[std::string::String]> {
self.remove_subnet_arns.as_deref()
}
pub fn options(&self) -> std::option::Option<&crate::model::VpcOptions> {
self.options.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UpdateSiteInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub site_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub location: std::option::Option<crate::model::Location>,
}
impl UpdateSiteInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn site_id(&self) -> std::option::Option<&str> {
self.site_id.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn location(&self) -> std::option::Option<&crate::model::Location> {
self.location.as_ref()
}
}
impl std::fmt::Debug for UpdateSiteInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UpdateSiteInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("site_id", &self.site_id);
formatter.field("description", &self.description);
formatter.field("location", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateNetworkResourceMetadataInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub metadata:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl UpdateNetworkResourceMetadataInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn metadata(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.metadata.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateLinkInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub link_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub r#type: std::option::Option<std::string::String>,
#[doc(hidden)]
pub bandwidth: std::option::Option<crate::model::Bandwidth>,
#[doc(hidden)]
pub provider: std::option::Option<std::string::String>,
}
impl UpdateLinkInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn link_id(&self) -> std::option::Option<&str> {
self.link_id.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn r#type(&self) -> std::option::Option<&str> {
self.r#type.as_deref()
}
pub fn bandwidth(&self) -> std::option::Option<&crate::model::Bandwidth> {
self.bandwidth.as_ref()
}
pub fn provider(&self) -> std::option::Option<&str> {
self.provider.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateGlobalNetworkInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
}
impl UpdateGlobalNetworkInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UpdateDeviceInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub device_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub aws_location: std::option::Option<crate::model::AwsLocation>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub r#type: std::option::Option<std::string::String>,
#[doc(hidden)]
pub vendor: std::option::Option<std::string::String>,
#[doc(hidden)]
pub model: std::option::Option<std::string::String>,
#[doc(hidden)]
pub serial_number: std::option::Option<std::string::String>,
#[doc(hidden)]
pub location: std::option::Option<crate::model::Location>,
#[doc(hidden)]
pub site_id: std::option::Option<std::string::String>,
}
impl UpdateDeviceInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn device_id(&self) -> std::option::Option<&str> {
self.device_id.as_deref()
}
pub fn aws_location(&self) -> std::option::Option<&crate::model::AwsLocation> {
self.aws_location.as_ref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn r#type(&self) -> std::option::Option<&str> {
self.r#type.as_deref()
}
pub fn vendor(&self) -> std::option::Option<&str> {
self.vendor.as_deref()
}
pub fn model(&self) -> std::option::Option<&str> {
self.model.as_deref()
}
pub fn serial_number(&self) -> std::option::Option<&str> {
self.serial_number.as_deref()
}
pub fn location(&self) -> std::option::Option<&crate::model::Location> {
self.location.as_ref()
}
pub fn site_id(&self) -> std::option::Option<&str> {
self.site_id.as_deref()
}
}
impl std::fmt::Debug for UpdateDeviceInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UpdateDeviceInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("device_id", &self.device_id);
formatter.field("aws_location", &self.aws_location);
formatter.field("description", &self.description);
formatter.field("r#type", &self.r#type);
formatter.field("vendor", &self.vendor);
formatter.field("model", &self.model);
formatter.field("serial_number", &self.serial_number);
formatter.field("location", &"*** Sensitive Data Redacted ***");
formatter.field("site_id", &self.site_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateCoreNetworkInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
}
impl UpdateCoreNetworkInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateConnectionInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub connection_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub link_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub connected_link_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
}
impl UpdateConnectionInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn connection_id(&self) -> std::option::Option<&str> {
self.connection_id.as_deref()
}
pub fn link_id(&self) -> std::option::Option<&str> {
self.link_id.as_deref()
}
pub fn connected_link_id(&self) -> std::option::Option<&str> {
self.connected_link_id.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
}
#[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::vec::Vec<crate::model::Tag>>,
}
impl TagResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct StartRouteAnalysisInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub source: std::option::Option<crate::model::RouteAnalysisEndpointOptionsSpecification>,
#[doc(hidden)]
pub destination: std::option::Option<crate::model::RouteAnalysisEndpointOptionsSpecification>,
#[doc(hidden)]
pub include_return_path: bool,
#[doc(hidden)]
pub use_middleboxes: bool,
}
impl StartRouteAnalysisInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn source(
&self,
) -> std::option::Option<&crate::model::RouteAnalysisEndpointOptionsSpecification> {
self.source.as_ref()
}
pub fn destination(
&self,
) -> std::option::Option<&crate::model::RouteAnalysisEndpointOptionsSpecification> {
self.destination.as_ref()
}
pub fn include_return_path(&self) -> bool {
self.include_return_path
}
pub fn use_middleboxes(&self) -> bool {
self.use_middleboxes
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct StartOrganizationServiceAccessUpdateInput {
#[doc(hidden)]
pub action: std::option::Option<std::string::String>,
}
impl StartOrganizationServiceAccessUpdateInput {
pub fn action(&self) -> std::option::Option<&str> {
self.action.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RestoreCoreNetworkPolicyVersionInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub policy_version_id: std::option::Option<i32>,
}
impl RestoreCoreNetworkPolicyVersionInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn policy_version_id(&self) -> std::option::Option<i32> {
self.policy_version_id
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RejectAttachmentInput {
#[doc(hidden)]
pub attachment_id: std::option::Option<std::string::String>,
}
impl RejectAttachmentInput {
pub fn attachment_id(&self) -> std::option::Option<&str> {
self.attachment_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RegisterTransitGatewayInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub transit_gateway_arn: std::option::Option<std::string::String>,
}
impl RegisterTransitGatewayInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn transit_gateway_arn(&self) -> std::option::Option<&str> {
self.transit_gateway_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PutResourcePolicyInput {
#[doc(hidden)]
pub policy_document: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
}
impl PutResourcePolicyInput {
pub fn policy_document(&self) -> std::option::Option<&str> {
self.policy_document.as_deref()
}
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 PutCoreNetworkPolicyInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub policy_document: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub latest_version_id: std::option::Option<i32>,
#[doc(hidden)]
pub client_token: std::option::Option<std::string::String>,
}
impl PutCoreNetworkPolicyInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn policy_document(&self) -> std::option::Option<&str> {
self.policy_document.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn latest_version_id(&self) -> std::option::Option<i32> {
self.latest_version_id
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
#[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 ListPeeringsInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub peering_type: std::option::Option<crate::model::PeeringType>,
#[doc(hidden)]
pub edge_location: std::option::Option<std::string::String>,
#[doc(hidden)]
pub state: std::option::Option<crate::model::PeeringState>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListPeeringsInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn peering_type(&self) -> std::option::Option<&crate::model::PeeringType> {
self.peering_type.as_ref()
}
pub fn edge_location(&self) -> std::option::Option<&str> {
self.edge_location.as_deref()
}
pub fn state(&self) -> std::option::Option<&crate::model::PeeringState> {
self.state.as_ref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListOrganizationServiceAccessStatusInput {
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListOrganizationServiceAccessStatusInput {
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListCoreNetworksInput {
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListCoreNetworksInput {
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListCoreNetworkPolicyVersionsInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListCoreNetworkPolicyVersionsInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListConnectPeersInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub connect_attachment_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListConnectPeersInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn connect_attachment_id(&self) -> std::option::Option<&str> {
self.connect_attachment_id.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListAttachmentsInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub attachment_type: std::option::Option<crate::model::AttachmentType>,
#[doc(hidden)]
pub edge_location: std::option::Option<std::string::String>,
#[doc(hidden)]
pub state: std::option::Option<crate::model::AttachmentState>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListAttachmentsInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn attachment_type(&self) -> std::option::Option<&crate::model::AttachmentType> {
self.attachment_type.as_ref()
}
pub fn edge_location(&self) -> std::option::Option<&str> {
self.edge_location.as_deref()
}
pub fn state(&self) -> std::option::Option<&crate::model::AttachmentState> {
self.state.as_ref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetVpcAttachmentInput {
#[doc(hidden)]
pub attachment_id: std::option::Option<std::string::String>,
}
impl GetVpcAttachmentInput {
pub fn attachment_id(&self) -> std::option::Option<&str> {
self.attachment_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetTransitGatewayRouteTableAttachmentInput {
#[doc(hidden)]
pub attachment_id: std::option::Option<std::string::String>,
}
impl GetTransitGatewayRouteTableAttachmentInput {
pub fn attachment_id(&self) -> std::option::Option<&str> {
self.attachment_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetTransitGatewayRegistrationsInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub transit_gateway_arns: 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>,
}
impl GetTransitGatewayRegistrationsInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn transit_gateway_arns(&self) -> std::option::Option<&[std::string::String]> {
self.transit_gateway_arns.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetTransitGatewayPeeringInput {
#[doc(hidden)]
pub peering_id: std::option::Option<std::string::String>,
}
impl GetTransitGatewayPeeringInput {
pub fn peering_id(&self) -> std::option::Option<&str> {
self.peering_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetTransitGatewayConnectPeerAssociationsInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub transit_gateway_connect_peer_arns: 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>,
}
impl GetTransitGatewayConnectPeerAssociationsInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn transit_gateway_connect_peer_arns(&self) -> std::option::Option<&[std::string::String]> {
self.transit_gateway_connect_peer_arns.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetSiteToSiteVpnAttachmentInput {
#[doc(hidden)]
pub attachment_id: std::option::Option<std::string::String>,
}
impl GetSiteToSiteVpnAttachmentInput {
pub fn attachment_id(&self) -> std::option::Option<&str> {
self.attachment_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetSitesInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub site_ids: 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>,
}
impl GetSitesInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn site_ids(&self) -> std::option::Option<&[std::string::String]> {
self.site_ids.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetRouteAnalysisInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub route_analysis_id: std::option::Option<std::string::String>,
}
impl GetRouteAnalysisInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn route_analysis_id(&self) -> std::option::Option<&str> {
self.route_analysis_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetResourcePolicyInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
}
impl GetResourcePolicyInput {
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 GetNetworkTelemetryInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub registered_gateway_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub aws_region: std::option::Option<std::string::String>,
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_type: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl GetNetworkTelemetryInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn registered_gateway_arn(&self) -> std::option::Option<&str> {
self.registered_gateway_arn.as_deref()
}
pub fn aws_region(&self) -> std::option::Option<&str> {
self.aws_region.as_deref()
}
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn resource_type(&self) -> std::option::Option<&str> {
self.resource_type.as_deref()
}
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetNetworkRoutesInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub route_table_identifier: std::option::Option<crate::model::RouteTableIdentifier>,
#[doc(hidden)]
pub exact_cidr_matches: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub longest_prefix_matches: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub subnet_of_matches: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub supernet_of_matches: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub prefix_list_ids: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub states: std::option::Option<std::vec::Vec<crate::model::RouteState>>,
#[doc(hidden)]
pub types: std::option::Option<std::vec::Vec<crate::model::RouteType>>,
#[doc(hidden)]
pub destination_filters: std::option::Option<
std::collections::HashMap<std::string::String, std::vec::Vec<std::string::String>>,
>,
}
impl GetNetworkRoutesInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn route_table_identifier(
&self,
) -> std::option::Option<&crate::model::RouteTableIdentifier> {
self.route_table_identifier.as_ref()
}
pub fn exact_cidr_matches(&self) -> std::option::Option<&[std::string::String]> {
self.exact_cidr_matches.as_deref()
}
pub fn longest_prefix_matches(&self) -> std::option::Option<&[std::string::String]> {
self.longest_prefix_matches.as_deref()
}
pub fn subnet_of_matches(&self) -> std::option::Option<&[std::string::String]> {
self.subnet_of_matches.as_deref()
}
pub fn supernet_of_matches(&self) -> std::option::Option<&[std::string::String]> {
self.supernet_of_matches.as_deref()
}
pub fn prefix_list_ids(&self) -> std::option::Option<&[std::string::String]> {
self.prefix_list_ids.as_deref()
}
pub fn states(&self) -> std::option::Option<&[crate::model::RouteState]> {
self.states.as_deref()
}
pub fn types(&self) -> std::option::Option<&[crate::model::RouteType]> {
self.types.as_deref()
}
pub fn destination_filters(
&self,
) -> std::option::Option<
&std::collections::HashMap<std::string::String, std::vec::Vec<std::string::String>>,
> {
self.destination_filters.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetNetworkResourcesInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub registered_gateway_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub aws_region: std::option::Option<std::string::String>,
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_type: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl GetNetworkResourcesInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn registered_gateway_arn(&self) -> std::option::Option<&str> {
self.registered_gateway_arn.as_deref()
}
pub fn aws_region(&self) -> std::option::Option<&str> {
self.aws_region.as_deref()
}
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn resource_type(&self) -> std::option::Option<&str> {
self.resource_type.as_deref()
}
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetNetworkResourceRelationshipsInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub registered_gateway_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub aws_region: std::option::Option<std::string::String>,
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_type: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl GetNetworkResourceRelationshipsInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn registered_gateway_arn(&self) -> std::option::Option<&str> {
self.registered_gateway_arn.as_deref()
}
pub fn aws_region(&self) -> std::option::Option<&str> {
self.aws_region.as_deref()
}
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn resource_type(&self) -> std::option::Option<&str> {
self.resource_type.as_deref()
}
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetNetworkResourceCountsInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_type: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl GetNetworkResourceCountsInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn resource_type(&self) -> std::option::Option<&str> {
self.resource_type.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetLinksInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub link_ids: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub site_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub r#type: std::option::Option<std::string::String>,
#[doc(hidden)]
pub provider: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl GetLinksInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn link_ids(&self) -> std::option::Option<&[std::string::String]> {
self.link_ids.as_deref()
}
pub fn site_id(&self) -> std::option::Option<&str> {
self.site_id.as_deref()
}
pub fn r#type(&self) -> std::option::Option<&str> {
self.r#type.as_deref()
}
pub fn provider(&self) -> std::option::Option<&str> {
self.provider.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetLinkAssociationsInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub device_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub link_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl GetLinkAssociationsInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn device_id(&self) -> std::option::Option<&str> {
self.device_id.as_deref()
}
pub fn link_id(&self) -> std::option::Option<&str> {
self.link_id.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetDevicesInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub device_ids: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub site_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl GetDevicesInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn device_ids(&self) -> std::option::Option<&[std::string::String]> {
self.device_ids.as_deref()
}
pub fn site_id(&self) -> std::option::Option<&str> {
self.site_id.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetCustomerGatewayAssociationsInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub customer_gateway_arns: 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>,
}
impl GetCustomerGatewayAssociationsInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn customer_gateway_arns(&self) -> std::option::Option<&[std::string::String]> {
self.customer_gateway_arns.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetCoreNetworkPolicyInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub policy_version_id: std::option::Option<i32>,
#[doc(hidden)]
pub alias: std::option::Option<crate::model::CoreNetworkPolicyAlias>,
}
impl GetCoreNetworkPolicyInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn policy_version_id(&self) -> std::option::Option<i32> {
self.policy_version_id
}
pub fn alias(&self) -> std::option::Option<&crate::model::CoreNetworkPolicyAlias> {
self.alias.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetCoreNetworkChangeSetInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub policy_version_id: std::option::Option<i32>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl GetCoreNetworkChangeSetInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn policy_version_id(&self) -> std::option::Option<i32> {
self.policy_version_id
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetCoreNetworkChangeEventsInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub policy_version_id: std::option::Option<i32>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl GetCoreNetworkChangeEventsInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn policy_version_id(&self) -> std::option::Option<i32> {
self.policy_version_id
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetCoreNetworkInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
}
impl GetCoreNetworkInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetConnectPeerAssociationsInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub connect_peer_ids: 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>,
}
impl GetConnectPeerAssociationsInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn connect_peer_ids(&self) -> std::option::Option<&[std::string::String]> {
self.connect_peer_ids.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetConnectPeerInput {
#[doc(hidden)]
pub connect_peer_id: std::option::Option<std::string::String>,
}
impl GetConnectPeerInput {
pub fn connect_peer_id(&self) -> std::option::Option<&str> {
self.connect_peer_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetConnectionsInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub connection_ids: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub device_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl GetConnectionsInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn connection_ids(&self) -> std::option::Option<&[std::string::String]> {
self.connection_ids.as_deref()
}
pub fn device_id(&self) -> std::option::Option<&str> {
self.device_id.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetConnectAttachmentInput {
#[doc(hidden)]
pub attachment_id: std::option::Option<std::string::String>,
}
impl GetConnectAttachmentInput {
pub fn attachment_id(&self) -> std::option::Option<&str> {
self.attachment_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ExecuteCoreNetworkChangeSetInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub policy_version_id: std::option::Option<i32>,
}
impl ExecuteCoreNetworkChangeSetInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn policy_version_id(&self) -> std::option::Option<i32> {
self.policy_version_id
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DisassociateTransitGatewayConnectPeerInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub transit_gateway_connect_peer_arn: std::option::Option<std::string::String>,
}
impl DisassociateTransitGatewayConnectPeerInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn transit_gateway_connect_peer_arn(&self) -> std::option::Option<&str> {
self.transit_gateway_connect_peer_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DisassociateLinkInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub device_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub link_id: std::option::Option<std::string::String>,
}
impl DisassociateLinkInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn device_id(&self) -> std::option::Option<&str> {
self.device_id.as_deref()
}
pub fn link_id(&self) -> std::option::Option<&str> {
self.link_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DisassociateCustomerGatewayInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub customer_gateway_arn: std::option::Option<std::string::String>,
}
impl DisassociateCustomerGatewayInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn customer_gateway_arn(&self) -> std::option::Option<&str> {
self.customer_gateway_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DisassociateConnectPeerInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub connect_peer_id: std::option::Option<std::string::String>,
}
impl DisassociateConnectPeerInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn connect_peer_id(&self) -> std::option::Option<&str> {
self.connect_peer_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeGlobalNetworksInput {
#[doc(hidden)]
pub global_network_ids: 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>,
}
impl DescribeGlobalNetworksInput {
pub fn global_network_ids(&self) -> std::option::Option<&[std::string::String]> {
self.global_network_ids.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeregisterTransitGatewayInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub transit_gateway_arn: std::option::Option<std::string::String>,
}
impl DeregisterTransitGatewayInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn transit_gateway_arn(&self) -> std::option::Option<&str> {
self.transit_gateway_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteSiteInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub site_id: std::option::Option<std::string::String>,
}
impl DeleteSiteInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
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 DeleteResourcePolicyInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
}
impl DeleteResourcePolicyInput {
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 DeletePeeringInput {
#[doc(hidden)]
pub peering_id: std::option::Option<std::string::String>,
}
impl DeletePeeringInput {
pub fn peering_id(&self) -> std::option::Option<&str> {
self.peering_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteLinkInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub link_id: std::option::Option<std::string::String>,
}
impl DeleteLinkInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn link_id(&self) -> std::option::Option<&str> {
self.link_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteGlobalNetworkInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
}
impl DeleteGlobalNetworkInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteDeviceInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub device_id: std::option::Option<std::string::String>,
}
impl DeleteDeviceInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn device_id(&self) -> std::option::Option<&str> {
self.device_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteCoreNetworkPolicyVersionInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub policy_version_id: std::option::Option<i32>,
}
impl DeleteCoreNetworkPolicyVersionInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn policy_version_id(&self) -> std::option::Option<i32> {
self.policy_version_id
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteCoreNetworkInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
}
impl DeleteCoreNetworkInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteConnectPeerInput {
#[doc(hidden)]
pub connect_peer_id: std::option::Option<std::string::String>,
}
impl DeleteConnectPeerInput {
pub fn connect_peer_id(&self) -> std::option::Option<&str> {
self.connect_peer_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteConnectionInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub connection_id: std::option::Option<std::string::String>,
}
impl DeleteConnectionInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
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 DeleteAttachmentInput {
#[doc(hidden)]
pub attachment_id: std::option::Option<std::string::String>,
}
impl DeleteAttachmentInput {
pub fn attachment_id(&self) -> std::option::Option<&str> {
self.attachment_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateVpcAttachmentInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub vpc_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub subnet_arns: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub options: std::option::Option<crate::model::VpcOptions>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
#[doc(hidden)]
pub client_token: std::option::Option<std::string::String>,
}
impl CreateVpcAttachmentInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn vpc_arn(&self) -> std::option::Option<&str> {
self.vpc_arn.as_deref()
}
pub fn subnet_arns(&self) -> std::option::Option<&[std::string::String]> {
self.subnet_arns.as_deref()
}
pub fn options(&self) -> std::option::Option<&crate::model::VpcOptions> {
self.options.as_ref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateTransitGatewayRouteTableAttachmentInput {
#[doc(hidden)]
pub peering_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub transit_gateway_route_table_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
#[doc(hidden)]
pub client_token: std::option::Option<std::string::String>,
}
impl CreateTransitGatewayRouteTableAttachmentInput {
pub fn peering_id(&self) -> std::option::Option<&str> {
self.peering_id.as_deref()
}
pub fn transit_gateway_route_table_arn(&self) -> std::option::Option<&str> {
self.transit_gateway_route_table_arn.as_deref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateTransitGatewayPeeringInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub transit_gateway_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
#[doc(hidden)]
pub client_token: std::option::Option<std::string::String>,
}
impl CreateTransitGatewayPeeringInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn transit_gateway_arn(&self) -> std::option::Option<&str> {
self.transit_gateway_arn.as_deref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateSiteToSiteVpnAttachmentInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub vpn_connection_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
#[doc(hidden)]
pub client_token: std::option::Option<std::string::String>,
}
impl CreateSiteToSiteVpnAttachmentInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn vpn_connection_arn(&self) -> std::option::Option<&str> {
self.vpn_connection_arn.as_deref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreateSiteInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub location: std::option::Option<crate::model::Location>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
impl CreateSiteInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn location(&self) -> std::option::Option<&crate::model::Location> {
self.location.as_ref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
}
impl std::fmt::Debug for CreateSiteInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreateSiteInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("description", &self.description);
formatter.field("location", &"*** Sensitive Data Redacted ***");
formatter.field("tags", &self.tags);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateLinkInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub r#type: std::option::Option<std::string::String>,
#[doc(hidden)]
pub bandwidth: std::option::Option<crate::model::Bandwidth>,
#[doc(hidden)]
pub provider: std::option::Option<std::string::String>,
#[doc(hidden)]
pub site_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
impl CreateLinkInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn r#type(&self) -> std::option::Option<&str> {
self.r#type.as_deref()
}
pub fn bandwidth(&self) -> std::option::Option<&crate::model::Bandwidth> {
self.bandwidth.as_ref()
}
pub fn provider(&self) -> std::option::Option<&str> {
self.provider.as_deref()
}
pub fn site_id(&self) -> std::option::Option<&str> {
self.site_id.as_deref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateGlobalNetworkInput {
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
impl CreateGlobalNetworkInput {
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreateDeviceInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub aws_location: std::option::Option<crate::model::AwsLocation>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub r#type: std::option::Option<std::string::String>,
#[doc(hidden)]
pub vendor: std::option::Option<std::string::String>,
#[doc(hidden)]
pub model: std::option::Option<std::string::String>,
#[doc(hidden)]
pub serial_number: std::option::Option<std::string::String>,
#[doc(hidden)]
pub location: std::option::Option<crate::model::Location>,
#[doc(hidden)]
pub site_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
impl CreateDeviceInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn aws_location(&self) -> std::option::Option<&crate::model::AwsLocation> {
self.aws_location.as_ref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn r#type(&self) -> std::option::Option<&str> {
self.r#type.as_deref()
}
pub fn vendor(&self) -> std::option::Option<&str> {
self.vendor.as_deref()
}
pub fn model(&self) -> std::option::Option<&str> {
self.model.as_deref()
}
pub fn serial_number(&self) -> std::option::Option<&str> {
self.serial_number.as_deref()
}
pub fn location(&self) -> std::option::Option<&crate::model::Location> {
self.location.as_ref()
}
pub fn site_id(&self) -> std::option::Option<&str> {
self.site_id.as_deref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
}
impl std::fmt::Debug for CreateDeviceInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreateDeviceInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("aws_location", &self.aws_location);
formatter.field("description", &self.description);
formatter.field("r#type", &self.r#type);
formatter.field("vendor", &self.vendor);
formatter.field("model", &self.model);
formatter.field("serial_number", &self.serial_number);
formatter.field("location", &"*** Sensitive Data Redacted ***");
formatter.field("site_id", &self.site_id);
formatter.field("tags", &self.tags);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateCoreNetworkInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
#[doc(hidden)]
pub policy_document: std::option::Option<std::string::String>,
#[doc(hidden)]
pub client_token: std::option::Option<std::string::String>,
}
impl CreateCoreNetworkInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
pub fn policy_document(&self) -> std::option::Option<&str> {
self.policy_document.as_deref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateConnectPeerInput {
#[doc(hidden)]
pub connect_attachment_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub core_network_address: std::option::Option<std::string::String>,
#[doc(hidden)]
pub peer_address: std::option::Option<std::string::String>,
#[doc(hidden)]
pub bgp_options: std::option::Option<crate::model::BgpOptions>,
#[doc(hidden)]
pub inside_cidr_blocks: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
#[doc(hidden)]
pub client_token: std::option::Option<std::string::String>,
}
impl CreateConnectPeerInput {
pub fn connect_attachment_id(&self) -> std::option::Option<&str> {
self.connect_attachment_id.as_deref()
}
pub fn core_network_address(&self) -> std::option::Option<&str> {
self.core_network_address.as_deref()
}
pub fn peer_address(&self) -> std::option::Option<&str> {
self.peer_address.as_deref()
}
pub fn bgp_options(&self) -> std::option::Option<&crate::model::BgpOptions> {
self.bgp_options.as_ref()
}
pub fn inside_cidr_blocks(&self) -> std::option::Option<&[std::string::String]> {
self.inside_cidr_blocks.as_deref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateConnectionInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub device_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub connected_device_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub link_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub connected_link_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
impl CreateConnectionInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn device_id(&self) -> std::option::Option<&str> {
self.device_id.as_deref()
}
pub fn connected_device_id(&self) -> std::option::Option<&str> {
self.connected_device_id.as_deref()
}
pub fn link_id(&self) -> std::option::Option<&str> {
self.link_id.as_deref()
}
pub fn connected_link_id(&self) -> std::option::Option<&str> {
self.connected_link_id.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateConnectAttachmentInput {
#[doc(hidden)]
pub core_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub edge_location: std::option::Option<std::string::String>,
#[doc(hidden)]
pub transport_attachment_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub options: std::option::Option<crate::model::ConnectAttachmentOptions>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
#[doc(hidden)]
pub client_token: std::option::Option<std::string::String>,
}
impl CreateConnectAttachmentInput {
pub fn core_network_id(&self) -> std::option::Option<&str> {
self.core_network_id.as_deref()
}
pub fn edge_location(&self) -> std::option::Option<&str> {
self.edge_location.as_deref()
}
pub fn transport_attachment_id(&self) -> std::option::Option<&str> {
self.transport_attachment_id.as_deref()
}
pub fn options(&self) -> std::option::Option<&crate::model::ConnectAttachmentOptions> {
self.options.as_ref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AssociateTransitGatewayConnectPeerInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub transit_gateway_connect_peer_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub device_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub link_id: std::option::Option<std::string::String>,
}
impl AssociateTransitGatewayConnectPeerInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn transit_gateway_connect_peer_arn(&self) -> std::option::Option<&str> {
self.transit_gateway_connect_peer_arn.as_deref()
}
pub fn device_id(&self) -> std::option::Option<&str> {
self.device_id.as_deref()
}
pub fn link_id(&self) -> std::option::Option<&str> {
self.link_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AssociateLinkInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub device_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub link_id: std::option::Option<std::string::String>,
}
impl AssociateLinkInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn device_id(&self) -> std::option::Option<&str> {
self.device_id.as_deref()
}
pub fn link_id(&self) -> std::option::Option<&str> {
self.link_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AssociateCustomerGatewayInput {
#[doc(hidden)]
pub customer_gateway_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub device_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub link_id: std::option::Option<std::string::String>,
}
impl AssociateCustomerGatewayInput {
pub fn customer_gateway_arn(&self) -> std::option::Option<&str> {
self.customer_gateway_arn.as_deref()
}
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn device_id(&self) -> std::option::Option<&str> {
self.device_id.as_deref()
}
pub fn link_id(&self) -> std::option::Option<&str> {
self.link_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AssociateConnectPeerInput {
#[doc(hidden)]
pub global_network_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub connect_peer_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub device_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub link_id: std::option::Option<std::string::String>,
}
impl AssociateConnectPeerInput {
pub fn global_network_id(&self) -> std::option::Option<&str> {
self.global_network_id.as_deref()
}
pub fn connect_peer_id(&self) -> std::option::Option<&str> {
self.connect_peer_id.as_deref()
}
pub fn device_id(&self) -> std::option::Option<&str> {
self.device_id.as_deref()
}
pub fn link_id(&self) -> std::option::Option<&str> {
self.link_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AcceptAttachmentInput {
#[doc(hidden)]
pub attachment_id: std::option::Option<std::string::String>,
}
impl AcceptAttachmentInput {
pub fn attachment_id(&self) -> std::option::Option<&str> {
self.attachment_id.as_deref()
}
}