use std::fmt::Write;
pub mod create_budget_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget: std::option::Option<crate::model::Budget>,
pub(crate) notifications_with_subscribers:
std::option::Option<std::vec::Vec<crate::model::NotificationWithSubscribers>>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget(mut self, input: crate::model::Budget) -> Self {
self.budget = Some(input);
self
}
pub fn set_budget(mut self, input: std::option::Option<crate::model::Budget>) -> Self {
self.budget = input;
self
}
pub fn notifications_with_subscribers(
mut self,
input: crate::model::NotificationWithSubscribers,
) -> Self {
let mut v = self.notifications_with_subscribers.unwrap_or_default();
v.push(input);
self.notifications_with_subscribers = Some(v);
self
}
pub fn set_notifications_with_subscribers(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::NotificationWithSubscribers>>,
) -> Self {
self.notifications_with_subscribers = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateBudgetInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateBudgetInput {
account_id: self.account_id,
budget: self.budget,
notifications_with_subscribers: self.notifications_with_subscribers,
})
}
}
}
impl CreateBudgetInput {
#[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::CreateBudget,
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::CreateBudgetInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateBudgetInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.CreateBudget",
);
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_budget(&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::CreateBudget::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateBudget",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_budget_input::Builder {
crate::input::create_budget_input::Builder::default()
}
}
pub mod create_budget_action_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
pub(crate) notification_type: std::option::Option<crate::model::NotificationType>,
pub(crate) action_type: std::option::Option<crate::model::ActionType>,
pub(crate) action_threshold: std::option::Option<crate::model::ActionThreshold>,
pub(crate) definition: std::option::Option<crate::model::Definition>,
pub(crate) execution_role_arn: std::option::Option<std::string::String>,
pub(crate) approval_model: std::option::Option<crate::model::ApprovalModel>,
pub(crate) subscribers: std::option::Option<std::vec::Vec<crate::model::Subscriber>>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = input;
self
}
pub fn notification_type(mut self, input: crate::model::NotificationType) -> Self {
self.notification_type = Some(input);
self
}
pub fn set_notification_type(
mut self,
input: std::option::Option<crate::model::NotificationType>,
) -> Self {
self.notification_type = input;
self
}
pub fn action_type(mut self, input: crate::model::ActionType) -> Self {
self.action_type = Some(input);
self
}
pub fn set_action_type(
mut self,
input: std::option::Option<crate::model::ActionType>,
) -> Self {
self.action_type = input;
self
}
pub fn action_threshold(mut self, input: crate::model::ActionThreshold) -> Self {
self.action_threshold = Some(input);
self
}
pub fn set_action_threshold(
mut self,
input: std::option::Option<crate::model::ActionThreshold>,
) -> Self {
self.action_threshold = input;
self
}
pub fn definition(mut self, input: crate::model::Definition) -> Self {
self.definition = Some(input);
self
}
pub fn set_definition(
mut self,
input: std::option::Option<crate::model::Definition>,
) -> Self {
self.definition = input;
self
}
pub fn execution_role_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.execution_role_arn = Some(input.into());
self
}
pub fn set_execution_role_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.execution_role_arn = input;
self
}
pub fn approval_model(mut self, input: crate::model::ApprovalModel) -> Self {
self.approval_model = Some(input);
self
}
pub fn set_approval_model(
mut self,
input: std::option::Option<crate::model::ApprovalModel>,
) -> Self {
self.approval_model = input;
self
}
pub fn subscribers(mut self, input: crate::model::Subscriber) -> Self {
let mut v = self.subscribers.unwrap_or_default();
v.push(input);
self.subscribers = Some(v);
self
}
pub fn set_subscribers(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Subscriber>>,
) -> Self {
self.subscribers = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateBudgetActionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateBudgetActionInput {
account_id: self.account_id,
budget_name: self.budget_name,
notification_type: self.notification_type,
action_type: self.action_type,
action_threshold: self.action_threshold,
definition: self.definition,
execution_role_arn: self.execution_role_arn,
approval_model: self.approval_model,
subscribers: self.subscribers,
})
}
}
}
impl CreateBudgetActionInput {
#[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::CreateBudgetAction,
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::CreateBudgetActionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateBudgetActionInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.CreateBudgetAction",
);
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_budget_action(&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::CreateBudgetAction::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateBudgetAction",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_budget_action_input::Builder {
crate::input::create_budget_action_input::Builder::default()
}
}
pub mod create_notification_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
pub(crate) notification: std::option::Option<crate::model::Notification>,
pub(crate) subscribers: std::option::Option<std::vec::Vec<crate::model::Subscriber>>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = input;
self
}
pub fn notification(mut self, input: crate::model::Notification) -> Self {
self.notification = Some(input);
self
}
pub fn set_notification(
mut self,
input: std::option::Option<crate::model::Notification>,
) -> Self {
self.notification = input;
self
}
pub fn subscribers(mut self, input: crate::model::Subscriber) -> Self {
let mut v = self.subscribers.unwrap_or_default();
v.push(input);
self.subscribers = Some(v);
self
}
pub fn set_subscribers(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Subscriber>>,
) -> Self {
self.subscribers = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateNotificationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateNotificationInput {
account_id: self.account_id,
budget_name: self.budget_name,
notification: self.notification,
subscribers: self.subscribers,
})
}
}
}
impl CreateNotificationInput {
#[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::CreateNotification,
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::CreateNotificationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateNotificationInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.CreateNotification",
);
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_notification(&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::CreateNotification::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateNotification",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_notification_input::Builder {
crate::input::create_notification_input::Builder::default()
}
}
pub mod create_subscriber_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
pub(crate) notification: std::option::Option<crate::model::Notification>,
pub(crate) subscriber: std::option::Option<crate::model::Subscriber>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = input;
self
}
pub fn notification(mut self, input: crate::model::Notification) -> Self {
self.notification = Some(input);
self
}
pub fn set_notification(
mut self,
input: std::option::Option<crate::model::Notification>,
) -> Self {
self.notification = input;
self
}
pub fn subscriber(mut self, input: crate::model::Subscriber) -> Self {
self.subscriber = Some(input);
self
}
pub fn set_subscriber(
mut self,
input: std::option::Option<crate::model::Subscriber>,
) -> Self {
self.subscriber = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateSubscriberInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateSubscriberInput {
account_id: self.account_id,
budget_name: self.budget_name,
notification: self.notification,
subscriber: self.subscriber,
})
}
}
}
impl CreateSubscriberInput {
#[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::CreateSubscriber,
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::CreateSubscriberInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateSubscriberInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.CreateSubscriber",
);
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_subscriber(&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::CreateSubscriber::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateSubscriber",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_subscriber_input::Builder {
crate::input::create_subscriber_input::Builder::default()
}
}
pub mod delete_budget_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteBudgetInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteBudgetInput {
account_id: self.account_id,
budget_name: self.budget_name,
})
}
}
}
impl DeleteBudgetInput {
#[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::DeleteBudget,
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::DeleteBudgetInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteBudgetInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.DeleteBudget",
);
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_delete_budget(&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::DeleteBudget::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteBudget",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_budget_input::Builder {
crate::input::delete_budget_input::Builder::default()
}
}
pub mod delete_budget_action_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
pub(crate) action_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = input;
self
}
pub fn action_id(mut self, input: impl Into<std::string::String>) -> Self {
self.action_id = Some(input.into());
self
}
pub fn set_action_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.action_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteBudgetActionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteBudgetActionInput {
account_id: self.account_id,
budget_name: self.budget_name,
action_id: self.action_id,
})
}
}
}
impl DeleteBudgetActionInput {
#[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::DeleteBudgetAction,
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::DeleteBudgetActionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteBudgetActionInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.DeleteBudgetAction",
);
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_delete_budget_action(&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::DeleteBudgetAction::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteBudgetAction",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_budget_action_input::Builder {
crate::input::delete_budget_action_input::Builder::default()
}
}
pub mod delete_notification_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
pub(crate) notification: std::option::Option<crate::model::Notification>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = input;
self
}
pub fn notification(mut self, input: crate::model::Notification) -> Self {
self.notification = Some(input);
self
}
pub fn set_notification(
mut self,
input: std::option::Option<crate::model::Notification>,
) -> Self {
self.notification = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteNotificationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteNotificationInput {
account_id: self.account_id,
budget_name: self.budget_name,
notification: self.notification,
})
}
}
}
impl DeleteNotificationInput {
#[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::DeleteNotification,
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::DeleteNotificationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteNotificationInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.DeleteNotification",
);
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_delete_notification(&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::DeleteNotification::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteNotification",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_notification_input::Builder {
crate::input::delete_notification_input::Builder::default()
}
}
pub mod delete_subscriber_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
pub(crate) notification: std::option::Option<crate::model::Notification>,
pub(crate) subscriber: std::option::Option<crate::model::Subscriber>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = input;
self
}
pub fn notification(mut self, input: crate::model::Notification) -> Self {
self.notification = Some(input);
self
}
pub fn set_notification(
mut self,
input: std::option::Option<crate::model::Notification>,
) -> Self {
self.notification = input;
self
}
pub fn subscriber(mut self, input: crate::model::Subscriber) -> Self {
self.subscriber = Some(input);
self
}
pub fn set_subscriber(
mut self,
input: std::option::Option<crate::model::Subscriber>,
) -> Self {
self.subscriber = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteSubscriberInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteSubscriberInput {
account_id: self.account_id,
budget_name: self.budget_name,
notification: self.notification,
subscriber: self.subscriber,
})
}
}
}
impl DeleteSubscriberInput {
#[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::DeleteSubscriber,
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::DeleteSubscriberInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteSubscriberInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.DeleteSubscriber",
);
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_delete_subscriber(&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::DeleteSubscriber::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteSubscriber",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_subscriber_input::Builder {
crate::input::delete_subscriber_input::Builder::default()
}
}
pub mod describe_budget_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DescribeBudgetInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DescribeBudgetInput {
account_id: self.account_id,
budget_name: self.budget_name,
})
}
}
}
impl DescribeBudgetInput {
#[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::DescribeBudget,
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::DescribeBudgetInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeBudgetInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.DescribeBudget",
);
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_describe_budget(&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::DescribeBudget::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeBudget",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_budget_input::Builder {
crate::input::describe_budget_input::Builder::default()
}
}
pub mod describe_budget_action_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
pub(crate) action_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = input;
self
}
pub fn action_id(mut self, input: impl Into<std::string::String>) -> Self {
self.action_id = Some(input.into());
self
}
pub fn set_action_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.action_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeBudgetActionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeBudgetActionInput {
account_id: self.account_id,
budget_name: self.budget_name,
action_id: self.action_id,
})
}
}
}
impl DescribeBudgetActionInput {
#[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::DescribeBudgetAction,
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::DescribeBudgetActionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeBudgetActionInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.DescribeBudgetAction",
);
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_describe_budget_action(
&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::DescribeBudgetAction::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeBudgetAction",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_budget_action_input::Builder {
crate::input::describe_budget_action_input::Builder::default()
}
}
pub mod describe_budget_action_histories_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
pub(crate) action_id: std::option::Option<std::string::String>,
pub(crate) time_period: std::option::Option<crate::model::TimePeriod>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = input;
self
}
pub fn action_id(mut self, input: impl Into<std::string::String>) -> Self {
self.action_id = Some(input.into());
self
}
pub fn set_action_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.action_id = input;
self
}
pub fn time_period(mut self, input: crate::model::TimePeriod) -> Self {
self.time_period = Some(input);
self
}
pub fn set_time_period(
mut self,
input: std::option::Option<crate::model::TimePeriod>,
) -> Self {
self.time_period = 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::DescribeBudgetActionHistoriesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeBudgetActionHistoriesInput {
account_id: self.account_id,
budget_name: self.budget_name,
action_id: self.action_id,
time_period: self.time_period,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl DescribeBudgetActionHistoriesInput {
#[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::DescribeBudgetActionHistories,
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::DescribeBudgetActionHistoriesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeBudgetActionHistoriesInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.DescribeBudgetActionHistories",
);
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_describe_budget_action_histories(&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::DescribeBudgetActionHistories::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeBudgetActionHistories",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_budget_action_histories_input::Builder {
crate::input::describe_budget_action_histories_input::Builder::default()
}
}
pub mod describe_budget_actions_for_account_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn 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::DescribeBudgetActionsForAccountInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeBudgetActionsForAccountInput {
account_id: self.account_id,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl DescribeBudgetActionsForAccountInput {
#[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::DescribeBudgetActionsForAccount,
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::DescribeBudgetActionsForAccountInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeBudgetActionsForAccountInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.DescribeBudgetActionsForAccount",
);
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_describe_budget_actions_for_account(&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::DescribeBudgetActionsForAccount::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeBudgetActionsForAccount",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_budget_actions_for_account_input::Builder {
crate::input::describe_budget_actions_for_account_input::Builder::default()
}
}
pub mod describe_budget_actions_for_budget_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = 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::DescribeBudgetActionsForBudgetInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeBudgetActionsForBudgetInput {
account_id: self.account_id,
budget_name: self.budget_name,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl DescribeBudgetActionsForBudgetInput {
#[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::DescribeBudgetActionsForBudget,
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::DescribeBudgetActionsForBudgetInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeBudgetActionsForBudgetInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.DescribeBudgetActionsForBudget",
);
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_describe_budget_actions_for_budget(&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::DescribeBudgetActionsForBudget::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeBudgetActionsForBudget",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_budget_actions_for_budget_input::Builder {
crate::input::describe_budget_actions_for_budget_input::Builder::default()
}
}
pub mod describe_budget_notifications_for_account_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn 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::DescribeBudgetNotificationsForAccountInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeBudgetNotificationsForAccountInput {
account_id: self.account_id,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl DescribeBudgetNotificationsForAccountInput {
#[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::DescribeBudgetNotificationsForAccount,
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::DescribeBudgetNotificationsForAccountInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeBudgetNotificationsForAccountInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.DescribeBudgetNotificationsForAccount",
);
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_describe_budget_notifications_for_account(&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::DescribeBudgetNotificationsForAccount::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeBudgetNotificationsForAccount",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_budget_notifications_for_account_input::Builder {
crate::input::describe_budget_notifications_for_account_input::Builder::default()
}
}
pub mod describe_budget_performance_history_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
pub(crate) time_period: std::option::Option<crate::model::TimePeriod>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = input;
self
}
pub fn time_period(mut self, input: crate::model::TimePeriod) -> Self {
self.time_period = Some(input);
self
}
pub fn set_time_period(
mut self,
input: std::option::Option<crate::model::TimePeriod>,
) -> Self {
self.time_period = 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::DescribeBudgetPerformanceHistoryInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeBudgetPerformanceHistoryInput {
account_id: self.account_id,
budget_name: self.budget_name,
time_period: self.time_period,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl DescribeBudgetPerformanceHistoryInput {
#[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::DescribeBudgetPerformanceHistory,
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::DescribeBudgetPerformanceHistoryInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeBudgetPerformanceHistoryInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.DescribeBudgetPerformanceHistory",
);
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_describe_budget_performance_history(&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::DescribeBudgetPerformanceHistory::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeBudgetPerformanceHistory",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_budget_performance_history_input::Builder {
crate::input::describe_budget_performance_history_input::Builder::default()
}
}
pub mod describe_budgets_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn 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::DescribeBudgetsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DescribeBudgetsInput {
account_id: self.account_id,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl DescribeBudgetsInput {
#[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::DescribeBudgets,
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::DescribeBudgetsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeBudgetsInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.DescribeBudgets",
);
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_describe_budgets(&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::DescribeBudgets::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeBudgets",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_budgets_input::Builder {
crate::input::describe_budgets_input::Builder::default()
}
}
pub mod describe_notifications_for_budget_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = 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::DescribeNotificationsForBudgetInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeNotificationsForBudgetInput {
account_id: self.account_id,
budget_name: self.budget_name,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl DescribeNotificationsForBudgetInput {
#[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::DescribeNotificationsForBudget,
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::DescribeNotificationsForBudgetInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeNotificationsForBudgetInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.DescribeNotificationsForBudget",
);
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_describe_notifications_for_budget(&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::DescribeNotificationsForBudget::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeNotificationsForBudget",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_notifications_for_budget_input::Builder {
crate::input::describe_notifications_for_budget_input::Builder::default()
}
}
pub mod describe_subscribers_for_notification_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
pub(crate) notification: std::option::Option<crate::model::Notification>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = input;
self
}
pub fn notification(mut self, input: crate::model::Notification) -> Self {
self.notification = Some(input);
self
}
pub fn set_notification(
mut self,
input: std::option::Option<crate::model::Notification>,
) -> Self {
self.notification = 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::DescribeSubscribersForNotificationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeSubscribersForNotificationInput {
account_id: self.account_id,
budget_name: self.budget_name,
notification: self.notification,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl DescribeSubscribersForNotificationInput {
#[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::DescribeSubscribersForNotification,
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::DescribeSubscribersForNotificationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeSubscribersForNotificationInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.DescribeSubscribersForNotification",
);
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_describe_subscribers_for_notification(&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::DescribeSubscribersForNotification::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeSubscribersForNotification",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_subscribers_for_notification_input::Builder {
crate::input::describe_subscribers_for_notification_input::Builder::default()
}
}
pub mod execute_budget_action_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
pub(crate) action_id: std::option::Option<std::string::String>,
pub(crate) execution_type: std::option::Option<crate::model::ExecutionType>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = input;
self
}
pub fn action_id(mut self, input: impl Into<std::string::String>) -> Self {
self.action_id = Some(input.into());
self
}
pub fn set_action_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.action_id = input;
self
}
pub fn execution_type(mut self, input: crate::model::ExecutionType) -> Self {
self.execution_type = Some(input);
self
}
pub fn set_execution_type(
mut self,
input: std::option::Option<crate::model::ExecutionType>,
) -> Self {
self.execution_type = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ExecuteBudgetActionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ExecuteBudgetActionInput {
account_id: self.account_id,
budget_name: self.budget_name,
action_id: self.action_id,
execution_type: self.execution_type,
})
}
}
}
impl ExecuteBudgetActionInput {
#[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::ExecuteBudgetAction,
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::ExecuteBudgetActionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ExecuteBudgetActionInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.ExecuteBudgetAction",
);
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_execute_budget_action(&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::ExecuteBudgetAction::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ExecuteBudgetAction",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::execute_budget_action_input::Builder {
crate::input::execute_budget_action_input::Builder::default()
}
}
pub mod update_budget_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) new_budget: std::option::Option<crate::model::Budget>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn new_budget(mut self, input: crate::model::Budget) -> Self {
self.new_budget = Some(input);
self
}
pub fn set_new_budget(mut self, input: std::option::Option<crate::model::Budget>) -> Self {
self.new_budget = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateBudgetInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateBudgetInput {
account_id: self.account_id,
new_budget: self.new_budget,
})
}
}
}
impl UpdateBudgetInput {
#[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::UpdateBudget,
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::UpdateBudgetInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateBudgetInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.UpdateBudget",
);
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_budget(&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::UpdateBudget::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateBudget",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_budget_input::Builder {
crate::input::update_budget_input::Builder::default()
}
}
pub mod update_budget_action_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
pub(crate) action_id: std::option::Option<std::string::String>,
pub(crate) notification_type: std::option::Option<crate::model::NotificationType>,
pub(crate) action_threshold: std::option::Option<crate::model::ActionThreshold>,
pub(crate) definition: std::option::Option<crate::model::Definition>,
pub(crate) execution_role_arn: std::option::Option<std::string::String>,
pub(crate) approval_model: std::option::Option<crate::model::ApprovalModel>,
pub(crate) subscribers: std::option::Option<std::vec::Vec<crate::model::Subscriber>>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = input;
self
}
pub fn action_id(mut self, input: impl Into<std::string::String>) -> Self {
self.action_id = Some(input.into());
self
}
pub fn set_action_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.action_id = input;
self
}
pub fn notification_type(mut self, input: crate::model::NotificationType) -> Self {
self.notification_type = Some(input);
self
}
pub fn set_notification_type(
mut self,
input: std::option::Option<crate::model::NotificationType>,
) -> Self {
self.notification_type = input;
self
}
pub fn action_threshold(mut self, input: crate::model::ActionThreshold) -> Self {
self.action_threshold = Some(input);
self
}
pub fn set_action_threshold(
mut self,
input: std::option::Option<crate::model::ActionThreshold>,
) -> Self {
self.action_threshold = input;
self
}
pub fn definition(mut self, input: crate::model::Definition) -> Self {
self.definition = Some(input);
self
}
pub fn set_definition(
mut self,
input: std::option::Option<crate::model::Definition>,
) -> Self {
self.definition = input;
self
}
pub fn execution_role_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.execution_role_arn = Some(input.into());
self
}
pub fn set_execution_role_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.execution_role_arn = input;
self
}
pub fn approval_model(mut self, input: crate::model::ApprovalModel) -> Self {
self.approval_model = Some(input);
self
}
pub fn set_approval_model(
mut self,
input: std::option::Option<crate::model::ApprovalModel>,
) -> Self {
self.approval_model = input;
self
}
pub fn subscribers(mut self, input: crate::model::Subscriber) -> Self {
let mut v = self.subscribers.unwrap_or_default();
v.push(input);
self.subscribers = Some(v);
self
}
pub fn set_subscribers(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Subscriber>>,
) -> Self {
self.subscribers = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateBudgetActionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateBudgetActionInput {
account_id: self.account_id,
budget_name: self.budget_name,
action_id: self.action_id,
notification_type: self.notification_type,
action_threshold: self.action_threshold,
definition: self.definition,
execution_role_arn: self.execution_role_arn,
approval_model: self.approval_model,
subscribers: self.subscribers,
})
}
}
}
impl UpdateBudgetActionInput {
#[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::UpdateBudgetAction,
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::UpdateBudgetActionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateBudgetActionInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.UpdateBudgetAction",
);
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_budget_action(&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::UpdateBudgetAction::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateBudgetAction",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_budget_action_input::Builder {
crate::input::update_budget_action_input::Builder::default()
}
}
pub mod update_notification_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
pub(crate) old_notification: std::option::Option<crate::model::Notification>,
pub(crate) new_notification: std::option::Option<crate::model::Notification>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = input;
self
}
pub fn old_notification(mut self, input: crate::model::Notification) -> Self {
self.old_notification = Some(input);
self
}
pub fn set_old_notification(
mut self,
input: std::option::Option<crate::model::Notification>,
) -> Self {
self.old_notification = input;
self
}
pub fn new_notification(mut self, input: crate::model::Notification) -> Self {
self.new_notification = Some(input);
self
}
pub fn set_new_notification(
mut self,
input: std::option::Option<crate::model::Notification>,
) -> Self {
self.new_notification = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateNotificationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateNotificationInput {
account_id: self.account_id,
budget_name: self.budget_name,
old_notification: self.old_notification,
new_notification: self.new_notification,
})
}
}
}
impl UpdateNotificationInput {
#[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::UpdateNotification,
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::UpdateNotificationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateNotificationInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.UpdateNotification",
);
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_notification(&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::UpdateNotification::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateNotification",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_notification_input::Builder {
crate::input::update_notification_input::Builder::default()
}
}
pub mod update_subscriber_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) account_id: std::option::Option<std::string::String>,
pub(crate) budget_name: std::option::Option<std::string::String>,
pub(crate) notification: std::option::Option<crate::model::Notification>,
pub(crate) old_subscriber: std::option::Option<crate::model::Subscriber>,
pub(crate) new_subscriber: std::option::Option<crate::model::Subscriber>,
}
impl Builder {
pub fn account_id(mut self, input: impl Into<std::string::String>) -> Self {
self.account_id = Some(input.into());
self
}
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn budget_name(mut self, input: impl Into<std::string::String>) -> Self {
self.budget_name = Some(input.into());
self
}
pub fn set_budget_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.budget_name = input;
self
}
pub fn notification(mut self, input: crate::model::Notification) -> Self {
self.notification = Some(input);
self
}
pub fn set_notification(
mut self,
input: std::option::Option<crate::model::Notification>,
) -> Self {
self.notification = input;
self
}
pub fn old_subscriber(mut self, input: crate::model::Subscriber) -> Self {
self.old_subscriber = Some(input);
self
}
pub fn set_old_subscriber(
mut self,
input: std::option::Option<crate::model::Subscriber>,
) -> Self {
self.old_subscriber = input;
self
}
pub fn new_subscriber(mut self, input: crate::model::Subscriber) -> Self {
self.new_subscriber = Some(input);
self
}
pub fn set_new_subscriber(
mut self,
input: std::option::Option<crate::model::Subscriber>,
) -> Self {
self.new_subscriber = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateSubscriberInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateSubscriberInput {
account_id: self.account_id,
budget_name: self.budget_name,
notification: self.notification,
old_subscriber: self.old_subscriber,
new_subscriber: self.new_subscriber,
})
}
}
}
impl UpdateSubscriberInput {
#[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::UpdateSubscriber,
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::UpdateSubscriberInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateSubscriberInput,
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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSBudgetServiceGateway.UpdateSubscriber",
);
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_subscriber(&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::UpdateSubscriber::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateSubscriber",
"budgets",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_subscriber_input::Builder {
crate::input::update_subscriber_input::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateSubscriberInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub notification: std::option::Option<crate::model::Notification>,
#[doc(hidden)]
pub old_subscriber: std::option::Option<crate::model::Subscriber>,
#[doc(hidden)]
pub new_subscriber: std::option::Option<crate::model::Subscriber>,
}
impl UpdateSubscriberInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
pub fn notification(&self) -> std::option::Option<&crate::model::Notification> {
self.notification.as_ref()
}
pub fn old_subscriber(&self) -> std::option::Option<&crate::model::Subscriber> {
self.old_subscriber.as_ref()
}
pub fn new_subscriber(&self) -> std::option::Option<&crate::model::Subscriber> {
self.new_subscriber.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateNotificationInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub old_notification: std::option::Option<crate::model::Notification>,
#[doc(hidden)]
pub new_notification: std::option::Option<crate::model::Notification>,
}
impl UpdateNotificationInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
pub fn old_notification(&self) -> std::option::Option<&crate::model::Notification> {
self.old_notification.as_ref()
}
pub fn new_notification(&self) -> std::option::Option<&crate::model::Notification> {
self.new_notification.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateBudgetActionInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub action_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub notification_type: std::option::Option<crate::model::NotificationType>,
#[doc(hidden)]
pub action_threshold: std::option::Option<crate::model::ActionThreshold>,
#[doc(hidden)]
pub definition: std::option::Option<crate::model::Definition>,
#[doc(hidden)]
pub execution_role_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub approval_model: std::option::Option<crate::model::ApprovalModel>,
#[doc(hidden)]
pub subscribers: std::option::Option<std::vec::Vec<crate::model::Subscriber>>,
}
impl UpdateBudgetActionInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
pub fn action_id(&self) -> std::option::Option<&str> {
self.action_id.as_deref()
}
pub fn notification_type(&self) -> std::option::Option<&crate::model::NotificationType> {
self.notification_type.as_ref()
}
pub fn action_threshold(&self) -> std::option::Option<&crate::model::ActionThreshold> {
self.action_threshold.as_ref()
}
pub fn definition(&self) -> std::option::Option<&crate::model::Definition> {
self.definition.as_ref()
}
pub fn execution_role_arn(&self) -> std::option::Option<&str> {
self.execution_role_arn.as_deref()
}
pub fn approval_model(&self) -> std::option::Option<&crate::model::ApprovalModel> {
self.approval_model.as_ref()
}
pub fn subscribers(&self) -> std::option::Option<&[crate::model::Subscriber]> {
self.subscribers.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateBudgetInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub new_budget: std::option::Option<crate::model::Budget>,
}
impl UpdateBudgetInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn new_budget(&self) -> std::option::Option<&crate::model::Budget> {
self.new_budget.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ExecuteBudgetActionInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub action_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub execution_type: std::option::Option<crate::model::ExecutionType>,
}
impl ExecuteBudgetActionInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
pub fn action_id(&self) -> std::option::Option<&str> {
self.action_id.as_deref()
}
pub fn execution_type(&self) -> std::option::Option<&crate::model::ExecutionType> {
self.execution_type.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeSubscribersForNotificationInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub notification: std::option::Option<crate::model::Notification>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl DescribeSubscribersForNotificationInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
pub fn notification(&self) -> std::option::Option<&crate::model::Notification> {
self.notification.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 DescribeNotificationsForBudgetInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl DescribeNotificationsForBudgetInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeBudgetsInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl DescribeBudgetsInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeBudgetPerformanceHistoryInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub time_period: std::option::Option<crate::model::TimePeriod>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl DescribeBudgetPerformanceHistoryInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
pub fn time_period(&self) -> std::option::Option<&crate::model::TimePeriod> {
self.time_period.as_ref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeBudgetNotificationsForAccountInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl DescribeBudgetNotificationsForAccountInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeBudgetActionsForBudgetInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl DescribeBudgetActionsForBudgetInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeBudgetActionsForAccountInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl DescribeBudgetActionsForAccountInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeBudgetActionHistoriesInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub action_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub time_period: std::option::Option<crate::model::TimePeriod>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl DescribeBudgetActionHistoriesInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
pub fn action_id(&self) -> std::option::Option<&str> {
self.action_id.as_deref()
}
pub fn time_period(&self) -> std::option::Option<&crate::model::TimePeriod> {
self.time_period.as_ref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeBudgetActionInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub action_id: std::option::Option<std::string::String>,
}
impl DescribeBudgetActionInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
pub fn action_id(&self) -> std::option::Option<&str> {
self.action_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeBudgetInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
}
impl DescribeBudgetInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteSubscriberInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub notification: std::option::Option<crate::model::Notification>,
#[doc(hidden)]
pub subscriber: std::option::Option<crate::model::Subscriber>,
}
impl DeleteSubscriberInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
pub fn notification(&self) -> std::option::Option<&crate::model::Notification> {
self.notification.as_ref()
}
pub fn subscriber(&self) -> std::option::Option<&crate::model::Subscriber> {
self.subscriber.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteNotificationInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub notification: std::option::Option<crate::model::Notification>,
}
impl DeleteNotificationInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
pub fn notification(&self) -> std::option::Option<&crate::model::Notification> {
self.notification.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteBudgetActionInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub action_id: std::option::Option<std::string::String>,
}
impl DeleteBudgetActionInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
pub fn action_id(&self) -> std::option::Option<&str> {
self.action_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteBudgetInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
}
impl DeleteBudgetInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateSubscriberInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub notification: std::option::Option<crate::model::Notification>,
#[doc(hidden)]
pub subscriber: std::option::Option<crate::model::Subscriber>,
}
impl CreateSubscriberInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
pub fn notification(&self) -> std::option::Option<&crate::model::Notification> {
self.notification.as_ref()
}
pub fn subscriber(&self) -> std::option::Option<&crate::model::Subscriber> {
self.subscriber.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateNotificationInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub notification: std::option::Option<crate::model::Notification>,
#[doc(hidden)]
pub subscribers: std::option::Option<std::vec::Vec<crate::model::Subscriber>>,
}
impl CreateNotificationInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
pub fn notification(&self) -> std::option::Option<&crate::model::Notification> {
self.notification.as_ref()
}
pub fn subscribers(&self) -> std::option::Option<&[crate::model::Subscriber]> {
self.subscribers.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateBudgetActionInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub notification_type: std::option::Option<crate::model::NotificationType>,
#[doc(hidden)]
pub action_type: std::option::Option<crate::model::ActionType>,
#[doc(hidden)]
pub action_threshold: std::option::Option<crate::model::ActionThreshold>,
#[doc(hidden)]
pub definition: std::option::Option<crate::model::Definition>,
#[doc(hidden)]
pub execution_role_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub approval_model: std::option::Option<crate::model::ApprovalModel>,
#[doc(hidden)]
pub subscribers: std::option::Option<std::vec::Vec<crate::model::Subscriber>>,
}
impl CreateBudgetActionInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget_name(&self) -> std::option::Option<&str> {
self.budget_name.as_deref()
}
pub fn notification_type(&self) -> std::option::Option<&crate::model::NotificationType> {
self.notification_type.as_ref()
}
pub fn action_type(&self) -> std::option::Option<&crate::model::ActionType> {
self.action_type.as_ref()
}
pub fn action_threshold(&self) -> std::option::Option<&crate::model::ActionThreshold> {
self.action_threshold.as_ref()
}
pub fn definition(&self) -> std::option::Option<&crate::model::Definition> {
self.definition.as_ref()
}
pub fn execution_role_arn(&self) -> std::option::Option<&str> {
self.execution_role_arn.as_deref()
}
pub fn approval_model(&self) -> std::option::Option<&crate::model::ApprovalModel> {
self.approval_model.as_ref()
}
pub fn subscribers(&self) -> std::option::Option<&[crate::model::Subscriber]> {
self.subscribers.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateBudgetInput {
#[doc(hidden)]
pub account_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub budget: std::option::Option<crate::model::Budget>,
#[doc(hidden)]
pub notifications_with_subscribers:
std::option::Option<std::vec::Vec<crate::model::NotificationWithSubscribers>>,
}
impl CreateBudgetInput {
pub fn account_id(&self) -> std::option::Option<&str> {
self.account_id.as_deref()
}
pub fn budget(&self) -> std::option::Option<&crate::model::Budget> {
self.budget.as_ref()
}
pub fn notifications_with_subscribers(
&self,
) -> std::option::Option<&[crate::model::NotificationWithSubscribers]> {
self.notifications_with_subscribers.as_deref()
}
}