use std::fmt::Write;
pub mod create_member_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) client_request_token: std::option::Option<std::string::String>,
pub(crate) invitation_id: std::option::Option<std::string::String>,
pub(crate) network_id: std::option::Option<std::string::String>,
pub(crate) member_configuration: std::option::Option<crate::model::MemberConfiguration>,
}
impl Builder {
pub fn client_request_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_request_token = Some(input.into());
self
}
pub fn set_client_request_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_request_token = input;
self
}
pub fn invitation_id(mut self, input: impl Into<std::string::String>) -> Self {
self.invitation_id = Some(input.into());
self
}
pub fn set_invitation_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.invitation_id = input;
self
}
pub fn network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.network_id = Some(input.into());
self
}
pub fn set_network_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.network_id = input;
self
}
pub fn member_configuration(mut self, input: crate::model::MemberConfiguration) -> Self {
self.member_configuration = Some(input);
self
}
pub fn set_member_configuration(
mut self,
input: std::option::Option<crate::model::MemberConfiguration>,
) -> Self {
self.member_configuration = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::CreateMemberInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::CreateMemberInput {
client_request_token: self.client_request_token,
invitation_id: self.invitation_id,
network_id: self.network_id,
member_configuration: self.member_configuration,
})
}
}
}
#[doc(hidden)]
pub type CreateMemberInputOperationOutputAlias = crate::operation::CreateMember;
#[doc(hidden)]
pub type CreateMemberInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl CreateMemberInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateMember,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::CreateMemberInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_1 = &_input.network_id;
let input_1 =
input_1
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
})?;
let network_id = aws_smithy_http::label::fmt_string(input_1, false);
if network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/networks/{NetworkId}/members",
NetworkId = network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateMemberInput,
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::CreateMemberInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
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)
}
if self.client_request_token.is_none() {
self.client_request_token = Some(_config.make_token.make_idempotency_token());
}
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_member(&self)?;
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::CreateMember::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateMember",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
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_member_input::Builder {
crate::input::create_member_input::Builder::default()
}
}
pub mod create_network_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) client_request_token: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) framework: std::option::Option<crate::model::Framework>,
pub(crate) framework_version: std::option::Option<std::string::String>,
pub(crate) framework_configuration:
std::option::Option<crate::model::NetworkFrameworkConfiguration>,
pub(crate) voting_policy: std::option::Option<crate::model::VotingPolicy>,
pub(crate) member_configuration: std::option::Option<crate::model::MemberConfiguration>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn client_request_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_request_token = Some(input.into());
self
}
pub fn set_client_request_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_request_token = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn framework(mut self, input: crate::model::Framework) -> Self {
self.framework = Some(input);
self
}
pub fn set_framework(
mut self,
input: std::option::Option<crate::model::Framework>,
) -> Self {
self.framework = input;
self
}
pub fn framework_version(mut self, input: impl Into<std::string::String>) -> Self {
self.framework_version = Some(input.into());
self
}
pub fn set_framework_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.framework_version = input;
self
}
pub fn framework_configuration(
mut self,
input: crate::model::NetworkFrameworkConfiguration,
) -> Self {
self.framework_configuration = Some(input);
self
}
pub fn set_framework_configuration(
mut self,
input: std::option::Option<crate::model::NetworkFrameworkConfiguration>,
) -> Self {
self.framework_configuration = input;
self
}
pub fn voting_policy(mut self, input: crate::model::VotingPolicy) -> Self {
self.voting_policy = Some(input);
self
}
pub fn set_voting_policy(
mut self,
input: std::option::Option<crate::model::VotingPolicy>,
) -> Self {
self.voting_policy = input;
self
}
pub fn member_configuration(mut self, input: crate::model::MemberConfiguration) -> Self {
self.member_configuration = Some(input);
self
}
pub fn set_member_configuration(
mut self,
input: std::option::Option<crate::model::MemberConfiguration>,
) -> Self {
self.member_configuration = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::CreateNetworkInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::CreateNetworkInput {
client_request_token: self.client_request_token,
name: self.name,
description: self.description,
framework: self.framework,
framework_version: self.framework_version,
framework_configuration: self.framework_configuration,
voting_policy: self.voting_policy,
member_configuration: self.member_configuration,
tags: self.tags,
})
}
}
}
#[doc(hidden)]
pub type CreateNetworkInputOperationOutputAlias = crate::operation::CreateNetwork;
#[doc(hidden)]
pub type CreateNetworkInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl CreateNetworkInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateNetwork,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::CreateNetworkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/networks").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateNetworkInput,
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::CreateNetworkInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
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)
}
if self.client_request_token.is_none() {
self.client_request_token = Some(_config.make_token.make_idempotency_token());
}
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_network(&self)?;
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::CreateNetwork::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateNetwork",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
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_network_input::Builder {
crate::input::create_network_input::Builder::default()
}
}
pub mod create_node_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) client_request_token: std::option::Option<std::string::String>,
pub(crate) network_id: std::option::Option<std::string::String>,
pub(crate) member_id: std::option::Option<std::string::String>,
pub(crate) node_configuration: std::option::Option<crate::model::NodeConfiguration>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn client_request_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_request_token = Some(input.into());
self
}
pub fn set_client_request_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_request_token = input;
self
}
pub fn network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.network_id = Some(input.into());
self
}
pub fn set_network_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.network_id = input;
self
}
pub fn member_id(mut self, input: impl Into<std::string::String>) -> Self {
self.member_id = Some(input.into());
self
}
pub fn set_member_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.member_id = input;
self
}
pub fn node_configuration(mut self, input: crate::model::NodeConfiguration) -> Self {
self.node_configuration = Some(input);
self
}
pub fn set_node_configuration(
mut self,
input: std::option::Option<crate::model::NodeConfiguration>,
) -> Self {
self.node_configuration = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::CreateNodeInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::CreateNodeInput {
client_request_token: self.client_request_token,
network_id: self.network_id,
member_id: self.member_id,
node_configuration: self.node_configuration,
tags: self.tags,
})
}
}
}
#[doc(hidden)]
pub type CreateNodeInputOperationOutputAlias = crate::operation::CreateNode;
#[doc(hidden)]
pub type CreateNodeInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl CreateNodeInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateNode,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::CreateNodeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_2 = &_input.network_id;
let input_2 =
input_2
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
})?;
let network_id = aws_smithy_http::label::fmt_string(input_2, false);
if network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/networks/{NetworkId}/nodes",
NetworkId = network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateNodeInput,
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::CreateNodeInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
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)
}
if self.client_request_token.is_none() {
self.client_request_token = Some(_config.make_token.make_idempotency_token());
}
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_node(&self)?;
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::CreateNode::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateNode",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
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_node_input::Builder {
crate::input::create_node_input::Builder::default()
}
}
pub mod create_proposal_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) client_request_token: std::option::Option<std::string::String>,
pub(crate) network_id: std::option::Option<std::string::String>,
pub(crate) member_id: std::option::Option<std::string::String>,
pub(crate) actions: std::option::Option<crate::model::ProposalActions>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn client_request_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_request_token = Some(input.into());
self
}
pub fn set_client_request_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_request_token = input;
self
}
pub fn network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.network_id = Some(input.into());
self
}
pub fn set_network_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.network_id = input;
self
}
pub fn member_id(mut self, input: impl Into<std::string::String>) -> Self {
self.member_id = Some(input.into());
self
}
pub fn set_member_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.member_id = input;
self
}
pub fn actions(mut self, input: crate::model::ProposalActions) -> Self {
self.actions = Some(input);
self
}
pub fn set_actions(
mut self,
input: std::option::Option<crate::model::ProposalActions>,
) -> Self {
self.actions = 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,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::CreateProposalInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::CreateProposalInput {
client_request_token: self.client_request_token,
network_id: self.network_id,
member_id: self.member_id,
actions: self.actions,
description: self.description,
tags: self.tags,
})
}
}
}
#[doc(hidden)]
pub type CreateProposalInputOperationOutputAlias = crate::operation::CreateProposal;
#[doc(hidden)]
pub type CreateProposalInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl CreateProposalInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateProposal,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::CreateProposalInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_3 = &_input.network_id;
let input_3 =
input_3
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
})?;
let network_id = aws_smithy_http::label::fmt_string(input_3, false);
if network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/networks/{NetworkId}/proposals",
NetworkId = network_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateProposalInput,
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::CreateProposalInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
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)
}
if self.client_request_token.is_none() {
self.client_request_token = Some(_config.make_token.make_idempotency_token());
}
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_proposal(&self)?;
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::CreateProposal::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateProposal",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
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_proposal_input::Builder {
crate::input::create_proposal_input::Builder::default()
}
}
pub mod delete_member_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) network_id: std::option::Option<std::string::String>,
pub(crate) member_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.network_id = Some(input.into());
self
}
pub fn set_network_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.network_id = input;
self
}
pub fn member_id(mut self, input: impl Into<std::string::String>) -> Self {
self.member_id = Some(input.into());
self
}
pub fn set_member_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.member_id = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::DeleteMemberInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::DeleteMemberInput {
network_id: self.network_id,
member_id: self.member_id,
})
}
}
}
#[doc(hidden)]
pub type DeleteMemberInputOperationOutputAlias = crate::operation::DeleteMember;
#[doc(hidden)]
pub type DeleteMemberInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl DeleteMemberInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteMember,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::DeleteMemberInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_4 = &_input.network_id;
let input_4 =
input_4
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
})?;
let network_id = aws_smithy_http::label::fmt_string(input_4, false);
if network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
});
}
let input_5 = &_input.member_id;
let input_5 =
input_5
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "member_id",
details: "cannot be empty or unset",
})?;
let member_id = aws_smithy_http::label::fmt_string(input_5, false);
if member_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "member_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/networks/{NetworkId}/members/{MemberId}",
NetworkId = network_id,
MemberId = member_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteMemberInput,
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::DeleteMemberInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
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::DeleteMember::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteMember",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::delete_member_input::Builder {
crate::input::delete_member_input::Builder::default()
}
}
pub mod delete_node_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) network_id: std::option::Option<std::string::String>,
pub(crate) member_id: std::option::Option<std::string::String>,
pub(crate) node_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.network_id = Some(input.into());
self
}
pub fn set_network_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.network_id = input;
self
}
pub fn member_id(mut self, input: impl Into<std::string::String>) -> Self {
self.member_id = Some(input.into());
self
}
pub fn set_member_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.member_id = input;
self
}
pub fn node_id(mut self, input: impl Into<std::string::String>) -> Self {
self.node_id = Some(input.into());
self
}
pub fn set_node_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.node_id = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::DeleteNodeInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::DeleteNodeInput {
network_id: self.network_id,
member_id: self.member_id,
node_id: self.node_id,
})
}
}
}
#[doc(hidden)]
pub type DeleteNodeInputOperationOutputAlias = crate::operation::DeleteNode;
#[doc(hidden)]
pub type DeleteNodeInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl DeleteNodeInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteNode,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::DeleteNodeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_6 = &_input.network_id;
let input_6 =
input_6
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
})?;
let network_id = aws_smithy_http::label::fmt_string(input_6, false);
if network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
});
}
let input_7 = &_input.node_id;
let input_7 =
input_7
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "node_id",
details: "cannot be empty or unset",
})?;
let node_id = aws_smithy_http::label::fmt_string(input_7, false);
if node_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "node_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/networks/{NetworkId}/nodes/{NodeId}",
NetworkId = network_id,
NodeId = node_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(_input: &crate::input::DeleteNodeInput, mut output: &mut String) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_8) = &_input.member_id {
query.push_kv("memberId", &aws_smithy_http::query::fmt_string(&inner_8));
}
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteNodeInput,
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::DeleteNodeInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
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::DeleteNode::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteNode",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::delete_node_input::Builder {
crate::input::delete_node_input::Builder::default()
}
}
pub mod get_member_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) network_id: std::option::Option<std::string::String>,
pub(crate) member_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.network_id = Some(input.into());
self
}
pub fn set_network_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.network_id = input;
self
}
pub fn member_id(mut self, input: impl Into<std::string::String>) -> Self {
self.member_id = Some(input.into());
self
}
pub fn set_member_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.member_id = input;
self
}
pub fn build(
self,
) -> std::result::Result<crate::input::GetMemberInput, aws_smithy_http::operation::BuildError>
{
Ok(crate::input::GetMemberInput {
network_id: self.network_id,
member_id: self.member_id,
})
}
}
}
#[doc(hidden)]
pub type GetMemberInputOperationOutputAlias = crate::operation::GetMember;
#[doc(hidden)]
pub type GetMemberInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl GetMemberInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetMember,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetMemberInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_9 = &_input.network_id;
let input_9 =
input_9
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
})?;
let network_id = aws_smithy_http::label::fmt_string(input_9, false);
if network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
});
}
let input_10 = &_input.member_id;
let input_10 =
input_10
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "member_id",
details: "cannot be empty or unset",
})?;
let member_id = aws_smithy_http::label::fmt_string(input_10, false);
if member_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "member_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/networks/{NetworkId}/members/{MemberId}",
NetworkId = network_id,
MemberId = member_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetMemberInput,
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::GetMemberInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
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::GetMember::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetMember",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::get_member_input::Builder {
crate::input::get_member_input::Builder::default()
}
}
pub mod get_network_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) network_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.network_id = Some(input.into());
self
}
pub fn set_network_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.network_id = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::GetNetworkInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::GetNetworkInput {
network_id: self.network_id,
})
}
}
}
#[doc(hidden)]
pub type GetNetworkInputOperationOutputAlias = crate::operation::GetNetwork;
#[doc(hidden)]
pub type GetNetworkInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl GetNetworkInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetNetwork,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetNetworkInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_11 = &_input.network_id;
let input_11 =
input_11
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
})?;
let network_id = aws_smithy_http::label::fmt_string(input_11, false);
if network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
});
}
write!(output, "/networks/{NetworkId}", NetworkId = network_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetNetworkInput,
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::GetNetworkInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
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::GetNetwork::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetNetwork",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::get_network_input::Builder {
crate::input::get_network_input::Builder::default()
}
}
pub mod get_node_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) network_id: std::option::Option<std::string::String>,
pub(crate) member_id: std::option::Option<std::string::String>,
pub(crate) node_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.network_id = Some(input.into());
self
}
pub fn set_network_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.network_id = input;
self
}
pub fn member_id(mut self, input: impl Into<std::string::String>) -> Self {
self.member_id = Some(input.into());
self
}
pub fn set_member_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.member_id = input;
self
}
pub fn node_id(mut self, input: impl Into<std::string::String>) -> Self {
self.node_id = Some(input.into());
self
}
pub fn set_node_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.node_id = input;
self
}
pub fn build(
self,
) -> std::result::Result<crate::input::GetNodeInput, aws_smithy_http::operation::BuildError>
{
Ok(crate::input::GetNodeInput {
network_id: self.network_id,
member_id: self.member_id,
node_id: self.node_id,
})
}
}
}
#[doc(hidden)]
pub type GetNodeInputOperationOutputAlias = crate::operation::GetNode;
#[doc(hidden)]
pub type GetNodeInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl GetNodeInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetNode,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetNodeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_12 = &_input.network_id;
let input_12 =
input_12
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
})?;
let network_id = aws_smithy_http::label::fmt_string(input_12, false);
if network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
});
}
let input_13 = &_input.node_id;
let input_13 =
input_13
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "node_id",
details: "cannot be empty or unset",
})?;
let node_id = aws_smithy_http::label::fmt_string(input_13, false);
if node_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "node_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/networks/{NetworkId}/nodes/{NodeId}",
NetworkId = network_id,
NodeId = node_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(_input: &crate::input::GetNodeInput, mut output: &mut String) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_14) = &_input.member_id {
query.push_kv("memberId", &aws_smithy_http::query::fmt_string(&inner_14));
}
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetNodeInput,
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::GetNodeInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
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::GetNode::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetNode",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::get_node_input::Builder {
crate::input::get_node_input::Builder::default()
}
}
pub mod get_proposal_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) network_id: std::option::Option<std::string::String>,
pub(crate) proposal_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.network_id = Some(input.into());
self
}
pub fn set_network_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.network_id = input;
self
}
pub fn proposal_id(mut self, input: impl Into<std::string::String>) -> Self {
self.proposal_id = Some(input.into());
self
}
pub fn set_proposal_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.proposal_id = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::GetProposalInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::GetProposalInput {
network_id: self.network_id,
proposal_id: self.proposal_id,
})
}
}
}
#[doc(hidden)]
pub type GetProposalInputOperationOutputAlias = crate::operation::GetProposal;
#[doc(hidden)]
pub type GetProposalInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl GetProposalInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetProposal,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetProposalInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_15 = &_input.network_id;
let input_15 =
input_15
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
})?;
let network_id = aws_smithy_http::label::fmt_string(input_15, false);
if network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
});
}
let input_16 = &_input.proposal_id;
let input_16 =
input_16
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "proposal_id",
details: "cannot be empty or unset",
})?;
let proposal_id = aws_smithy_http::label::fmt_string(input_16, false);
if proposal_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "proposal_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/networks/{NetworkId}/proposals/{ProposalId}",
NetworkId = network_id,
ProposalId = proposal_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetProposalInput,
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::GetProposalInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
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::GetProposal::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetProposal",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::get_proposal_input::Builder {
crate::input::get_proposal_input::Builder::default()
}
}
pub mod list_invitations_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::ListInvitationsInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ListInvitationsInput {
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
#[doc(hidden)]
pub type ListInvitationsInputOperationOutputAlias = crate::operation::ListInvitations;
#[doc(hidden)]
pub type ListInvitationsInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl ListInvitationsInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListInvitations,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ListInvitationsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/invitations").expect("formatting should succeed");
Ok(())
}
fn uri_query(_input: &crate::input::ListInvitationsInput, mut output: &mut String) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_17) = &_input.max_results {
query.push_kv(
"maxResults",
&aws_smithy_types::primitive::Encoder::from(*inner_17).encode(),
);
}
if let Some(inner_18) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_18));
}
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListInvitationsInput,
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::ListInvitationsInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
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::ListInvitations::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListInvitations",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::list_invitations_input::Builder {
crate::input::list_invitations_input::Builder::default()
}
}
pub mod list_members_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) network_id: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) status: std::option::Option<crate::model::MemberStatus>,
pub(crate) is_owned: std::option::Option<bool>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.network_id = Some(input.into());
self
}
pub fn set_network_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.network_id = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn status(mut self, input: crate::model::MemberStatus) -> Self {
self.status = Some(input);
self
}
pub fn set_status(
mut self,
input: std::option::Option<crate::model::MemberStatus>,
) -> Self {
self.status = input;
self
}
pub fn is_owned(mut self, input: bool) -> Self {
self.is_owned = Some(input);
self
}
pub fn set_is_owned(mut self, input: std::option::Option<bool>) -> Self {
self.is_owned = 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::ListMembersInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ListMembersInput {
network_id: self.network_id,
name: self.name,
status: self.status,
is_owned: self.is_owned,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
#[doc(hidden)]
pub type ListMembersInputOperationOutputAlias = crate::operation::ListMembers;
#[doc(hidden)]
pub type ListMembersInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl ListMembersInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListMembers,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ListMembersInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_19 = &_input.network_id;
let input_19 =
input_19
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
})?;
let network_id = aws_smithy_http::label::fmt_string(input_19, false);
if network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/networks/{NetworkId}/members",
NetworkId = network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(_input: &crate::input::ListMembersInput, mut output: &mut String) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_20) = &_input.name {
query.push_kv("name", &aws_smithy_http::query::fmt_string(&inner_20));
}
if let Some(inner_21) = &_input.status {
query.push_kv("status", &aws_smithy_http::query::fmt_string(&inner_21));
}
if let Some(inner_22) = &_input.is_owned {
query.push_kv(
"isOwned",
&aws_smithy_types::primitive::Encoder::from(*inner_22).encode(),
);
}
if let Some(inner_23) = &_input.max_results {
query.push_kv(
"maxResults",
&aws_smithy_types::primitive::Encoder::from(*inner_23).encode(),
);
}
if let Some(inner_24) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_24));
}
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListMembersInput,
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::ListMembersInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
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::ListMembers::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListMembers",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::list_members_input::Builder {
crate::input::list_members_input::Builder::default()
}
}
pub mod list_networks_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) framework: std::option::Option<crate::model::Framework>,
pub(crate) status: std::option::Option<crate::model::NetworkStatus>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn framework(mut self, input: crate::model::Framework) -> Self {
self.framework = Some(input);
self
}
pub fn set_framework(
mut self,
input: std::option::Option<crate::model::Framework>,
) -> Self {
self.framework = input;
self
}
pub fn status(mut self, input: crate::model::NetworkStatus) -> Self {
self.status = Some(input);
self
}
pub fn set_status(
mut self,
input: std::option::Option<crate::model::NetworkStatus>,
) -> Self {
self.status = 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::ListNetworksInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ListNetworksInput {
name: self.name,
framework: self.framework,
status: self.status,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
#[doc(hidden)]
pub type ListNetworksInputOperationOutputAlias = crate::operation::ListNetworks;
#[doc(hidden)]
pub type ListNetworksInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl ListNetworksInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListNetworks,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ListNetworksInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/networks").expect("formatting should succeed");
Ok(())
}
fn uri_query(_input: &crate::input::ListNetworksInput, mut output: &mut String) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_25) = &_input.name {
query.push_kv("name", &aws_smithy_http::query::fmt_string(&inner_25));
}
if let Some(inner_26) = &_input.framework {
query.push_kv("framework", &aws_smithy_http::query::fmt_string(&inner_26));
}
if let Some(inner_27) = &_input.status {
query.push_kv("status", &aws_smithy_http::query::fmt_string(&inner_27));
}
if let Some(inner_28) = &_input.max_results {
query.push_kv(
"maxResults",
&aws_smithy_types::primitive::Encoder::from(*inner_28).encode(),
);
}
if let Some(inner_29) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_29));
}
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListNetworksInput,
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::ListNetworksInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
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::ListNetworks::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListNetworks",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::list_networks_input::Builder {
crate::input::list_networks_input::Builder::default()
}
}
pub mod list_nodes_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) network_id: std::option::Option<std::string::String>,
pub(crate) member_id: std::option::Option<std::string::String>,
pub(crate) status: std::option::Option<crate::model::NodeStatus>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.network_id = Some(input.into());
self
}
pub fn set_network_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.network_id = input;
self
}
pub fn member_id(mut self, input: impl Into<std::string::String>) -> Self {
self.member_id = Some(input.into());
self
}
pub fn set_member_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.member_id = input;
self
}
pub fn status(mut self, input: crate::model::NodeStatus) -> Self {
self.status = Some(input);
self
}
pub fn set_status(mut self, input: std::option::Option<crate::model::NodeStatus>) -> Self {
self.status = 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::ListNodesInput, aws_smithy_http::operation::BuildError>
{
Ok(crate::input::ListNodesInput {
network_id: self.network_id,
member_id: self.member_id,
status: self.status,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
#[doc(hidden)]
pub type ListNodesInputOperationOutputAlias = crate::operation::ListNodes;
#[doc(hidden)]
pub type ListNodesInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl ListNodesInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListNodes,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ListNodesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_30 = &_input.network_id;
let input_30 =
input_30
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
})?;
let network_id = aws_smithy_http::label::fmt_string(input_30, false);
if network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/networks/{NetworkId}/nodes",
NetworkId = network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(_input: &crate::input::ListNodesInput, mut output: &mut String) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_31) = &_input.member_id {
query.push_kv("memberId", &aws_smithy_http::query::fmt_string(&inner_31));
}
if let Some(inner_32) = &_input.status {
query.push_kv("status", &aws_smithy_http::query::fmt_string(&inner_32));
}
if let Some(inner_33) = &_input.max_results {
query.push_kv(
"maxResults",
&aws_smithy_types::primitive::Encoder::from(*inner_33).encode(),
);
}
if let Some(inner_34) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_34));
}
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListNodesInput,
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::ListNodesInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
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::ListNodes::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListNodes",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::list_nodes_input::Builder {
crate::input::list_nodes_input::Builder::default()
}
}
pub mod list_proposals_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) network_id: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.network_id = Some(input.into());
self
}
pub fn set_network_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.network_id = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::ListProposalsInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ListProposalsInput {
network_id: self.network_id,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
#[doc(hidden)]
pub type ListProposalsInputOperationOutputAlias = crate::operation::ListProposals;
#[doc(hidden)]
pub type ListProposalsInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl ListProposalsInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListProposals,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ListProposalsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_35 = &_input.network_id;
let input_35 =
input_35
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
})?;
let network_id = aws_smithy_http::label::fmt_string(input_35, false);
if network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/networks/{NetworkId}/proposals",
NetworkId = network_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(_input: &crate::input::ListProposalsInput, mut output: &mut String) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_36) = &_input.max_results {
query.push_kv(
"maxResults",
&aws_smithy_types::primitive::Encoder::from(*inner_36).encode(),
);
}
if let Some(inner_37) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_37));
}
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListProposalsInput,
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::ListProposalsInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
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::ListProposals::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListProposals",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::list_proposals_input::Builder {
crate::input::list_proposals_input::Builder::default()
}
}
pub mod list_proposal_votes_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) network_id: std::option::Option<std::string::String>,
pub(crate) proposal_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 network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.network_id = Some(input.into());
self
}
pub fn set_network_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.network_id = input;
self
}
pub fn proposal_id(mut self, input: impl Into<std::string::String>) -> Self {
self.proposal_id = Some(input.into());
self
}
pub fn set_proposal_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.proposal_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::ListProposalVotesInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ListProposalVotesInput {
network_id: self.network_id,
proposal_id: self.proposal_id,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
#[doc(hidden)]
pub type ListProposalVotesInputOperationOutputAlias = crate::operation::ListProposalVotes;
#[doc(hidden)]
pub type ListProposalVotesInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl ListProposalVotesInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListProposalVotes,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ListProposalVotesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_38 = &_input.network_id;
let input_38 =
input_38
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
})?;
let network_id = aws_smithy_http::label::fmt_string(input_38, false);
if network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
});
}
let input_39 = &_input.proposal_id;
let input_39 =
input_39
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "proposal_id",
details: "cannot be empty or unset",
})?;
let proposal_id = aws_smithy_http::label::fmt_string(input_39, false);
if proposal_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "proposal_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/networks/{NetworkId}/proposals/{ProposalId}/votes",
NetworkId = network_id,
ProposalId = proposal_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(_input: &crate::input::ListProposalVotesInput, mut output: &mut String) {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_40) = &_input.max_results {
query.push_kv(
"maxResults",
&aws_smithy_types::primitive::Encoder::from(*inner_40).encode(),
);
}
if let Some(inner_41) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_41));
}
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListProposalVotesInput,
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::ListProposalVotesInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
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::ListProposalVotes::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListProposalVotes",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::list_proposal_votes_input::Builder {
crate::input::list_proposal_votes_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 async 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_42 = &_input.resource_arn;
let input_42 =
input_42
.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_42, 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>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
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",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
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 reject_invitation_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) invitation_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn invitation_id(mut self, input: impl Into<std::string::String>) -> Self {
self.invitation_id = Some(input.into());
self
}
pub fn set_invitation_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.invitation_id = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::RejectInvitationInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::RejectInvitationInput {
invitation_id: self.invitation_id,
})
}
}
}
#[doc(hidden)]
pub type RejectInvitationInputOperationOutputAlias = crate::operation::RejectInvitation;
#[doc(hidden)]
pub type RejectInvitationInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl RejectInvitationInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::RejectInvitation,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::RejectInvitationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_43 = &_input.invitation_id;
let input_43 =
input_43
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "invitation_id",
details: "cannot be empty or unset",
})?;
let invitation_id = aws_smithy_http::label::fmt_string(input_43, false);
if invitation_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "invitation_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/invitations/{InvitationId}",
InvitationId = invitation_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RejectInvitationInput,
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::RejectInvitationInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
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::RejectInvitation::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RejectInvitation",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
builder.body(body).expect("should be valid request")
}
pub fn builder() -> crate::input::reject_invitation_input::Builder {
crate::input::reject_invitation_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::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> 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 async 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_44 = &_input.resource_arn;
let input_44 =
input_44
.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_44, 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>
{
#[allow(unused_mut)]
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)?;
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",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
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 async 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_45 = &_input.resource_arn;
let input_45 =
input_45
.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_45, 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_46) = &_input.tag_keys {
for inner_47 in inner_46 {
query.push_kv("tagKeys", &aws_smithy_http::query::fmt_string(&inner_47));
}
}
}
#[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>
{
#[allow(unused_mut)]
let mut builder = update_http_builder(input, http::request::Builder::new())?;
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",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
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_member_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) network_id: std::option::Option<std::string::String>,
pub(crate) member_id: std::option::Option<std::string::String>,
pub(crate) log_publishing_configuration:
std::option::Option<crate::model::MemberLogPublishingConfiguration>,
}
impl Builder {
pub fn network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.network_id = Some(input.into());
self
}
pub fn set_network_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.network_id = input;
self
}
pub fn member_id(mut self, input: impl Into<std::string::String>) -> Self {
self.member_id = Some(input.into());
self
}
pub fn set_member_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.member_id = input;
self
}
pub fn log_publishing_configuration(
mut self,
input: crate::model::MemberLogPublishingConfiguration,
) -> Self {
self.log_publishing_configuration = Some(input);
self
}
pub fn set_log_publishing_configuration(
mut self,
input: std::option::Option<crate::model::MemberLogPublishingConfiguration>,
) -> Self {
self.log_publishing_configuration = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::UpdateMemberInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::UpdateMemberInput {
network_id: self.network_id,
member_id: self.member_id,
log_publishing_configuration: self.log_publishing_configuration,
})
}
}
}
#[doc(hidden)]
pub type UpdateMemberInputOperationOutputAlias = crate::operation::UpdateMember;
#[doc(hidden)]
pub type UpdateMemberInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl UpdateMemberInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateMember,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::UpdateMemberInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_48 = &_input.network_id;
let input_48 =
input_48
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
})?;
let network_id = aws_smithy_http::label::fmt_string(input_48, false);
if network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
});
}
let input_49 = &_input.member_id;
let input_49 =
input_49
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "member_id",
details: "cannot be empty or unset",
})?;
let member_id = aws_smithy_http::label::fmt_string(input_49, false);
if member_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "member_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/networks/{NetworkId}/members/{MemberId}",
NetworkId = network_id,
MemberId = member_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateMemberInput,
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::UpdateMemberInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
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_member(&self)?;
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::UpdateMember::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateMember",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
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_member_input::Builder {
crate::input::update_member_input::Builder::default()
}
}
pub mod update_node_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) network_id: std::option::Option<std::string::String>,
pub(crate) member_id: std::option::Option<std::string::String>,
pub(crate) node_id: std::option::Option<std::string::String>,
pub(crate) log_publishing_configuration:
std::option::Option<crate::model::NodeLogPublishingConfiguration>,
}
impl Builder {
pub fn network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.network_id = Some(input.into());
self
}
pub fn set_network_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.network_id = input;
self
}
pub fn member_id(mut self, input: impl Into<std::string::String>) -> Self {
self.member_id = Some(input.into());
self
}
pub fn set_member_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.member_id = input;
self
}
pub fn node_id(mut self, input: impl Into<std::string::String>) -> Self {
self.node_id = Some(input.into());
self
}
pub fn set_node_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.node_id = input;
self
}
pub fn log_publishing_configuration(
mut self,
input: crate::model::NodeLogPublishingConfiguration,
) -> Self {
self.log_publishing_configuration = Some(input);
self
}
pub fn set_log_publishing_configuration(
mut self,
input: std::option::Option<crate::model::NodeLogPublishingConfiguration>,
) -> Self {
self.log_publishing_configuration = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::UpdateNodeInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::UpdateNodeInput {
network_id: self.network_id,
member_id: self.member_id,
node_id: self.node_id,
log_publishing_configuration: self.log_publishing_configuration,
})
}
}
}
#[doc(hidden)]
pub type UpdateNodeInputOperationOutputAlias = crate::operation::UpdateNode;
#[doc(hidden)]
pub type UpdateNodeInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl UpdateNodeInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateNode,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::UpdateNodeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_50 = &_input.network_id;
let input_50 =
input_50
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
})?;
let network_id = aws_smithy_http::label::fmt_string(input_50, false);
if network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
});
}
let input_51 = &_input.node_id;
let input_51 =
input_51
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "node_id",
details: "cannot be empty or unset",
})?;
let node_id = aws_smithy_http::label::fmt_string(input_51, false);
if node_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "node_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/networks/{NetworkId}/nodes/{NodeId}",
NetworkId = network_id,
NodeId = node_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateNodeInput,
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::UpdateNodeInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
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_node(&self)?;
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::UpdateNode::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateNode",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
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_node_input::Builder {
crate::input::update_node_input::Builder::default()
}
}
pub mod vote_on_proposal_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) network_id: std::option::Option<std::string::String>,
pub(crate) proposal_id: std::option::Option<std::string::String>,
pub(crate) voter_member_id: std::option::Option<std::string::String>,
pub(crate) vote: std::option::Option<crate::model::VoteValue>,
}
impl Builder {
pub fn network_id(mut self, input: impl Into<std::string::String>) -> Self {
self.network_id = Some(input.into());
self
}
pub fn set_network_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.network_id = input;
self
}
pub fn proposal_id(mut self, input: impl Into<std::string::String>) -> Self {
self.proposal_id = Some(input.into());
self
}
pub fn set_proposal_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.proposal_id = input;
self
}
pub fn voter_member_id(mut self, input: impl Into<std::string::String>) -> Self {
self.voter_member_id = Some(input.into());
self
}
pub fn set_voter_member_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.voter_member_id = input;
self
}
pub fn vote(mut self, input: crate::model::VoteValue) -> Self {
self.vote = Some(input);
self
}
pub fn set_vote(mut self, input: std::option::Option<crate::model::VoteValue>) -> Self {
self.vote = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::VoteOnProposalInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::VoteOnProposalInput {
network_id: self.network_id,
proposal_id: self.proposal_id,
voter_member_id: self.voter_member_id,
vote: self.vote,
})
}
}
}
#[doc(hidden)]
pub type VoteOnProposalInputOperationOutputAlias = crate::operation::VoteOnProposal;
#[doc(hidden)]
pub type VoteOnProposalInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl VoteOnProposalInput {
#[allow(clippy::let_and_return)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::VoteOnProposal,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::VoteOnProposalInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_52 = &_input.network_id;
let input_52 =
input_52
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
})?;
let network_id = aws_smithy_http::label::fmt_string(input_52, false);
if network_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "network_id",
details: "cannot be empty or unset",
});
}
let input_53 = &_input.proposal_id;
let input_53 =
input_53
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "proposal_id",
details: "cannot be empty or unset",
})?;
let proposal_id = aws_smithy_http::label::fmt_string(input_53, false);
if proposal_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "proposal_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/networks/{NetworkId}/proposals/{ProposalId}/votes",
NetworkId = network_id,
ProposalId = proposal_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::VoteOnProposalInput,
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::VoteOnProposalInput,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
#[allow(unused_mut)]
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_vote_on_proposal(&self)?;
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::VoteOnProposal::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"VoteOnProposal",
"managedblockchain",
));
let op = op.with_retry_policy(aws_http::AwsErrorRetryPolicy::new());
Ok(op)
}
fn assemble(
builder: http::request::Builder,
body: aws_smithy_http::body::SdkBody,
) -> http::request::Request<aws_smithy_http::body::SdkBody> {
let mut builder = builder;
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::vote_on_proposal_input::Builder {
crate::input::vote_on_proposal_input::Builder::default()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct VoteOnProposalInput {
pub network_id: std::option::Option<std::string::String>,
pub proposal_id: std::option::Option<std::string::String>,
pub voter_member_id: std::option::Option<std::string::String>,
pub vote: std::option::Option<crate::model::VoteValue>,
}
impl VoteOnProposalInput {
pub fn network_id(&self) -> std::option::Option<&str> {
self.network_id.as_deref()
}
pub fn proposal_id(&self) -> std::option::Option<&str> {
self.proposal_id.as_deref()
}
pub fn voter_member_id(&self) -> std::option::Option<&str> {
self.voter_member_id.as_deref()
}
pub fn vote(&self) -> std::option::Option<&crate::model::VoteValue> {
self.vote.as_ref()
}
}
impl std::fmt::Debug for VoteOnProposalInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("VoteOnProposalInput");
formatter.field("network_id", &self.network_id);
formatter.field("proposal_id", &self.proposal_id);
formatter.field("voter_member_id", &self.voter_member_id);
formatter.field("vote", &self.vote);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UpdateNodeInput {
pub network_id: std::option::Option<std::string::String>,
pub member_id: std::option::Option<std::string::String>,
pub node_id: std::option::Option<std::string::String>,
pub log_publishing_configuration:
std::option::Option<crate::model::NodeLogPublishingConfiguration>,
}
impl UpdateNodeInput {
pub fn network_id(&self) -> std::option::Option<&str> {
self.network_id.as_deref()
}
pub fn member_id(&self) -> std::option::Option<&str> {
self.member_id.as_deref()
}
pub fn node_id(&self) -> std::option::Option<&str> {
self.node_id.as_deref()
}
pub fn log_publishing_configuration(
&self,
) -> std::option::Option<&crate::model::NodeLogPublishingConfiguration> {
self.log_publishing_configuration.as_ref()
}
}
impl std::fmt::Debug for UpdateNodeInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UpdateNodeInput");
formatter.field("network_id", &self.network_id);
formatter.field("member_id", &self.member_id);
formatter.field("node_id", &self.node_id);
formatter.field(
"log_publishing_configuration",
&self.log_publishing_configuration,
);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UpdateMemberInput {
pub network_id: std::option::Option<std::string::String>,
pub member_id: std::option::Option<std::string::String>,
pub log_publishing_configuration:
std::option::Option<crate::model::MemberLogPublishingConfiguration>,
}
impl UpdateMemberInput {
pub fn network_id(&self) -> std::option::Option<&str> {
self.network_id.as_deref()
}
pub fn member_id(&self) -> std::option::Option<&str> {
self.member_id.as_deref()
}
pub fn log_publishing_configuration(
&self,
) -> std::option::Option<&crate::model::MemberLogPublishingConfiguration> {
self.log_publishing_configuration.as_ref()
}
}
impl std::fmt::Debug for UpdateMemberInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UpdateMemberInput");
formatter.field("network_id", &self.network_id);
formatter.field("member_id", &self.member_id);
formatter.field(
"log_publishing_configuration",
&self.log_publishing_configuration,
);
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 UntagResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn tag_keys(&self) -> std::option::Option<&[std::string::String]> {
self.tag_keys.as_deref()
}
}
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::collections::HashMap<std::string::String, std::string::String>>,
}
impl TagResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
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 RejectInvitationInput {
pub invitation_id: std::option::Option<std::string::String>,
}
impl RejectInvitationInput {
pub fn invitation_id(&self) -> std::option::Option<&str> {
self.invitation_id.as_deref()
}
}
impl std::fmt::Debug for RejectInvitationInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("RejectInvitationInput");
formatter.field("invitation_id", &self.invitation_id);
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 ListTagsForResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
}
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 ListProposalVotesInput {
pub network_id: std::option::Option<std::string::String>,
pub proposal_id: std::option::Option<std::string::String>,
pub max_results: std::option::Option<i32>,
pub next_token: std::option::Option<std::string::String>,
}
impl ListProposalVotesInput {
pub fn network_id(&self) -> std::option::Option<&str> {
self.network_id.as_deref()
}
pub fn proposal_id(&self) -> std::option::Option<&str> {
self.proposal_id.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
impl std::fmt::Debug for ListProposalVotesInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListProposalVotesInput");
formatter.field("network_id", &self.network_id);
formatter.field("proposal_id", &self.proposal_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 ListProposalsInput {
pub network_id: std::option::Option<std::string::String>,
pub max_results: std::option::Option<i32>,
pub next_token: std::option::Option<std::string::String>,
}
impl ListProposalsInput {
pub fn network_id(&self) -> std::option::Option<&str> {
self.network_id.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
impl std::fmt::Debug for ListProposalsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListProposalsInput");
formatter.field("network_id", &self.network_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 ListNodesInput {
pub network_id: std::option::Option<std::string::String>,
pub member_id: std::option::Option<std::string::String>,
pub status: std::option::Option<crate::model::NodeStatus>,
pub max_results: std::option::Option<i32>,
pub next_token: std::option::Option<std::string::String>,
}
impl ListNodesInput {
pub fn network_id(&self) -> std::option::Option<&str> {
self.network_id.as_deref()
}
pub fn member_id(&self) -> std::option::Option<&str> {
self.member_id.as_deref()
}
pub fn status(&self) -> std::option::Option<&crate::model::NodeStatus> {
self.status.as_ref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
impl std::fmt::Debug for ListNodesInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListNodesInput");
formatter.field("network_id", &self.network_id);
formatter.field("member_id", &self.member_id);
formatter.field("status", &self.status);
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 ListNetworksInput {
pub name: std::option::Option<std::string::String>,
pub framework: std::option::Option<crate::model::Framework>,
pub status: std::option::Option<crate::model::NetworkStatus>,
pub max_results: std::option::Option<i32>,
pub next_token: std::option::Option<std::string::String>,
}
impl ListNetworksInput {
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn framework(&self) -> std::option::Option<&crate::model::Framework> {
self.framework.as_ref()
}
pub fn status(&self) -> std::option::Option<&crate::model::NetworkStatus> {
self.status.as_ref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
impl std::fmt::Debug for ListNetworksInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListNetworksInput");
formatter.field("name", &self.name);
formatter.field("framework", &self.framework);
formatter.field("status", &self.status);
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 ListMembersInput {
pub network_id: std::option::Option<std::string::String>,
pub name: std::option::Option<std::string::String>,
pub status: std::option::Option<crate::model::MemberStatus>,
pub is_owned: std::option::Option<bool>,
pub max_results: std::option::Option<i32>,
pub next_token: std::option::Option<std::string::String>,
}
impl ListMembersInput {
pub fn network_id(&self) -> std::option::Option<&str> {
self.network_id.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn status(&self) -> std::option::Option<&crate::model::MemberStatus> {
self.status.as_ref()
}
pub fn is_owned(&self) -> std::option::Option<bool> {
self.is_owned
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
impl std::fmt::Debug for ListMembersInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListMembersInput");
formatter.field("network_id", &self.network_id);
formatter.field("name", &self.name);
formatter.field("status", &self.status);
formatter.field("is_owned", &self.is_owned);
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 ListInvitationsInput {
pub max_results: std::option::Option<i32>,
pub next_token: std::option::Option<std::string::String>,
}
impl ListInvitationsInput {
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
impl std::fmt::Debug for ListInvitationsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListInvitationsInput");
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 GetProposalInput {
pub network_id: std::option::Option<std::string::String>,
pub proposal_id: std::option::Option<std::string::String>,
}
impl GetProposalInput {
pub fn network_id(&self) -> std::option::Option<&str> {
self.network_id.as_deref()
}
pub fn proposal_id(&self) -> std::option::Option<&str> {
self.proposal_id.as_deref()
}
}
impl std::fmt::Debug for GetProposalInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetProposalInput");
formatter.field("network_id", &self.network_id);
formatter.field("proposal_id", &self.proposal_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetNodeInput {
pub network_id: std::option::Option<std::string::String>,
pub member_id: std::option::Option<std::string::String>,
pub node_id: std::option::Option<std::string::String>,
}
impl GetNodeInput {
pub fn network_id(&self) -> std::option::Option<&str> {
self.network_id.as_deref()
}
pub fn member_id(&self) -> std::option::Option<&str> {
self.member_id.as_deref()
}
pub fn node_id(&self) -> std::option::Option<&str> {
self.node_id.as_deref()
}
}
impl std::fmt::Debug for GetNodeInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetNodeInput");
formatter.field("network_id", &self.network_id);
formatter.field("member_id", &self.member_id);
formatter.field("node_id", &self.node_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetNetworkInput {
pub network_id: std::option::Option<std::string::String>,
}
impl GetNetworkInput {
pub fn network_id(&self) -> std::option::Option<&str> {
self.network_id.as_deref()
}
}
impl std::fmt::Debug for GetNetworkInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetNetworkInput");
formatter.field("network_id", &self.network_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetMemberInput {
pub network_id: std::option::Option<std::string::String>,
pub member_id: std::option::Option<std::string::String>,
}
impl GetMemberInput {
pub fn network_id(&self) -> std::option::Option<&str> {
self.network_id.as_deref()
}
pub fn member_id(&self) -> std::option::Option<&str> {
self.member_id.as_deref()
}
}
impl std::fmt::Debug for GetMemberInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetMemberInput");
formatter.field("network_id", &self.network_id);
formatter.field("member_id", &self.member_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DeleteNodeInput {
pub network_id: std::option::Option<std::string::String>,
pub member_id: std::option::Option<std::string::String>,
pub node_id: std::option::Option<std::string::String>,
}
impl DeleteNodeInput {
pub fn network_id(&self) -> std::option::Option<&str> {
self.network_id.as_deref()
}
pub fn member_id(&self) -> std::option::Option<&str> {
self.member_id.as_deref()
}
pub fn node_id(&self) -> std::option::Option<&str> {
self.node_id.as_deref()
}
}
impl std::fmt::Debug for DeleteNodeInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DeleteNodeInput");
formatter.field("network_id", &self.network_id);
formatter.field("member_id", &self.member_id);
formatter.field("node_id", &self.node_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DeleteMemberInput {
pub network_id: std::option::Option<std::string::String>,
pub member_id: std::option::Option<std::string::String>,
}
impl DeleteMemberInput {
pub fn network_id(&self) -> std::option::Option<&str> {
self.network_id.as_deref()
}
pub fn member_id(&self) -> std::option::Option<&str> {
self.member_id.as_deref()
}
}
impl std::fmt::Debug for DeleteMemberInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DeleteMemberInput");
formatter.field("network_id", &self.network_id);
formatter.field("member_id", &self.member_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreateProposalInput {
pub client_request_token: std::option::Option<std::string::String>,
pub network_id: std::option::Option<std::string::String>,
pub member_id: std::option::Option<std::string::String>,
pub actions: std::option::Option<crate::model::ProposalActions>,
pub description: std::option::Option<std::string::String>,
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl CreateProposalInput {
pub fn client_request_token(&self) -> std::option::Option<&str> {
self.client_request_token.as_deref()
}
pub fn network_id(&self) -> std::option::Option<&str> {
self.network_id.as_deref()
}
pub fn member_id(&self) -> std::option::Option<&str> {
self.member_id.as_deref()
}
pub fn actions(&self) -> std::option::Option<&crate::model::ProposalActions> {
self.actions.as_ref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
impl std::fmt::Debug for CreateProposalInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreateProposalInput");
formatter.field("client_request_token", &self.client_request_token);
formatter.field("network_id", &self.network_id);
formatter.field("member_id", &self.member_id);
formatter.field("actions", &self.actions);
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 CreateNodeInput {
pub client_request_token: std::option::Option<std::string::String>,
pub network_id: std::option::Option<std::string::String>,
pub member_id: std::option::Option<std::string::String>,
pub node_configuration: std::option::Option<crate::model::NodeConfiguration>,
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl CreateNodeInput {
pub fn client_request_token(&self) -> std::option::Option<&str> {
self.client_request_token.as_deref()
}
pub fn network_id(&self) -> std::option::Option<&str> {
self.network_id.as_deref()
}
pub fn member_id(&self) -> std::option::Option<&str> {
self.member_id.as_deref()
}
pub fn node_configuration(&self) -> std::option::Option<&crate::model::NodeConfiguration> {
self.node_configuration.as_ref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
impl std::fmt::Debug for CreateNodeInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreateNodeInput");
formatter.field("client_request_token", &self.client_request_token);
formatter.field("network_id", &self.network_id);
formatter.field("member_id", &self.member_id);
formatter.field("node_configuration", &self.node_configuration);
formatter.field("tags", &self.tags);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreateNetworkInput {
pub client_request_token: std::option::Option<std::string::String>,
pub name: std::option::Option<std::string::String>,
pub description: std::option::Option<std::string::String>,
pub framework: std::option::Option<crate::model::Framework>,
pub framework_version: std::option::Option<std::string::String>,
pub framework_configuration: std::option::Option<crate::model::NetworkFrameworkConfiguration>,
pub voting_policy: std::option::Option<crate::model::VotingPolicy>,
pub member_configuration: std::option::Option<crate::model::MemberConfiguration>,
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl CreateNetworkInput {
pub fn client_request_token(&self) -> std::option::Option<&str> {
self.client_request_token.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn framework(&self) -> std::option::Option<&crate::model::Framework> {
self.framework.as_ref()
}
pub fn framework_version(&self) -> std::option::Option<&str> {
self.framework_version.as_deref()
}
pub fn framework_configuration(
&self,
) -> std::option::Option<&crate::model::NetworkFrameworkConfiguration> {
self.framework_configuration.as_ref()
}
pub fn voting_policy(&self) -> std::option::Option<&crate::model::VotingPolicy> {
self.voting_policy.as_ref()
}
pub fn member_configuration(&self) -> std::option::Option<&crate::model::MemberConfiguration> {
self.member_configuration.as_ref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
impl std::fmt::Debug for CreateNetworkInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreateNetworkInput");
formatter.field("client_request_token", &self.client_request_token);
formatter.field("name", &self.name);
formatter.field("description", &self.description);
formatter.field("framework", &self.framework);
formatter.field("framework_version", &self.framework_version);
formatter.field("framework_configuration", &self.framework_configuration);
formatter.field("voting_policy", &self.voting_policy);
formatter.field("member_configuration", &self.member_configuration);
formatter.field("tags", &self.tags);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreateMemberInput {
pub client_request_token: std::option::Option<std::string::String>,
pub invitation_id: std::option::Option<std::string::String>,
pub network_id: std::option::Option<std::string::String>,
pub member_configuration: std::option::Option<crate::model::MemberConfiguration>,
}
impl CreateMemberInput {
pub fn client_request_token(&self) -> std::option::Option<&str> {
self.client_request_token.as_deref()
}
pub fn invitation_id(&self) -> std::option::Option<&str> {
self.invitation_id.as_deref()
}
pub fn network_id(&self) -> std::option::Option<&str> {
self.network_id.as_deref()
}
pub fn member_configuration(&self) -> std::option::Option<&crate::model::MemberConfiguration> {
self.member_configuration.as_ref()
}
}
impl std::fmt::Debug for CreateMemberInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreateMemberInput");
formatter.field("client_request_token", &self.client_request_token);
formatter.field("invitation_id", &self.invitation_id);
formatter.field("network_id", &self.network_id);
formatter.field("member_configuration", &self.member_configuration);
formatter.finish()
}
}