use std::fmt::Write;
pub mod apply_archive_rule_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) analyzer_arn: std::option::Option<std::string::String>,
pub(crate) rule_name: std::option::Option<std::string::String>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn analyzer_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_arn = Some(input.into());
self
}
pub fn set_analyzer_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.analyzer_arn = input;
self
}
pub fn rule_name(mut self, input: impl Into<std::string::String>) -> Self {
self.rule_name = Some(input.into());
self
}
pub fn set_rule_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.rule_name = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::ApplyArchiveRuleInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ApplyArchiveRuleInput {
analyzer_arn: self.analyzer_arn,
rule_name: self.rule_name,
client_token: self.client_token,
})
}
}
}
#[doc(hidden)]
pub type ApplyArchiveRuleInputOperationOutputAlias = crate::operation::ApplyArchiveRule;
#[doc(hidden)]
pub type ApplyArchiveRuleInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl ApplyArchiveRuleInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ApplyArchiveRule,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ApplyArchiveRuleInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/archive-rule").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ApplyArchiveRuleInput,
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("PUT").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::ApplyArchiveRuleInput,
) -> 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_token.is_none() {
self.client_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_apply_archive_rule(&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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::ApplyArchiveRule::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ApplyArchiveRule",
"accessanalyzer",
));
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::apply_archive_rule_input::Builder {
crate::input::apply_archive_rule_input::Builder::default()
}
}
pub mod cancel_policy_generation_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) job_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.job_id = Some(input.into());
self
}
pub fn set_job_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.job_id = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::CancelPolicyGenerationInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::CancelPolicyGenerationInput {
job_id: self.job_id,
})
}
}
}
#[doc(hidden)]
pub type CancelPolicyGenerationInputOperationOutputAlias = crate::operation::CancelPolicyGeneration;
#[doc(hidden)]
pub type CancelPolicyGenerationInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl CancelPolicyGenerationInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CancelPolicyGeneration,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::CancelPolicyGenerationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_1 = &_input.job_id;
let input_1 =
input_1
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "job_id",
details: "cannot be empty or unset",
})?;
let job_id = aws_smithy_http::label::fmt_string(input_1, false);
if job_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "job_id",
details: "cannot be empty or unset",
});
}
write!(output, "/policy/generation/{jobId}", jobId = job_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CancelPolicyGenerationInput,
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("PUT").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::CancelPolicyGenerationInput,
) -> 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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::CancelPolicyGeneration::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CancelPolicyGeneration",
"accessanalyzer",
));
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::cancel_policy_generation_input::Builder {
crate::input::cancel_policy_generation_input::Builder::default()
}
}
pub mod create_access_preview_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) analyzer_arn: std::option::Option<std::string::String>,
pub(crate) configurations: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::Configuration>,
>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn analyzer_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_arn = Some(input.into());
self
}
pub fn set_analyzer_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.analyzer_arn = input;
self
}
pub fn configurations(
mut self,
k: impl Into<std::string::String>,
v: impl Into<crate::model::Configuration>,
) -> Self {
let mut hash_map = self.configurations.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.configurations = Some(hash_map);
self
}
pub fn set_configurations(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::Configuration>,
>,
) -> Self {
self.configurations = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::CreateAccessPreviewInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::CreateAccessPreviewInput {
analyzer_arn: self.analyzer_arn,
configurations: self.configurations,
client_token: self.client_token,
})
}
}
}
#[doc(hidden)]
pub type CreateAccessPreviewInputOperationOutputAlias = crate::operation::CreateAccessPreview;
#[doc(hidden)]
pub type CreateAccessPreviewInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl CreateAccessPreviewInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateAccessPreview,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::CreateAccessPreviewInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/access-preview").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateAccessPreviewInput,
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("PUT").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::CreateAccessPreviewInput,
) -> 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_token.is_none() {
self.client_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_access_preview(&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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::CreateAccessPreview::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateAccessPreview",
"accessanalyzer",
));
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_access_preview_input::Builder {
crate::input::create_access_preview_input::Builder::default()
}
}
pub mod create_analyzer_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) analyzer_name: std::option::Option<std::string::String>,
pub(crate) r#type: std::option::Option<crate::model::Type>,
pub(crate) archive_rules:
std::option::Option<std::vec::Vec<crate::model::InlineArchiveRule>>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn analyzer_name(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_name = Some(input.into());
self
}
pub fn set_analyzer_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.analyzer_name = input;
self
}
pub fn r#type(mut self, input: crate::model::Type) -> Self {
self.r#type = Some(input);
self
}
pub fn set_type(mut self, input: std::option::Option<crate::model::Type>) -> Self {
self.r#type = input;
self
}
pub fn archive_rules(mut self, input: impl Into<crate::model::InlineArchiveRule>) -> Self {
let mut v = self.archive_rules.unwrap_or_default();
v.push(input.into());
self.archive_rules = Some(v);
self
}
pub fn set_archive_rules(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::InlineArchiveRule>>,
) -> Self {
self.archive_rules = 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 client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::CreateAnalyzerInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::CreateAnalyzerInput {
analyzer_name: self.analyzer_name,
r#type: self.r#type,
archive_rules: self.archive_rules,
tags: self.tags,
client_token: self.client_token,
})
}
}
}
#[doc(hidden)]
pub type CreateAnalyzerInputOperationOutputAlias = crate::operation::CreateAnalyzer;
#[doc(hidden)]
pub type CreateAnalyzerInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl CreateAnalyzerInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateAnalyzer,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::CreateAnalyzerInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/analyzer").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateAnalyzerInput,
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("PUT").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::CreateAnalyzerInput,
) -> 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_token.is_none() {
self.client_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_analyzer(&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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::CreateAnalyzer::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateAnalyzer",
"accessanalyzer",
));
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_analyzer_input::Builder {
crate::input::create_analyzer_input::Builder::default()
}
}
pub mod create_archive_rule_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) analyzer_name: std::option::Option<std::string::String>,
pub(crate) rule_name: std::option::Option<std::string::String>,
pub(crate) filter: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::Criterion>,
>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn analyzer_name(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_name = Some(input.into());
self
}
pub fn set_analyzer_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.analyzer_name = input;
self
}
pub fn rule_name(mut self, input: impl Into<std::string::String>) -> Self {
self.rule_name = Some(input.into());
self
}
pub fn set_rule_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.rule_name = input;
self
}
pub fn filter(
mut self,
k: impl Into<std::string::String>,
v: impl Into<crate::model::Criterion>,
) -> Self {
let mut hash_map = self.filter.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.filter = Some(hash_map);
self
}
pub fn set_filter(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::Criterion>,
>,
) -> Self {
self.filter = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::CreateArchiveRuleInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::CreateArchiveRuleInput {
analyzer_name: self.analyzer_name,
rule_name: self.rule_name,
filter: self.filter,
client_token: self.client_token,
})
}
}
}
#[doc(hidden)]
pub type CreateArchiveRuleInputOperationOutputAlias = crate::operation::CreateArchiveRule;
#[doc(hidden)]
pub type CreateArchiveRuleInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl CreateArchiveRuleInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateArchiveRule,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::CreateArchiveRuleInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_2 = &_input.analyzer_name;
let input_2 =
input_2
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "analyzer_name",
details: "cannot be empty or unset",
})?;
let analyzer_name = aws_smithy_http::label::fmt_string(input_2, false);
if analyzer_name.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "analyzer_name",
details: "cannot be empty or unset",
});
}
write!(
output,
"/analyzer/{analyzerName}/archive-rule",
analyzerName = analyzer_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateArchiveRuleInput,
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("PUT").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::CreateArchiveRuleInput,
) -> 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_token.is_none() {
self.client_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_archive_rule(&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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::CreateArchiveRule::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateArchiveRule",
"accessanalyzer",
));
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_archive_rule_input::Builder {
crate::input::create_archive_rule_input::Builder::default()
}
}
pub mod delete_analyzer_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) analyzer_name: std::option::Option<std::string::String>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn analyzer_name(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_name = Some(input.into());
self
}
pub fn set_analyzer_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.analyzer_name = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::DeleteAnalyzerInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::DeleteAnalyzerInput {
analyzer_name: self.analyzer_name,
client_token: self.client_token,
})
}
}
}
#[doc(hidden)]
pub type DeleteAnalyzerInputOperationOutputAlias = crate::operation::DeleteAnalyzer;
#[doc(hidden)]
pub type DeleteAnalyzerInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl DeleteAnalyzerInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteAnalyzer,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::DeleteAnalyzerInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_3 = &_input.analyzer_name;
let input_3 =
input_3
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "analyzer_name",
details: "cannot be empty or unset",
})?;
let analyzer_name = aws_smithy_http::label::fmt_string(input_3, false);
if analyzer_name.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "analyzer_name",
details: "cannot be empty or unset",
});
}
write!(
output,
"/analyzer/{analyzerName}",
analyzerName = analyzer_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::DeleteAnalyzerInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_4) = &_input.client_token {
query.push_kv("clientToken", &aws_smithy_http::query::fmt_string(&inner_4));
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteAnalyzerInput,
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::DeleteAnalyzerInput,
) -> 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)
}
if self.client_token.is_none() {
self.client_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 = 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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::DeleteAnalyzer::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteAnalyzer",
"accessanalyzer",
));
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_analyzer_input::Builder {
crate::input::delete_analyzer_input::Builder::default()
}
}
pub mod delete_archive_rule_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) analyzer_name: std::option::Option<std::string::String>,
pub(crate) rule_name: std::option::Option<std::string::String>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn analyzer_name(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_name = Some(input.into());
self
}
pub fn set_analyzer_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.analyzer_name = input;
self
}
pub fn rule_name(mut self, input: impl Into<std::string::String>) -> Self {
self.rule_name = Some(input.into());
self
}
pub fn set_rule_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.rule_name = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::DeleteArchiveRuleInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::DeleteArchiveRuleInput {
analyzer_name: self.analyzer_name,
rule_name: self.rule_name,
client_token: self.client_token,
})
}
}
}
#[doc(hidden)]
pub type DeleteArchiveRuleInputOperationOutputAlias = crate::operation::DeleteArchiveRule;
#[doc(hidden)]
pub type DeleteArchiveRuleInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl DeleteArchiveRuleInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteArchiveRule,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::DeleteArchiveRuleInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_5 = &_input.analyzer_name;
let input_5 =
input_5
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "analyzer_name",
details: "cannot be empty or unset",
})?;
let analyzer_name = aws_smithy_http::label::fmt_string(input_5, false);
if analyzer_name.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "analyzer_name",
details: "cannot be empty or unset",
});
}
let input_6 = &_input.rule_name;
let input_6 =
input_6
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "rule_name",
details: "cannot be empty or unset",
})?;
let rule_name = aws_smithy_http::label::fmt_string(input_6, false);
if rule_name.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "rule_name",
details: "cannot be empty or unset",
});
}
write!(
output,
"/analyzer/{analyzerName}/archive-rule/{ruleName}",
analyzerName = analyzer_name,
ruleName = rule_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::DeleteArchiveRuleInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_7) = &_input.client_token {
query.push_kv("clientToken", &aws_smithy_http::query::fmt_string(&inner_7));
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteArchiveRuleInput,
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::DeleteArchiveRuleInput,
) -> 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)
}
if self.client_token.is_none() {
self.client_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 = 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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::DeleteArchiveRule::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteArchiveRule",
"accessanalyzer",
));
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_archive_rule_input::Builder {
crate::input::delete_archive_rule_input::Builder::default()
}
}
pub mod get_access_preview_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) access_preview_id: std::option::Option<std::string::String>,
pub(crate) analyzer_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn access_preview_id(mut self, input: impl Into<std::string::String>) -> Self {
self.access_preview_id = Some(input.into());
self
}
pub fn set_access_preview_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.access_preview_id = input;
self
}
pub fn analyzer_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_arn = Some(input.into());
self
}
pub fn set_analyzer_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.analyzer_arn = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::GetAccessPreviewInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::GetAccessPreviewInput {
access_preview_id: self.access_preview_id,
analyzer_arn: self.analyzer_arn,
})
}
}
}
#[doc(hidden)]
pub type GetAccessPreviewInputOperationOutputAlias = crate::operation::GetAccessPreview;
#[doc(hidden)]
pub type GetAccessPreviewInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl GetAccessPreviewInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetAccessPreview,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetAccessPreviewInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_8 = &_input.access_preview_id;
let input_8 =
input_8
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "access_preview_id",
details: "cannot be empty or unset",
})?;
let access_preview_id = aws_smithy_http::label::fmt_string(input_8, false);
if access_preview_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "access_preview_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/access-preview/{accessPreviewId}",
accessPreviewId = access_preview_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetAccessPreviewInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_9) = &_input.analyzer_arn {
query.push_kv("analyzerArn", &aws_smithy_http::query::fmt_string(&inner_9));
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetAccessPreviewInput,
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::GetAccessPreviewInput,
) -> 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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::GetAccessPreview::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetAccessPreview",
"accessanalyzer",
));
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_access_preview_input::Builder {
crate::input::get_access_preview_input::Builder::default()
}
}
pub mod get_analyzed_resource_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) analyzer_arn: std::option::Option<std::string::String>,
pub(crate) resource_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn analyzer_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_arn = Some(input.into());
self
}
pub fn set_analyzer_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.analyzer_arn = input;
self
}
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::GetAnalyzedResourceInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::GetAnalyzedResourceInput {
analyzer_arn: self.analyzer_arn,
resource_arn: self.resource_arn,
})
}
}
}
#[doc(hidden)]
pub type GetAnalyzedResourceInputOperationOutputAlias = crate::operation::GetAnalyzedResource;
#[doc(hidden)]
pub type GetAnalyzedResourceInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl GetAnalyzedResourceInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetAnalyzedResource,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetAnalyzedResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/analyzed-resource").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetAnalyzedResourceInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_10) = &_input.analyzer_arn {
query.push_kv(
"analyzerArn",
&aws_smithy_http::query::fmt_string(&inner_10),
);
}
if let Some(inner_11) = &_input.resource_arn {
query.push_kv(
"resourceArn",
&aws_smithy_http::query::fmt_string(&inner_11),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetAnalyzedResourceInput,
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::GetAnalyzedResourceInput,
) -> 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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::GetAnalyzedResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetAnalyzedResource",
"accessanalyzer",
));
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_analyzed_resource_input::Builder {
crate::input::get_analyzed_resource_input::Builder::default()
}
}
pub mod get_analyzer_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) analyzer_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn analyzer_name(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_name = Some(input.into());
self
}
pub fn set_analyzer_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.analyzer_name = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::GetAnalyzerInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::GetAnalyzerInput {
analyzer_name: self.analyzer_name,
})
}
}
}
#[doc(hidden)]
pub type GetAnalyzerInputOperationOutputAlias = crate::operation::GetAnalyzer;
#[doc(hidden)]
pub type GetAnalyzerInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl GetAnalyzerInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetAnalyzer,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetAnalyzerInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_12 = &_input.analyzer_name;
let input_12 =
input_12
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "analyzer_name",
details: "cannot be empty or unset",
})?;
let analyzer_name = aws_smithy_http::label::fmt_string(input_12, false);
if analyzer_name.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "analyzer_name",
details: "cannot be empty or unset",
});
}
write!(
output,
"/analyzer/{analyzerName}",
analyzerName = analyzer_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetAnalyzerInput,
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::GetAnalyzerInput,
) -> 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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::GetAnalyzer::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetAnalyzer",
"accessanalyzer",
));
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_analyzer_input::Builder {
crate::input::get_analyzer_input::Builder::default()
}
}
pub mod get_archive_rule_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) analyzer_name: std::option::Option<std::string::String>,
pub(crate) rule_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn analyzer_name(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_name = Some(input.into());
self
}
pub fn set_analyzer_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.analyzer_name = input;
self
}
pub fn rule_name(mut self, input: impl Into<std::string::String>) -> Self {
self.rule_name = Some(input.into());
self
}
pub fn set_rule_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.rule_name = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::GetArchiveRuleInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::GetArchiveRuleInput {
analyzer_name: self.analyzer_name,
rule_name: self.rule_name,
})
}
}
}
#[doc(hidden)]
pub type GetArchiveRuleInputOperationOutputAlias = crate::operation::GetArchiveRule;
#[doc(hidden)]
pub type GetArchiveRuleInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl GetArchiveRuleInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetArchiveRule,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetArchiveRuleInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_13 = &_input.analyzer_name;
let input_13 =
input_13
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "analyzer_name",
details: "cannot be empty or unset",
})?;
let analyzer_name = aws_smithy_http::label::fmt_string(input_13, false);
if analyzer_name.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "analyzer_name",
details: "cannot be empty or unset",
});
}
let input_14 = &_input.rule_name;
let input_14 =
input_14
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "rule_name",
details: "cannot be empty or unset",
})?;
let rule_name = aws_smithy_http::label::fmt_string(input_14, false);
if rule_name.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "rule_name",
details: "cannot be empty or unset",
});
}
write!(
output,
"/analyzer/{analyzerName}/archive-rule/{ruleName}",
analyzerName = analyzer_name,
ruleName = rule_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetArchiveRuleInput,
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::GetArchiveRuleInput,
) -> 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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::GetArchiveRule::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetArchiveRule",
"accessanalyzer",
));
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_archive_rule_input::Builder {
crate::input::get_archive_rule_input::Builder::default()
}
}
pub mod get_finding_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) analyzer_arn: std::option::Option<std::string::String>,
pub(crate) id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn analyzer_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_arn = Some(input.into());
self
}
pub fn set_analyzer_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.analyzer_arn = input;
self
}
pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
self.id = Some(input.into());
self
}
pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.id = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::GetFindingInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::GetFindingInput {
analyzer_arn: self.analyzer_arn,
id: self.id,
})
}
}
}
#[doc(hidden)]
pub type GetFindingInputOperationOutputAlias = crate::operation::GetFinding;
#[doc(hidden)]
pub type GetFindingInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl GetFindingInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetFinding,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetFindingInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_15 = &_input.id;
let input_15 =
input_15
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "id",
details: "cannot be empty or unset",
})?;
let id = aws_smithy_http::label::fmt_string(input_15, false);
if id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "id",
details: "cannot be empty or unset",
});
}
write!(output, "/finding/{id}", id = id).expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetFindingInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_16) = &_input.analyzer_arn {
query.push_kv(
"analyzerArn",
&aws_smithy_http::query::fmt_string(&inner_16),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetFindingInput,
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::GetFindingInput,
) -> 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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::GetFinding::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetFinding",
"accessanalyzer",
));
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_finding_input::Builder {
crate::input::get_finding_input::Builder::default()
}
}
pub mod get_generated_policy_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) job_id: std::option::Option<std::string::String>,
pub(crate) include_resource_placeholders: std::option::Option<bool>,
pub(crate) include_service_level_template: std::option::Option<bool>,
}
impl Builder {
pub fn job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.job_id = Some(input.into());
self
}
pub fn set_job_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.job_id = input;
self
}
pub fn include_resource_placeholders(mut self, input: bool) -> Self {
self.include_resource_placeholders = Some(input);
self
}
pub fn set_include_resource_placeholders(
mut self,
input: std::option::Option<bool>,
) -> Self {
self.include_resource_placeholders = input;
self
}
pub fn include_service_level_template(mut self, input: bool) -> Self {
self.include_service_level_template = Some(input);
self
}
pub fn set_include_service_level_template(
mut self,
input: std::option::Option<bool>,
) -> Self {
self.include_service_level_template = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::GetGeneratedPolicyInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::GetGeneratedPolicyInput {
job_id: self.job_id,
include_resource_placeholders: self.include_resource_placeholders,
include_service_level_template: self.include_service_level_template,
})
}
}
}
#[doc(hidden)]
pub type GetGeneratedPolicyInputOperationOutputAlias = crate::operation::GetGeneratedPolicy;
#[doc(hidden)]
pub type GetGeneratedPolicyInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl GetGeneratedPolicyInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetGeneratedPolicy,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::GetGeneratedPolicyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_17 = &_input.job_id;
let input_17 =
input_17
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "job_id",
details: "cannot be empty or unset",
})?;
let job_id = aws_smithy_http::label::fmt_string(input_17, false);
if job_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "job_id",
details: "cannot be empty or unset",
});
}
write!(output, "/policy/generation/{jobId}", jobId = job_id)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetGeneratedPolicyInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_18) = &_input.include_resource_placeholders {
query.push_kv(
"includeResourcePlaceholders",
aws_smithy_types::primitive::Encoder::from(*inner_18).encode(),
);
}
if let Some(inner_19) = &_input.include_service_level_template {
query.push_kv(
"includeServiceLevelTemplate",
aws_smithy_types::primitive::Encoder::from(*inner_19).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetGeneratedPolicyInput,
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::GetGeneratedPolicyInput,
) -> 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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::GetGeneratedPolicy::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetGeneratedPolicy",
"accessanalyzer",
));
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_generated_policy_input::Builder {
crate::input::get_generated_policy_input::Builder::default()
}
}
pub mod list_access_preview_findings_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) access_preview_id: std::option::Option<std::string::String>,
pub(crate) analyzer_arn: std::option::Option<std::string::String>,
pub(crate) filter: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::Criterion>,
>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn access_preview_id(mut self, input: impl Into<std::string::String>) -> Self {
self.access_preview_id = Some(input.into());
self
}
pub fn set_access_preview_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.access_preview_id = input;
self
}
pub fn analyzer_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_arn = Some(input.into());
self
}
pub fn set_analyzer_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.analyzer_arn = input;
self
}
pub fn filter(
mut self,
k: impl Into<std::string::String>,
v: impl Into<crate::model::Criterion>,
) -> Self {
let mut hash_map = self.filter.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.filter = Some(hash_map);
self
}
pub fn set_filter(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::Criterion>,
>,
) -> Self {
self.filter = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::ListAccessPreviewFindingsInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ListAccessPreviewFindingsInput {
access_preview_id: self.access_preview_id,
analyzer_arn: self.analyzer_arn,
filter: self.filter,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
#[doc(hidden)]
pub type ListAccessPreviewFindingsInputOperationOutputAlias =
crate::operation::ListAccessPreviewFindings;
#[doc(hidden)]
pub type ListAccessPreviewFindingsInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl ListAccessPreviewFindingsInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListAccessPreviewFindings,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ListAccessPreviewFindingsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_20 = &_input.access_preview_id;
let input_20 =
input_20
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "access_preview_id",
details: "cannot be empty or unset",
})?;
let access_preview_id = aws_smithy_http::label::fmt_string(input_20, false);
if access_preview_id.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "access_preview_id",
details: "cannot be empty or unset",
});
}
write!(
output,
"/access-preview/{accessPreviewId}",
accessPreviewId = access_preview_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListAccessPreviewFindingsInput,
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::ListAccessPreviewFindingsInput,
) -> 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_list_access_preview_findings(
&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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::ListAccessPreviewFindings::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListAccessPreviewFindings",
"accessanalyzer",
));
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::list_access_preview_findings_input::Builder {
crate::input::list_access_preview_findings_input::Builder::default()
}
}
pub mod list_access_previews_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) analyzer_arn: std::option::Option<std::string::String>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn analyzer_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_arn = Some(input.into());
self
}
pub fn set_analyzer_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.analyzer_arn = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::ListAccessPreviewsInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ListAccessPreviewsInput {
analyzer_arn: self.analyzer_arn,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
#[doc(hidden)]
pub type ListAccessPreviewsInputOperationOutputAlias = crate::operation::ListAccessPreviews;
#[doc(hidden)]
pub type ListAccessPreviewsInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl ListAccessPreviewsInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListAccessPreviews,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ListAccessPreviewsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/access-preview").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListAccessPreviewsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_21) = &_input.analyzer_arn {
query.push_kv(
"analyzerArn",
&aws_smithy_http::query::fmt_string(&inner_21),
);
}
if let Some(inner_22) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_22));
}
if let Some(inner_23) = &_input.max_results {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_23).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListAccessPreviewsInput,
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::ListAccessPreviewsInput,
) -> 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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::ListAccessPreviews::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListAccessPreviews",
"accessanalyzer",
));
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_access_previews_input::Builder {
crate::input::list_access_previews_input::Builder::default()
}
}
pub mod list_analyzed_resources_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) analyzer_arn: std::option::Option<std::string::String>,
pub(crate) resource_type: std::option::Option<crate::model::ResourceType>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn analyzer_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_arn = Some(input.into());
self
}
pub fn set_analyzer_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.analyzer_arn = input;
self
}
pub fn resource_type(mut self, input: crate::model::ResourceType) -> Self {
self.resource_type = Some(input);
self
}
pub fn set_resource_type(
mut self,
input: std::option::Option<crate::model::ResourceType>,
) -> Self {
self.resource_type = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::ListAnalyzedResourcesInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ListAnalyzedResourcesInput {
analyzer_arn: self.analyzer_arn,
resource_type: self.resource_type,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
#[doc(hidden)]
pub type ListAnalyzedResourcesInputOperationOutputAlias = crate::operation::ListAnalyzedResources;
#[doc(hidden)]
pub type ListAnalyzedResourcesInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl ListAnalyzedResourcesInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListAnalyzedResources,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ListAnalyzedResourcesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/analyzed-resource").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListAnalyzedResourcesInput,
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::ListAnalyzedResourcesInput,
) -> 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_list_analyzed_resources(
&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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::ListAnalyzedResources::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListAnalyzedResources",
"accessanalyzer",
));
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::list_analyzed_resources_input::Builder {
crate::input::list_analyzed_resources_input::Builder::default()
}
}
pub mod list_analyzers_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) r#type: std::option::Option<crate::model::Type>,
}
impl Builder {
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn r#type(mut self, input: crate::model::Type) -> Self {
self.r#type = Some(input);
self
}
pub fn set_type(mut self, input: std::option::Option<crate::model::Type>) -> Self {
self.r#type = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::ListAnalyzersInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ListAnalyzersInput {
next_token: self.next_token,
max_results: self.max_results,
r#type: self.r#type,
})
}
}
}
#[doc(hidden)]
pub type ListAnalyzersInputOperationOutputAlias = crate::operation::ListAnalyzers;
#[doc(hidden)]
pub type ListAnalyzersInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl ListAnalyzersInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListAnalyzers,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ListAnalyzersInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/analyzer").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListAnalyzersInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_24) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_24));
}
if let Some(inner_25) = &_input.max_results {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_25).encode(),
);
}
if let Some(inner_26) = &_input.r#type {
query.push_kv("type", &aws_smithy_http::query::fmt_string(&inner_26));
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListAnalyzersInput,
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::ListAnalyzersInput,
) -> 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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::ListAnalyzers::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListAnalyzers",
"accessanalyzer",
));
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_analyzers_input::Builder {
crate::input::list_analyzers_input::Builder::default()
}
}
pub mod list_archive_rules_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) analyzer_name: std::option::Option<std::string::String>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn analyzer_name(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_name = Some(input.into());
self
}
pub fn set_analyzer_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.analyzer_name = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::ListArchiveRulesInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ListArchiveRulesInput {
analyzer_name: self.analyzer_name,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
#[doc(hidden)]
pub type ListArchiveRulesInputOperationOutputAlias = crate::operation::ListArchiveRules;
#[doc(hidden)]
pub type ListArchiveRulesInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl ListArchiveRulesInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListArchiveRules,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ListArchiveRulesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_27 = &_input.analyzer_name;
let input_27 =
input_27
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "analyzer_name",
details: "cannot be empty or unset",
})?;
let analyzer_name = aws_smithy_http::label::fmt_string(input_27, false);
if analyzer_name.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "analyzer_name",
details: "cannot be empty or unset",
});
}
write!(
output,
"/analyzer/{analyzerName}/archive-rule",
analyzerName = analyzer_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListArchiveRulesInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_28) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_28));
}
if let Some(inner_29) = &_input.max_results {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_29).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListArchiveRulesInput,
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::ListArchiveRulesInput,
) -> 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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::ListArchiveRules::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListArchiveRules",
"accessanalyzer",
));
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_archive_rules_input::Builder {
crate::input::list_archive_rules_input::Builder::default()
}
}
pub mod list_findings_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) analyzer_arn: std::option::Option<std::string::String>,
pub(crate) filter: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::Criterion>,
>,
pub(crate) sort: std::option::Option<crate::model::SortCriteria>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn analyzer_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_arn = Some(input.into());
self
}
pub fn set_analyzer_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.analyzer_arn = input;
self
}
pub fn filter(
mut self,
k: impl Into<std::string::String>,
v: impl Into<crate::model::Criterion>,
) -> Self {
let mut hash_map = self.filter.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.filter = Some(hash_map);
self
}
pub fn set_filter(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::Criterion>,
>,
) -> Self {
self.filter = input;
self
}
pub fn sort(mut self, input: crate::model::SortCriteria) -> Self {
self.sort = Some(input);
self
}
pub fn set_sort(mut self, input: std::option::Option<crate::model::SortCriteria>) -> Self {
self.sort = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::ListFindingsInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ListFindingsInput {
analyzer_arn: self.analyzer_arn,
filter: self.filter,
sort: self.sort,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
#[doc(hidden)]
pub type ListFindingsInputOperationOutputAlias = crate::operation::ListFindings;
#[doc(hidden)]
pub type ListFindingsInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl ListFindingsInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListFindings,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ListFindingsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/finding").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListFindingsInput,
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::ListFindingsInput,
) -> 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_list_findings(&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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::ListFindings::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListFindings",
"accessanalyzer",
));
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::list_findings_input::Builder {
crate::input::list_findings_input::Builder::default()
}
}
pub mod list_policy_generations_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) principal_arn: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn principal_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.principal_arn = Some(input.into());
self
}
pub fn set_principal_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.principal_arn = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::ListPolicyGenerationsInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ListPolicyGenerationsInput {
principal_arn: self.principal_arn,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
#[doc(hidden)]
pub type ListPolicyGenerationsInputOperationOutputAlias = crate::operation::ListPolicyGenerations;
#[doc(hidden)]
pub type ListPolicyGenerationsInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl ListPolicyGenerationsInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListPolicyGenerations,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ListPolicyGenerationsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/policy/generation").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListPolicyGenerationsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_30) = &_input.principal_arn {
query.push_kv(
"principalArn",
&aws_smithy_http::query::fmt_string(&inner_30),
);
}
if let Some(inner_31) = &_input.max_results {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_31).encode(),
);
}
if let Some(inner_32) = &_input.next_token {
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_32));
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListPolicyGenerationsInput,
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::ListPolicyGenerationsInput,
) -> 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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::ListPolicyGenerations::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListPolicyGenerations",
"accessanalyzer",
));
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_policy_generations_input::Builder {
crate::input::list_policy_generations_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)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListTagsForResource,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ListTagsForResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_33 = &_input.resource_arn;
let input_33 =
input_33
.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_33, 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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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",
"accessanalyzer",
));
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 start_policy_generation_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) policy_generation_details:
std::option::Option<crate::model::PolicyGenerationDetails>,
pub(crate) cloud_trail_details: std::option::Option<crate::model::CloudTrailDetails>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn policy_generation_details(
mut self,
input: crate::model::PolicyGenerationDetails,
) -> Self {
self.policy_generation_details = Some(input);
self
}
pub fn set_policy_generation_details(
mut self,
input: std::option::Option<crate::model::PolicyGenerationDetails>,
) -> Self {
self.policy_generation_details = input;
self
}
pub fn cloud_trail_details(mut self, input: crate::model::CloudTrailDetails) -> Self {
self.cloud_trail_details = Some(input);
self
}
pub fn set_cloud_trail_details(
mut self,
input: std::option::Option<crate::model::CloudTrailDetails>,
) -> Self {
self.cloud_trail_details = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::StartPolicyGenerationInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::StartPolicyGenerationInput {
policy_generation_details: self.policy_generation_details,
cloud_trail_details: self.cloud_trail_details,
client_token: self.client_token,
})
}
}
}
#[doc(hidden)]
pub type StartPolicyGenerationInputOperationOutputAlias = crate::operation::StartPolicyGeneration;
#[doc(hidden)]
pub type StartPolicyGenerationInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl StartPolicyGenerationInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::StartPolicyGeneration,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::StartPolicyGenerationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/policy/generation").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::StartPolicyGenerationInput,
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("PUT").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::StartPolicyGenerationInput,
) -> 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_token.is_none() {
self.client_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_start_policy_generation(
&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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::StartPolicyGeneration::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"StartPolicyGeneration",
"accessanalyzer",
));
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::start_policy_generation_input::Builder {
crate::input::start_policy_generation_input::Builder::default()
}
}
pub mod start_resource_scan_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) analyzer_arn: std::option::Option<std::string::String>,
pub(crate) resource_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn analyzer_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_arn = Some(input.into());
self
}
pub fn set_analyzer_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.analyzer_arn = input;
self
}
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::StartResourceScanInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::StartResourceScanInput {
analyzer_arn: self.analyzer_arn,
resource_arn: self.resource_arn,
})
}
}
}
#[doc(hidden)]
pub type StartResourceScanInputOperationOutputAlias = crate::operation::StartResourceScan;
#[doc(hidden)]
pub type StartResourceScanInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl StartResourceScanInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::StartResourceScan,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::StartResourceScanInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/resource/scan").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::StartResourceScanInput,
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::StartResourceScanInput,
) -> 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_start_resource_scan(&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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::StartResourceScan::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"StartResourceScan",
"accessanalyzer",
));
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::start_resource_scan_input::Builder {
crate::input::start_resource_scan_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)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::TagResource,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::TagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_34 = &_input.resource_arn;
let input_34 =
input_34
.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_34, 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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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",
"accessanalyzer",
));
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)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UntagResource,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::UntagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_35 = &_input.resource_arn;
let input_35 =
input_35
.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_35, 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,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_36) = &_input.tag_keys {
for inner_37 in inner_36 {
query.push_kv("tagKeys", &aws_smithy_http::query::fmt_string(&inner_37));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UntagResourceInput,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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",
"accessanalyzer",
));
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_archive_rule_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) analyzer_name: std::option::Option<std::string::String>,
pub(crate) rule_name: std::option::Option<std::string::String>,
pub(crate) filter: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::Criterion>,
>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn analyzer_name(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_name = Some(input.into());
self
}
pub fn set_analyzer_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.analyzer_name = input;
self
}
pub fn rule_name(mut self, input: impl Into<std::string::String>) -> Self {
self.rule_name = Some(input.into());
self
}
pub fn set_rule_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.rule_name = input;
self
}
pub fn filter(
mut self,
k: impl Into<std::string::String>,
v: impl Into<crate::model::Criterion>,
) -> Self {
let mut hash_map = self.filter.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.filter = Some(hash_map);
self
}
pub fn set_filter(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::Criterion>,
>,
) -> Self {
self.filter = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::UpdateArchiveRuleInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::UpdateArchiveRuleInput {
analyzer_name: self.analyzer_name,
rule_name: self.rule_name,
filter: self.filter,
client_token: self.client_token,
})
}
}
}
#[doc(hidden)]
pub type UpdateArchiveRuleInputOperationOutputAlias = crate::operation::UpdateArchiveRule;
#[doc(hidden)]
pub type UpdateArchiveRuleInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl UpdateArchiveRuleInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateArchiveRule,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::UpdateArchiveRuleInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
let input_38 = &_input.analyzer_name;
let input_38 =
input_38
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "analyzer_name",
details: "cannot be empty or unset",
})?;
let analyzer_name = aws_smithy_http::label::fmt_string(input_38, false);
if analyzer_name.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "analyzer_name",
details: "cannot be empty or unset",
});
}
let input_39 = &_input.rule_name;
let input_39 =
input_39
.as_ref()
.ok_or(aws_smithy_http::operation::BuildError::MissingField {
field: "rule_name",
details: "cannot be empty or unset",
})?;
let rule_name = aws_smithy_http::label::fmt_string(input_39, false);
if rule_name.is_empty() {
return Err(aws_smithy_http::operation::BuildError::MissingField {
field: "rule_name",
details: "cannot be empty or unset",
});
}
write!(
output,
"/analyzer/{analyzerName}/archive-rule/{ruleName}",
analyzerName = analyzer_name,
ruleName = rule_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateArchiveRuleInput,
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("PUT").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::UpdateArchiveRuleInput,
) -> 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_token.is_none() {
self.client_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_update_archive_rule(&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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::UpdateArchiveRule::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateArchiveRule",
"accessanalyzer",
));
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_archive_rule_input::Builder {
crate::input::update_archive_rule_input::Builder::default()
}
}
pub mod update_findings_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) analyzer_arn: std::option::Option<std::string::String>,
pub(crate) status: std::option::Option<crate::model::FindingStatusUpdate>,
pub(crate) ids: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) resource_arn: std::option::Option<std::string::String>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn analyzer_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.analyzer_arn = Some(input.into());
self
}
pub fn set_analyzer_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.analyzer_arn = input;
self
}
pub fn status(mut self, input: crate::model::FindingStatusUpdate) -> Self {
self.status = Some(input);
self
}
pub fn set_status(
mut self,
input: std::option::Option<crate::model::FindingStatusUpdate>,
) -> Self {
self.status = input;
self
}
pub fn ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.ids.unwrap_or_default();
v.push(input.into());
self.ids = Some(v);
self
}
pub fn set_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.ids = input;
self
}
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::UpdateFindingsInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::UpdateFindingsInput {
analyzer_arn: self.analyzer_arn,
status: self.status,
ids: self.ids,
resource_arn: self.resource_arn,
client_token: self.client_token,
})
}
}
}
#[doc(hidden)]
pub type UpdateFindingsInputOperationOutputAlias = crate::operation::UpdateFindings;
#[doc(hidden)]
pub type UpdateFindingsInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl UpdateFindingsInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateFindings,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::UpdateFindingsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/finding").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateFindingsInput,
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("PUT").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::UpdateFindingsInput,
) -> 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_token.is_none() {
self.client_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_update_findings(&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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::UpdateFindings::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateFindings",
"accessanalyzer",
));
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_findings_input::Builder {
crate::input::update_findings_input::Builder::default()
}
}
pub mod validate_policy_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) locale: std::option::Option<crate::model::Locale>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) policy_document: std::option::Option<std::string::String>,
pub(crate) policy_type: std::option::Option<crate::model::PolicyType>,
pub(crate) validate_policy_resource_type:
std::option::Option<crate::model::ValidatePolicyResourceType>,
}
impl Builder {
pub fn locale(mut self, input: crate::model::Locale) -> Self {
self.locale = Some(input);
self
}
pub fn set_locale(mut self, input: std::option::Option<crate::model::Locale>) -> Self {
self.locale = 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 policy_document(mut self, input: impl Into<std::string::String>) -> Self {
self.policy_document = Some(input.into());
self
}
pub fn set_policy_document(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.policy_document = input;
self
}
pub fn policy_type(mut self, input: crate::model::PolicyType) -> Self {
self.policy_type = Some(input);
self
}
pub fn set_policy_type(
mut self,
input: std::option::Option<crate::model::PolicyType>,
) -> Self {
self.policy_type = input;
self
}
pub fn validate_policy_resource_type(
mut self,
input: crate::model::ValidatePolicyResourceType,
) -> Self {
self.validate_policy_resource_type = Some(input);
self
}
pub fn set_validate_policy_resource_type(
mut self,
input: std::option::Option<crate::model::ValidatePolicyResourceType>,
) -> Self {
self.validate_policy_resource_type = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::ValidatePolicyInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ValidatePolicyInput {
locale: self.locale,
max_results: self.max_results,
next_token: self.next_token,
policy_document: self.policy_document,
policy_type: self.policy_type,
validate_policy_resource_type: self.validate_policy_resource_type,
})
}
}
}
#[doc(hidden)]
pub type ValidatePolicyInputOperationOutputAlias = crate::operation::ValidatePolicy;
#[doc(hidden)]
pub type ValidatePolicyInputOperationRetryAlias = aws_http::AwsErrorRetryPolicy;
impl ValidatePolicyInput {
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ValidatePolicy,
aws_http::AwsErrorRetryPolicy,
>,
aws_smithy_http::operation::BuildError,
> {
fn uri_base(
_input: &crate::input::ValidatePolicyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/policy/validation").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ValidatePolicyInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
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));
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ValidatePolicyInput,
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("POST").uri(uri))
}
#[allow(clippy::unnecessary_wraps)]
fn request_builder_base(
input: &crate::input::ValidatePolicyInput,
) -> 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_validate_policy(&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,
);
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
#[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::ValidatePolicy::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ValidatePolicy",
"accessanalyzer",
));
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::validate_policy_input::Builder {
crate::input::validate_policy_input::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListAnalyzersInput {
pub next_token: std::option::Option<std::string::String>,
pub max_results: std::option::Option<i32>,
pub r#type: std::option::Option<crate::model::Type>,
}
impl ListAnalyzersInput {
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn r#type(&self) -> std::option::Option<&crate::model::Type> {
self.r#type.as_ref()
}
}
impl std::fmt::Debug for ListAnalyzersInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListAnalyzersInput");
formatter.field("next_token", &self.next_token);
formatter.field("max_results", &self.max_results);
formatter.field("r#type", &self.r#type);
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreateAnalyzerInput {
pub analyzer_name: std::option::Option<std::string::String>,
pub r#type: std::option::Option<crate::model::Type>,
pub archive_rules: std::option::Option<std::vec::Vec<crate::model::InlineArchiveRule>>,
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
pub client_token: std::option::Option<std::string::String>,
}
impl CreateAnalyzerInput {
pub fn analyzer_name(&self) -> std::option::Option<&str> {
self.analyzer_name.as_deref()
}
pub fn r#type(&self) -> std::option::Option<&crate::model::Type> {
self.r#type.as_ref()
}
pub fn archive_rules(&self) -> std::option::Option<&[crate::model::InlineArchiveRule]> {
self.archive_rules.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
impl std::fmt::Debug for CreateAnalyzerInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreateAnalyzerInput");
formatter.field("analyzer_name", &self.analyzer_name);
formatter.field("r#type", &self.r#type);
formatter.field("archive_rules", &self.archive_rules);
formatter.field("tags", &self.tags);
formatter.field("client_token", &self.client_token);
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DeleteAnalyzerInput {
pub analyzer_name: std::option::Option<std::string::String>,
pub client_token: std::option::Option<std::string::String>,
}
impl DeleteAnalyzerInput {
pub fn analyzer_name(&self) -> std::option::Option<&str> {
self.analyzer_name.as_deref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
impl std::fmt::Debug for DeleteAnalyzerInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DeleteAnalyzerInput");
formatter.field("analyzer_name", &self.analyzer_name);
formatter.field("client_token", &self.client_token);
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetAnalyzerInput {
pub analyzer_name: std::option::Option<std::string::String>,
}
impl GetAnalyzerInput {
pub fn analyzer_name(&self) -> std::option::Option<&str> {
self.analyzer_name.as_deref()
}
}
impl std::fmt::Debug for GetAnalyzerInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetAnalyzerInput");
formatter.field("analyzer_name", &self.analyzer_name);
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListArchiveRulesInput {
pub analyzer_name: std::option::Option<std::string::String>,
pub next_token: std::option::Option<std::string::String>,
pub max_results: std::option::Option<i32>,
}
impl ListArchiveRulesInput {
pub fn analyzer_name(&self) -> std::option::Option<&str> {
self.analyzer_name.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
impl std::fmt::Debug for ListArchiveRulesInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListArchiveRulesInput");
formatter.field("analyzer_name", &self.analyzer_name);
formatter.field("next_token", &self.next_token);
formatter.field("max_results", &self.max_results);
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreateArchiveRuleInput {
pub analyzer_name: std::option::Option<std::string::String>,
pub rule_name: std::option::Option<std::string::String>,
pub filter: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::Criterion>,
>,
pub client_token: std::option::Option<std::string::String>,
}
impl CreateArchiveRuleInput {
pub fn analyzer_name(&self) -> std::option::Option<&str> {
self.analyzer_name.as_deref()
}
pub fn rule_name(&self) -> std::option::Option<&str> {
self.rule_name.as_deref()
}
pub fn filter(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, crate::model::Criterion>>
{
self.filter.as_ref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
impl std::fmt::Debug for CreateArchiveRuleInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreateArchiveRuleInput");
formatter.field("analyzer_name", &self.analyzer_name);
formatter.field("rule_name", &self.rule_name);
formatter.field("filter", &self.filter);
formatter.field("client_token", &self.client_token);
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DeleteArchiveRuleInput {
pub analyzer_name: std::option::Option<std::string::String>,
pub rule_name: std::option::Option<std::string::String>,
pub client_token: std::option::Option<std::string::String>,
}
impl DeleteArchiveRuleInput {
pub fn analyzer_name(&self) -> std::option::Option<&str> {
self.analyzer_name.as_deref()
}
pub fn rule_name(&self) -> std::option::Option<&str> {
self.rule_name.as_deref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
impl std::fmt::Debug for DeleteArchiveRuleInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DeleteArchiveRuleInput");
formatter.field("analyzer_name", &self.analyzer_name);
formatter.field("rule_name", &self.rule_name);
formatter.field("client_token", &self.client_token);
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UpdateArchiveRuleInput {
pub analyzer_name: std::option::Option<std::string::String>,
pub rule_name: std::option::Option<std::string::String>,
pub filter: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::Criterion>,
>,
pub client_token: std::option::Option<std::string::String>,
}
impl UpdateArchiveRuleInput {
pub fn analyzer_name(&self) -> std::option::Option<&str> {
self.analyzer_name.as_deref()
}
pub fn rule_name(&self) -> std::option::Option<&str> {
self.rule_name.as_deref()
}
pub fn filter(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, crate::model::Criterion>>
{
self.filter.as_ref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
impl std::fmt::Debug for UpdateArchiveRuleInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UpdateArchiveRuleInput");
formatter.field("analyzer_name", &self.analyzer_name);
formatter.field("rule_name", &self.rule_name);
formatter.field("filter", &self.filter);
formatter.field("client_token", &self.client_token);
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetArchiveRuleInput {
pub analyzer_name: std::option::Option<std::string::String>,
pub rule_name: std::option::Option<std::string::String>,
}
impl GetArchiveRuleInput {
pub fn analyzer_name(&self) -> std::option::Option<&str> {
self.analyzer_name.as_deref()
}
pub fn rule_name(&self) -> std::option::Option<&str> {
self.rule_name.as_deref()
}
}
impl std::fmt::Debug for GetArchiveRuleInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetArchiveRuleInput");
formatter.field("analyzer_name", &self.analyzer_name);
formatter.field("rule_name", &self.rule_name);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ValidatePolicyInput {
pub locale: std::option::Option<crate::model::Locale>,
pub max_results: std::option::Option<i32>,
pub next_token: std::option::Option<std::string::String>,
pub policy_document: std::option::Option<std::string::String>,
pub policy_type: std::option::Option<crate::model::PolicyType>,
pub validate_policy_resource_type:
std::option::Option<crate::model::ValidatePolicyResourceType>,
}
impl ValidatePolicyInput {
pub fn locale(&self) -> std::option::Option<&crate::model::Locale> {
self.locale.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()
}
pub fn policy_document(&self) -> std::option::Option<&str> {
self.policy_document.as_deref()
}
pub fn policy_type(&self) -> std::option::Option<&crate::model::PolicyType> {
self.policy_type.as_ref()
}
pub fn validate_policy_resource_type(
&self,
) -> std::option::Option<&crate::model::ValidatePolicyResourceType> {
self.validate_policy_resource_type.as_ref()
}
}
impl std::fmt::Debug for ValidatePolicyInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ValidatePolicyInput");
formatter.field("locale", &self.locale);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &self.next_token);
formatter.field("policy_document", &self.policy_document);
formatter.field("policy_type", &self.policy_type);
formatter.field(
"validate_policy_resource_type",
&self.validate_policy_resource_type,
);
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UpdateFindingsInput {
pub analyzer_arn: std::option::Option<std::string::String>,
pub status: std::option::Option<crate::model::FindingStatusUpdate>,
pub ids: std::option::Option<std::vec::Vec<std::string::String>>,
pub resource_arn: std::option::Option<std::string::String>,
pub client_token: std::option::Option<std::string::String>,
}
impl UpdateFindingsInput {
pub fn analyzer_arn(&self) -> std::option::Option<&str> {
self.analyzer_arn.as_deref()
}
pub fn status(&self) -> std::option::Option<&crate::model::FindingStatusUpdate> {
self.status.as_ref()
}
pub fn ids(&self) -> std::option::Option<&[std::string::String]> {
self.ids.as_deref()
}
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
impl std::fmt::Debug for UpdateFindingsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UpdateFindingsInput");
formatter.field("analyzer_arn", &self.analyzer_arn);
formatter.field("status", &self.status);
formatter.field("ids", &self.ids);
formatter.field("resource_arn", &self.resource_arn);
formatter.field("client_token", &self.client_token);
formatter.finish()
}
}
#[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()
}
}
#[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()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct StartResourceScanInput {
pub analyzer_arn: std::option::Option<std::string::String>,
pub resource_arn: std::option::Option<std::string::String>,
}
impl StartResourceScanInput {
pub fn analyzer_arn(&self) -> std::option::Option<&str> {
self.analyzer_arn.as_deref()
}
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
}
impl std::fmt::Debug for StartResourceScanInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("StartResourceScanInput");
formatter.field("analyzer_arn", &self.analyzer_arn);
formatter.field("resource_arn", &self.resource_arn);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct StartPolicyGenerationInput {
pub policy_generation_details: std::option::Option<crate::model::PolicyGenerationDetails>,
pub cloud_trail_details: std::option::Option<crate::model::CloudTrailDetails>,
pub client_token: std::option::Option<std::string::String>,
}
impl StartPolicyGenerationInput {
pub fn policy_generation_details(
&self,
) -> std::option::Option<&crate::model::PolicyGenerationDetails> {
self.policy_generation_details.as_ref()
}
pub fn cloud_trail_details(&self) -> std::option::Option<&crate::model::CloudTrailDetails> {
self.cloud_trail_details.as_ref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
impl std::fmt::Debug for StartPolicyGenerationInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("StartPolicyGenerationInput");
formatter.field("policy_generation_details", &self.policy_generation_details);
formatter.field("cloud_trail_details", &self.cloud_trail_details);
formatter.field("client_token", &self.client_token);
formatter.finish()
}
}
#[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 ListPolicyGenerationsInput {
pub principal_arn: std::option::Option<std::string::String>,
pub max_results: std::option::Option<i32>,
pub next_token: std::option::Option<std::string::String>,
}
impl ListPolicyGenerationsInput {
pub fn principal_arn(&self) -> std::option::Option<&str> {
self.principal_arn.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
impl std::fmt::Debug for ListPolicyGenerationsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListPolicyGenerationsInput");
formatter.field("principal_arn", &self.principal_arn);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &self.next_token);
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListFindingsInput {
pub analyzer_arn: std::option::Option<std::string::String>,
pub filter: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::Criterion>,
>,
pub sort: std::option::Option<crate::model::SortCriteria>,
pub next_token: std::option::Option<std::string::String>,
pub max_results: std::option::Option<i32>,
}
impl ListFindingsInput {
pub fn analyzer_arn(&self) -> std::option::Option<&str> {
self.analyzer_arn.as_deref()
}
pub fn filter(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, crate::model::Criterion>>
{
self.filter.as_ref()
}
pub fn sort(&self) -> std::option::Option<&crate::model::SortCriteria> {
self.sort.as_ref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
impl std::fmt::Debug for ListFindingsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListFindingsInput");
formatter.field("analyzer_arn", &self.analyzer_arn);
formatter.field("filter", &self.filter);
formatter.field("sort", &self.sort);
formatter.field("next_token", &self.next_token);
formatter.field("max_results", &self.max_results);
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListAnalyzedResourcesInput {
pub analyzer_arn: std::option::Option<std::string::String>,
pub resource_type: std::option::Option<crate::model::ResourceType>,
pub next_token: std::option::Option<std::string::String>,
pub max_results: std::option::Option<i32>,
}
impl ListAnalyzedResourcesInput {
pub fn analyzer_arn(&self) -> std::option::Option<&str> {
self.analyzer_arn.as_deref()
}
pub fn resource_type(&self) -> std::option::Option<&crate::model::ResourceType> {
self.resource_type.as_ref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
impl std::fmt::Debug for ListAnalyzedResourcesInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListAnalyzedResourcesInput");
formatter.field("analyzer_arn", &self.analyzer_arn);
formatter.field("resource_type", &self.resource_type);
formatter.field("next_token", &self.next_token);
formatter.field("max_results", &self.max_results);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListAccessPreviewsInput {
pub analyzer_arn: std::option::Option<std::string::String>,
pub next_token: std::option::Option<std::string::String>,
pub max_results: std::option::Option<i32>,
}
impl ListAccessPreviewsInput {
pub fn analyzer_arn(&self) -> std::option::Option<&str> {
self.analyzer_arn.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
impl std::fmt::Debug for ListAccessPreviewsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListAccessPreviewsInput");
formatter.field("analyzer_arn", &self.analyzer_arn);
formatter.field("next_token", &self.next_token);
formatter.field("max_results", &self.max_results);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListAccessPreviewFindingsInput {
pub access_preview_id: std::option::Option<std::string::String>,
pub analyzer_arn: std::option::Option<std::string::String>,
pub filter: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::Criterion>,
>,
pub next_token: std::option::Option<std::string::String>,
pub max_results: std::option::Option<i32>,
}
impl ListAccessPreviewFindingsInput {
pub fn access_preview_id(&self) -> std::option::Option<&str> {
self.access_preview_id.as_deref()
}
pub fn analyzer_arn(&self) -> std::option::Option<&str> {
self.analyzer_arn.as_deref()
}
pub fn filter(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, crate::model::Criterion>>
{
self.filter.as_ref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
impl std::fmt::Debug for ListAccessPreviewFindingsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListAccessPreviewFindingsInput");
formatter.field("access_preview_id", &self.access_preview_id);
formatter.field("analyzer_arn", &self.analyzer_arn);
formatter.field("filter", &self.filter);
formatter.field("next_token", &self.next_token);
formatter.field("max_results", &self.max_results);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetGeneratedPolicyInput {
pub job_id: std::option::Option<std::string::String>,
pub include_resource_placeholders: std::option::Option<bool>,
pub include_service_level_template: std::option::Option<bool>,
}
impl GetGeneratedPolicyInput {
pub fn job_id(&self) -> std::option::Option<&str> {
self.job_id.as_deref()
}
pub fn include_resource_placeholders(&self) -> std::option::Option<bool> {
self.include_resource_placeholders
}
pub fn include_service_level_template(&self) -> std::option::Option<bool> {
self.include_service_level_template
}
}
impl std::fmt::Debug for GetGeneratedPolicyInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetGeneratedPolicyInput");
formatter.field("job_id", &self.job_id);
formatter.field(
"include_resource_placeholders",
&self.include_resource_placeholders,
);
formatter.field(
"include_service_level_template",
&self.include_service_level_template,
);
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetFindingInput {
pub analyzer_arn: std::option::Option<std::string::String>,
pub id: std::option::Option<std::string::String>,
}
impl GetFindingInput {
pub fn analyzer_arn(&self) -> std::option::Option<&str> {
self.analyzer_arn.as_deref()
}
pub fn id(&self) -> std::option::Option<&str> {
self.id.as_deref()
}
}
impl std::fmt::Debug for GetFindingInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetFindingInput");
formatter.field("analyzer_arn", &self.analyzer_arn);
formatter.field("id", &self.id);
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetAnalyzedResourceInput {
pub analyzer_arn: std::option::Option<std::string::String>,
pub resource_arn: std::option::Option<std::string::String>,
}
impl GetAnalyzedResourceInput {
pub fn analyzer_arn(&self) -> std::option::Option<&str> {
self.analyzer_arn.as_deref()
}
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
}
impl std::fmt::Debug for GetAnalyzedResourceInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetAnalyzedResourceInput");
formatter.field("analyzer_arn", &self.analyzer_arn);
formatter.field("resource_arn", &self.resource_arn);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GetAccessPreviewInput {
pub access_preview_id: std::option::Option<std::string::String>,
pub analyzer_arn: std::option::Option<std::string::String>,
}
impl GetAccessPreviewInput {
pub fn access_preview_id(&self) -> std::option::Option<&str> {
self.access_preview_id.as_deref()
}
pub fn analyzer_arn(&self) -> std::option::Option<&str> {
self.analyzer_arn.as_deref()
}
}
impl std::fmt::Debug for GetAccessPreviewInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GetAccessPreviewInput");
formatter.field("access_preview_id", &self.access_preview_id);
formatter.field("analyzer_arn", &self.analyzer_arn);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreateAccessPreviewInput {
pub analyzer_arn: std::option::Option<std::string::String>,
pub configurations: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::Configuration>,
>,
pub client_token: std::option::Option<std::string::String>,
}
impl CreateAccessPreviewInput {
pub fn analyzer_arn(&self) -> std::option::Option<&str> {
self.analyzer_arn.as_deref()
}
pub fn configurations(
&self,
) -> std::option::Option<
&std::collections::HashMap<std::string::String, crate::model::Configuration>,
> {
self.configurations.as_ref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
impl std::fmt::Debug for CreateAccessPreviewInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreateAccessPreviewInput");
formatter.field("analyzer_arn", &self.analyzer_arn);
formatter.field("configurations", &self.configurations);
formatter.field("client_token", &self.client_token);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CancelPolicyGenerationInput {
pub job_id: std::option::Option<std::string::String>,
}
impl CancelPolicyGenerationInput {
pub fn job_id(&self) -> std::option::Option<&str> {
self.job_id.as_deref()
}
}
impl std::fmt::Debug for CancelPolicyGenerationInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CancelPolicyGenerationInput");
formatter.field("job_id", &self.job_id);
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ApplyArchiveRuleInput {
pub analyzer_arn: std::option::Option<std::string::String>,
pub rule_name: std::option::Option<std::string::String>,
pub client_token: std::option::Option<std::string::String>,
}
impl ApplyArchiveRuleInput {
pub fn analyzer_arn(&self) -> std::option::Option<&str> {
self.analyzer_arn.as_deref()
}
pub fn rule_name(&self) -> std::option::Option<&str> {
self.rule_name.as_deref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
impl std::fmt::Debug for ApplyArchiveRuleInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ApplyArchiveRuleInput");
formatter.field("analyzer_arn", &self.analyzer_arn);
formatter.field("rule_name", &self.rule_name);
formatter.field("client_token", &self.client_token);
formatter.finish()
}
}