use std::fmt::Write;
pub mod add_notification_channels_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
pub(crate) channels: std::option::Option<std::vec::Vec<crate::model::Channel>>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn channels(mut self, input: crate::model::Channel) -> Self {
let mut v = self.channels.unwrap_or_default();
v.push(input);
self.channels = Some(v);
self
}
pub fn set_channels(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Channel>>,
) -> Self {
self.channels = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::AddNotificationChannelsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::AddNotificationChannelsInput {
profiling_group_name: self.profiling_group_name,
channels: self.channels,
})
}
}
}
impl AddNotificationChannelsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::AddNotificationChannels,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::AddNotificationChannelsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_1 = &_input.profiling_group_name;
let input_1 = input_1.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
)
})?;
let profiling_group_name = aws_smithy_http::label::fmt_string(
input_1,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profiling_group_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/profilingGroups/{profilingGroupName}/notificationConfiguration",
profilingGroupName = profiling_group_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::AddNotificationChannelsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_add_notification_channels(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::AddNotificationChannels::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"AddNotificationChannels",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::add_notification_channels_input::Builder {
crate::input::add_notification_channels_input::Builder::default()
}
}
pub mod batch_get_frame_metric_data_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
pub(crate) start_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) end_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) period: std::option::Option<std::string::String>,
pub(crate) target_resolution: std::option::Option<crate::model::AggregationPeriod>,
pub(crate) frame_metrics: std::option::Option<std::vec::Vec<crate::model::FrameMetric>>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn start_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.start_time = Some(input);
self
}
pub fn set_start_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.start_time = input;
self
}
pub fn end_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.end_time = Some(input);
self
}
pub fn set_end_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.end_time = input;
self
}
pub fn period(mut self, input: impl Into<std::string::String>) -> Self {
self.period = Some(input.into());
self
}
pub fn set_period(mut self, input: std::option::Option<std::string::String>) -> Self {
self.period = input;
self
}
pub fn target_resolution(mut self, input: crate::model::AggregationPeriod) -> Self {
self.target_resolution = Some(input);
self
}
pub fn set_target_resolution(
mut self,
input: std::option::Option<crate::model::AggregationPeriod>,
) -> Self {
self.target_resolution = input;
self
}
pub fn frame_metrics(mut self, input: crate::model::FrameMetric) -> Self {
let mut v = self.frame_metrics.unwrap_or_default();
v.push(input);
self.frame_metrics = Some(v);
self
}
pub fn set_frame_metrics(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::FrameMetric>>,
) -> Self {
self.frame_metrics = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::BatchGetFrameMetricDataInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::BatchGetFrameMetricDataInput {
profiling_group_name: self.profiling_group_name,
start_time: self.start_time,
end_time: self.end_time,
period: self.period,
target_resolution: self.target_resolution,
frame_metrics: self.frame_metrics,
})
}
}
}
impl BatchGetFrameMetricDataInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::BatchGetFrameMetricData,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::BatchGetFrameMetricDataInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_2 = &_input.profiling_group_name;
let input_2 = input_2.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
)
})?;
let profiling_group_name = aws_smithy_http::label::fmt_string(
input_2,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profiling_group_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/profilingGroups/{profilingGroupName}/frames/-/metrics",
profilingGroupName = profiling_group_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::BatchGetFrameMetricDataInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_3) = &_input.start_time {
{
query.push_kv(
"startTime",
&aws_smithy_http::query::fmt_timestamp(
inner_3,
aws_smithy_types::date_time::Format::DateTime,
)?,
);
}
}
if let Some(inner_4) = &_input.end_time {
{
query.push_kv(
"endTime",
&aws_smithy_http::query::fmt_timestamp(
inner_4,
aws_smithy_types::date_time::Format::DateTime,
)?,
);
}
}
if let Some(inner_5) = &_input.period {
{
query.push_kv("period", &aws_smithy_http::query::fmt_string(&inner_5));
}
}
if let Some(inner_6) = &_input.target_resolution {
{
query.push_kv(
"targetResolution",
&aws_smithy_http::query::fmt_string(&inner_6),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::BatchGetFrameMetricDataInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_batch_get_frame_metric_data(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::BatchGetFrameMetricData::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"BatchGetFrameMetricData",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::batch_get_frame_metric_data_input::Builder {
crate::input::batch_get_frame_metric_data_input::Builder::default()
}
}
pub mod configure_agent_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
pub(crate) fleet_instance_id: std::option::Option<std::string::String>,
pub(crate) metadata: std::option::Option<
std::collections::HashMap<crate::model::MetadataField, std::string::String>,
>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn fleet_instance_id(mut self, input: impl Into<std::string::String>) -> Self {
self.fleet_instance_id = Some(input.into());
self
}
pub fn set_fleet_instance_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.fleet_instance_id = input;
self
}
pub fn metadata(
mut self,
k: crate::model::MetadataField,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.metadata.unwrap_or_default();
hash_map.insert(k, v.into());
self.metadata = Some(hash_map);
self
}
pub fn set_metadata(
mut self,
input: std::option::Option<
std::collections::HashMap<crate::model::MetadataField, std::string::String>,
>,
) -> Self {
self.metadata = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ConfigureAgentInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ConfigureAgentInput {
profiling_group_name: self.profiling_group_name,
fleet_instance_id: self.fleet_instance_id,
metadata: self.metadata,
})
}
}
}
impl ConfigureAgentInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ConfigureAgent,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ConfigureAgentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_7 = &_input.profiling_group_name;
let input_7 = input_7.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
)
})?;
let profiling_group_name = aws_smithy_http::label::fmt_string(
input_7,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profiling_group_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/profilingGroups/{profilingGroupName}/configureAgent",
profilingGroupName = profiling_group_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ConfigureAgentInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_configure_agent(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ConfigureAgent::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ConfigureAgent",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::configure_agent_input::Builder {
crate::input::configure_agent_input::Builder::default()
}
}
pub mod create_profiling_group_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
pub(crate) compute_platform: std::option::Option<crate::model::ComputePlatform>,
pub(crate) client_token: std::option::Option<std::string::String>,
pub(crate) agent_orchestration_config:
std::option::Option<crate::model::AgentOrchestrationConfig>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn compute_platform(mut self, input: crate::model::ComputePlatform) -> Self {
self.compute_platform = Some(input);
self
}
pub fn set_compute_platform(
mut self,
input: std::option::Option<crate::model::ComputePlatform>,
) -> Self {
self.compute_platform = 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 agent_orchestration_config(
mut self,
input: crate::model::AgentOrchestrationConfig,
) -> Self {
self.agent_orchestration_config = Some(input);
self
}
pub fn set_agent_orchestration_config(
mut self,
input: std::option::Option<crate::model::AgentOrchestrationConfig>,
) -> Self {
self.agent_orchestration_config = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateProfilingGroupInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateProfilingGroupInput {
profiling_group_name: self.profiling_group_name,
compute_platform: self.compute_platform,
client_token: self.client_token,
agent_orchestration_config: self.agent_orchestration_config,
tags: self.tags,
})
}
}
}
impl CreateProfilingGroupInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateProfilingGroup,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
if self.client_token.is_none() {
self.client_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::CreateProfilingGroupInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/profilingGroups").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::CreateProfilingGroupInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_8 = &_input.client_token;
let inner_8 = inner_8.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"client_token",
"cannot be empty or unset",
)
})?;
if inner_8.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"client_token",
"cannot be empty or unset",
),
);
}
query.push_kv("clientToken", &aws_smithy_http::query::fmt_string(&inner_8));
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateProfilingGroupInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_profiling_group(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateProfilingGroup::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateProfilingGroup",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_profiling_group_input::Builder {
crate::input::create_profiling_group_input::Builder::default()
}
}
pub mod delete_profiling_group_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteProfilingGroupInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteProfilingGroupInput {
profiling_group_name: self.profiling_group_name,
})
}
}
}
impl DeleteProfilingGroupInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteProfilingGroup,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteProfilingGroupInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_9 = &_input.profiling_group_name;
let input_9 = input_9.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
)
})?;
let profiling_group_name = aws_smithy_http::label::fmt_string(
input_9,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profiling_group_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/profilingGroups/{profilingGroupName}",
profilingGroupName = profiling_group_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteProfilingGroupInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteProfilingGroup::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteProfilingGroup",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_profiling_group_input::Builder {
crate::input::delete_profiling_group_input::Builder::default()
}
}
pub mod describe_profiling_group_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeProfilingGroupInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeProfilingGroupInput {
profiling_group_name: self.profiling_group_name,
})
}
}
}
impl DescribeProfilingGroupInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DescribeProfilingGroup,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DescribeProfilingGroupInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_10 = &_input.profiling_group_name;
let input_10 = input_10.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
)
})?;
let profiling_group_name = aws_smithy_http::label::fmt_string(
input_10,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profiling_group_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/profilingGroups/{profilingGroupName}",
profilingGroupName = profiling_group_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeProfilingGroupInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DescribeProfilingGroup::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeProfilingGroup",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_profiling_group_input::Builder {
crate::input::describe_profiling_group_input::Builder::default()
}
}
pub mod get_findings_report_account_summary_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) daily_reports_only: std::option::Option<bool>,
}
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 daily_reports_only(mut self, input: bool) -> Self {
self.daily_reports_only = Some(input);
self
}
pub fn set_daily_reports_only(mut self, input: std::option::Option<bool>) -> Self {
self.daily_reports_only = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetFindingsReportAccountSummaryInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetFindingsReportAccountSummaryInput {
next_token: self.next_token,
max_results: self.max_results,
daily_reports_only: self.daily_reports_only,
})
}
}
}
impl GetFindingsReportAccountSummaryInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetFindingsReportAccountSummary,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetFindingsReportAccountSummaryInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/internal/findingsReports").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetFindingsReportAccountSummaryInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_11) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_11));
}
}
if let Some(inner_12) = &_input.max_results {
if *inner_12 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_12).encode(),
);
}
}
if let Some(inner_13) = &_input.daily_reports_only {
if *inner_13 {
query.push_kv(
"dailyReportsOnly",
aws_smithy_types::primitive::Encoder::from(*inner_13).encode(),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetFindingsReportAccountSummaryInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetFindingsReportAccountSummary::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetFindingsReportAccountSummary",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_findings_report_account_summary_input::Builder {
crate::input::get_findings_report_account_summary_input::Builder::default()
}
}
pub mod get_notification_configuration_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetNotificationConfigurationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetNotificationConfigurationInput {
profiling_group_name: self.profiling_group_name,
})
}
}
}
impl GetNotificationConfigurationInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetNotificationConfiguration,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetNotificationConfigurationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_14 = &_input.profiling_group_name;
let input_14 = input_14.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
)
})?;
let profiling_group_name = aws_smithy_http::label::fmt_string(
input_14,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profiling_group_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/profilingGroups/{profilingGroupName}/notificationConfiguration",
profilingGroupName = profiling_group_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetNotificationConfigurationInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetNotificationConfiguration::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetNotificationConfiguration",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_notification_configuration_input::Builder {
crate::input::get_notification_configuration_input::Builder::default()
}
}
pub mod get_policy_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetPolicyInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetPolicyInput {
profiling_group_name: self.profiling_group_name,
})
}
}
}
impl GetPolicyInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetPolicy,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetPolicyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_15 = &_input.profiling_group_name;
let input_15 = input_15.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
)
})?;
let profiling_group_name = aws_smithy_http::label::fmt_string(
input_15,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profiling_group_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/profilingGroups/{profilingGroupName}/policy",
profilingGroupName = profiling_group_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetPolicyInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::GetPolicy::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetPolicy",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_policy_input::Builder {
crate::input::get_policy_input::Builder::default()
}
}
pub mod get_profile_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
pub(crate) start_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) period: std::option::Option<std::string::String>,
pub(crate) end_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) max_depth: std::option::Option<i32>,
pub(crate) accept: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn start_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.start_time = Some(input);
self
}
pub fn set_start_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.start_time = input;
self
}
pub fn period(mut self, input: impl Into<std::string::String>) -> Self {
self.period = Some(input.into());
self
}
pub fn set_period(mut self, input: std::option::Option<std::string::String>) -> Self {
self.period = input;
self
}
pub fn end_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.end_time = Some(input);
self
}
pub fn set_end_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.end_time = input;
self
}
pub fn max_depth(mut self, input: i32) -> Self {
self.max_depth = Some(input);
self
}
pub fn set_max_depth(mut self, input: std::option::Option<i32>) -> Self {
self.max_depth = input;
self
}
pub fn accept(mut self, input: impl Into<std::string::String>) -> Self {
self.accept = Some(input.into());
self
}
pub fn set_accept(mut self, input: std::option::Option<std::string::String>) -> Self {
self.accept = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetProfileInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetProfileInput {
profiling_group_name: self.profiling_group_name,
start_time: self.start_time,
period: self.period,
end_time: self.end_time,
max_depth: self.max_depth,
accept: self.accept,
})
}
}
}
impl GetProfileInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetProfile,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetProfileInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_16 = &_input.profiling_group_name;
let input_16 = input_16.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
)
})?;
let profiling_group_name = aws_smithy_http::label::fmt_string(
input_16,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profiling_group_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/profilingGroups/{profilingGroupName}/profile",
profilingGroupName = profiling_group_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetProfileInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_17) = &_input.start_time {
{
query.push_kv(
"startTime",
&aws_smithy_http::query::fmt_timestamp(
inner_17,
aws_smithy_types::date_time::Format::DateTime,
)?,
);
}
}
if let Some(inner_18) = &_input.period {
{
query.push_kv("period", &aws_smithy_http::query::fmt_string(&inner_18));
}
}
if let Some(inner_19) = &_input.end_time {
{
query.push_kv(
"endTime",
&aws_smithy_http::query::fmt_timestamp(
inner_19,
aws_smithy_types::date_time::Format::DateTime,
)?,
);
}
}
if let Some(inner_20) = &_input.max_depth {
if *inner_20 != 0 {
query.push_kv(
"maxDepth",
aws_smithy_types::primitive::Encoder::from(*inner_20).encode(),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetProfileInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
let builder = crate::http_serde::add_headers_get_profile(input, builder)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetProfile::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetProfile",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_profile_input::Builder {
crate::input::get_profile_input::Builder::default()
}
}
pub mod get_recommendations_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
pub(crate) start_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) end_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) locale: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn start_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.start_time = Some(input);
self
}
pub fn set_start_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.start_time = input;
self
}
pub fn end_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.end_time = Some(input);
self
}
pub fn set_end_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.end_time = input;
self
}
pub fn locale(mut self, input: impl Into<std::string::String>) -> Self {
self.locale = Some(input.into());
self
}
pub fn set_locale(mut self, input: std::option::Option<std::string::String>) -> Self {
self.locale = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetRecommendationsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetRecommendationsInput {
profiling_group_name: self.profiling_group_name,
start_time: self.start_time,
end_time: self.end_time,
locale: self.locale,
})
}
}
}
impl GetRecommendationsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetRecommendations,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetRecommendationsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_21 = &_input.profiling_group_name;
let input_21 = input_21.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
)
})?;
let profiling_group_name = aws_smithy_http::label::fmt_string(
input_21,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profiling_group_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/internal/profilingGroups/{profilingGroupName}/recommendations",
profilingGroupName = profiling_group_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetRecommendationsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_22 = &_input.start_time;
let inner_22 = inner_22.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"start_time",
"cannot be empty or unset",
)
})?;
query.push_kv(
"startTime",
&aws_smithy_http::query::fmt_timestamp(
inner_22,
aws_smithy_types::date_time::Format::DateTime,
)?,
);
let inner_23 = &_input.end_time;
let inner_23 = inner_23.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"end_time",
"cannot be empty or unset",
)
})?;
query.push_kv(
"endTime",
&aws_smithy_http::query::fmt_timestamp(
inner_23,
aws_smithy_types::date_time::Format::DateTime,
)?,
);
if let Some(inner_24) = &_input.locale {
{
query.push_kv("locale", &aws_smithy_http::query::fmt_string(&inner_24));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetRecommendationsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetRecommendations::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetRecommendations",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_recommendations_input::Builder {
crate::input::get_recommendations_input::Builder::default()
}
}
pub mod list_findings_reports_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
pub(crate) start_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) end_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) daily_reports_only: std::option::Option<bool>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn start_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.start_time = Some(input);
self
}
pub fn set_start_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.start_time = input;
self
}
pub fn end_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.end_time = Some(input);
self
}
pub fn set_end_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.end_time = 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 daily_reports_only(mut self, input: bool) -> Self {
self.daily_reports_only = Some(input);
self
}
pub fn set_daily_reports_only(mut self, input: std::option::Option<bool>) -> Self {
self.daily_reports_only = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListFindingsReportsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListFindingsReportsInput {
profiling_group_name: self.profiling_group_name,
start_time: self.start_time,
end_time: self.end_time,
next_token: self.next_token,
max_results: self.max_results,
daily_reports_only: self.daily_reports_only,
})
}
}
}
impl ListFindingsReportsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListFindingsReports,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListFindingsReportsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_25 = &_input.profiling_group_name;
let input_25 = input_25.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
)
})?;
let profiling_group_name = aws_smithy_http::label::fmt_string(
input_25,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profiling_group_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/internal/profilingGroups/{profilingGroupName}/findingsReports",
profilingGroupName = profiling_group_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListFindingsReportsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_26 = &_input.start_time;
let inner_26 = inner_26.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"start_time",
"cannot be empty or unset",
)
})?;
query.push_kv(
"startTime",
&aws_smithy_http::query::fmt_timestamp(
inner_26,
aws_smithy_types::date_time::Format::DateTime,
)?,
);
let inner_27 = &_input.end_time;
let inner_27 = inner_27.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"end_time",
"cannot be empty or unset",
)
})?;
query.push_kv(
"endTime",
&aws_smithy_http::query::fmt_timestamp(
inner_27,
aws_smithy_types::date_time::Format::DateTime,
)?,
);
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 {
if *inner_29 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_29).encode(),
);
}
}
if let Some(inner_30) = &_input.daily_reports_only {
if *inner_30 {
query.push_kv(
"dailyReportsOnly",
aws_smithy_types::primitive::Encoder::from(*inner_30).encode(),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListFindingsReportsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListFindingsReports::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListFindingsReports",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_findings_reports_input::Builder {
crate::input::list_findings_reports_input::Builder::default()
}
}
pub mod list_profile_times_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
pub(crate) start_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) end_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) period: std::option::Option<crate::model::AggregationPeriod>,
pub(crate) order_by: std::option::Option<crate::model::OrderBy>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn start_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.start_time = Some(input);
self
}
pub fn set_start_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.start_time = input;
self
}
pub fn end_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.end_time = Some(input);
self
}
pub fn set_end_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.end_time = input;
self
}
pub fn period(mut self, input: crate::model::AggregationPeriod) -> Self {
self.period = Some(input);
self
}
pub fn set_period(
mut self,
input: std::option::Option<crate::model::AggregationPeriod>,
) -> Self {
self.period = input;
self
}
pub fn order_by(mut self, input: crate::model::OrderBy) -> Self {
self.order_by = Some(input);
self
}
pub fn set_order_by(mut self, input: std::option::Option<crate::model::OrderBy>) -> Self {
self.order_by = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListProfileTimesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListProfileTimesInput {
profiling_group_name: self.profiling_group_name,
start_time: self.start_time,
end_time: self.end_time,
period: self.period,
order_by: self.order_by,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl ListProfileTimesInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListProfileTimes,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListProfileTimesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_31 = &_input.profiling_group_name;
let input_31 = input_31.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
)
})?;
let profiling_group_name = aws_smithy_http::label::fmt_string(
input_31,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profiling_group_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/profilingGroups/{profilingGroupName}/profileTimes",
profilingGroupName = profiling_group_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListProfileTimesInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_32 = &_input.start_time;
let inner_32 = inner_32.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"start_time",
"cannot be empty or unset",
)
})?;
query.push_kv(
"startTime",
&aws_smithy_http::query::fmt_timestamp(
inner_32,
aws_smithy_types::date_time::Format::DateTime,
)?,
);
let inner_33 = &_input.end_time;
let inner_33 = inner_33.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"end_time",
"cannot be empty or unset",
)
})?;
query.push_kv(
"endTime",
&aws_smithy_http::query::fmt_timestamp(
inner_33,
aws_smithy_types::date_time::Format::DateTime,
)?,
);
let inner_34 = &_input.period;
let inner_34 = inner_34.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"period",
"cannot be empty or unset",
)
})?;
query.push_kv("period", &aws_smithy_http::query::fmt_string(&inner_34));
if let Some(inner_35) = &_input.order_by {
{
query.push_kv("orderBy", &aws_smithy_http::query::fmt_string(&inner_35));
}
}
if let Some(inner_36) = &_input.max_results {
if *inner_36 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_36).encode(),
);
}
}
if let Some(inner_37) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_37));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListProfileTimesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListProfileTimes::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListProfileTimes",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_profile_times_input::Builder {
crate::input::list_profile_times_input::Builder::default()
}
}
pub mod list_profiling_groups_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) include_description: std::option::Option<bool>,
}
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 include_description(mut self, input: bool) -> Self {
self.include_description = Some(input);
self
}
pub fn set_include_description(mut self, input: std::option::Option<bool>) -> Self {
self.include_description = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListProfilingGroupsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListProfilingGroupsInput {
next_token: self.next_token,
max_results: self.max_results,
include_description: self.include_description,
})
}
}
}
impl ListProfilingGroupsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListProfilingGroups,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListProfilingGroupsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/profilingGroups").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListProfilingGroupsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_38) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_38));
}
}
if let Some(inner_39) = &_input.max_results {
if *inner_39 != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(*inner_39).encode(),
);
}
}
if let Some(inner_40) = &_input.include_description {
if *inner_40 {
query.push_kv(
"includeDescription",
aws_smithy_types::primitive::Encoder::from(*inner_40).encode(),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListProfilingGroupsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListProfilingGroups::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListProfilingGroups",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_profiling_groups_input::Builder {
crate::input::list_profiling_groups_input::Builder::default()
}
}
pub mod list_tags_for_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListTagsForResourceInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListTagsForResourceInput {
resource_arn: self.resource_arn,
})
}
}
}
impl ListTagsForResourceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListTagsForResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListTagsForResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_41 = &_input.resource_arn;
let input_41 = input_41.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
)
})?;
let resource_arn = aws_smithy_http::label::fmt_string(
input_41,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/tags/{resourceArn}", resourceArn = resource_arn)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListTagsForResourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListTagsForResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListTagsForResource",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_tags_for_resource_input::Builder {
crate::input::list_tags_for_resource_input::Builder::default()
}
}
pub mod post_agent_profile_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
pub(crate) agent_profile: std::option::Option<aws_smithy_types::Blob>,
pub(crate) profile_token: std::option::Option<std::string::String>,
pub(crate) content_type: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn agent_profile(mut self, input: aws_smithy_types::Blob) -> Self {
self.agent_profile = Some(input);
self
}
pub fn set_agent_profile(
mut self,
input: std::option::Option<aws_smithy_types::Blob>,
) -> Self {
self.agent_profile = input;
self
}
pub fn profile_token(mut self, input: impl Into<std::string::String>) -> Self {
self.profile_token = Some(input.into());
self
}
pub fn set_profile_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profile_token = input;
self
}
pub fn content_type(mut self, input: impl Into<std::string::String>) -> Self {
self.content_type = Some(input.into());
self
}
pub fn set_content_type(mut self, input: std::option::Option<std::string::String>) -> Self {
self.content_type = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::PostAgentProfileInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::PostAgentProfileInput {
profiling_group_name: self.profiling_group_name,
agent_profile: self.agent_profile,
profile_token: self.profile_token,
content_type: self.content_type,
})
}
}
}
impl PostAgentProfileInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::PostAgentProfile,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
if self.profile_token.is_none() {
self.profile_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::PostAgentProfileInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_42 = &_input.profiling_group_name;
let input_42 = input_42.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
)
})?;
let profiling_group_name = aws_smithy_http::label::fmt_string(
input_42,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profiling_group_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/profilingGroups/{profilingGroupName}/agentProfile",
profilingGroupName = profiling_group_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::PostAgentProfileInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_43) = &_input.profile_token {
{
query.push_kv(
"profileToken",
&aws_smithy_http::query::fmt_string(&inner_43),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PostAgentProfileInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
let builder = crate::http_serde::add_headers_post_agent_profile(input, builder)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/octet-stream",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_payload_post_agent_profile_input(self.agent_profile)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::PostAgentProfile::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PostAgentProfile",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::post_agent_profile_input::Builder {
crate::input::post_agent_profile_input::Builder::default()
}
}
pub mod put_permission_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
pub(crate) action_group: std::option::Option<crate::model::ActionGroup>,
pub(crate) principals: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) revision_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn action_group(mut self, input: crate::model::ActionGroup) -> Self {
self.action_group = Some(input);
self
}
pub fn set_action_group(
mut self,
input: std::option::Option<crate::model::ActionGroup>,
) -> Self {
self.action_group = input;
self
}
pub fn principals(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.principals.unwrap_or_default();
v.push(input.into());
self.principals = Some(v);
self
}
pub fn set_principals(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.principals = input;
self
}
pub fn revision_id(mut self, input: impl Into<std::string::String>) -> Self {
self.revision_id = Some(input.into());
self
}
pub fn set_revision_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.revision_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::PutPermissionInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::PutPermissionInput {
profiling_group_name: self.profiling_group_name,
action_group: self.action_group,
principals: self.principals,
revision_id: self.revision_id,
})
}
}
}
impl PutPermissionInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::PutPermission,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::PutPermissionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_44 = &_input.profiling_group_name;
let input_44 = input_44.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
)
})?;
let profiling_group_name = aws_smithy_http::label::fmt_string(
input_44,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profiling_group_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
),
);
}
let input_45 = &_input.action_group;
let input_45 = input_45.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"action_group",
"cannot be empty or unset",
)
})?;
let action_group = aws_smithy_http::label::fmt_string(
input_45,
aws_smithy_http::label::EncodingStrategy::Default,
);
if action_group.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"action_group",
"cannot be empty or unset",
),
);
}
write!(
output,
"/profilingGroups/{profilingGroupName}/policy/{actionGroup}",
profilingGroupName = profiling_group_name,
actionGroup = action_group
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PutPermissionInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_put_permission(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::PutPermission::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PutPermission",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::put_permission_input::Builder {
crate::input::put_permission_input::Builder::default()
}
}
pub mod remove_notification_channel_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
pub(crate) channel_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn channel_id(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_id = Some(input.into());
self
}
pub fn set_channel_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::RemoveNotificationChannelInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::RemoveNotificationChannelInput {
profiling_group_name: self.profiling_group_name,
channel_id: self.channel_id,
})
}
}
}
impl RemoveNotificationChannelInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::RemoveNotificationChannel,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::RemoveNotificationChannelInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_46 = &_input.profiling_group_name;
let input_46 = input_46.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
)
})?;
let profiling_group_name = aws_smithy_http::label::fmt_string(
input_46,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profiling_group_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
),
);
}
let input_47 = &_input.channel_id;
let input_47 = input_47.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_id",
"cannot be empty or unset",
)
})?;
let channel_id = aws_smithy_http::label::fmt_string(
input_47,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/profilingGroups/{profilingGroupName}/notificationConfiguration/{channelId}",
profilingGroupName = profiling_group_name,
channelId = channel_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RemoveNotificationChannelInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::RemoveNotificationChannel::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RemoveNotificationChannel",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::remove_notification_channel_input::Builder {
crate::input::remove_notification_channel_input::Builder::default()
}
}
pub mod remove_permission_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
pub(crate) action_group: std::option::Option<crate::model::ActionGroup>,
pub(crate) revision_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn action_group(mut self, input: crate::model::ActionGroup) -> Self {
self.action_group = Some(input);
self
}
pub fn set_action_group(
mut self,
input: std::option::Option<crate::model::ActionGroup>,
) -> Self {
self.action_group = input;
self
}
pub fn revision_id(mut self, input: impl Into<std::string::String>) -> Self {
self.revision_id = Some(input.into());
self
}
pub fn set_revision_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.revision_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::RemovePermissionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::RemovePermissionInput {
profiling_group_name: self.profiling_group_name,
action_group: self.action_group,
revision_id: self.revision_id,
})
}
}
}
impl RemovePermissionInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::RemovePermission,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::RemovePermissionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_48 = &_input.profiling_group_name;
let input_48 = input_48.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
)
})?;
let profiling_group_name = aws_smithy_http::label::fmt_string(
input_48,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profiling_group_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
),
);
}
let input_49 = &_input.action_group;
let input_49 = input_49.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"action_group",
"cannot be empty or unset",
)
})?;
let action_group = aws_smithy_http::label::fmt_string(
input_49,
aws_smithy_http::label::EncodingStrategy::Default,
);
if action_group.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"action_group",
"cannot be empty or unset",
),
);
}
write!(
output,
"/profilingGroups/{profilingGroupName}/policy/{actionGroup}",
profilingGroupName = profiling_group_name,
actionGroup = action_group
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::RemovePermissionInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_50 = &_input.revision_id;
let inner_50 = inner_50.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"revision_id",
"cannot be empty or unset",
)
})?;
if inner_50.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"revision_id",
"cannot be empty or unset",
),
);
}
query.push_kv("revisionId", &aws_smithy_http::query::fmt_string(&inner_50));
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RemovePermissionInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::RemovePermission::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RemovePermission",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::remove_permission_input::Builder {
crate::input::remove_permission_input::Builder::default()
}
}
pub mod submit_feedback_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
pub(crate) anomaly_instance_id: std::option::Option<std::string::String>,
pub(crate) r#type: std::option::Option<crate::model::FeedbackType>,
pub(crate) comment: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn anomaly_instance_id(mut self, input: impl Into<std::string::String>) -> Self {
self.anomaly_instance_id = Some(input.into());
self
}
pub fn set_anomaly_instance_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.anomaly_instance_id = input;
self
}
pub fn r#type(mut self, input: crate::model::FeedbackType) -> Self {
self.r#type = Some(input);
self
}
pub fn set_type(mut self, input: std::option::Option<crate::model::FeedbackType>) -> Self {
self.r#type = input;
self
}
pub fn comment(mut self, input: impl Into<std::string::String>) -> Self {
self.comment = Some(input.into());
self
}
pub fn set_comment(mut self, input: std::option::Option<std::string::String>) -> Self {
self.comment = input;
self
}
pub fn build(
self,
) -> Result<crate::input::SubmitFeedbackInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::SubmitFeedbackInput {
profiling_group_name: self.profiling_group_name,
anomaly_instance_id: self.anomaly_instance_id,
r#type: self.r#type,
comment: self.comment,
})
}
}
}
impl SubmitFeedbackInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::SubmitFeedback,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::SubmitFeedbackInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_51 = &_input.profiling_group_name;
let input_51 = input_51.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
)
})?;
let profiling_group_name = aws_smithy_http::label::fmt_string(
input_51,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profiling_group_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
),
);
}
let input_52 = &_input.anomaly_instance_id;
let input_52 = input_52.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"anomaly_instance_id",
"cannot be empty or unset",
)
})?;
let anomaly_instance_id = aws_smithy_http::label::fmt_string(
input_52,
aws_smithy_http::label::EncodingStrategy::Default,
);
if anomaly_instance_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"anomaly_instance_id",
"cannot be empty or unset",
),
);
}
write!(output, "/internal/profilingGroups/{profilingGroupName}/anomalies/{anomalyInstanceId}/feedback", profilingGroupName = profiling_group_name, anomalyInstanceId = anomaly_instance_id).expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::SubmitFeedbackInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_submit_feedback(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::SubmitFeedback::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"SubmitFeedback",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::submit_feedback_input::Builder {
crate::input::submit_feedback_input::Builder::default()
}
}
pub mod tag_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_arn: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> Result<crate::input::TagResourceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::TagResourceInput {
resource_arn: self.resource_arn,
tags: self.tags,
})
}
}
}
impl TagResourceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::TagResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::TagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_53 = &_input.resource_arn;
let input_53 = input_53.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
)
})?;
let resource_arn = aws_smithy_http::label::fmt_string(
input_53,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/tags/{resourceArn}", resourceArn = resource_arn)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::TagResourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_tag_resource(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::TagResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"TagResource",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::tag_resource_input::Builder {
crate::input::tag_resource_input::Builder::default()
}
}
pub mod untag_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_arn: std::option::Option<std::string::String>,
pub(crate) tag_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn tag_keys(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.tag_keys.unwrap_or_default();
v.push(input.into());
self.tag_keys = Some(v);
self
}
pub fn set_tag_keys(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.tag_keys = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UntagResourceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UntagResourceInput {
resource_arn: self.resource_arn,
tag_keys: self.tag_keys,
})
}
}
}
impl UntagResourceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UntagResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UntagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_54 = &_input.resource_arn;
let input_54 = input_54.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
)
})?;
let resource_arn = aws_smithy_http::label::fmt_string(
input_54,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/tags/{resourceArn}", resourceArn = resource_arn)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::UntagResourceInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_55 = &_input.tag_keys;
let inner_55 = inner_55.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"tag_keys",
"cannot be empty or unset",
)
})?;
for inner_56 in inner_55 {
query.push_kv("tagKeys", &aws_smithy_http::query::fmt_string(&inner_56));
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UntagResourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UntagResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UntagResource",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::untag_resource_input::Builder {
crate::input::untag_resource_input::Builder::default()
}
}
pub mod update_profiling_group_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) profiling_group_name: std::option::Option<std::string::String>,
pub(crate) agent_orchestration_config:
std::option::Option<crate::model::AgentOrchestrationConfig>,
}
impl Builder {
pub fn profiling_group_name(mut self, input: impl Into<std::string::String>) -> Self {
self.profiling_group_name = Some(input.into());
self
}
pub fn set_profiling_group_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.profiling_group_name = input;
self
}
pub fn agent_orchestration_config(
mut self,
input: crate::model::AgentOrchestrationConfig,
) -> Self {
self.agent_orchestration_config = Some(input);
self
}
pub fn set_agent_orchestration_config(
mut self,
input: std::option::Option<crate::model::AgentOrchestrationConfig>,
) -> Self {
self.agent_orchestration_config = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateProfilingGroupInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateProfilingGroupInput {
profiling_group_name: self.profiling_group_name,
agent_orchestration_config: self.agent_orchestration_config,
})
}
}
}
impl UpdateProfilingGroupInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateProfilingGroup,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateProfilingGroupInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_57 = &_input.profiling_group_name;
let input_57 = input_57.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
)
})?;
let profiling_group_name = aws_smithy_http::label::fmt_string(
input_57,
aws_smithy_http::label::EncodingStrategy::Default,
);
if profiling_group_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"profiling_group_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/profilingGroups/{profilingGroupName}",
profilingGroupName = profiling_group_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateProfilingGroupInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_profiling_group(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateProfilingGroup::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateProfilingGroup",
"codeguruprofiler",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_profiling_group_input::Builder {
crate::input::update_profiling_group_input::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SubmitFeedbackInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub anomaly_instance_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub r#type: std::option::Option<crate::model::FeedbackType>,
#[doc(hidden)]
pub comment: std::option::Option<std::string::String>,
}
impl SubmitFeedbackInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
pub fn anomaly_instance_id(&self) -> std::option::Option<&str> {
self.anomaly_instance_id.as_deref()
}
pub fn r#type(&self) -> std::option::Option<&crate::model::FeedbackType> {
self.r#type.as_ref()
}
pub fn comment(&self) -> std::option::Option<&str> {
self.comment.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RemovePermissionInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub action_group: std::option::Option<crate::model::ActionGroup>,
#[doc(hidden)]
pub revision_id: std::option::Option<std::string::String>,
}
impl RemovePermissionInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
pub fn action_group(&self) -> std::option::Option<&crate::model::ActionGroup> {
self.action_group.as_ref()
}
pub fn revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RemoveNotificationChannelInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub channel_id: std::option::Option<std::string::String>,
}
impl RemoveNotificationChannelInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
pub fn channel_id(&self) -> std::option::Option<&str> {
self.channel_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PutPermissionInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub action_group: std::option::Option<crate::model::ActionGroup>,
#[doc(hidden)]
pub principals: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub revision_id: std::option::Option<std::string::String>,
}
impl PutPermissionInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
pub fn action_group(&self) -> std::option::Option<&crate::model::ActionGroup> {
self.action_group.as_ref()
}
pub fn principals(&self) -> std::option::Option<&[std::string::String]> {
self.principals.as_deref()
}
pub fn revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PostAgentProfileInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub agent_profile: std::option::Option<aws_smithy_types::Blob>,
#[doc(hidden)]
pub profile_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub content_type: std::option::Option<std::string::String>,
}
impl PostAgentProfileInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
pub fn agent_profile(&self) -> std::option::Option<&aws_smithy_types::Blob> {
self.agent_profile.as_ref()
}
pub fn profile_token(&self) -> std::option::Option<&str> {
self.profile_token.as_deref()
}
pub fn content_type(&self) -> std::option::Option<&str> {
self.content_type.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListProfileTimesInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub start_time: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub end_time: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub period: std::option::Option<crate::model::AggregationPeriod>,
#[doc(hidden)]
pub order_by: std::option::Option<crate::model::OrderBy>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListProfileTimesInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
pub fn start_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.start_time.as_ref()
}
pub fn end_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.end_time.as_ref()
}
pub fn period(&self) -> std::option::Option<&crate::model::AggregationPeriod> {
self.period.as_ref()
}
pub fn order_by(&self) -> std::option::Option<&crate::model::OrderBy> {
self.order_by.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()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListFindingsReportsInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub start_time: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub end_time: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub daily_reports_only: std::option::Option<bool>,
}
impl ListFindingsReportsInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
pub fn start_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.start_time.as_ref()
}
pub fn end_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.end_time.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
}
pub fn daily_reports_only(&self) -> std::option::Option<bool> {
self.daily_reports_only
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetRecommendationsInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub start_time: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub end_time: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub locale: std::option::Option<std::string::String>,
}
impl GetRecommendationsInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
pub fn start_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.start_time.as_ref()
}
pub fn end_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.end_time.as_ref()
}
pub fn locale(&self) -> std::option::Option<&str> {
self.locale.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetProfileInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub start_time: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub period: std::option::Option<std::string::String>,
#[doc(hidden)]
pub end_time: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub max_depth: std::option::Option<i32>,
#[doc(hidden)]
pub accept: std::option::Option<std::string::String>,
}
impl GetProfileInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
pub fn start_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.start_time.as_ref()
}
pub fn period(&self) -> std::option::Option<&str> {
self.period.as_deref()
}
pub fn end_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.end_time.as_ref()
}
pub fn max_depth(&self) -> std::option::Option<i32> {
self.max_depth
}
pub fn accept(&self) -> std::option::Option<&str> {
self.accept.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetPolicyInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
}
impl GetPolicyInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetNotificationConfigurationInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
}
impl GetNotificationConfigurationInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ConfigureAgentInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub fleet_instance_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub metadata: std::option::Option<
std::collections::HashMap<crate::model::MetadataField, std::string::String>,
>,
}
impl ConfigureAgentInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
pub fn fleet_instance_id(&self) -> std::option::Option<&str> {
self.fleet_instance_id.as_deref()
}
pub fn metadata(
&self,
) -> std::option::Option<
&std::collections::HashMap<crate::model::MetadataField, std::string::String>,
> {
self.metadata.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct BatchGetFrameMetricDataInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub start_time: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub end_time: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub period: std::option::Option<std::string::String>,
#[doc(hidden)]
pub target_resolution: std::option::Option<crate::model::AggregationPeriod>,
#[doc(hidden)]
pub frame_metrics: std::option::Option<std::vec::Vec<crate::model::FrameMetric>>,
}
impl BatchGetFrameMetricDataInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
pub fn start_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.start_time.as_ref()
}
pub fn end_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.end_time.as_ref()
}
pub fn period(&self) -> std::option::Option<&str> {
self.period.as_deref()
}
pub fn target_resolution(&self) -> std::option::Option<&crate::model::AggregationPeriod> {
self.target_resolution.as_ref()
}
pub fn frame_metrics(&self) -> std::option::Option<&[crate::model::FrameMetric]> {
self.frame_metrics.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AddNotificationChannelsInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub channels: std::option::Option<std::vec::Vec<crate::model::Channel>>,
}
impl AddNotificationChannelsInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
pub fn channels(&self) -> std::option::Option<&[crate::model::Channel]> {
self.channels.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListProfilingGroupsInput {
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub include_description: std::option::Option<bool>,
}
impl ListProfilingGroupsInput {
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 include_description(&self) -> std::option::Option<bool> {
self.include_description
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateProfilingGroupInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub compute_platform: std::option::Option<crate::model::ComputePlatform>,
#[doc(hidden)]
pub client_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub agent_orchestration_config: std::option::Option<crate::model::AgentOrchestrationConfig>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl CreateProfilingGroupInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
pub fn compute_platform(&self) -> std::option::Option<&crate::model::ComputePlatform> {
self.compute_platform.as_ref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
pub fn agent_orchestration_config(
&self,
) -> std::option::Option<&crate::model::AgentOrchestrationConfig> {
self.agent_orchestration_config.as_ref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteProfilingGroupInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
}
impl DeleteProfilingGroupInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateProfilingGroupInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub agent_orchestration_config: std::option::Option<crate::model::AgentOrchestrationConfig>,
}
impl UpdateProfilingGroupInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
pub fn agent_orchestration_config(
&self,
) -> std::option::Option<&crate::model::AgentOrchestrationConfig> {
self.agent_orchestration_config.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeProfilingGroupInput {
#[doc(hidden)]
pub profiling_group_name: std::option::Option<std::string::String>,
}
impl DescribeProfilingGroupInput {
pub fn profiling_group_name(&self) -> std::option::Option<&str> {
self.profiling_group_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UntagResourceInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tag_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl UntagResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn tag_keys(&self) -> std::option::Option<&[std::string::String]> {
self.tag_keys.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct TagResourceInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl TagResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListTagsForResourceInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
}
impl ListTagsForResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetFindingsReportAccountSummaryInput {
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub daily_reports_only: std::option::Option<bool>,
}
impl GetFindingsReportAccountSummaryInput {
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 daily_reports_only(&self) -> std::option::Option<bool> {
self.daily_reports_only
}
}