use std::fmt::Write;
pub mod create_app_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) repository: std::option::Option<std::string::String>,
pub(crate) platform: std::option::Option<crate::model::Platform>,
pub(crate) iam_service_role_arn: std::option::Option<std::string::String>,
pub(crate) oauth_token: std::option::Option<std::string::String>,
pub(crate) access_token: std::option::Option<std::string::String>,
pub(crate) environment_variables: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) enable_branch_auto_build: std::option::Option<bool>,
pub(crate) enable_branch_auto_deletion: std::option::Option<bool>,
pub(crate) enable_basic_auth: std::option::Option<bool>,
pub(crate) basic_auth_credentials: std::option::Option<std::string::String>,
pub(crate) custom_rules: std::option::Option<std::vec::Vec<crate::model::CustomRule>>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) build_spec: std::option::Option<std::string::String>,
pub(crate) custom_headers: std::option::Option<std::string::String>,
pub(crate) enable_auto_branch_creation: std::option::Option<bool>,
pub(crate) auto_branch_creation_patterns:
std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) auto_branch_creation_config:
std::option::Option<crate::model::AutoBranchCreationConfig>,
}
impl Builder {
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn repository(mut self, input: impl Into<std::string::String>) -> Self {
self.repository = Some(input.into());
self
}
pub fn set_repository(mut self, input: std::option::Option<std::string::String>) -> Self {
self.repository = input;
self
}
pub fn platform(mut self, input: crate::model::Platform) -> Self {
self.platform = Some(input);
self
}
pub fn set_platform(mut self, input: std::option::Option<crate::model::Platform>) -> Self {
self.platform = input;
self
}
pub fn iam_service_role_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.iam_service_role_arn = Some(input.into());
self
}
pub fn set_iam_service_role_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.iam_service_role_arn = input;
self
}
pub fn oauth_token(mut self, input: impl Into<std::string::String>) -> Self {
self.oauth_token = Some(input.into());
self
}
pub fn set_oauth_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.oauth_token = input;
self
}
pub fn access_token(mut self, input: impl Into<std::string::String>) -> Self {
self.access_token = Some(input.into());
self
}
pub fn set_access_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.access_token = input;
self
}
pub fn environment_variables(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.environment_variables.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.environment_variables = Some(hash_map);
self
}
pub fn set_environment_variables(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.environment_variables = input;
self
}
pub fn enable_branch_auto_build(mut self, input: bool) -> Self {
self.enable_branch_auto_build = Some(input);
self
}
pub fn set_enable_branch_auto_build(mut self, input: std::option::Option<bool>) -> Self {
self.enable_branch_auto_build = input;
self
}
pub fn enable_branch_auto_deletion(mut self, input: bool) -> Self {
self.enable_branch_auto_deletion = Some(input);
self
}
pub fn set_enable_branch_auto_deletion(mut self, input: std::option::Option<bool>) -> Self {
self.enable_branch_auto_deletion = input;
self
}
pub fn enable_basic_auth(mut self, input: bool) -> Self {
self.enable_basic_auth = Some(input);
self
}
pub fn set_enable_basic_auth(mut self, input: std::option::Option<bool>) -> Self {
self.enable_basic_auth = input;
self
}
pub fn basic_auth_credentials(mut self, input: impl Into<std::string::String>) -> Self {
self.basic_auth_credentials = Some(input.into());
self
}
pub fn set_basic_auth_credentials(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.basic_auth_credentials = input;
self
}
pub fn custom_rules(mut self, input: crate::model::CustomRule) -> Self {
let mut v = self.custom_rules.unwrap_or_default();
v.push(input);
self.custom_rules = Some(v);
self
}
pub fn set_custom_rules(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::CustomRule>>,
) -> Self {
self.custom_rules = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn build_spec(mut self, input: impl Into<std::string::String>) -> Self {
self.build_spec = Some(input.into());
self
}
pub fn set_build_spec(mut self, input: std::option::Option<std::string::String>) -> Self {
self.build_spec = input;
self
}
pub fn custom_headers(mut self, input: impl Into<std::string::String>) -> Self {
self.custom_headers = Some(input.into());
self
}
pub fn set_custom_headers(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.custom_headers = input;
self
}
pub fn enable_auto_branch_creation(mut self, input: bool) -> Self {
self.enable_auto_branch_creation = Some(input);
self
}
pub fn set_enable_auto_branch_creation(mut self, input: std::option::Option<bool>) -> Self {
self.enable_auto_branch_creation = input;
self
}
pub fn auto_branch_creation_patterns(
mut self,
input: impl Into<std::string::String>,
) -> Self {
let mut v = self.auto_branch_creation_patterns.unwrap_or_default();
v.push(input.into());
self.auto_branch_creation_patterns = Some(v);
self
}
pub fn set_auto_branch_creation_patterns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.auto_branch_creation_patterns = input;
self
}
pub fn auto_branch_creation_config(
mut self,
input: crate::model::AutoBranchCreationConfig,
) -> Self {
self.auto_branch_creation_config = Some(input);
self
}
pub fn set_auto_branch_creation_config(
mut self,
input: std::option::Option<crate::model::AutoBranchCreationConfig>,
) -> Self {
self.auto_branch_creation_config = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateAppInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateAppInput {
name: self.name,
description: self.description,
repository: self.repository,
platform: self.platform,
iam_service_role_arn: self.iam_service_role_arn,
oauth_token: self.oauth_token,
access_token: self.access_token,
environment_variables: self.environment_variables,
enable_branch_auto_build: self.enable_branch_auto_build,
enable_branch_auto_deletion: self.enable_branch_auto_deletion,
enable_basic_auth: self.enable_basic_auth,
basic_auth_credentials: self.basic_auth_credentials,
custom_rules: self.custom_rules,
tags: self.tags,
build_spec: self.build_spec,
custom_headers: self.custom_headers,
enable_auto_branch_creation: self.enable_auto_branch_creation,
auto_branch_creation_patterns: self.auto_branch_creation_patterns,
auto_branch_creation_config: self.auto_branch_creation_config,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("name", &self.name);
formatter.field("description", &self.description);
formatter.field("repository", &self.repository);
formatter.field("platform", &self.platform);
formatter.field("iam_service_role_arn", &self.iam_service_role_arn);
formatter.field("oauth_token", &"*** Sensitive Data Redacted ***");
formatter.field("access_token", &"*** Sensitive Data Redacted ***");
formatter.field("environment_variables", &self.environment_variables);
formatter.field("enable_branch_auto_build", &self.enable_branch_auto_build);
formatter.field(
"enable_branch_auto_deletion",
&self.enable_branch_auto_deletion,
);
formatter.field("enable_basic_auth", &self.enable_basic_auth);
formatter.field("basic_auth_credentials", &"*** Sensitive Data Redacted ***");
formatter.field("custom_rules", &self.custom_rules);
formatter.field("tags", &self.tags);
formatter.field("build_spec", &"*** Sensitive Data Redacted ***");
formatter.field("custom_headers", &self.custom_headers);
formatter.field(
"enable_auto_branch_creation",
&self.enable_auto_branch_creation,
);
formatter.field(
"auto_branch_creation_patterns",
&self.auto_branch_creation_patterns,
);
formatter.field(
"auto_branch_creation_config",
&self.auto_branch_creation_config,
);
formatter.finish()
}
}
}
impl CreateAppInput {
#[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::CreateApp,
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::CreateAppInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/apps").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateAppInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_app(&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::CreateApp::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateApp",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_app_input::Builder {
crate::input::create_app_input::Builder::default()
}
}
pub mod create_backend_environment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) environment_name: std::option::Option<std::string::String>,
pub(crate) stack_name: std::option::Option<std::string::String>,
pub(crate) deployment_artifacts: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.environment_name = Some(input.into());
self
}
pub fn set_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.environment_name = input;
self
}
pub fn stack_name(mut self, input: impl Into<std::string::String>) -> Self {
self.stack_name = Some(input.into());
self
}
pub fn set_stack_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.stack_name = input;
self
}
pub fn deployment_artifacts(mut self, input: impl Into<std::string::String>) -> Self {
self.deployment_artifacts = Some(input.into());
self
}
pub fn set_deployment_artifacts(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.deployment_artifacts = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateBackendEnvironmentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateBackendEnvironmentInput {
app_id: self.app_id,
environment_name: self.environment_name,
stack_name: self.stack_name,
deployment_artifacts: self.deployment_artifacts,
})
}
}
}
impl CreateBackendEnvironmentInput {
#[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::CreateBackendEnvironment,
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::CreateBackendEnvironmentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_1 = &_input.app_id;
let input_1 = input_1.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_1,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
write!(output, "/apps/{appId}/backendenvironments", appId = app_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateBackendEnvironmentInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_backend_environment(
&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::CreateBackendEnvironment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateBackendEnvironment",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_backend_environment_input::Builder {
crate::input::create_backend_environment_input::Builder::default()
}
}
pub mod create_branch_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) stage: std::option::Option<crate::model::Stage>,
pub(crate) framework: std::option::Option<std::string::String>,
pub(crate) enable_notification: std::option::Option<bool>,
pub(crate) enable_auto_build: std::option::Option<bool>,
pub(crate) environment_variables: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) basic_auth_credentials: std::option::Option<std::string::String>,
pub(crate) enable_basic_auth: std::option::Option<bool>,
pub(crate) enable_performance_mode: std::option::Option<bool>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) build_spec: std::option::Option<std::string::String>,
pub(crate) ttl: std::option::Option<std::string::String>,
pub(crate) display_name: std::option::Option<std::string::String>,
pub(crate) enable_pull_request_preview: std::option::Option<bool>,
pub(crate) pull_request_environment_name: std::option::Option<std::string::String>,
pub(crate) backend_environment_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn stage(mut self, input: crate::model::Stage) -> Self {
self.stage = Some(input);
self
}
pub fn set_stage(mut self, input: std::option::Option<crate::model::Stage>) -> Self {
self.stage = input;
self
}
pub fn framework(mut self, input: impl Into<std::string::String>) -> Self {
self.framework = Some(input.into());
self
}
pub fn set_framework(mut self, input: std::option::Option<std::string::String>) -> Self {
self.framework = input;
self
}
pub fn enable_notification(mut self, input: bool) -> Self {
self.enable_notification = Some(input);
self
}
pub fn set_enable_notification(mut self, input: std::option::Option<bool>) -> Self {
self.enable_notification = input;
self
}
pub fn enable_auto_build(mut self, input: bool) -> Self {
self.enable_auto_build = Some(input);
self
}
pub fn set_enable_auto_build(mut self, input: std::option::Option<bool>) -> Self {
self.enable_auto_build = input;
self
}
pub fn environment_variables(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.environment_variables.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.environment_variables = Some(hash_map);
self
}
pub fn set_environment_variables(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.environment_variables = input;
self
}
pub fn basic_auth_credentials(mut self, input: impl Into<std::string::String>) -> Self {
self.basic_auth_credentials = Some(input.into());
self
}
pub fn set_basic_auth_credentials(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.basic_auth_credentials = input;
self
}
pub fn enable_basic_auth(mut self, input: bool) -> Self {
self.enable_basic_auth = Some(input);
self
}
pub fn set_enable_basic_auth(mut self, input: std::option::Option<bool>) -> Self {
self.enable_basic_auth = input;
self
}
pub fn enable_performance_mode(mut self, input: bool) -> Self {
self.enable_performance_mode = Some(input);
self
}
pub fn set_enable_performance_mode(mut self, input: std::option::Option<bool>) -> Self {
self.enable_performance_mode = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn build_spec(mut self, input: impl Into<std::string::String>) -> Self {
self.build_spec = Some(input.into());
self
}
pub fn set_build_spec(mut self, input: std::option::Option<std::string::String>) -> Self {
self.build_spec = input;
self
}
pub fn ttl(mut self, input: impl Into<std::string::String>) -> Self {
self.ttl = Some(input.into());
self
}
pub fn set_ttl(mut self, input: std::option::Option<std::string::String>) -> Self {
self.ttl = input;
self
}
pub fn display_name(mut self, input: impl Into<std::string::String>) -> Self {
self.display_name = Some(input.into());
self
}
pub fn set_display_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.display_name = input;
self
}
pub fn enable_pull_request_preview(mut self, input: bool) -> Self {
self.enable_pull_request_preview = Some(input);
self
}
pub fn set_enable_pull_request_preview(mut self, input: std::option::Option<bool>) -> Self {
self.enable_pull_request_preview = input;
self
}
pub fn pull_request_environment_name(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.pull_request_environment_name = Some(input.into());
self
}
pub fn set_pull_request_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_environment_name = input;
self
}
pub fn backend_environment_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_arn = Some(input.into());
self
}
pub fn set_backend_environment_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_arn = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateBranchInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateBranchInput {
app_id: self.app_id,
branch_name: self.branch_name,
description: self.description,
stage: self.stage,
framework: self.framework,
enable_notification: self.enable_notification,
enable_auto_build: self.enable_auto_build,
environment_variables: self.environment_variables,
basic_auth_credentials: self.basic_auth_credentials,
enable_basic_auth: self.enable_basic_auth,
enable_performance_mode: self.enable_performance_mode,
tags: self.tags,
build_spec: self.build_spec,
ttl: self.ttl,
display_name: self.display_name,
enable_pull_request_preview: self.enable_pull_request_preview,
pull_request_environment_name: self.pull_request_environment_name,
backend_environment_arn: self.backend_environment_arn,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("app_id", &self.app_id);
formatter.field("branch_name", &self.branch_name);
formatter.field("description", &self.description);
formatter.field("stage", &self.stage);
formatter.field("framework", &self.framework);
formatter.field("enable_notification", &self.enable_notification);
formatter.field("enable_auto_build", &self.enable_auto_build);
formatter.field("environment_variables", &self.environment_variables);
formatter.field("basic_auth_credentials", &"*** Sensitive Data Redacted ***");
formatter.field("enable_basic_auth", &self.enable_basic_auth);
formatter.field("enable_performance_mode", &self.enable_performance_mode);
formatter.field("tags", &self.tags);
formatter.field("build_spec", &"*** Sensitive Data Redacted ***");
formatter.field("ttl", &self.ttl);
formatter.field("display_name", &self.display_name);
formatter.field(
"enable_pull_request_preview",
&self.enable_pull_request_preview,
);
formatter.field(
"pull_request_environment_name",
&self.pull_request_environment_name,
);
formatter.field("backend_environment_arn", &self.backend_environment_arn);
formatter.finish()
}
}
}
impl CreateBranchInput {
#[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::CreateBranch,
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::CreateBranchInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_2 = &_input.app_id;
let input_2 = input_2.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_2,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
write!(output, "/apps/{appId}/branches", appId = app_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateBranchInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_branch(&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::CreateBranch::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateBranch",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_branch_input::Builder {
crate::input::create_branch_input::Builder::default()
}
}
pub mod create_deployment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
pub(crate) file_map: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn file_map(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.file_map.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.file_map = Some(hash_map);
self
}
pub fn set_file_map(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.file_map = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateDeploymentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateDeploymentInput {
app_id: self.app_id,
branch_name: self.branch_name,
file_map: self.file_map,
})
}
}
}
impl CreateDeploymentInput {
#[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::CreateDeployment,
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::CreateDeploymentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_3 = &_input.app_id;
let input_3 = input_3.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_3,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
let input_4 = &_input.branch_name;
let input_4 = input_4.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
)
})?;
let branch_name = aws_smithy_http::label::fmt_string(
input_4,
aws_smithy_http::label::EncodingStrategy::Default,
);
if branch_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/apps/{appId}/branches/{branchName}/deployments",
appId = app_id,
branchName = branch_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateDeploymentInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_deployment(&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::CreateDeployment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateDeployment",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_deployment_input::Builder {
crate::input::create_deployment_input::Builder::default()
}
}
pub mod create_domain_association_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) domain_name: std::option::Option<std::string::String>,
pub(crate) enable_auto_sub_domain: std::option::Option<bool>,
pub(crate) sub_domain_settings:
std::option::Option<std::vec::Vec<crate::model::SubDomainSetting>>,
pub(crate) auto_sub_domain_creation_patterns:
std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) auto_sub_domain_iam_role: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn domain_name(mut self, input: impl Into<std::string::String>) -> Self {
self.domain_name = Some(input.into());
self
}
pub fn set_domain_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.domain_name = input;
self
}
pub fn enable_auto_sub_domain(mut self, input: bool) -> Self {
self.enable_auto_sub_domain = Some(input);
self
}
pub fn set_enable_auto_sub_domain(mut self, input: std::option::Option<bool>) -> Self {
self.enable_auto_sub_domain = input;
self
}
pub fn sub_domain_settings(mut self, input: crate::model::SubDomainSetting) -> Self {
let mut v = self.sub_domain_settings.unwrap_or_default();
v.push(input);
self.sub_domain_settings = Some(v);
self
}
pub fn set_sub_domain_settings(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::SubDomainSetting>>,
) -> Self {
self.sub_domain_settings = input;
self
}
pub fn auto_sub_domain_creation_patterns(
mut self,
input: impl Into<std::string::String>,
) -> Self {
let mut v = self.auto_sub_domain_creation_patterns.unwrap_or_default();
v.push(input.into());
self.auto_sub_domain_creation_patterns = Some(v);
self
}
pub fn set_auto_sub_domain_creation_patterns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.auto_sub_domain_creation_patterns = input;
self
}
pub fn auto_sub_domain_iam_role(mut self, input: impl Into<std::string::String>) -> Self {
self.auto_sub_domain_iam_role = Some(input.into());
self
}
pub fn set_auto_sub_domain_iam_role(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.auto_sub_domain_iam_role = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateDomainAssociationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateDomainAssociationInput {
app_id: self.app_id,
domain_name: self.domain_name,
enable_auto_sub_domain: self.enable_auto_sub_domain,
sub_domain_settings: self.sub_domain_settings,
auto_sub_domain_creation_patterns: self.auto_sub_domain_creation_patterns,
auto_sub_domain_iam_role: self.auto_sub_domain_iam_role,
})
}
}
}
impl CreateDomainAssociationInput {
#[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::CreateDomainAssociation,
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::CreateDomainAssociationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_5 = &_input.app_id;
let input_5 = input_5.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_5,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
write!(output, "/apps/{appId}/domains", appId = app_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateDomainAssociationInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_domain_association(
&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::CreateDomainAssociation::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateDomainAssociation",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_domain_association_input::Builder {
crate::input::create_domain_association_input::Builder::default()
}
}
pub mod create_webhook_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateWebhookInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateWebhookInput {
app_id: self.app_id,
branch_name: self.branch_name,
description: self.description,
})
}
}
}
impl CreateWebhookInput {
#[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::CreateWebhook,
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::CreateWebhookInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_6 = &_input.app_id;
let input_6 = input_6.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_6,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
write!(output, "/apps/{appId}/webhooks", appId = app_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateWebhookInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_webhook(&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::CreateWebhook::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateWebhook",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_webhook_input::Builder {
crate::input::create_webhook_input::Builder::default()
}
}
pub mod delete_app_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteAppInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteAppInput {
app_id: self.app_id,
})
}
}
}
impl DeleteAppInput {
#[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::DeleteApp,
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::DeleteAppInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_7 = &_input.app_id;
let input_7 = input_7.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_7,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
write!(output, "/apps/{appId}", appId = app_id).expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteAppInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::DeleteApp::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteApp",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_app_input::Builder {
crate::input::delete_app_input::Builder::default()
}
}
pub mod delete_backend_environment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) environment_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.environment_name = Some(input.into());
self
}
pub fn set_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.environment_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteBackendEnvironmentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteBackendEnvironmentInput {
app_id: self.app_id,
environment_name: self.environment_name,
})
}
}
}
impl DeleteBackendEnvironmentInput {
#[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::DeleteBackendEnvironment,
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::DeleteBackendEnvironmentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_8 = &_input.app_id;
let input_8 = input_8.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_8,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
let input_9 = &_input.environment_name;
let input_9 = input_9.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"environment_name",
"cannot be empty or unset",
)
})?;
let environment_name = aws_smithy_http::label::fmt_string(
input_9,
aws_smithy_http::label::EncodingStrategy::Default,
);
if environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/apps/{appId}/backendenvironments/{environmentName}",
appId = app_id,
environmentName = environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteBackendEnvironmentInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteBackendEnvironment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteBackendEnvironment",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_backend_environment_input::Builder {
crate::input::delete_backend_environment_input::Builder::default()
}
}
pub mod delete_branch_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteBranchInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteBranchInput {
app_id: self.app_id,
branch_name: self.branch_name,
})
}
}
}
impl DeleteBranchInput {
#[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::DeleteBranch,
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::DeleteBranchInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_10 = &_input.app_id;
let input_10 = input_10.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_10,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
let input_11 = &_input.branch_name;
let input_11 = input_11.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
)
})?;
let branch_name = aws_smithy_http::label::fmt_string(
input_11,
aws_smithy_http::label::EncodingStrategy::Default,
);
if branch_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/apps/{appId}/branches/{branchName}",
appId = app_id,
branchName = branch_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteBranchInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteBranch::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteBranch",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_branch_input::Builder {
crate::input::delete_branch_input::Builder::default()
}
}
pub mod delete_domain_association_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) domain_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn domain_name(mut self, input: impl Into<std::string::String>) -> Self {
self.domain_name = Some(input.into());
self
}
pub fn set_domain_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.domain_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteDomainAssociationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteDomainAssociationInput {
app_id: self.app_id,
domain_name: self.domain_name,
})
}
}
}
impl DeleteDomainAssociationInput {
#[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::DeleteDomainAssociation,
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::DeleteDomainAssociationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_12 = &_input.app_id;
let input_12 = input_12.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_12,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
let input_13 = &_input.domain_name;
let input_13 = input_13.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
)
})?;
let domain_name = aws_smithy_http::label::fmt_string(
input_13,
aws_smithy_http::label::EncodingStrategy::Default,
);
if domain_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/apps/{appId}/domains/{domainName}",
appId = app_id,
domainName = domain_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteDomainAssociationInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteDomainAssociation::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteDomainAssociation",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_domain_association_input::Builder {
crate::input::delete_domain_association_input::Builder::default()
}
}
pub mod delete_job_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
pub(crate) job_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.job_id = Some(input.into());
self
}
pub fn set_job_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.job_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteJobInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteJobInput {
app_id: self.app_id,
branch_name: self.branch_name,
job_id: self.job_id,
})
}
}
}
impl DeleteJobInput {
#[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::DeleteJob,
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::DeleteJobInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_14 = &_input.app_id;
let input_14 = input_14.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_14,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
let input_15 = &_input.branch_name;
let input_15 = input_15.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
)
})?;
let branch_name = aws_smithy_http::label::fmt_string(
input_15,
aws_smithy_http::label::EncodingStrategy::Default,
);
if branch_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
),
);
}
let input_16 = &_input.job_id;
let input_16 = input_16.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"job_id",
"cannot be empty or unset",
)
})?;
let job_id = aws_smithy_http::label::fmt_string(
input_16,
aws_smithy_http::label::EncodingStrategy::Default,
);
if job_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"job_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/apps/{appId}/branches/{branchName}/jobs/{jobId}",
appId = app_id,
branchName = branch_name,
jobId = job_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteJobInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::DeleteJob::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteJob",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_job_input::Builder {
crate::input::delete_job_input::Builder::default()
}
}
pub mod delete_webhook_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) webhook_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn webhook_id(mut self, input: impl Into<std::string::String>) -> Self {
self.webhook_id = Some(input.into());
self
}
pub fn set_webhook_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.webhook_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteWebhookInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteWebhookInput {
webhook_id: self.webhook_id,
})
}
}
}
impl DeleteWebhookInput {
#[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::DeleteWebhook,
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::DeleteWebhookInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_17 = &_input.webhook_id;
let input_17 = input_17.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"webhook_id",
"cannot be empty or unset",
)
})?;
let webhook_id = aws_smithy_http::label::fmt_string(
input_17,
aws_smithy_http::label::EncodingStrategy::Default,
);
if webhook_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"webhook_id",
"cannot be empty or unset",
),
);
}
write!(output, "/webhooks/{webhookId}", webhookId = webhook_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteWebhookInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteWebhook::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteWebhook",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_webhook_input::Builder {
crate::input::delete_webhook_input::Builder::default()
}
}
pub mod generate_access_logs_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) start_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) end_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) domain_name: std::option::Option<std::string::String>,
pub(crate) app_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn start_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.start_time = Some(input);
self
}
pub fn set_start_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.start_time = input;
self
}
pub fn end_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.end_time = Some(input);
self
}
pub fn set_end_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.end_time = input;
self
}
pub fn domain_name(mut self, input: impl Into<std::string::String>) -> Self {
self.domain_name = Some(input.into());
self
}
pub fn set_domain_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.domain_name = input;
self
}
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GenerateAccessLogsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GenerateAccessLogsInput {
start_time: self.start_time,
end_time: self.end_time,
domain_name: self.domain_name,
app_id: self.app_id,
})
}
}
}
impl GenerateAccessLogsInput {
#[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::GenerateAccessLogs,
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::GenerateAccessLogsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_18 = &_input.app_id;
let input_18 = input_18.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_18,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
write!(output, "/apps/{appId}/accesslogs", appId = app_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GenerateAccessLogsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_generate_access_logs(&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::GenerateAccessLogs::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GenerateAccessLogs",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::generate_access_logs_input::Builder {
crate::input::generate_access_logs_input::Builder::default()
}
}
pub mod get_app_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetAppInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetAppInput {
app_id: self.app_id,
})
}
}
}
impl GetAppInput {
#[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::GetApp,
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::GetAppInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_19 = &_input.app_id;
let input_19 = input_19.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_19,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
write!(output, "/apps/{appId}", appId = app_id).expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetAppInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::GetApp::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetApp", "amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_app_input::Builder {
crate::input::get_app_input::Builder::default()
}
}
pub mod get_artifact_url_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) artifact_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn artifact_id(mut self, input: impl Into<std::string::String>) -> Self {
self.artifact_id = Some(input.into());
self
}
pub fn set_artifact_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.artifact_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetArtifactUrlInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetArtifactUrlInput {
artifact_id: self.artifact_id,
})
}
}
}
impl GetArtifactUrlInput {
#[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::GetArtifactUrl,
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::GetArtifactUrlInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_20 = &_input.artifact_id;
let input_20 = input_20.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"artifact_id",
"cannot be empty or unset",
)
})?;
let artifact_id = aws_smithy_http::label::fmt_string(
input_20,
aws_smithy_http::label::EncodingStrategy::Default,
);
if artifact_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"artifact_id",
"cannot be empty or unset",
),
);
}
write!(output, "/artifacts/{artifactId}", artifactId = artifact_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetArtifactUrlInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetArtifactUrl::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetArtifactUrl",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_artifact_url_input::Builder {
crate::input::get_artifact_url_input::Builder::default()
}
}
pub mod get_backend_environment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) environment_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.environment_name = Some(input.into());
self
}
pub fn set_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.environment_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetBackendEnvironmentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetBackendEnvironmentInput {
app_id: self.app_id,
environment_name: self.environment_name,
})
}
}
}
impl GetBackendEnvironmentInput {
#[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::GetBackendEnvironment,
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::GetBackendEnvironmentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_21 = &_input.app_id;
let input_21 = input_21.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_21,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
let input_22 = &_input.environment_name;
let input_22 = input_22.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"environment_name",
"cannot be empty or unset",
)
})?;
let environment_name = aws_smithy_http::label::fmt_string(
input_22,
aws_smithy_http::label::EncodingStrategy::Default,
);
if environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/apps/{appId}/backendenvironments/{environmentName}",
appId = app_id,
environmentName = environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetBackendEnvironmentInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetBackendEnvironment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetBackendEnvironment",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_backend_environment_input::Builder {
crate::input::get_backend_environment_input::Builder::default()
}
}
pub mod get_branch_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetBranchInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetBranchInput {
app_id: self.app_id,
branch_name: self.branch_name,
})
}
}
}
impl GetBranchInput {
#[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::GetBranch,
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::GetBranchInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_23 = &_input.app_id;
let input_23 = input_23.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_23,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
let input_24 = &_input.branch_name;
let input_24 = input_24.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
)
})?;
let branch_name = aws_smithy_http::label::fmt_string(
input_24,
aws_smithy_http::label::EncodingStrategy::Default,
);
if branch_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/apps/{appId}/branches/{branchName}",
appId = app_id,
branchName = branch_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetBranchInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::GetBranch::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetBranch",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_branch_input::Builder {
crate::input::get_branch_input::Builder::default()
}
}
pub mod get_domain_association_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) domain_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn domain_name(mut self, input: impl Into<std::string::String>) -> Self {
self.domain_name = Some(input.into());
self
}
pub fn set_domain_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.domain_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetDomainAssociationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetDomainAssociationInput {
app_id: self.app_id,
domain_name: self.domain_name,
})
}
}
}
impl GetDomainAssociationInput {
#[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::GetDomainAssociation,
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::GetDomainAssociationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_25 = &_input.app_id;
let input_25 = input_25.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_25,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
let input_26 = &_input.domain_name;
let input_26 = input_26.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
)
})?;
let domain_name = aws_smithy_http::label::fmt_string(
input_26,
aws_smithy_http::label::EncodingStrategy::Default,
);
if domain_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/apps/{appId}/domains/{domainName}",
appId = app_id,
domainName = domain_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetDomainAssociationInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetDomainAssociation::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetDomainAssociation",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_domain_association_input::Builder {
crate::input::get_domain_association_input::Builder::default()
}
}
pub mod get_job_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
pub(crate) job_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.job_id = Some(input.into());
self
}
pub fn set_job_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.job_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetJobInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetJobInput {
app_id: self.app_id,
branch_name: self.branch_name,
job_id: self.job_id,
})
}
}
}
impl GetJobInput {
#[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::GetJob,
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::GetJobInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_27 = &_input.app_id;
let input_27 = input_27.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_27,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
let input_28 = &_input.branch_name;
let input_28 = input_28.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
)
})?;
let branch_name = aws_smithy_http::label::fmt_string(
input_28,
aws_smithy_http::label::EncodingStrategy::Default,
);
if branch_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
),
);
}
let input_29 = &_input.job_id;
let input_29 = input_29.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"job_id",
"cannot be empty or unset",
)
})?;
let job_id = aws_smithy_http::label::fmt_string(
input_29,
aws_smithy_http::label::EncodingStrategy::Default,
);
if job_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"job_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/apps/{appId}/branches/{branchName}/jobs/{jobId}",
appId = app_id,
branchName = branch_name,
jobId = job_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetJobInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::GetJob::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetJob", "amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_job_input::Builder {
crate::input::get_job_input::Builder::default()
}
}
pub mod get_webhook_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) webhook_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn webhook_id(mut self, input: impl Into<std::string::String>) -> Self {
self.webhook_id = Some(input.into());
self
}
pub fn set_webhook_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.webhook_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetWebhookInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetWebhookInput {
webhook_id: self.webhook_id,
})
}
}
}
impl GetWebhookInput {
#[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::GetWebhook,
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::GetWebhookInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_30 = &_input.webhook_id;
let input_30 = input_30.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"webhook_id",
"cannot be empty or unset",
)
})?;
let webhook_id = aws_smithy_http::label::fmt_string(
input_30,
aws_smithy_http::label::EncodingStrategy::Default,
);
if webhook_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"webhook_id",
"cannot be empty or unset",
),
);
}
write!(output, "/webhooks/{webhookId}", webhookId = webhook_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetWebhookInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetWebhook::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetWebhook",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_webhook_input::Builder {
crate::input::get_webhook_input::Builder::default()
}
}
pub mod list_apps_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListAppsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListAppsInput {
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
})
}
}
}
impl ListAppsInput {
#[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::ListApps,
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::ListAppsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/apps").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListAppsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_31) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_31));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListAppsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::ListApps::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListApps", "amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_apps_input::Builder {
crate::input::list_apps_input::Builder::default()
}
}
pub mod list_artifacts_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
pub(crate) job_id: std::option::Option<std::string::String>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.job_id = Some(input.into());
self
}
pub fn set_job_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.job_id = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListArtifactsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListArtifactsInput {
app_id: self.app_id,
branch_name: self.branch_name,
job_id: self.job_id,
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
})
}
}
}
impl ListArtifactsInput {
#[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::ListArtifacts,
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::ListArtifactsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_32 = &_input.app_id;
let input_32 = input_32.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_32,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
let input_33 = &_input.branch_name;
let input_33 = input_33.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
)
})?;
let branch_name = aws_smithy_http::label::fmt_string(
input_33,
aws_smithy_http::label::EncodingStrategy::Default,
);
if branch_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
),
);
}
let input_34 = &_input.job_id;
let input_34 = input_34.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"job_id",
"cannot be empty or unset",
)
})?;
let job_id = aws_smithy_http::label::fmt_string(
input_34,
aws_smithy_http::label::EncodingStrategy::Default,
);
if job_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"job_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/apps/{appId}/branches/{branchName}/jobs/{jobId}/artifacts",
appId = app_id,
branchName = branch_name,
jobId = job_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListArtifactsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_35) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_35));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListArtifactsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListArtifacts::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListArtifacts",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_artifacts_input::Builder {
crate::input::list_artifacts_input::Builder::default()
}
}
pub mod list_backend_environments_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) environment_name: std::option::Option<std::string::String>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.environment_name = Some(input.into());
self
}
pub fn set_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.environment_name = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListBackendEnvironmentsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListBackendEnvironmentsInput {
app_id: self.app_id,
environment_name: self.environment_name,
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
})
}
}
}
impl ListBackendEnvironmentsInput {
#[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::ListBackendEnvironments,
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::ListBackendEnvironmentsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_36 = &_input.app_id;
let input_36 = input_36.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_36,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
write!(output, "/apps/{appId}/backendenvironments", appId = app_id)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListBackendEnvironmentsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_37) = &_input.environment_name {
{
query.push_kv(
"environmentName",
&aws_smithy_http::query::fmt_string(&inner_37),
);
}
}
if let Some(inner_38) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_38));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListBackendEnvironmentsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListBackendEnvironments::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListBackendEnvironments",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_backend_environments_input::Builder {
crate::input::list_backend_environments_input::Builder::default()
}
}
pub mod list_branches_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListBranchesInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListBranchesInput {
app_id: self.app_id,
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
})
}
}
}
impl ListBranchesInput {
#[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::ListBranches,
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::ListBranchesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_39 = &_input.app_id;
let input_39 = input_39.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_39,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
write!(output, "/apps/{appId}/branches", appId = app_id)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListBranchesInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_40) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_40));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListBranchesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListBranches::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListBranches",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_branches_input::Builder {
crate::input::list_branches_input::Builder::default()
}
}
pub mod list_domain_associations_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListDomainAssociationsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListDomainAssociationsInput {
app_id: self.app_id,
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
})
}
}
}
impl ListDomainAssociationsInput {
#[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::ListDomainAssociations,
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::ListDomainAssociationsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_41 = &_input.app_id;
let input_41 = input_41.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_41,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
write!(output, "/apps/{appId}/domains", appId = app_id)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListDomainAssociationsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_42) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_42));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListDomainAssociationsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListDomainAssociations::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListDomainAssociations",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_domain_associations_input::Builder {
crate::input::list_domain_associations_input::Builder::default()
}
}
pub mod list_jobs_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListJobsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListJobsInput {
app_id: self.app_id,
branch_name: self.branch_name,
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
})
}
}
}
impl ListJobsInput {
#[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::ListJobs,
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::ListJobsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_43 = &_input.app_id;
let input_43 = input_43.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_43,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
let input_44 = &_input.branch_name;
let input_44 = input_44.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
)
})?;
let branch_name = aws_smithy_http::label::fmt_string(
input_44,
aws_smithy_http::label::EncodingStrategy::Default,
);
if branch_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/apps/{appId}/branches/{branchName}/jobs",
appId = app_id,
branchName = branch_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListJobsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_45) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_45));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListJobsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::ListJobs::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListJobs", "amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_jobs_input::Builder {
crate::input::list_jobs_input::Builder::default()
}
}
pub mod list_tags_for_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListTagsForResourceInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListTagsForResourceInput {
resource_arn: self.resource_arn,
})
}
}
}
impl ListTagsForResourceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListTagsForResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListTagsForResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_46 = &_input.resource_arn;
let input_46 = input_46.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
)
})?;
let resource_arn = aws_smithy_http::label::fmt_string(
input_46,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/tags/{resourceArn}", resourceArn = resource_arn)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListTagsForResourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListTagsForResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListTagsForResource",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_tags_for_resource_input::Builder {
crate::input::list_tags_for_resource_input::Builder::default()
}
}
pub mod list_webhooks_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListWebhooksInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListWebhooksInput {
app_id: self.app_id,
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
})
}
}
}
impl ListWebhooksInput {
#[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::ListWebhooks,
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::ListWebhooksInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_47 = &_input.app_id;
let input_47 = input_47.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_47,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
write!(output, "/apps/{appId}/webhooks", appId = app_id)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListWebhooksInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_48) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_48));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListWebhooksInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListWebhooks::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListWebhooks",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_webhooks_input::Builder {
crate::input::list_webhooks_input::Builder::default()
}
}
pub mod start_deployment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
pub(crate) job_id: std::option::Option<std::string::String>,
pub(crate) source_url: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.job_id = Some(input.into());
self
}
pub fn set_job_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.job_id = input;
self
}
pub fn source_url(mut self, input: impl Into<std::string::String>) -> Self {
self.source_url = Some(input.into());
self
}
pub fn set_source_url(mut self, input: std::option::Option<std::string::String>) -> Self {
self.source_url = input;
self
}
pub fn build(
self,
) -> Result<crate::input::StartDeploymentInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::StartDeploymentInput {
app_id: self.app_id,
branch_name: self.branch_name,
job_id: self.job_id,
source_url: self.source_url,
})
}
}
}
impl StartDeploymentInput {
#[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::StartDeployment,
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::StartDeploymentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_49 = &_input.app_id;
let input_49 = input_49.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_49,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
let input_50 = &_input.branch_name;
let input_50 = input_50.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
)
})?;
let branch_name = aws_smithy_http::label::fmt_string(
input_50,
aws_smithy_http::label::EncodingStrategy::Default,
);
if branch_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/apps/{appId}/branches/{branchName}/deployments/start",
appId = app_id,
branchName = branch_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::StartDeploymentInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_start_deployment(&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::StartDeployment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"StartDeployment",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::start_deployment_input::Builder {
crate::input::start_deployment_input::Builder::default()
}
}
pub mod start_job_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
pub(crate) job_id: std::option::Option<std::string::String>,
pub(crate) job_type: std::option::Option<crate::model::JobType>,
pub(crate) job_reason: std::option::Option<std::string::String>,
pub(crate) commit_id: std::option::Option<std::string::String>,
pub(crate) commit_message: std::option::Option<std::string::String>,
pub(crate) commit_time: std::option::Option<aws_smithy_types::DateTime>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.job_id = Some(input.into());
self
}
pub fn set_job_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.job_id = input;
self
}
pub fn job_type(mut self, input: crate::model::JobType) -> Self {
self.job_type = Some(input);
self
}
pub fn set_job_type(mut self, input: std::option::Option<crate::model::JobType>) -> Self {
self.job_type = input;
self
}
pub fn job_reason(mut self, input: impl Into<std::string::String>) -> Self {
self.job_reason = Some(input.into());
self
}
pub fn set_job_reason(mut self, input: std::option::Option<std::string::String>) -> Self {
self.job_reason = input;
self
}
pub fn commit_id(mut self, input: impl Into<std::string::String>) -> Self {
self.commit_id = Some(input.into());
self
}
pub fn set_commit_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.commit_id = input;
self
}
pub fn commit_message(mut self, input: impl Into<std::string::String>) -> Self {
self.commit_message = Some(input.into());
self
}
pub fn set_commit_message(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.commit_message = input;
self
}
pub fn commit_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.commit_time = Some(input);
self
}
pub fn set_commit_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.commit_time = input;
self
}
pub fn build(
self,
) -> Result<crate::input::StartJobInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::StartJobInput {
app_id: self.app_id,
branch_name: self.branch_name,
job_id: self.job_id,
job_type: self.job_type,
job_reason: self.job_reason,
commit_id: self.commit_id,
commit_message: self.commit_message,
commit_time: self.commit_time,
})
}
}
}
impl StartJobInput {
#[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::StartJob,
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::StartJobInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_51 = &_input.app_id;
let input_51 = input_51.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_51,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
let input_52 = &_input.branch_name;
let input_52 = input_52.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
)
})?;
let branch_name = aws_smithy_http::label::fmt_string(
input_52,
aws_smithy_http::label::EncodingStrategy::Default,
);
if branch_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/apps/{appId}/branches/{branchName}/jobs",
appId = app_id,
branchName = branch_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::StartJobInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_start_job(&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::StartJob::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"StartJob", "amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::start_job_input::Builder {
crate::input::start_job_input::Builder::default()
}
}
pub mod stop_job_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
pub(crate) job_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn job_id(mut self, input: impl Into<std::string::String>) -> Self {
self.job_id = Some(input.into());
self
}
pub fn set_job_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.job_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::StopJobInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::StopJobInput {
app_id: self.app_id,
branch_name: self.branch_name,
job_id: self.job_id,
})
}
}
}
impl StopJobInput {
#[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::StopJob,
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::StopJobInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_53 = &_input.app_id;
let input_53 = input_53.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_53,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
let input_54 = &_input.branch_name;
let input_54 = input_54.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
)
})?;
let branch_name = aws_smithy_http::label::fmt_string(
input_54,
aws_smithy_http::label::EncodingStrategy::Default,
);
if branch_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
),
);
}
let input_55 = &_input.job_id;
let input_55 = input_55.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"job_id",
"cannot be empty or unset",
)
})?;
let job_id = aws_smithy_http::label::fmt_string(
input_55,
aws_smithy_http::label::EncodingStrategy::Default,
);
if job_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"job_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/apps/{appId}/branches/{branchName}/jobs/{jobId}/stop",
appId = app_id,
branchName = branch_name,
jobId = job_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::StopJobInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::StopJob::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"StopJob", "amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::stop_job_input::Builder {
crate::input::stop_job_input::Builder::default()
}
}
pub mod tag_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_arn: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> Result<crate::input::TagResourceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::TagResourceInput {
resource_arn: self.resource_arn,
tags: self.tags,
})
}
}
}
impl TagResourceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::TagResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::TagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_56 = &_input.resource_arn;
let input_56 = input_56.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
)
})?;
let resource_arn = aws_smithy_http::label::fmt_string(
input_56,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/tags/{resourceArn}", resourceArn = resource_arn)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::TagResourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_tag_resource(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::TagResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"TagResource",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::tag_resource_input::Builder {
crate::input::tag_resource_input::Builder::default()
}
}
pub mod untag_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_arn: std::option::Option<std::string::String>,
pub(crate) tag_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn tag_keys(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.tag_keys.unwrap_or_default();
v.push(input.into());
self.tag_keys = Some(v);
self
}
pub fn set_tag_keys(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.tag_keys = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UntagResourceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UntagResourceInput {
resource_arn: self.resource_arn,
tag_keys: self.tag_keys,
})
}
}
}
impl UntagResourceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UntagResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UntagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_57 = &_input.resource_arn;
let input_57 = input_57.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
)
})?;
let resource_arn = aws_smithy_http::label::fmt_string(
input_57,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/tags/{resourceArn}", resourceArn = resource_arn)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::UntagResourceInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_58 = &_input.tag_keys;
let inner_58 = inner_58.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"tag_keys",
"cannot be empty or unset",
)
})?;
for inner_59 in inner_58 {
query.push_kv("tagKeys", &aws_smithy_http::query::fmt_string(&inner_59));
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UntagResourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UntagResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UntagResource",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::untag_resource_input::Builder {
crate::input::untag_resource_input::Builder::default()
}
}
pub mod update_app_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) platform: std::option::Option<crate::model::Platform>,
pub(crate) iam_service_role_arn: std::option::Option<std::string::String>,
pub(crate) environment_variables: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) enable_branch_auto_build: std::option::Option<bool>,
pub(crate) enable_branch_auto_deletion: std::option::Option<bool>,
pub(crate) enable_basic_auth: std::option::Option<bool>,
pub(crate) basic_auth_credentials: std::option::Option<std::string::String>,
pub(crate) custom_rules: std::option::Option<std::vec::Vec<crate::model::CustomRule>>,
pub(crate) build_spec: std::option::Option<std::string::String>,
pub(crate) custom_headers: std::option::Option<std::string::String>,
pub(crate) enable_auto_branch_creation: std::option::Option<bool>,
pub(crate) auto_branch_creation_patterns:
std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) auto_branch_creation_config:
std::option::Option<crate::model::AutoBranchCreationConfig>,
pub(crate) repository: std::option::Option<std::string::String>,
pub(crate) oauth_token: std::option::Option<std::string::String>,
pub(crate) access_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn platform(mut self, input: crate::model::Platform) -> Self {
self.platform = Some(input);
self
}
pub fn set_platform(mut self, input: std::option::Option<crate::model::Platform>) -> Self {
self.platform = input;
self
}
pub fn iam_service_role_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.iam_service_role_arn = Some(input.into());
self
}
pub fn set_iam_service_role_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.iam_service_role_arn = input;
self
}
pub fn environment_variables(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.environment_variables.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.environment_variables = Some(hash_map);
self
}
pub fn set_environment_variables(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.environment_variables = input;
self
}
pub fn enable_branch_auto_build(mut self, input: bool) -> Self {
self.enable_branch_auto_build = Some(input);
self
}
pub fn set_enable_branch_auto_build(mut self, input: std::option::Option<bool>) -> Self {
self.enable_branch_auto_build = input;
self
}
pub fn enable_branch_auto_deletion(mut self, input: bool) -> Self {
self.enable_branch_auto_deletion = Some(input);
self
}
pub fn set_enable_branch_auto_deletion(mut self, input: std::option::Option<bool>) -> Self {
self.enable_branch_auto_deletion = input;
self
}
pub fn enable_basic_auth(mut self, input: bool) -> Self {
self.enable_basic_auth = Some(input);
self
}
pub fn set_enable_basic_auth(mut self, input: std::option::Option<bool>) -> Self {
self.enable_basic_auth = input;
self
}
pub fn basic_auth_credentials(mut self, input: impl Into<std::string::String>) -> Self {
self.basic_auth_credentials = Some(input.into());
self
}
pub fn set_basic_auth_credentials(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.basic_auth_credentials = input;
self
}
pub fn custom_rules(mut self, input: crate::model::CustomRule) -> Self {
let mut v = self.custom_rules.unwrap_or_default();
v.push(input);
self.custom_rules = Some(v);
self
}
pub fn set_custom_rules(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::CustomRule>>,
) -> Self {
self.custom_rules = input;
self
}
pub fn build_spec(mut self, input: impl Into<std::string::String>) -> Self {
self.build_spec = Some(input.into());
self
}
pub fn set_build_spec(mut self, input: std::option::Option<std::string::String>) -> Self {
self.build_spec = input;
self
}
pub fn custom_headers(mut self, input: impl Into<std::string::String>) -> Self {
self.custom_headers = Some(input.into());
self
}
pub fn set_custom_headers(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.custom_headers = input;
self
}
pub fn enable_auto_branch_creation(mut self, input: bool) -> Self {
self.enable_auto_branch_creation = Some(input);
self
}
pub fn set_enable_auto_branch_creation(mut self, input: std::option::Option<bool>) -> Self {
self.enable_auto_branch_creation = input;
self
}
pub fn auto_branch_creation_patterns(
mut self,
input: impl Into<std::string::String>,
) -> Self {
let mut v = self.auto_branch_creation_patterns.unwrap_or_default();
v.push(input.into());
self.auto_branch_creation_patterns = Some(v);
self
}
pub fn set_auto_branch_creation_patterns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.auto_branch_creation_patterns = input;
self
}
pub fn auto_branch_creation_config(
mut self,
input: crate::model::AutoBranchCreationConfig,
) -> Self {
self.auto_branch_creation_config = Some(input);
self
}
pub fn set_auto_branch_creation_config(
mut self,
input: std::option::Option<crate::model::AutoBranchCreationConfig>,
) -> Self {
self.auto_branch_creation_config = input;
self
}
pub fn repository(mut self, input: impl Into<std::string::String>) -> Self {
self.repository = Some(input.into());
self
}
pub fn set_repository(mut self, input: std::option::Option<std::string::String>) -> Self {
self.repository = input;
self
}
pub fn oauth_token(mut self, input: impl Into<std::string::String>) -> Self {
self.oauth_token = Some(input.into());
self
}
pub fn set_oauth_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.oauth_token = input;
self
}
pub fn access_token(mut self, input: impl Into<std::string::String>) -> Self {
self.access_token = Some(input.into());
self
}
pub fn set_access_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.access_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateAppInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateAppInput {
app_id: self.app_id,
name: self.name,
description: self.description,
platform: self.platform,
iam_service_role_arn: self.iam_service_role_arn,
environment_variables: self.environment_variables,
enable_branch_auto_build: self.enable_branch_auto_build,
enable_branch_auto_deletion: self.enable_branch_auto_deletion,
enable_basic_auth: self.enable_basic_auth,
basic_auth_credentials: self.basic_auth_credentials,
custom_rules: self.custom_rules,
build_spec: self.build_spec,
custom_headers: self.custom_headers,
enable_auto_branch_creation: self.enable_auto_branch_creation,
auto_branch_creation_patterns: self.auto_branch_creation_patterns,
auto_branch_creation_config: self.auto_branch_creation_config,
repository: self.repository,
oauth_token: self.oauth_token,
access_token: self.access_token,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("app_id", &self.app_id);
formatter.field("name", &self.name);
formatter.field("description", &self.description);
formatter.field("platform", &self.platform);
formatter.field("iam_service_role_arn", &self.iam_service_role_arn);
formatter.field("environment_variables", &self.environment_variables);
formatter.field("enable_branch_auto_build", &self.enable_branch_auto_build);
formatter.field(
"enable_branch_auto_deletion",
&self.enable_branch_auto_deletion,
);
formatter.field("enable_basic_auth", &self.enable_basic_auth);
formatter.field("basic_auth_credentials", &"*** Sensitive Data Redacted ***");
formatter.field("custom_rules", &self.custom_rules);
formatter.field("build_spec", &"*** Sensitive Data Redacted ***");
formatter.field("custom_headers", &self.custom_headers);
formatter.field(
"enable_auto_branch_creation",
&self.enable_auto_branch_creation,
);
formatter.field(
"auto_branch_creation_patterns",
&self.auto_branch_creation_patterns,
);
formatter.field(
"auto_branch_creation_config",
&self.auto_branch_creation_config,
);
formatter.field("repository", &self.repository);
formatter.field("oauth_token", &"*** Sensitive Data Redacted ***");
formatter.field("access_token", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
}
impl UpdateAppInput {
#[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::UpdateApp,
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::UpdateAppInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_60 = &_input.app_id;
let input_60 = input_60.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_60,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
write!(output, "/apps/{appId}", appId = app_id).expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateAppInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_app(&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::UpdateApp::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateApp",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_app_input::Builder {
crate::input::update_app_input::Builder::default()
}
}
pub mod update_branch_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) framework: std::option::Option<std::string::String>,
pub(crate) stage: std::option::Option<crate::model::Stage>,
pub(crate) enable_notification: std::option::Option<bool>,
pub(crate) enable_auto_build: std::option::Option<bool>,
pub(crate) environment_variables: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) basic_auth_credentials: std::option::Option<std::string::String>,
pub(crate) enable_basic_auth: std::option::Option<bool>,
pub(crate) enable_performance_mode: std::option::Option<bool>,
pub(crate) build_spec: std::option::Option<std::string::String>,
pub(crate) ttl: std::option::Option<std::string::String>,
pub(crate) display_name: std::option::Option<std::string::String>,
pub(crate) enable_pull_request_preview: std::option::Option<bool>,
pub(crate) pull_request_environment_name: std::option::Option<std::string::String>,
pub(crate) backend_environment_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn framework(mut self, input: impl Into<std::string::String>) -> Self {
self.framework = Some(input.into());
self
}
pub fn set_framework(mut self, input: std::option::Option<std::string::String>) -> Self {
self.framework = input;
self
}
pub fn stage(mut self, input: crate::model::Stage) -> Self {
self.stage = Some(input);
self
}
pub fn set_stage(mut self, input: std::option::Option<crate::model::Stage>) -> Self {
self.stage = input;
self
}
pub fn enable_notification(mut self, input: bool) -> Self {
self.enable_notification = Some(input);
self
}
pub fn set_enable_notification(mut self, input: std::option::Option<bool>) -> Self {
self.enable_notification = input;
self
}
pub fn enable_auto_build(mut self, input: bool) -> Self {
self.enable_auto_build = Some(input);
self
}
pub fn set_enable_auto_build(mut self, input: std::option::Option<bool>) -> Self {
self.enable_auto_build = input;
self
}
pub fn environment_variables(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.environment_variables.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.environment_variables = Some(hash_map);
self
}
pub fn set_environment_variables(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.environment_variables = input;
self
}
pub fn basic_auth_credentials(mut self, input: impl Into<std::string::String>) -> Self {
self.basic_auth_credentials = Some(input.into());
self
}
pub fn set_basic_auth_credentials(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.basic_auth_credentials = input;
self
}
pub fn enable_basic_auth(mut self, input: bool) -> Self {
self.enable_basic_auth = Some(input);
self
}
pub fn set_enable_basic_auth(mut self, input: std::option::Option<bool>) -> Self {
self.enable_basic_auth = input;
self
}
pub fn enable_performance_mode(mut self, input: bool) -> Self {
self.enable_performance_mode = Some(input);
self
}
pub fn set_enable_performance_mode(mut self, input: std::option::Option<bool>) -> Self {
self.enable_performance_mode = input;
self
}
pub fn build_spec(mut self, input: impl Into<std::string::String>) -> Self {
self.build_spec = Some(input.into());
self
}
pub fn set_build_spec(mut self, input: std::option::Option<std::string::String>) -> Self {
self.build_spec = input;
self
}
pub fn ttl(mut self, input: impl Into<std::string::String>) -> Self {
self.ttl = Some(input.into());
self
}
pub fn set_ttl(mut self, input: std::option::Option<std::string::String>) -> Self {
self.ttl = input;
self
}
pub fn display_name(mut self, input: impl Into<std::string::String>) -> Self {
self.display_name = Some(input.into());
self
}
pub fn set_display_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.display_name = input;
self
}
pub fn enable_pull_request_preview(mut self, input: bool) -> Self {
self.enable_pull_request_preview = Some(input);
self
}
pub fn set_enable_pull_request_preview(mut self, input: std::option::Option<bool>) -> Self {
self.enable_pull_request_preview = input;
self
}
pub fn pull_request_environment_name(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.pull_request_environment_name = Some(input.into());
self
}
pub fn set_pull_request_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_environment_name = input;
self
}
pub fn backend_environment_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_arn = Some(input.into());
self
}
pub fn set_backend_environment_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_arn = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateBranchInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateBranchInput {
app_id: self.app_id,
branch_name: self.branch_name,
description: self.description,
framework: self.framework,
stage: self.stage,
enable_notification: self.enable_notification,
enable_auto_build: self.enable_auto_build,
environment_variables: self.environment_variables,
basic_auth_credentials: self.basic_auth_credentials,
enable_basic_auth: self.enable_basic_auth,
enable_performance_mode: self.enable_performance_mode,
build_spec: self.build_spec,
ttl: self.ttl,
display_name: self.display_name,
enable_pull_request_preview: self.enable_pull_request_preview,
pull_request_environment_name: self.pull_request_environment_name,
backend_environment_arn: self.backend_environment_arn,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("app_id", &self.app_id);
formatter.field("branch_name", &self.branch_name);
formatter.field("description", &self.description);
formatter.field("framework", &self.framework);
formatter.field("stage", &self.stage);
formatter.field("enable_notification", &self.enable_notification);
formatter.field("enable_auto_build", &self.enable_auto_build);
formatter.field("environment_variables", &self.environment_variables);
formatter.field("basic_auth_credentials", &"*** Sensitive Data Redacted ***");
formatter.field("enable_basic_auth", &self.enable_basic_auth);
formatter.field("enable_performance_mode", &self.enable_performance_mode);
formatter.field("build_spec", &"*** Sensitive Data Redacted ***");
formatter.field("ttl", &self.ttl);
formatter.field("display_name", &self.display_name);
formatter.field(
"enable_pull_request_preview",
&self.enable_pull_request_preview,
);
formatter.field(
"pull_request_environment_name",
&self.pull_request_environment_name,
);
formatter.field("backend_environment_arn", &self.backend_environment_arn);
formatter.finish()
}
}
}
impl UpdateBranchInput {
#[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::UpdateBranch,
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::UpdateBranchInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_61 = &_input.app_id;
let input_61 = input_61.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_61,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
let input_62 = &_input.branch_name;
let input_62 = input_62.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
)
})?;
let branch_name = aws_smithy_http::label::fmt_string(
input_62,
aws_smithy_http::label::EncodingStrategy::Default,
);
if branch_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"branch_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/apps/{appId}/branches/{branchName}",
appId = app_id,
branchName = branch_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateBranchInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_branch(&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::UpdateBranch::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateBranch",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_branch_input::Builder {
crate::input::update_branch_input::Builder::default()
}
}
pub mod update_domain_association_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) app_id: std::option::Option<std::string::String>,
pub(crate) domain_name: std::option::Option<std::string::String>,
pub(crate) enable_auto_sub_domain: std::option::Option<bool>,
pub(crate) sub_domain_settings:
std::option::Option<std::vec::Vec<crate::model::SubDomainSetting>>,
pub(crate) auto_sub_domain_creation_patterns:
std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) auto_sub_domain_iam_role: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.app_id = Some(input.into());
self
}
pub fn set_app_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn domain_name(mut self, input: impl Into<std::string::String>) -> Self {
self.domain_name = Some(input.into());
self
}
pub fn set_domain_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.domain_name = input;
self
}
pub fn enable_auto_sub_domain(mut self, input: bool) -> Self {
self.enable_auto_sub_domain = Some(input);
self
}
pub fn set_enable_auto_sub_domain(mut self, input: std::option::Option<bool>) -> Self {
self.enable_auto_sub_domain = input;
self
}
pub fn sub_domain_settings(mut self, input: crate::model::SubDomainSetting) -> Self {
let mut v = self.sub_domain_settings.unwrap_or_default();
v.push(input);
self.sub_domain_settings = Some(v);
self
}
pub fn set_sub_domain_settings(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::SubDomainSetting>>,
) -> Self {
self.sub_domain_settings = input;
self
}
pub fn auto_sub_domain_creation_patterns(
mut self,
input: impl Into<std::string::String>,
) -> Self {
let mut v = self.auto_sub_domain_creation_patterns.unwrap_or_default();
v.push(input.into());
self.auto_sub_domain_creation_patterns = Some(v);
self
}
pub fn set_auto_sub_domain_creation_patterns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.auto_sub_domain_creation_patterns = input;
self
}
pub fn auto_sub_domain_iam_role(mut self, input: impl Into<std::string::String>) -> Self {
self.auto_sub_domain_iam_role = Some(input.into());
self
}
pub fn set_auto_sub_domain_iam_role(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.auto_sub_domain_iam_role = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateDomainAssociationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateDomainAssociationInput {
app_id: self.app_id,
domain_name: self.domain_name,
enable_auto_sub_domain: self.enable_auto_sub_domain,
sub_domain_settings: self.sub_domain_settings,
auto_sub_domain_creation_patterns: self.auto_sub_domain_creation_patterns,
auto_sub_domain_iam_role: self.auto_sub_domain_iam_role,
})
}
}
}
impl UpdateDomainAssociationInput {
#[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::UpdateDomainAssociation,
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::UpdateDomainAssociationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_63 = &_input.app_id;
let input_63 = input_63.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
)
})?;
let app_id = aws_smithy_http::label::fmt_string(
input_63,
aws_smithy_http::label::EncodingStrategy::Default,
);
if app_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_id",
"cannot be empty or unset",
),
);
}
let input_64 = &_input.domain_name;
let input_64 = input_64.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
)
})?;
let domain_name = aws_smithy_http::label::fmt_string(
input_64,
aws_smithy_http::label::EncodingStrategy::Default,
);
if domain_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/apps/{appId}/domains/{domainName}",
appId = app_id,
domainName = domain_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateDomainAssociationInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_domain_association(
&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::UpdateDomainAssociation::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateDomainAssociation",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_domain_association_input::Builder {
crate::input::update_domain_association_input::Builder::default()
}
}
pub mod update_webhook_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) webhook_id: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
}
impl Builder {
pub fn webhook_id(mut self, input: impl Into<std::string::String>) -> Self {
self.webhook_id = Some(input.into());
self
}
pub fn set_webhook_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.webhook_id = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateWebhookInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateWebhookInput {
webhook_id: self.webhook_id,
branch_name: self.branch_name,
description: self.description,
})
}
}
}
impl UpdateWebhookInput {
#[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::UpdateWebhook,
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::UpdateWebhookInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_65 = &_input.webhook_id;
let input_65 = input_65.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"webhook_id",
"cannot be empty or unset",
)
})?;
let webhook_id = aws_smithy_http::label::fmt_string(
input_65,
aws_smithy_http::label::EncodingStrategy::Default,
);
if webhook_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"webhook_id",
"cannot be empty or unset",
),
);
}
write!(output, "/webhooks/{webhookId}", webhookId = webhook_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateWebhookInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_webhook(&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::UpdateWebhook::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateWebhook",
"amplify",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_webhook_input::Builder {
crate::input::update_webhook_input::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateWebhookInput {
#[doc(hidden)]
pub webhook_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
}
impl UpdateWebhookInput {
pub fn webhook_id(&self) -> std::option::Option<&str> {
self.webhook_id.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateDomainAssociationInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub domain_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub enable_auto_sub_domain: std::option::Option<bool>,
#[doc(hidden)]
pub sub_domain_settings: std::option::Option<std::vec::Vec<crate::model::SubDomainSetting>>,
#[doc(hidden)]
pub auto_sub_domain_creation_patterns: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub auto_sub_domain_iam_role: std::option::Option<std::string::String>,
}
impl UpdateDomainAssociationInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn domain_name(&self) -> std::option::Option<&str> {
self.domain_name.as_deref()
}
pub fn enable_auto_sub_domain(&self) -> std::option::Option<bool> {
self.enable_auto_sub_domain
}
pub fn sub_domain_settings(&self) -> std::option::Option<&[crate::model::SubDomainSetting]> {
self.sub_domain_settings.as_deref()
}
pub fn auto_sub_domain_creation_patterns(&self) -> std::option::Option<&[std::string::String]> {
self.auto_sub_domain_creation_patterns.as_deref()
}
pub fn auto_sub_domain_iam_role(&self) -> std::option::Option<&str> {
self.auto_sub_domain_iam_role.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UpdateBranchInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub framework: std::option::Option<std::string::String>,
#[doc(hidden)]
pub stage: std::option::Option<crate::model::Stage>,
#[doc(hidden)]
pub enable_notification: std::option::Option<bool>,
#[doc(hidden)]
pub enable_auto_build: std::option::Option<bool>,
#[doc(hidden)]
pub environment_variables:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub basic_auth_credentials: std::option::Option<std::string::String>,
#[doc(hidden)]
pub enable_basic_auth: std::option::Option<bool>,
#[doc(hidden)]
pub enable_performance_mode: std::option::Option<bool>,
#[doc(hidden)]
pub build_spec: std::option::Option<std::string::String>,
#[doc(hidden)]
pub ttl: std::option::Option<std::string::String>,
#[doc(hidden)]
pub display_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub enable_pull_request_preview: std::option::Option<bool>,
#[doc(hidden)]
pub pull_request_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_arn: std::option::Option<std::string::String>,
}
impl UpdateBranchInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn framework(&self) -> std::option::Option<&str> {
self.framework.as_deref()
}
pub fn stage(&self) -> std::option::Option<&crate::model::Stage> {
self.stage.as_ref()
}
pub fn enable_notification(&self) -> std::option::Option<bool> {
self.enable_notification
}
pub fn enable_auto_build(&self) -> std::option::Option<bool> {
self.enable_auto_build
}
pub fn environment_variables(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.environment_variables.as_ref()
}
pub fn basic_auth_credentials(&self) -> std::option::Option<&str> {
self.basic_auth_credentials.as_deref()
}
pub fn enable_basic_auth(&self) -> std::option::Option<bool> {
self.enable_basic_auth
}
pub fn enable_performance_mode(&self) -> std::option::Option<bool> {
self.enable_performance_mode
}
pub fn build_spec(&self) -> std::option::Option<&str> {
self.build_spec.as_deref()
}
pub fn ttl(&self) -> std::option::Option<&str> {
self.ttl.as_deref()
}
pub fn display_name(&self) -> std::option::Option<&str> {
self.display_name.as_deref()
}
pub fn enable_pull_request_preview(&self) -> std::option::Option<bool> {
self.enable_pull_request_preview
}
pub fn pull_request_environment_name(&self) -> std::option::Option<&str> {
self.pull_request_environment_name.as_deref()
}
pub fn backend_environment_arn(&self) -> std::option::Option<&str> {
self.backend_environment_arn.as_deref()
}
}
impl std::fmt::Debug for UpdateBranchInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UpdateBranchInput");
formatter.field("app_id", &self.app_id);
formatter.field("branch_name", &self.branch_name);
formatter.field("description", &self.description);
formatter.field("framework", &self.framework);
formatter.field("stage", &self.stage);
formatter.field("enable_notification", &self.enable_notification);
formatter.field("enable_auto_build", &self.enable_auto_build);
formatter.field("environment_variables", &self.environment_variables);
formatter.field("basic_auth_credentials", &"*** Sensitive Data Redacted ***");
formatter.field("enable_basic_auth", &self.enable_basic_auth);
formatter.field("enable_performance_mode", &self.enable_performance_mode);
formatter.field("build_spec", &"*** Sensitive Data Redacted ***");
formatter.field("ttl", &self.ttl);
formatter.field("display_name", &self.display_name);
formatter.field(
"enable_pull_request_preview",
&self.enable_pull_request_preview,
);
formatter.field(
"pull_request_environment_name",
&self.pull_request_environment_name,
);
formatter.field("backend_environment_arn", &self.backend_environment_arn);
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UpdateAppInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub platform: std::option::Option<crate::model::Platform>,
#[doc(hidden)]
pub iam_service_role_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub environment_variables:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub enable_branch_auto_build: std::option::Option<bool>,
#[doc(hidden)]
pub enable_branch_auto_deletion: std::option::Option<bool>,
#[doc(hidden)]
pub enable_basic_auth: std::option::Option<bool>,
#[doc(hidden)]
pub basic_auth_credentials: std::option::Option<std::string::String>,
#[doc(hidden)]
pub custom_rules: std::option::Option<std::vec::Vec<crate::model::CustomRule>>,
#[doc(hidden)]
pub build_spec: std::option::Option<std::string::String>,
#[doc(hidden)]
pub custom_headers: std::option::Option<std::string::String>,
#[doc(hidden)]
pub enable_auto_branch_creation: std::option::Option<bool>,
#[doc(hidden)]
pub auto_branch_creation_patterns: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub auto_branch_creation_config: std::option::Option<crate::model::AutoBranchCreationConfig>,
#[doc(hidden)]
pub repository: std::option::Option<std::string::String>,
#[doc(hidden)]
pub oauth_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub access_token: std::option::Option<std::string::String>,
}
impl UpdateAppInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn platform(&self) -> std::option::Option<&crate::model::Platform> {
self.platform.as_ref()
}
pub fn iam_service_role_arn(&self) -> std::option::Option<&str> {
self.iam_service_role_arn.as_deref()
}
pub fn environment_variables(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.environment_variables.as_ref()
}
pub fn enable_branch_auto_build(&self) -> std::option::Option<bool> {
self.enable_branch_auto_build
}
pub fn enable_branch_auto_deletion(&self) -> std::option::Option<bool> {
self.enable_branch_auto_deletion
}
pub fn enable_basic_auth(&self) -> std::option::Option<bool> {
self.enable_basic_auth
}
pub fn basic_auth_credentials(&self) -> std::option::Option<&str> {
self.basic_auth_credentials.as_deref()
}
pub fn custom_rules(&self) -> std::option::Option<&[crate::model::CustomRule]> {
self.custom_rules.as_deref()
}
pub fn build_spec(&self) -> std::option::Option<&str> {
self.build_spec.as_deref()
}
pub fn custom_headers(&self) -> std::option::Option<&str> {
self.custom_headers.as_deref()
}
pub fn enable_auto_branch_creation(&self) -> std::option::Option<bool> {
self.enable_auto_branch_creation
}
pub fn auto_branch_creation_patterns(&self) -> std::option::Option<&[std::string::String]> {
self.auto_branch_creation_patterns.as_deref()
}
pub fn auto_branch_creation_config(
&self,
) -> std::option::Option<&crate::model::AutoBranchCreationConfig> {
self.auto_branch_creation_config.as_ref()
}
pub fn repository(&self) -> std::option::Option<&str> {
self.repository.as_deref()
}
pub fn oauth_token(&self) -> std::option::Option<&str> {
self.oauth_token.as_deref()
}
pub fn access_token(&self) -> std::option::Option<&str> {
self.access_token.as_deref()
}
}
impl std::fmt::Debug for UpdateAppInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UpdateAppInput");
formatter.field("app_id", &self.app_id);
formatter.field("name", &self.name);
formatter.field("description", &self.description);
formatter.field("platform", &self.platform);
formatter.field("iam_service_role_arn", &self.iam_service_role_arn);
formatter.field("environment_variables", &self.environment_variables);
formatter.field("enable_branch_auto_build", &self.enable_branch_auto_build);
formatter.field(
"enable_branch_auto_deletion",
&self.enable_branch_auto_deletion,
);
formatter.field("enable_basic_auth", &self.enable_basic_auth);
formatter.field("basic_auth_credentials", &"*** Sensitive Data Redacted ***");
formatter.field("custom_rules", &self.custom_rules);
formatter.field("build_spec", &"*** Sensitive Data Redacted ***");
formatter.field("custom_headers", &self.custom_headers);
formatter.field(
"enable_auto_branch_creation",
&self.enable_auto_branch_creation,
);
formatter.field(
"auto_branch_creation_patterns",
&self.auto_branch_creation_patterns,
);
formatter.field(
"auto_branch_creation_config",
&self.auto_branch_creation_config,
);
formatter.field("repository", &self.repository);
formatter.field("oauth_token", &"*** Sensitive Data Redacted ***");
formatter.field("access_token", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UntagResourceInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tag_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl UntagResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn tag_keys(&self) -> std::option::Option<&[std::string::String]> {
self.tag_keys.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct TagResourceInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl TagResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct StopJobInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub job_id: std::option::Option<std::string::String>,
}
impl StopJobInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
pub fn job_id(&self) -> std::option::Option<&str> {
self.job_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct StartJobInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub job_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub job_type: std::option::Option<crate::model::JobType>,
#[doc(hidden)]
pub job_reason: std::option::Option<std::string::String>,
#[doc(hidden)]
pub commit_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub commit_message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub commit_time: std::option::Option<aws_smithy_types::DateTime>,
}
impl StartJobInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
pub fn job_id(&self) -> std::option::Option<&str> {
self.job_id.as_deref()
}
pub fn job_type(&self) -> std::option::Option<&crate::model::JobType> {
self.job_type.as_ref()
}
pub fn job_reason(&self) -> std::option::Option<&str> {
self.job_reason.as_deref()
}
pub fn commit_id(&self) -> std::option::Option<&str> {
self.commit_id.as_deref()
}
pub fn commit_message(&self) -> std::option::Option<&str> {
self.commit_message.as_deref()
}
pub fn commit_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.commit_time.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct StartDeploymentInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub job_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub source_url: std::option::Option<std::string::String>,
}
impl StartDeploymentInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
pub fn job_id(&self) -> std::option::Option<&str> {
self.job_id.as_deref()
}
pub fn source_url(&self) -> std::option::Option<&str> {
self.source_url.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListWebhooksInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
}
impl ListWebhooksInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListTagsForResourceInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
}
impl ListTagsForResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListJobsInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
}
impl ListJobsInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListDomainAssociationsInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
}
impl ListDomainAssociationsInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListBranchesInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
}
impl ListBranchesInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListBackendEnvironmentsInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
}
impl ListBackendEnvironmentsInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn environment_name(&self) -> std::option::Option<&str> {
self.environment_name.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListArtifactsInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub job_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
}
impl ListArtifactsInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
pub fn job_id(&self) -> std::option::Option<&str> {
self.job_id.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListAppsInput {
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
}
impl ListAppsInput {
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetWebhookInput {
#[doc(hidden)]
pub webhook_id: std::option::Option<std::string::String>,
}
impl GetWebhookInput {
pub fn webhook_id(&self) -> std::option::Option<&str> {
self.webhook_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetJobInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub job_id: std::option::Option<std::string::String>,
}
impl GetJobInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
pub fn job_id(&self) -> std::option::Option<&str> {
self.job_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetDomainAssociationInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub domain_name: std::option::Option<std::string::String>,
}
impl GetDomainAssociationInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn domain_name(&self) -> std::option::Option<&str> {
self.domain_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetBranchInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
}
impl GetBranchInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetBackendEnvironmentInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub environment_name: std::option::Option<std::string::String>,
}
impl GetBackendEnvironmentInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn environment_name(&self) -> std::option::Option<&str> {
self.environment_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetArtifactUrlInput {
#[doc(hidden)]
pub artifact_id: std::option::Option<std::string::String>,
}
impl GetArtifactUrlInput {
pub fn artifact_id(&self) -> std::option::Option<&str> {
self.artifact_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetAppInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
}
impl GetAppInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GenerateAccessLogsInput {
#[doc(hidden)]
pub start_time: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub end_time: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub domain_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
}
impl GenerateAccessLogsInput {
pub fn start_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.start_time.as_ref()
}
pub fn end_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.end_time.as_ref()
}
pub fn domain_name(&self) -> std::option::Option<&str> {
self.domain_name.as_deref()
}
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteWebhookInput {
#[doc(hidden)]
pub webhook_id: std::option::Option<std::string::String>,
}
impl DeleteWebhookInput {
pub fn webhook_id(&self) -> std::option::Option<&str> {
self.webhook_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteJobInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub job_id: std::option::Option<std::string::String>,
}
impl DeleteJobInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
pub fn job_id(&self) -> std::option::Option<&str> {
self.job_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteDomainAssociationInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub domain_name: std::option::Option<std::string::String>,
}
impl DeleteDomainAssociationInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn domain_name(&self) -> std::option::Option<&str> {
self.domain_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteBranchInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
}
impl DeleteBranchInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteBackendEnvironmentInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub environment_name: std::option::Option<std::string::String>,
}
impl DeleteBackendEnvironmentInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn environment_name(&self) -> std::option::Option<&str> {
self.environment_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteAppInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
}
impl DeleteAppInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateWebhookInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
}
impl CreateWebhookInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateDomainAssociationInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub domain_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub enable_auto_sub_domain: std::option::Option<bool>,
#[doc(hidden)]
pub sub_domain_settings: std::option::Option<std::vec::Vec<crate::model::SubDomainSetting>>,
#[doc(hidden)]
pub auto_sub_domain_creation_patterns: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub auto_sub_domain_iam_role: std::option::Option<std::string::String>,
}
impl CreateDomainAssociationInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn domain_name(&self) -> std::option::Option<&str> {
self.domain_name.as_deref()
}
pub fn enable_auto_sub_domain(&self) -> std::option::Option<bool> {
self.enable_auto_sub_domain
}
pub fn sub_domain_settings(&self) -> std::option::Option<&[crate::model::SubDomainSetting]> {
self.sub_domain_settings.as_deref()
}
pub fn auto_sub_domain_creation_patterns(&self) -> std::option::Option<&[std::string::String]> {
self.auto_sub_domain_creation_patterns.as_deref()
}
pub fn auto_sub_domain_iam_role(&self) -> std::option::Option<&str> {
self.auto_sub_domain_iam_role.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateDeploymentInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub file_map:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl CreateDeploymentInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
pub fn file_map(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.file_map.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreateBranchInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub stage: std::option::Option<crate::model::Stage>,
#[doc(hidden)]
pub framework: std::option::Option<std::string::String>,
#[doc(hidden)]
pub enable_notification: std::option::Option<bool>,
#[doc(hidden)]
pub enable_auto_build: std::option::Option<bool>,
#[doc(hidden)]
pub environment_variables:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub basic_auth_credentials: std::option::Option<std::string::String>,
#[doc(hidden)]
pub enable_basic_auth: std::option::Option<bool>,
#[doc(hidden)]
pub enable_performance_mode: std::option::Option<bool>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub build_spec: std::option::Option<std::string::String>,
#[doc(hidden)]
pub ttl: std::option::Option<std::string::String>,
#[doc(hidden)]
pub display_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub enable_pull_request_preview: std::option::Option<bool>,
#[doc(hidden)]
pub pull_request_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_arn: std::option::Option<std::string::String>,
}
impl CreateBranchInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn stage(&self) -> std::option::Option<&crate::model::Stage> {
self.stage.as_ref()
}
pub fn framework(&self) -> std::option::Option<&str> {
self.framework.as_deref()
}
pub fn enable_notification(&self) -> std::option::Option<bool> {
self.enable_notification
}
pub fn enable_auto_build(&self) -> std::option::Option<bool> {
self.enable_auto_build
}
pub fn environment_variables(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.environment_variables.as_ref()
}
pub fn basic_auth_credentials(&self) -> std::option::Option<&str> {
self.basic_auth_credentials.as_deref()
}
pub fn enable_basic_auth(&self) -> std::option::Option<bool> {
self.enable_basic_auth
}
pub fn enable_performance_mode(&self) -> std::option::Option<bool> {
self.enable_performance_mode
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
pub fn build_spec(&self) -> std::option::Option<&str> {
self.build_spec.as_deref()
}
pub fn ttl(&self) -> std::option::Option<&str> {
self.ttl.as_deref()
}
pub fn display_name(&self) -> std::option::Option<&str> {
self.display_name.as_deref()
}
pub fn enable_pull_request_preview(&self) -> std::option::Option<bool> {
self.enable_pull_request_preview
}
pub fn pull_request_environment_name(&self) -> std::option::Option<&str> {
self.pull_request_environment_name.as_deref()
}
pub fn backend_environment_arn(&self) -> std::option::Option<&str> {
self.backend_environment_arn.as_deref()
}
}
impl std::fmt::Debug for CreateBranchInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreateBranchInput");
formatter.field("app_id", &self.app_id);
formatter.field("branch_name", &self.branch_name);
formatter.field("description", &self.description);
formatter.field("stage", &self.stage);
formatter.field("framework", &self.framework);
formatter.field("enable_notification", &self.enable_notification);
formatter.field("enable_auto_build", &self.enable_auto_build);
formatter.field("environment_variables", &self.environment_variables);
formatter.field("basic_auth_credentials", &"*** Sensitive Data Redacted ***");
formatter.field("enable_basic_auth", &self.enable_basic_auth);
formatter.field("enable_performance_mode", &self.enable_performance_mode);
formatter.field("tags", &self.tags);
formatter.field("build_spec", &"*** Sensitive Data Redacted ***");
formatter.field("ttl", &self.ttl);
formatter.field("display_name", &self.display_name);
formatter.field(
"enable_pull_request_preview",
&self.enable_pull_request_preview,
);
formatter.field(
"pull_request_environment_name",
&self.pull_request_environment_name,
);
formatter.field("backend_environment_arn", &self.backend_environment_arn);
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateBackendEnvironmentInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub stack_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub deployment_artifacts: std::option::Option<std::string::String>,
}
impl CreateBackendEnvironmentInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn environment_name(&self) -> std::option::Option<&str> {
self.environment_name.as_deref()
}
pub fn stack_name(&self) -> std::option::Option<&str> {
self.stack_name.as_deref()
}
pub fn deployment_artifacts(&self) -> std::option::Option<&str> {
self.deployment_artifacts.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreateAppInput {
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub repository: std::option::Option<std::string::String>,
#[doc(hidden)]
pub platform: std::option::Option<crate::model::Platform>,
#[doc(hidden)]
pub iam_service_role_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub oauth_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub access_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub environment_variables:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub enable_branch_auto_build: std::option::Option<bool>,
#[doc(hidden)]
pub enable_branch_auto_deletion: std::option::Option<bool>,
#[doc(hidden)]
pub enable_basic_auth: std::option::Option<bool>,
#[doc(hidden)]
pub basic_auth_credentials: std::option::Option<std::string::String>,
#[doc(hidden)]
pub custom_rules: std::option::Option<std::vec::Vec<crate::model::CustomRule>>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub build_spec: std::option::Option<std::string::String>,
#[doc(hidden)]
pub custom_headers: std::option::Option<std::string::String>,
#[doc(hidden)]
pub enable_auto_branch_creation: std::option::Option<bool>,
#[doc(hidden)]
pub auto_branch_creation_patterns: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub auto_branch_creation_config: std::option::Option<crate::model::AutoBranchCreationConfig>,
}
impl CreateAppInput {
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn repository(&self) -> std::option::Option<&str> {
self.repository.as_deref()
}
pub fn platform(&self) -> std::option::Option<&crate::model::Platform> {
self.platform.as_ref()
}
pub fn iam_service_role_arn(&self) -> std::option::Option<&str> {
self.iam_service_role_arn.as_deref()
}
pub fn oauth_token(&self) -> std::option::Option<&str> {
self.oauth_token.as_deref()
}
pub fn access_token(&self) -> std::option::Option<&str> {
self.access_token.as_deref()
}
pub fn environment_variables(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.environment_variables.as_ref()
}
pub fn enable_branch_auto_build(&self) -> std::option::Option<bool> {
self.enable_branch_auto_build
}
pub fn enable_branch_auto_deletion(&self) -> std::option::Option<bool> {
self.enable_branch_auto_deletion
}
pub fn enable_basic_auth(&self) -> std::option::Option<bool> {
self.enable_basic_auth
}
pub fn basic_auth_credentials(&self) -> std::option::Option<&str> {
self.basic_auth_credentials.as_deref()
}
pub fn custom_rules(&self) -> std::option::Option<&[crate::model::CustomRule]> {
self.custom_rules.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
pub fn build_spec(&self) -> std::option::Option<&str> {
self.build_spec.as_deref()
}
pub fn custom_headers(&self) -> std::option::Option<&str> {
self.custom_headers.as_deref()
}
pub fn enable_auto_branch_creation(&self) -> std::option::Option<bool> {
self.enable_auto_branch_creation
}
pub fn auto_branch_creation_patterns(&self) -> std::option::Option<&[std::string::String]> {
self.auto_branch_creation_patterns.as_deref()
}
pub fn auto_branch_creation_config(
&self,
) -> std::option::Option<&crate::model::AutoBranchCreationConfig> {
self.auto_branch_creation_config.as_ref()
}
}
impl std::fmt::Debug for CreateAppInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreateAppInput");
formatter.field("name", &self.name);
formatter.field("description", &self.description);
formatter.field("repository", &self.repository);
formatter.field("platform", &self.platform);
formatter.field("iam_service_role_arn", &self.iam_service_role_arn);
formatter.field("oauth_token", &"*** Sensitive Data Redacted ***");
formatter.field("access_token", &"*** Sensitive Data Redacted ***");
formatter.field("environment_variables", &self.environment_variables);
formatter.field("enable_branch_auto_build", &self.enable_branch_auto_build);
formatter.field(
"enable_branch_auto_deletion",
&self.enable_branch_auto_deletion,
);
formatter.field("enable_basic_auth", &self.enable_basic_auth);
formatter.field("basic_auth_credentials", &"*** Sensitive Data Redacted ***");
formatter.field("custom_rules", &self.custom_rules);
formatter.field("tags", &self.tags);
formatter.field("build_spec", &"*** Sensitive Data Redacted ***");
formatter.field("custom_headers", &self.custom_headers);
formatter.field(
"enable_auto_branch_creation",
&self.enable_auto_branch_creation,
);
formatter.field(
"auto_branch_creation_patterns",
&self.auto_branch_creation_patterns,
);
formatter.field(
"auto_branch_creation_config",
&self.auto_branch_creation_config,
);
formatter.finish()
}
}