use std::fmt::Write;
pub mod associate_customer_gateway_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::AssociateCustomerGatewayInput,
aws_smithy_http::operation::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,
})
}
}
}
#[doc(hidden)]
pub type AssociateCustomerGatewayInputOperationOutputAlias =
crate::operation::AssociateCustomerGateway;
#[doc(hidden)]
pub type AssociateCustomerGatewayInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl AssociateCustomerGatewayInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::AssociateCustomerGateway,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::AssociateCustomerGatewayInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_1 = &_input.global_network_id;
let input_1 =
input_1
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_1, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::AssociateCustomerGatewayInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_associate_customer_gateway(
&self,
)
.map_err(|err| {
aws_smithy_http::operation::BuildError::SerializationError(err.into())
})?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::associate_customer_gateway_input::Builder {
crate::input::associate_customer_gateway_input::Builder::default()
}
}
pub mod associate_link_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::AssociateLinkInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::AssociateLinkInput {
global_network_id: self.global_network_id,
device_id: self.device_id,
link_id: self.link_id,
})
}
}
}
#[doc(hidden)]
pub type AssociateLinkInputOperationOutputAlias = crate::operation::AssociateLink;
#[doc(hidden)]
pub type AssociateLinkInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl AssociateLinkInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::AssociateLink,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::AssociateLinkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_2 = &_input.global_network_id;
let input_2 =
input_2
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_2, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::AssociateLinkInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = crate::operation_ser::serialize_operation_crate_operation_associate_link(&self)
.map_err(|err| {
aws_smithy_http::operation::BuildError::SerializationError(err.into())
})?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::associate_link_input::Builder {
crate::input::associate_link_input::Builder::default()
}
}
pub mod associate_transit_gateway_connect_peer_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::AssociateTransitGatewayConnectPeerInput,
aws_smithy_http::operation::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,
})
}
}
}
#[doc(hidden)]
pub type AssociateTransitGatewayConnectPeerInputOperationOutputAlias =
crate::operation::AssociateTransitGatewayConnectPeer;
#[doc(hidden)]
pub type AssociateTransitGatewayConnectPeerInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl AssociateTransitGatewayConnectPeerInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::AssociateTransitGatewayConnectPeer,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::AssociateTransitGatewayConnectPeerInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_3 = &_input.global_network_id;
let input_3 =
input_3
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_3, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::AssociateTransitGatewayConnectPeerInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_associate_transit_gateway_connect_peer(&self).map_err(|err|aws_smithy_http::operation::BuildError::SerializationError(err.into()))?
;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
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_connection_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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: impl Into<crate::model::Tag>) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input.into());
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,
) -> std::result::Result<
crate::input::CreateConnectionInput,
aws_smithy_http::operation::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,
})
}
}
}
#[doc(hidden)]
pub type CreateConnectionInputOperationOutputAlias = crate::operation::CreateConnection;
#[doc(hidden)]
pub type CreateConnectionInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl CreateConnectionInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateConnection,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::CreateConnectionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_4 = &_input.global_network_id;
let input_4 =
input_4
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_4, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::CreateConnectionInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_create_connection(&self)
.map_err(|err| {
aws_smithy_http::operation::BuildError::SerializationError(err.into())
})?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::create_connection_input::Builder {
crate::input::create_connection_input::Builder::default()
}
}
pub mod create_device_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
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: impl Into<crate::model::Tag>) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input.into());
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,
) -> std::result::Result<
crate::input::CreateDeviceInput,
aws_smithy_http::operation::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,
})
}
}
}
#[doc(hidden)]
pub type CreateDeviceInputOperationOutputAlias = crate::operation::CreateDevice;
#[doc(hidden)]
pub type CreateDeviceInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl CreateDeviceInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateDevice,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::CreateDeviceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_5 = &_input.global_network_id;
let input_5 =
input_5
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_5, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::CreateDeviceInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = crate::operation_ser::serialize_operation_crate_operation_create_device(&self)
.map_err(|err| {
aws_smithy_http::operation::BuildError::SerializationError(err.into())
})?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::create_device_input::Builder {
crate::input::create_device_input::Builder::default()
}
}
pub mod create_global_network_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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: impl Into<crate::model::Tag>) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input.into());
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,
) -> std::result::Result<
crate::input::CreateGlobalNetworkInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::CreateGlobalNetworkInput {
description: self.description,
tags: self.tags,
})
}
}
}
#[doc(hidden)]
pub type CreateGlobalNetworkInputOperationOutputAlias = crate::operation::CreateGlobalNetwork;
#[doc(hidden)]
pub type CreateGlobalNetworkInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl CreateGlobalNetworkInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateGlobalNetwork,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::CreateGlobalNetworkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::CreateGlobalNetworkInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_create_global_network(&self)
.map_err(|err| {
aws_smithy_http::operation::BuildError::SerializationError(err.into())
})?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::create_global_network_input::Builder {
crate::input::create_global_network_input::Builder::default()
}
}
pub mod create_link_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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: impl Into<crate::model::Tag>) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input.into());
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,
) -> std::result::Result<
crate::input::CreateLinkInput,
aws_smithy_http::operation::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,
})
}
}
}
#[doc(hidden)]
pub type CreateLinkInputOperationOutputAlias = crate::operation::CreateLink;
#[doc(hidden)]
pub type CreateLinkInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl CreateLinkInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateLink,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::CreateLinkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_6 = &_input.global_network_id;
let input_6 =
input_6
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_6, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::CreateLinkInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = crate::operation_ser::serialize_operation_crate_operation_create_link(&self)
.map_err(|err| {
aws_smithy_http::operation::BuildError::SerializationError(err.into())
})?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::create_link_input::Builder {
crate::input::create_link_input::Builder::default()
}
}
pub mod create_site_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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) 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: impl Into<crate::model::Tag>) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input.into());
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,
) -> std::result::Result<
crate::input::CreateSiteInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::CreateSiteInput {
global_network_id: self.global_network_id,
description: self.description,
location: self.location,
tags: self.tags,
})
}
}
}
#[doc(hidden)]
pub type CreateSiteInputOperationOutputAlias = crate::operation::CreateSite;
#[doc(hidden)]
pub type CreateSiteInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl CreateSiteInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateSite,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::CreateSiteInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_7 = &_input.global_network_id;
let input_7 =
input_7
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_7, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::CreateSiteInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = crate::operation_ser::serialize_operation_crate_operation_create_site(&self)
.map_err(|err| {
aws_smithy_http::operation::BuildError::SerializationError(err.into())
})?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::create_site_input::Builder {
crate::input::create_site_input::Builder::default()
}
}
pub mod delete_connection_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::DeleteConnectionInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::DeleteConnectionInput {
global_network_id: self.global_network_id,
connection_id: self.connection_id,
})
}
}
}
#[doc(hidden)]
pub type DeleteConnectionInputOperationOutputAlias = crate::operation::DeleteConnection;
#[doc(hidden)]
pub type DeleteConnectionInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl DeleteConnectionInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteConnection,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::DeleteConnectionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_8 = &_input.global_network_id;
let input_8 =
input_8
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_8, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
});
}
let input_9 = &_input.connection_id;
let input_9 =
input_9
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "connection_id",
details: "cannot be empty or unset",
})?;
let connection_id = aws_smithy_http::label::fmt_string(input_9, false);
if connection_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "connection_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::DeleteConnectionInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::delete_connection_input::Builder {
crate::input::delete_connection_input::Builder::default()
}
}
pub mod delete_device_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::DeleteDeviceInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::DeleteDeviceInput {
global_network_id: self.global_network_id,
device_id: self.device_id,
})
}
}
}
#[doc(hidden)]
pub type DeleteDeviceInputOperationOutputAlias = crate::operation::DeleteDevice;
#[doc(hidden)]
pub type DeleteDeviceInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl DeleteDeviceInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteDevice,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::DeleteDeviceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_10 = &_input.global_network_id;
let input_10 =
input_10
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_10, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
});
}
let input_11 = &_input.device_id;
let input_11 =
input_11
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "device_id",
details: "cannot be empty or unset",
})?;
let device_id = aws_smithy_http::label::fmt_string(input_11, false);
if device_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "device_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::DeleteDeviceInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::delete_device_input::Builder {
crate::input::delete_device_input::Builder::default()
}
}
pub mod delete_global_network_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::DeleteGlobalNetworkInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::DeleteGlobalNetworkInput {
global_network_id: self.global_network_id,
})
}
}
}
#[doc(hidden)]
pub type DeleteGlobalNetworkInputOperationOutputAlias = crate::operation::DeleteGlobalNetwork;
#[doc(hidden)]
pub type DeleteGlobalNetworkInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl DeleteGlobalNetworkInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteGlobalNetwork,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::DeleteGlobalNetworkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_12 = &_input.global_network_id;
let input_12 =
input_12
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_12, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::DeleteGlobalNetworkInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::delete_global_network_input::Builder {
crate::input::delete_global_network_input::Builder::default()
}
}
pub mod delete_link_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::DeleteLinkInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::DeleteLinkInput {
global_network_id: self.global_network_id,
link_id: self.link_id,
})
}
}
}
#[doc(hidden)]
pub type DeleteLinkInputOperationOutputAlias = crate::operation::DeleteLink;
#[doc(hidden)]
pub type DeleteLinkInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl DeleteLinkInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteLink,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::DeleteLinkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_13 = &_input.global_network_id;
let input_13 =
input_13
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_13, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
});
}
let input_14 = &_input.link_id;
let input_14 =
input_14
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "link_id",
details: "cannot be empty or unset",
})?;
let link_id = aws_smithy_http::label::fmt_string(input_14, false);
if link_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "link_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::DeleteLinkInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::delete_link_input::Builder {
crate::input::delete_link_input::Builder::default()
}
}
pub mod delete_site_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::DeleteSiteInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::DeleteSiteInput {
global_network_id: self.global_network_id,
site_id: self.site_id,
})
}
}
}
#[doc(hidden)]
pub type DeleteSiteInputOperationOutputAlias = crate::operation::DeleteSite;
#[doc(hidden)]
pub type DeleteSiteInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl DeleteSiteInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteSite,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::DeleteSiteInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_15 = &_input.global_network_id;
let input_15 =
input_15
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_15, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
});
}
let input_16 = &_input.site_id;
let input_16 =
input_16
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "site_id",
details: "cannot be empty or unset",
})?;
let site_id = aws_smithy_http::label::fmt_string(input_16, false);
if site_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "site_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::DeleteSiteInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::delete_site_input::Builder {
crate::input::delete_site_input::Builder::default()
}
}
pub mod deregister_transit_gateway_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::DeregisterTransitGatewayInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::DeregisterTransitGatewayInput {
global_network_id: self.global_network_id,
transit_gateway_arn: self.transit_gateway_arn,
})
}
}
}
#[doc(hidden)]
pub type DeregisterTransitGatewayInputOperationOutputAlias =
crate::operation::DeregisterTransitGateway;
#[doc(hidden)]
pub type DeregisterTransitGatewayInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl DeregisterTransitGatewayInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeregisterTransitGateway,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::DeregisterTransitGatewayInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_17 = &_input.global_network_id;
let input_17 =
input_17
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_17, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
});
}
let input_18 = &_input.transit_gateway_arn;
let input_18 =
input_18
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "transit_gateway_arn",
details: "cannot be empty or unset",
})?;
let transit_gateway_arn = aws_smithy_http::label::fmt_string(input_18, false);
if transit_gateway_arn.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "transit_gateway_arn",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::DeregisterTransitGatewayInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::deregister_transit_gateway_input::Builder {
crate::input::deregister_transit_gateway_input::Builder::default()
}
}
pub mod describe_global_networks_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::DescribeGlobalNetworksInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::DescribeGlobalNetworksInput {
global_network_ids: self.global_network_ids,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
#[doc(hidden)]
pub type DescribeGlobalNetworksInputOperationOutputAlias = crate::operation::DescribeGlobalNetworks;
#[doc(hidden)]
pub type DescribeGlobalNetworksInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl DescribeGlobalNetworksInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DescribeGlobalNetworks,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::DescribeGlobalNetworksInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/global-networks").expect("formatting should succeed");
Ok(())
}
fn uri_query(_input: &crate::input::DescribeGlobalNetworksInput, mut output: &mut String) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_19) = &_input.global_network_ids {
for inner_20 in inner_19 {
query.push_kv(
"globalNetworkIds",
&aws_smithy_http::query::fmt_string(&inner_20),
);
}
}
if let Some(inner_21) = &_input.max_results {
query.push_kv(
"maxResults",
&aws_smithy_types::primitive::Encoder::from(*inner_21).encode(),
);
}
if let Some(inner_22) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_22));
}
}
#[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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri);
Ok(builder.method("GET").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::DescribeGlobalNetworksInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::describe_global_networks_input::Builder {
crate::input::describe_global_networks_input::Builder::default()
}
}
pub mod disassociate_customer_gateway_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::DisassociateCustomerGatewayInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::DisassociateCustomerGatewayInput {
global_network_id: self.global_network_id,
customer_gateway_arn: self.customer_gateway_arn,
})
}
}
}
#[doc(hidden)]
pub type DisassociateCustomerGatewayInputOperationOutputAlias =
crate::operation::DisassociateCustomerGateway;
#[doc(hidden)]
pub type DisassociateCustomerGatewayInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl DisassociateCustomerGatewayInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DisassociateCustomerGateway,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::DisassociateCustomerGatewayInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_23 = &_input.global_network_id;
let input_23 =
input_23
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_23, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
});
}
let input_24 = &_input.customer_gateway_arn;
let input_24 =
input_24
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "customer_gateway_arn",
details: "cannot be empty or unset",
})?;
let customer_gateway_arn = aws_smithy_http::label::fmt_string(input_24, false);
if customer_gateway_arn.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "customer_gateway_arn",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::DisassociateCustomerGatewayInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::disassociate_customer_gateway_input::Builder {
crate::input::disassociate_customer_gateway_input::Builder::default()
}
}
pub mod disassociate_link_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::DisassociateLinkInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::DisassociateLinkInput {
global_network_id: self.global_network_id,
device_id: self.device_id,
link_id: self.link_id,
})
}
}
}
#[doc(hidden)]
pub type DisassociateLinkInputOperationOutputAlias = crate::operation::DisassociateLink;
#[doc(hidden)]
pub type DisassociateLinkInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl DisassociateLinkInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DisassociateLink,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::DisassociateLinkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_25 = &_input.global_network_id;
let input_25 =
input_25
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_25, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_26) = &_input.device_id {
query.push_kv("deviceId", &aws_smithy_http::query::fmt_string(&inner_26));
}
if let Some(inner_27) = &_input.link_id {
query.push_kv("linkId", &aws_smithy_http::query::fmt_string(&inner_27));
}
}
#[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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri);
Ok(builder.method("DELETE").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::DisassociateLinkInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::disassociate_link_input::Builder {
crate::input::disassociate_link_input::Builder::default()
}
}
pub mod disassociate_transit_gateway_connect_peer_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::DisassociateTransitGatewayConnectPeerInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::DisassociateTransitGatewayConnectPeerInput {
global_network_id: self.global_network_id,
transit_gateway_connect_peer_arn: self.transit_gateway_connect_peer_arn,
})
}
}
}
#[doc(hidden)]
pub type DisassociateTransitGatewayConnectPeerInputOperationOutputAlias =
crate::operation::DisassociateTransitGatewayConnectPeer;
#[doc(hidden)]
pub type DisassociateTransitGatewayConnectPeerInputOperationRetryAlias =
aws_http::AwsErrorRetryPolicy;
impl DisassociateTransitGatewayConnectPeerInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DisassociateTransitGatewayConnectPeer,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::DisassociateTransitGatewayConnectPeerInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_28 = &_input.global_network_id;
let input_28 =
input_28
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_28, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
});
}
let input_29 = &_input.transit_gateway_connect_peer_arn;
let input_29 =
input_29
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "transit_gateway_connect_peer_arn",
details: "cannot be empty or unset",
})?;
let transit_gateway_connect_peer_arn =
aws_smithy_http::label::fmt_string(input_29, false);
if transit_gateway_connect_peer_arn.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "transit_gateway_connect_peer_arn",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::DisassociateTransitGatewayConnectPeerInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::disassociate_transit_gateway_connect_peer_input::Builder {
crate::input::disassociate_transit_gateway_connect_peer_input::Builder::default()
}
}
pub mod get_connections_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::GetConnectionsInput,
aws_smithy_http::operation::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,
})
}
}
}
#[doc(hidden)]
pub type GetConnectionsInputOperationOutputAlias = crate::operation::GetConnections;
#[doc(hidden)]
pub type GetConnectionsInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl GetConnectionsInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetConnections,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetConnectionsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_30 = &_input.global_network_id;
let input_30 =
input_30
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_30, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_31) = &_input.connection_ids {
for inner_32 in inner_31 {
query.push_kv(
"connectionIds",
&aws_smithy_http::query::fmt_string(&inner_32),
);
}
}
if let Some(inner_33) = &_input.device_id {
query.push_kv("deviceId", &aws_smithy_http::query::fmt_string(&inner_33));
}
if let Some(inner_34) = &_input.max_results {
query.push_kv(
"maxResults",
&aws_smithy_types::primitive::Encoder::from(*inner_34).encode(),
);
}
if let Some(inner_35) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_35));
}
}
#[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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri);
Ok(builder.method("GET").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::GetConnectionsInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::get_connections_input::Builder {
crate::input::get_connections_input::Builder::default()
}
}
pub mod get_customer_gateway_associations_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::GetCustomerGatewayAssociationsInput,
aws_smithy_http::operation::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,
})
}
}
}
#[doc(hidden)]
pub type GetCustomerGatewayAssociationsInputOperationOutputAlias =
crate::operation::GetCustomerGatewayAssociations;
#[doc(hidden)]
pub type GetCustomerGatewayAssociationsInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl GetCustomerGatewayAssociationsInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetCustomerGatewayAssociations,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetCustomerGatewayAssociationsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_36 = &_input.global_network_id;
let input_36 =
input_36
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_36, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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,
) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_37) = &_input.customer_gateway_arns {
for inner_38 in inner_37 {
query.push_kv(
"customerGatewayArns",
&aws_smithy_http::query::fmt_string(&inner_38),
);
}
}
if let Some(inner_39) = &_input.max_results {
query.push_kv(
"maxResults",
&aws_smithy_types::primitive::Encoder::from(*inner_39).encode(),
);
}
if let Some(inner_40) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_40));
}
}
#[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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri);
Ok(builder.method("GET").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::GetCustomerGatewayAssociationsInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
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 {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::GetDevicesInput,
aws_smithy_http::operation::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,
})
}
}
}
#[doc(hidden)]
pub type GetDevicesInputOperationOutputAlias = crate::operation::GetDevices;
#[doc(hidden)]
pub type GetDevicesInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl GetDevicesInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetDevices,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetDevicesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_41 = &_input.global_network_id;
let input_41 =
input_41
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_41, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_42) = &_input.device_ids {
for inner_43 in inner_42 {
query.push_kv("deviceIds", &aws_smithy_http::query::fmt_string(&inner_43));
}
}
if let Some(inner_44) = &_input.site_id {
query.push_kv("siteId", &aws_smithy_http::query::fmt_string(&inner_44));
}
if let Some(inner_45) = &_input.max_results {
query.push_kv(
"maxResults",
&aws_smithy_types::primitive::Encoder::from(*inner_45).encode(),
);
}
if let Some(inner_46) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_46));
}
}
#[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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri);
Ok(builder.method("GET").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::GetDevicesInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::get_devices_input::Builder {
crate::input::get_devices_input::Builder::default()
}
}
pub mod get_link_associations_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::GetLinkAssociationsInput,
aws_smithy_http::operation::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,
})
}
}
}
#[doc(hidden)]
pub type GetLinkAssociationsInputOperationOutputAlias = crate::operation::GetLinkAssociations;
#[doc(hidden)]
pub type GetLinkAssociationsInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl GetLinkAssociationsInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetLinkAssociations,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetLinkAssociationsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_47 = &_input.global_network_id;
let input_47 =
input_47
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_47, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_48) = &_input.device_id {
query.push_kv("deviceId", &aws_smithy_http::query::fmt_string(&inner_48));
}
if let Some(inner_49) = &_input.link_id {
query.push_kv("linkId", &aws_smithy_http::query::fmt_string(&inner_49));
}
if let Some(inner_50) = &_input.max_results {
query.push_kv(
"maxResults",
&aws_smithy_types::primitive::Encoder::from(*inner_50).encode(),
);
}
if let Some(inner_51) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_51));
}
}
#[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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri);
Ok(builder.method("GET").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::GetLinkAssociationsInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::get_link_associations_input::Builder {
crate::input::get_link_associations_input::Builder::default()
}
}
pub mod get_links_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<crate::input::GetLinksInput, aws_smithy_http::operation::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,
})
}
}
}
#[doc(hidden)]
pub type GetLinksInputOperationOutputAlias = crate::operation::GetLinks;
#[doc(hidden)]
pub type GetLinksInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl GetLinksInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetLinks,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetLinksInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_52 = &_input.global_network_id;
let input_52 =
input_52
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_52, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_53) = &_input.link_ids {
for inner_54 in inner_53 {
query.push_kv("linkIds", &aws_smithy_http::query::fmt_string(&inner_54));
}
}
if let Some(inner_55) = &_input.site_id {
query.push_kv("siteId", &aws_smithy_http::query::fmt_string(&inner_55));
}
if let Some(inner_56) = &_input.r#type {
query.push_kv("type", &aws_smithy_http::query::fmt_string(&inner_56));
}
if let Some(inner_57) = &_input.provider {
query.push_kv("provider", &aws_smithy_http::query::fmt_string(&inner_57));
}
if let Some(inner_58) = &_input.max_results {
query.push_kv(
"maxResults",
&aws_smithy_types::primitive::Encoder::from(*inner_58).encode(),
);
}
if let Some(inner_59) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_59));
}
}
#[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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri);
Ok(builder.method("GET").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::GetLinksInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::get_links_input::Builder {
crate::input::get_links_input::Builder::default()
}
}
pub mod get_sites_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<crate::input::GetSitesInput, aws_smithy_http::operation::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,
})
}
}
}
#[doc(hidden)]
pub type GetSitesInputOperationOutputAlias = crate::operation::GetSites;
#[doc(hidden)]
pub type GetSitesInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl GetSitesInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetSites,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetSitesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_60 = &_input.global_network_id;
let input_60 =
input_60
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_60, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_61) = &_input.site_ids {
for inner_62 in inner_61 {
query.push_kv("siteIds", &aws_smithy_http::query::fmt_string(&inner_62));
}
}
if let Some(inner_63) = &_input.max_results {
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));
}
}
#[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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri);
Ok(builder.method("GET").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::GetSitesInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::get_sites_input::Builder {
crate::input::get_sites_input::Builder::default()
}
}
pub mod get_transit_gateway_connect_peer_associations_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::GetTransitGatewayConnectPeerAssociationsInput,
aws_smithy_http::operation::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,
},
)
}
}
}
#[doc(hidden)]
pub type GetTransitGatewayConnectPeerAssociationsInputOperationOutputAlias =
crate::operation::GetTransitGatewayConnectPeerAssociations;
#[doc(hidden)]
pub type GetTransitGatewayConnectPeerAssociationsInputOperationRetryAlias =
aws_http::AwsErrorRetryPolicy;
impl GetTransitGatewayConnectPeerAssociationsInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetTransitGatewayConnectPeerAssociations,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetTransitGatewayConnectPeerAssociationsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_65 = &_input.global_network_id;
let input_65 =
input_65
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_65, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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,
) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_66) = &_input.transit_gateway_connect_peer_arns {
for inner_67 in inner_66 {
query.push_kv(
"transitGatewayConnectPeerArns",
&aws_smithy_http::query::fmt_string(&inner_67),
);
}
}
if let Some(inner_68) = &_input.max_results {
query.push_kv(
"maxResults",
&aws_smithy_types::primitive::Encoder::from(*inner_68).encode(),
);
}
if let Some(inner_69) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_69));
}
}
#[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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri);
Ok(builder.method("GET").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::GetTransitGatewayConnectPeerAssociationsInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
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_registrations_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::GetTransitGatewayRegistrationsInput,
aws_smithy_http::operation::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,
})
}
}
}
#[doc(hidden)]
pub type GetTransitGatewayRegistrationsInputOperationOutputAlias =
crate::operation::GetTransitGatewayRegistrations;
#[doc(hidden)]
pub type GetTransitGatewayRegistrationsInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl GetTransitGatewayRegistrationsInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetTransitGatewayRegistrations,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetTransitGatewayRegistrationsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_70 = &_input.global_network_id;
let input_70 =
input_70
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_70, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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,
) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_71) = &_input.transit_gateway_arns {
for inner_72 in inner_71 {
query.push_kv(
"transitGatewayArns",
&aws_smithy_http::query::fmt_string(&inner_72),
);
}
}
if let Some(inner_73) = &_input.max_results {
query.push_kv(
"maxResults",
&aws_smithy_types::primitive::Encoder::from(*inner_73).encode(),
);
}
if let Some(inner_74) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_74));
}
}
#[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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri);
Ok(builder.method("GET").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::GetTransitGatewayRegistrationsInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::get_transit_gateway_registrations_input::Builder {
crate::input::get_transit_gateway_registrations_input::Builder::default()
}
}
pub mod list_tags_for_resource_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::ListTagsForResourceInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ListTagsForResourceInput {
resource_arn: self.resource_arn,
})
}
}
}
#[doc(hidden)]
pub type ListTagsForResourceInputOperationOutputAlias = crate::operation::ListTagsForResource;
#[doc(hidden)]
pub type ListTagsForResourceInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl ListTagsForResourceInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListTagsForResource,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ListTagsForResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_75 = &_input.resource_arn;
let input_75 =
input_75
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "resource_arn",
details: "cannot be empty or unset",
})?;
let resource_arn = aws_smithy_http::label::fmt_string(input_75, false);
if resource_arn.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "resource_arn",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::ListTagsForResourceInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::list_tags_for_resource_input::Builder {
crate::input::list_tags_for_resource_input::Builder::default()
}
}
pub mod register_transit_gateway_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::RegisterTransitGatewayInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::RegisterTransitGatewayInput {
global_network_id: self.global_network_id,
transit_gateway_arn: self.transit_gateway_arn,
})
}
}
}
#[doc(hidden)]
pub type RegisterTransitGatewayInputOperationOutputAlias = crate::operation::RegisterTransitGateway;
#[doc(hidden)]
pub type RegisterTransitGatewayInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl RegisterTransitGatewayInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::RegisterTransitGateway,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::RegisterTransitGatewayInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_76 = &_input.global_network_id;
let input_76 =
input_76
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_76, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::RegisterTransitGatewayInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_register_transit_gateway(
&self,
)
.map_err(|err| {
aws_smithy_http::operation::BuildError::SerializationError(err.into())
})?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::register_transit_gateway_input::Builder {
crate::input::register_transit_gateway_input::Builder::default()
}
}
pub mod tag_resource_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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: impl Into<crate::model::Tag>) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input.into());
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,
) -> std::result::Result<
crate::input::TagResourceInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::TagResourceInput {
resource_arn: self.resource_arn,
tags: self.tags,
})
}
}
}
#[doc(hidden)]
pub type TagResourceInputOperationOutputAlias = crate::operation::TagResource;
#[doc(hidden)]
pub type TagResourceInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl TagResourceInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::TagResource,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::TagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_77 = &_input.resource_arn;
let input_77 =
input_77
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "resource_arn",
details: "cannot be empty or unset",
})?;
let resource_arn = aws_smithy_http::label::fmt_string(input_77, false);
if resource_arn.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "resource_arn",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::TagResourceInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = crate::operation_ser::serialize_operation_crate_operation_tag_resource(&self)
.map_err(|err| {
aws_smithy_http::operation::BuildError::SerializationError(err.into())
})?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::tag_resource_input::Builder {
crate::input::tag_resource_input::Builder::default()
}
}
pub mod untag_resource_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::UntagResourceInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::UntagResourceInput {
resource_arn: self.resource_arn,
tag_keys: self.tag_keys,
})
}
}
}
#[doc(hidden)]
pub type UntagResourceInputOperationOutputAlias = crate::operation::UntagResource;
#[doc(hidden)]
pub type UntagResourceInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl UntagResourceInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UntagResource,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::UntagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_78 = &_input.resource_arn;
let input_78 =
input_78
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "resource_arn",
details: "cannot be empty or unset",
})?;
let resource_arn = aws_smithy_http::label::fmt_string(input_78, false);
if resource_arn.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "resource_arn",
details: "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) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_79) = &_input.tag_keys {
for inner_80 in inner_79 {
query.push_kv("tagKeys", &aws_smithy_http::query::fmt_string(&inner_80));
}
}
}
#[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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri);
Ok(builder.method("DELETE").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::UntagResourceInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = aws_smithy_http::body::SdkBody::from("");
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::untag_resource_input::Builder {
crate::input::untag_resource_input::Builder::default()
}
}
pub mod update_connection_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::UpdateConnectionInput,
aws_smithy_http::operation::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,
})
}
}
}
#[doc(hidden)]
pub type UpdateConnectionInputOperationOutputAlias = crate::operation::UpdateConnection;
#[doc(hidden)]
pub type UpdateConnectionInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl UpdateConnectionInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateConnection,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::UpdateConnectionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_81 = &_input.global_network_id;
let input_81 =
input_81
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_81, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
});
}
let input_82 = &_input.connection_id;
let input_82 =
input_82
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "connection_id",
details: "cannot be empty or unset",
})?;
let connection_id = aws_smithy_http::label::fmt_string(input_82, false);
if connection_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "connection_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PATCH").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::UpdateConnectionInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_update_connection(&self)
.map_err(|err| {
aws_smithy_http::operation::BuildError::SerializationError(err.into())
})?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::update_connection_input::Builder {
crate::input::update_connection_input::Builder::default()
}
}
pub mod update_device_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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) 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,
) -> std::result::Result<
crate::input::UpdateDeviceInput,
aws_smithy_http::operation::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,
})
}
}
}
#[doc(hidden)]
pub type UpdateDeviceInputOperationOutputAlias = crate::operation::UpdateDevice;
#[doc(hidden)]
pub type UpdateDeviceInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl UpdateDeviceInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateDevice,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::UpdateDeviceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_83 = &_input.global_network_id;
let input_83 =
input_83
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_83, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
});
}
let input_84 = &_input.device_id;
let input_84 =
input_84
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "device_id",
details: "cannot be empty or unset",
})?;
let device_id = aws_smithy_http::label::fmt_string(input_84, false);
if device_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "device_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PATCH").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::UpdateDeviceInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = crate::operation_ser::serialize_operation_crate_operation_update_device(&self)
.map_err(|err| {
aws_smithy_http::operation::BuildError::SerializationError(err.into())
})?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::update_device_input::Builder {
crate::input::update_device_input::Builder::default()
}
}
pub mod update_global_network_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::UpdateGlobalNetworkInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::UpdateGlobalNetworkInput {
global_network_id: self.global_network_id,
description: self.description,
})
}
}
}
#[doc(hidden)]
pub type UpdateGlobalNetworkInputOperationOutputAlias = crate::operation::UpdateGlobalNetwork;
#[doc(hidden)]
pub type UpdateGlobalNetworkInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl UpdateGlobalNetworkInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateGlobalNetwork,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::UpdateGlobalNetworkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_85 = &_input.global_network_id;
let input_85 =
input_85
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_85, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PATCH").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::UpdateGlobalNetworkInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body =
crate::operation_ser::serialize_operation_crate_operation_update_global_network(&self)
.map_err(|err| {
aws_smithy_http::operation::BuildError::SerializationError(err.into())
})?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::update_global_network_input::Builder {
crate::input::update_global_network_input::Builder::default()
}
}
pub mod update_link_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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,
) -> std::result::Result<
crate::input::UpdateLinkInput,
aws_smithy_http::operation::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,
})
}
}
}
#[doc(hidden)]
pub type UpdateLinkInputOperationOutputAlias = crate::operation::UpdateLink;
#[doc(hidden)]
pub type UpdateLinkInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl UpdateLinkInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateLink,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::UpdateLinkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_86 = &_input.global_network_id;
let input_86 =
input_86
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_86, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
});
}
let input_87 = &_input.link_id;
let input_87 =
input_87
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "link_id",
details: "cannot be empty or unset",
})?;
let link_id = aws_smithy_http::label::fmt_string(input_87, false);
if link_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "link_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PATCH").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::UpdateLinkInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = crate::operation_ser::serialize_operation_crate_operation_update_link(&self)
.map_err(|err| {
aws_smithy_http::operation::BuildError::SerializationError(err.into())
})?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::update_link_input::Builder {
crate::input::update_link_input::Builder::default()
}
}
pub mod update_site_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, 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>,
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,
) -> std::result::Result<
crate::input::UpdateSiteInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::UpdateSiteInput {
global_network_id: self.global_network_id,
site_id: self.site_id,
description: self.description,
location: self.location,
})
}
}
}
#[doc(hidden)]
pub type UpdateSiteInputOperationOutputAlias = crate::operation::UpdateSite;
#[doc(hidden)]
pub type UpdateSiteInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl UpdateSiteInput {
#[allow(clippy::let_and_return)]
pub fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateSite,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::UpdateSiteInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_88 = &_input.global_network_id;
let input_88 =
input_88
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
})?;
let global_network_id = aws_smithy_http::label::fmt_string(input_88, false);
if global_network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "global_network_id",
details: "cannot be empty or unset",
});
}
let input_89 = &_input.site_id;
let input_89 =
input_89
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "site_id",
details: "cannot be empty or unset",
})?;
let site_id = aws_smithy_http::label::fmt_string(input_89, false);
if site_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "site_id",
details: "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::BuildError>
{
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PATCH").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::UpdateSiteInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut builder = update_http_builder(input, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::HeaderName::from_static("content-type"),
"application/json",
);
Ok(builder)
}
let properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
let request = request_builder_base(&self)?;
let body = crate::operation_ser::serialize_operation_crate_operation_update_site(&self)
.map_err(|err| {
aws_smithy_http::operation::BuildError::SerializationError(err.into())
})?;
let request = Self::assemble(request, body);
#[allow(unused_mut)]
let mut request = aws_smithy_http::operation::Request::from_parts(
request.map(aws_smithy_http::body::SdkBody::from),
properties,
);
request
.properties_mut()
.insert(aws_http::user_agent::AwsUserAgent::new_from_environment(
crate::API_METADATA.clone(),
));
#[allow(unused_mut)]
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(),
));
aws_endpoint::set_endpoint_resolver(
&mut request.properties_mut(),
_config.endpoint_resolver.clone(),
);
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_provider(
&mut request.properties_mut(),
_config.credentials_provider.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_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
mut builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
if let Some(content_length) = body.content_length() {
builder = aws_smithy_http::header::set_header_if_absent(
builder,
http::header::CONTENT_LENGTH,
content_length,
);
}
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::update_site_input::Builder {
crate::input::update_site_input::Builder::default()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UpdateSiteInput {
pub global_network_id: std::option::Option<std::string::String>,
pub site_id: std::option::Option<std::string::String>,
pub description: std::option::Option<std::string::String>,
pub location: std::option::Option<crate::model::Location>,
}
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)]
pub struct UpdateLinkInput {
pub global_network_id: std::option::Option<std::string::String>,
pub link_id: std::option::Option<std::string::String>,
pub description: std::option::Option<std::string::String>,
pub r#type: std::option::Option<std::string::String>,
pub bandwidth: std::option::Option<crate::model::Bandwidth>,
pub provider: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for UpdateLinkInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UpdateLinkInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("link_id", &self.link_id);
formatter.field("description", &self.description);
formatter.field("r#type", &self.r#type);
formatter.field("bandwidth", &self.bandwidth);
formatter.field("provider", &self.provider);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UpdateGlobalNetworkInput {
pub global_network_id: std::option::Option<std::string::String>,
pub description: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for UpdateGlobalNetworkInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UpdateGlobalNetworkInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("description", &self.description);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UpdateDeviceInput {
pub global_network_id: std::option::Option<std::string::String>,
pub device_id: std::option::Option<std::string::String>,
pub aws_location: std::option::Option<crate::model::AwsLocation>,
pub description: std::option::Option<std::string::String>,
pub r#type: std::option::Option<std::string::String>,
pub vendor: std::option::Option<std::string::String>,
pub model: std::option::Option<std::string::String>,
pub serial_number: std::option::Option<std::string::String>,
pub location: std::option::Option<crate::model::Location>,
pub site_id: std::option::Option<std::string::String>,
}
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)]
pub struct UpdateConnectionInput {
pub global_network_id: std::option::Option<std::string::String>,
pub connection_id: std::option::Option<std::string::String>,
pub link_id: std::option::Option<std::string::String>,
pub connected_link_id: std::option::Option<std::string::String>,
pub description: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for UpdateConnectionInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UpdateConnectionInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("connection_id", &self.connection_id);
formatter.field("link_id", &self.link_id);
formatter.field("connected_link_id", &self.connected_link_id);
formatter.field("description", &self.description);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UntagResourceInput {
pub resource_arn: std::option::Option<std::string::String>,
pub tag_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl std::fmt::Debug for UntagResourceInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UntagResourceInput");
formatter.field("resource_arn", &self.resource_arn);
formatter.field("tag_keys", &self.tag_keys);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct TagResourceInput {
pub resource_arn: std::option::Option<std::string::String>,
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
impl std::fmt::Debug for TagResourceInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("TagResourceInput");
formatter.field("resource_arn", &self.resource_arn);
formatter.field("tags", &self.tags);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct RegisterTransitGatewayInput {
pub global_network_id: std::option::Option<std::string::String>,
pub transit_gateway_arn: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for RegisterTransitGatewayInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("RegisterTransitGatewayInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("transit_gateway_arn", &self.transit_gateway_arn);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListTagsForResourceInput {
pub resource_arn: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for ListTagsForResourceInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListTagsForResourceInput");
formatter.field("resource_arn", &self.resource_arn);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetTransitGatewayRegistrationsInput {
pub global_network_id: std::option::Option<std::string::String>,
pub transit_gateway_arns: std::option::Option<std::vec::Vec<std::string::String>>,
pub max_results: std::option::Option<i32>,
pub next_token: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for GetTransitGatewayRegistrationsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetTransitGatewayRegistrationsInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("transit_gateway_arns", &self.transit_gateway_arns);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &self.next_token);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetTransitGatewayConnectPeerAssociationsInput {
pub global_network_id: std::option::Option<std::string::String>,
pub transit_gateway_connect_peer_arns: std::option::Option<std::vec::Vec<std::string::String>>,
pub max_results: std::option::Option<i32>,
pub next_token: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for GetTransitGatewayConnectPeerAssociationsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetTransitGatewayConnectPeerAssociationsInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field(
"transit_gateway_connect_peer_arns",
&self.transit_gateway_connect_peer_arns,
);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &self.next_token);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetSitesInput {
pub global_network_id: std::option::Option<std::string::String>,
pub site_ids: std::option::Option<std::vec::Vec<std::string::String>>,
pub max_results: std::option::Option<i32>,
pub next_token: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for GetSitesInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetSitesInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("site_ids", &self.site_ids);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &self.next_token);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetLinksInput {
pub global_network_id: std::option::Option<std::string::String>,
pub link_ids: std::option::Option<std::vec::Vec<std::string::String>>,
pub site_id: std::option::Option<std::string::String>,
pub r#type: std::option::Option<std::string::String>,
pub provider: std::option::Option<std::string::String>,
pub max_results: std::option::Option<i32>,
pub next_token: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for GetLinksInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetLinksInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("link_ids", &self.link_ids);
formatter.field("site_id", &self.site_id);
formatter.field("r#type", &self.r#type);
formatter.field("provider", &self.provider);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &self.next_token);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetLinkAssociationsInput {
pub global_network_id: std::option::Option<std::string::String>,
pub device_id: std::option::Option<std::string::String>,
pub link_id: std::option::Option<std::string::String>,
pub max_results: std::option::Option<i32>,
pub next_token: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for GetLinkAssociationsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetLinkAssociationsInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("device_id", &self.device_id);
formatter.field("link_id", &self.link_id);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &self.next_token);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetDevicesInput {
pub global_network_id: std::option::Option<std::string::String>,
pub device_ids: std::option::Option<std::vec::Vec<std::string::String>>,
pub site_id: std::option::Option<std::string::String>,
pub max_results: std::option::Option<i32>,
pub next_token: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for GetDevicesInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetDevicesInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("device_ids", &self.device_ids);
formatter.field("site_id", &self.site_id);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &self.next_token);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetCustomerGatewayAssociationsInput {
pub global_network_id: std::option::Option<std::string::String>,
pub customer_gateway_arns: std::option::Option<std::vec::Vec<std::string::String>>,
pub max_results: std::option::Option<i32>,
pub next_token: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for GetCustomerGatewayAssociationsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetCustomerGatewayAssociationsInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("customer_gateway_arns", &self.customer_gateway_arns);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &self.next_token);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetConnectionsInput {
pub global_network_id: std::option::Option<std::string::String>,
pub connection_ids: std::option::Option<std::vec::Vec<std::string::String>>,
pub device_id: std::option::Option<std::string::String>,
pub max_results: std::option::Option<i32>,
pub next_token: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for GetConnectionsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetConnectionsInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("connection_ids", &self.connection_ids);
formatter.field("device_id", &self.device_id);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &self.next_token);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DisassociateTransitGatewayConnectPeerInput {
pub global_network_id: std::option::Option<std::string::String>,
pub transit_gateway_connect_peer_arn: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for DisassociateTransitGatewayConnectPeerInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DisassociateTransitGatewayConnectPeerInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field(
"transit_gateway_connect_peer_arn",
&self.transit_gateway_connect_peer_arn,
);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DisassociateLinkInput {
pub global_network_id: std::option::Option<std::string::String>,
pub device_id: std::option::Option<std::string::String>,
pub link_id: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for DisassociateLinkInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DisassociateLinkInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("device_id", &self.device_id);
formatter.field("link_id", &self.link_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DisassociateCustomerGatewayInput {
pub global_network_id: std::option::Option<std::string::String>,
pub customer_gateway_arn: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for DisassociateCustomerGatewayInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DisassociateCustomerGatewayInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("customer_gateway_arn", &self.customer_gateway_arn);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DescribeGlobalNetworksInput {
pub global_network_ids: std::option::Option<std::vec::Vec<std::string::String>>,
pub max_results: std::option::Option<i32>,
pub next_token: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for DescribeGlobalNetworksInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DescribeGlobalNetworksInput");
formatter.field("global_network_ids", &self.global_network_ids);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &self.next_token);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DeregisterTransitGatewayInput {
pub global_network_id: std::option::Option<std::string::String>,
pub transit_gateway_arn: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for DeregisterTransitGatewayInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DeregisterTransitGatewayInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("transit_gateway_arn", &self.transit_gateway_arn);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DeleteSiteInput {
pub global_network_id: std::option::Option<std::string::String>,
pub site_id: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for DeleteSiteInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DeleteSiteInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("site_id", &self.site_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DeleteLinkInput {
pub global_network_id: std::option::Option<std::string::String>,
pub link_id: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for DeleteLinkInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DeleteLinkInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("link_id", &self.link_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DeleteGlobalNetworkInput {
pub global_network_id: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for DeleteGlobalNetworkInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DeleteGlobalNetworkInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DeleteDeviceInput {
pub global_network_id: std::option::Option<std::string::String>,
pub device_id: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for DeleteDeviceInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DeleteDeviceInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("device_id", &self.device_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DeleteConnectionInput {
pub global_network_id: std::option::Option<std::string::String>,
pub connection_id: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for DeleteConnectionInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DeleteConnectionInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("connection_id", &self.connection_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreateSiteInput {
pub global_network_id: std::option::Option<std::string::String>,
pub description: std::option::Option<std::string::String>,
pub location: std::option::Option<crate::model::Location>,
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
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)]
pub struct CreateLinkInput {
pub global_network_id: std::option::Option<std::string::String>,
pub description: std::option::Option<std::string::String>,
pub r#type: std::option::Option<std::string::String>,
pub bandwidth: std::option::Option<crate::model::Bandwidth>,
pub provider: std::option::Option<std::string::String>,
pub site_id: std::option::Option<std::string::String>,
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
impl std::fmt::Debug for CreateLinkInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreateLinkInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("description", &self.description);
formatter.field("r#type", &self.r#type);
formatter.field("bandwidth", &self.bandwidth);
formatter.field("provider", &self.provider);
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)]
pub struct CreateGlobalNetworkInput {
pub description: std::option::Option<std::string::String>,
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
impl std::fmt::Debug for CreateGlobalNetworkInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreateGlobalNetworkInput");
formatter.field("description", &self.description);
formatter.field("tags", &self.tags);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreateDeviceInput {
pub global_network_id: std::option::Option<std::string::String>,
pub aws_location: std::option::Option<crate::model::AwsLocation>,
pub description: std::option::Option<std::string::String>,
pub r#type: std::option::Option<std::string::String>,
pub vendor: std::option::Option<std::string::String>,
pub model: std::option::Option<std::string::String>,
pub serial_number: std::option::Option<std::string::String>,
pub location: std::option::Option<crate::model::Location>,
pub site_id: std::option::Option<std::string::String>,
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
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)]
pub struct CreateConnectionInput {
pub global_network_id: std::option::Option<std::string::String>,
pub device_id: std::option::Option<std::string::String>,
pub connected_device_id: std::option::Option<std::string::String>,
pub link_id: std::option::Option<std::string::String>,
pub connected_link_id: std::option::Option<std::string::String>,
pub description: std::option::Option<std::string::String>,
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
}
impl std::fmt::Debug for CreateConnectionInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreateConnectionInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("device_id", &self.device_id);
formatter.field("connected_device_id", &self.connected_device_id);
formatter.field("link_id", &self.link_id);
formatter.field("connected_link_id", &self.connected_link_id);
formatter.field("description", &self.description);
formatter.field("tags", &self.tags);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct AssociateTransitGatewayConnectPeerInput {
pub global_network_id: std::option::Option<std::string::String>,
pub transit_gateway_connect_peer_arn: std::option::Option<std::string::String>,
pub device_id: std::option::Option<std::string::String>,
pub link_id: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for AssociateTransitGatewayConnectPeerInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("AssociateTransitGatewayConnectPeerInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field(
"transit_gateway_connect_peer_arn",
&self.transit_gateway_connect_peer_arn,
);
formatter.field("device_id", &self.device_id);
formatter.field("link_id", &self.link_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct AssociateLinkInput {
pub global_network_id: std::option::Option<std::string::String>,
pub device_id: std::option::Option<std::string::String>,
pub link_id: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for AssociateLinkInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("AssociateLinkInput");
formatter.field("global_network_id", &self.global_network_id);
formatter.field("device_id", &self.device_id);
formatter.field("link_id", &self.link_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct AssociateCustomerGatewayInput {
pub customer_gateway_arn: std::option::Option<std::string::String>,
pub global_network_id: std::option::Option<std::string::String>,
pub device_id: std::option::Option<std::string::String>,
pub link_id: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for AssociateCustomerGatewayInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("AssociateCustomerGatewayInput");
formatter.field("customer_gateway_arn", &self.customer_gateway_arn);
formatter.field("global_network_id", &self.global_network_id);
formatter.field("device_id", &self.device_id);
formatter.field("link_id", &self.link_id);
formatter.finish()
}
}