use std::fmt::Write;
pub mod clone_backend_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) target_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn target_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.target_environment_name = Some(input.into());
self
}
pub fn set_target_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.target_environment_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CloneBackendInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CloneBackendInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
target_environment_name: self.target_environment_name,
})
}
}
}
impl CloneBackendInput {
#[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::CloneBackend,
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::CloneBackendInput,
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",
),
);
}
let input_2 = &_input.backend_environment_name;
let input_2 = input_2.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_2,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/environments/{BackendEnvironmentName}/clone",
AppId = app_id,
BackendEnvironmentName = backend_environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CloneBackendInput,
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_clone_backend(&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::CloneBackend::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CloneBackend",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::clone_backend_input::Builder {
crate::input::clone_backend_input::Builder::default()
}
}
pub mod create_backend_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) app_name: std::option::Option<std::string::String>,
pub(crate) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) resource_config: std::option::Option<crate::model::ResourceConfig>,
pub(crate) resource_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 app_name(mut self, input: impl Into<std::string::String>) -> Self {
self.app_name = Some(input.into());
self
}
pub fn set_app_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.app_name = input;
self
}
pub fn backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn resource_config(mut self, input: crate::model::ResourceConfig) -> Self {
self.resource_config = Some(input);
self
}
pub fn set_resource_config(
mut self,
input: std::option::Option<crate::model::ResourceConfig>,
) -> Self {
self.resource_config = input;
self
}
pub fn resource_name(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_name = Some(input.into());
self
}
pub fn set_resource_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateBackendInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateBackendInput {
app_id: self.app_id,
app_name: self.app_name,
backend_environment_name: self.backend_environment_name,
resource_config: self.resource_config,
resource_name: self.resource_name,
})
}
}
}
impl CreateBackendInput {
#[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::CreateBackend,
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::CreateBackendInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/backend").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateBackendInput,
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(&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::CreateBackend::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateBackend",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_backend_input::Builder {
crate::input::create_backend_input::Builder::default()
}
}
pub mod create_backend_api_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) resource_config: std::option::Option<crate::model::BackendApiResourceConfig>,
pub(crate) resource_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn resource_config(mut self, input: crate::model::BackendApiResourceConfig) -> Self {
self.resource_config = Some(input);
self
}
pub fn set_resource_config(
mut self,
input: std::option::Option<crate::model::BackendApiResourceConfig>,
) -> Self {
self.resource_config = input;
self
}
pub fn resource_name(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_name = Some(input.into());
self
}
pub fn set_resource_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateBackendApiInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateBackendApiInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
resource_config: self.resource_config,
resource_name: self.resource_name,
})
}
}
}
impl CreateBackendApiInput {
#[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::CreateBackendAPI,
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::CreateBackendApiInput,
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",
),
);
}
write!(output, "/backend/{AppId}/api", AppId = app_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateBackendApiInput,
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_api(&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::CreateBackendAPI::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateBackendAPI",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_backend_api_input::Builder {
crate::input::create_backend_api_input::Builder::default()
}
}
pub mod create_backend_auth_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) resource_config:
std::option::Option<crate::model::CreateBackendAuthResourceConfig>,
pub(crate) resource_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn resource_config(
mut self,
input: crate::model::CreateBackendAuthResourceConfig,
) -> Self {
self.resource_config = Some(input);
self
}
pub fn set_resource_config(
mut self,
input: std::option::Option<crate::model::CreateBackendAuthResourceConfig>,
) -> Self {
self.resource_config = input;
self
}
pub fn resource_name(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_name = Some(input.into());
self
}
pub fn set_resource_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateBackendAuthInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateBackendAuthInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
resource_config: self.resource_config,
resource_name: self.resource_name,
})
}
}
}
impl CreateBackendAuthInput {
#[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::CreateBackendAuth,
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::CreateBackendAuthInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_4 = &_input.app_id;
let input_4 = input_4.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_4,
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, "/backend/{AppId}/auth", AppId = app_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateBackendAuthInput,
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_auth(&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::CreateBackendAuth::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateBackendAuth",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_backend_auth_input::Builder {
crate::input::create_backend_auth_input::Builder::default()
}
}
pub mod create_backend_config_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) backend_manager_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 backend_manager_app_id(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_manager_app_id = Some(input.into());
self
}
pub fn set_backend_manager_app_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_manager_app_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateBackendConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateBackendConfigInput {
app_id: self.app_id,
backend_manager_app_id: self.backend_manager_app_id,
})
}
}
}
impl CreateBackendConfigInput {
#[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::CreateBackendConfig,
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::CreateBackendConfigInput,
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, "/backend/{AppId}/config", AppId = app_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateBackendConfigInput,
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_config(&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::CreateBackendConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateBackendConfig",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_backend_config_input::Builder {
crate::input::create_backend_config_input::Builder::default()
}
}
pub mod create_backend_storage_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) resource_config:
std::option::Option<crate::model::CreateBackendStorageResourceConfig>,
pub(crate) resource_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn resource_config(
mut self,
input: crate::model::CreateBackendStorageResourceConfig,
) -> Self {
self.resource_config = Some(input);
self
}
pub fn set_resource_config(
mut self,
input: std::option::Option<crate::model::CreateBackendStorageResourceConfig>,
) -> Self {
self.resource_config = input;
self
}
pub fn resource_name(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_name = Some(input.into());
self
}
pub fn set_resource_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateBackendStorageInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateBackendStorageInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
resource_config: self.resource_config,
resource_name: self.resource_name,
})
}
}
}
impl CreateBackendStorageInput {
#[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::CreateBackendStorage,
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::CreateBackendStorageInput,
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, "/backend/{AppId}/storage", AppId = app_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateBackendStorageInput,
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_storage(
&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::CreateBackendStorage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateBackendStorage",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_backend_storage_input::Builder {
crate::input::create_backend_storage_input::Builder::default()
}
}
pub mod create_token_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::CreateTokenInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateTokenInput {
app_id: self.app_id,
})
}
}
}
impl CreateTokenInput {
#[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::CreateToken,
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::CreateTokenInput,
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, "/backend/{AppId}/challenge", AppId = app_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateTokenInput,
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
};
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::CreateToken::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateToken",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_token_input::Builder {
crate::input::create_token_input::Builder::default()
}
}
pub mod delete_backend_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) backend_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteBackendInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteBackendInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
})
}
}
}
impl DeleteBackendInput {
#[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::DeleteBackend,
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::DeleteBackendInput,
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.backend_environment_name;
let input_9 = input_9.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_9,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/environments/{BackendEnvironmentName}/remove",
AppId = app_id,
BackendEnvironmentName = backend_environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteBackendInput,
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
};
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::DeleteBackend::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteBackend",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_backend_input::Builder {
crate::input::delete_backend_input::Builder::default()
}
}
pub mod delete_backend_api_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) resource_config: std::option::Option<crate::model::BackendApiResourceConfig>,
pub(crate) resource_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn resource_config(mut self, input: crate::model::BackendApiResourceConfig) -> Self {
self.resource_config = Some(input);
self
}
pub fn set_resource_config(
mut self,
input: std::option::Option<crate::model::BackendApiResourceConfig>,
) -> Self {
self.resource_config = input;
self
}
pub fn resource_name(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_name = Some(input.into());
self
}
pub fn set_resource_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteBackendApiInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteBackendApiInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
resource_config: self.resource_config,
resource_name: self.resource_name,
})
}
}
}
impl DeleteBackendApiInput {
#[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::DeleteBackendAPI,
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::DeleteBackendApiInput,
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.backend_environment_name;
let input_11 = input_11.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_11,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/api/{BackendEnvironmentName}/remove",
AppId = app_id,
BackendEnvironmentName = backend_environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteBackendApiInput,
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_delete_backend_api(&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::DeleteBackendAPI::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteBackendAPI",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_backend_api_input::Builder {
crate::input::delete_backend_api_input::Builder::default()
}
}
pub mod delete_backend_auth_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) resource_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn resource_name(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_name = Some(input.into());
self
}
pub fn set_resource_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteBackendAuthInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteBackendAuthInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
resource_name: self.resource_name,
})
}
}
}
impl DeleteBackendAuthInput {
#[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::DeleteBackendAuth,
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::DeleteBackendAuthInput,
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.backend_environment_name;
let input_13 = input_13.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_13,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/auth/{BackendEnvironmentName}/remove",
AppId = app_id,
BackendEnvironmentName = backend_environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteBackendAuthInput,
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_delete_backend_auth(&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::DeleteBackendAuth::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteBackendAuth",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_backend_auth_input::Builder {
crate::input::delete_backend_auth_input::Builder::default()
}
}
pub mod delete_backend_storage_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) resource_name: std::option::Option<std::string::String>,
pub(crate) service_name: std::option::Option<crate::model::ServiceName>,
}
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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn resource_name(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_name = Some(input.into());
self
}
pub fn set_resource_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_name = input;
self
}
pub fn service_name(mut self, input: crate::model::ServiceName) -> Self {
self.service_name = Some(input);
self
}
pub fn set_service_name(
mut self,
input: std::option::Option<crate::model::ServiceName>,
) -> Self {
self.service_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteBackendStorageInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteBackendStorageInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
resource_name: self.resource_name,
service_name: self.service_name,
})
}
}
}
impl DeleteBackendStorageInput {
#[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::DeleteBackendStorage,
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::DeleteBackendStorageInput,
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.backend_environment_name;
let input_15 = input_15.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_15,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/storage/{BackendEnvironmentName}/remove",
AppId = app_id,
BackendEnvironmentName = backend_environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteBackendStorageInput,
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_delete_backend_storage(
&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::DeleteBackendStorage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteBackendStorage",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_backend_storage_input::Builder {
crate::input::delete_backend_storage_input::Builder::default()
}
}
pub mod delete_token_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) session_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 session_id(mut self, input: impl Into<std::string::String>) -> Self {
self.session_id = Some(input.into());
self
}
pub fn set_session_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.session_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteTokenInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteTokenInput {
app_id: self.app_id,
session_id: self.session_id,
})
}
}
}
impl DeleteTokenInput {
#[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::DeleteToken,
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::DeleteTokenInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_16 = &_input.app_id;
let input_16 = input_16.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_16,
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_17 = &_input.session_id;
let input_17 = input_17.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"session_id",
"cannot be empty or unset",
)
})?;
let session_id = aws_smithy_http::label::fmt_string(
input_17,
aws_smithy_http::label::EncodingStrategy::Default,
);
if session_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"session_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/challenge/{SessionId}/remove",
AppId = app_id,
SessionId = session_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteTokenInput,
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
};
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::DeleteToken::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteToken",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_token_input::Builder {
crate::input::delete_token_input::Builder::default()
}
}
pub mod generate_backend_api_models_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) resource_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn resource_name(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_name = Some(input.into());
self
}
pub fn set_resource_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GenerateBackendApiModelsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GenerateBackendApiModelsInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
resource_name: self.resource_name,
})
}
}
}
impl GenerateBackendApiModelsInput {
#[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::GenerateBackendAPIModels,
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::GenerateBackendApiModelsInput,
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",
),
);
}
let input_19 = &_input.backend_environment_name;
let input_19 = input_19.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_19,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/api/{BackendEnvironmentName}/generateModels",
AppId = app_id,
BackendEnvironmentName = backend_environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GenerateBackendApiModelsInput,
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_backend_api_models(
&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::GenerateBackendAPIModels::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GenerateBackendAPIModels",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::generate_backend_api_models_input::Builder {
crate::input::generate_backend_api_models_input::Builder::default()
}
}
pub mod get_backend_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) backend_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetBackendInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetBackendInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
})
}
}
}
impl GetBackendInput {
#[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::GetBackend,
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::GetBackendInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_20 = &_input.app_id;
let input_20 = input_20.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_20,
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, "/backend/{AppId}/details", AppId = app_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetBackendInput,
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_get_backend(&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::GetBackend::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetBackend",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_backend_input::Builder {
crate::input::get_backend_input::Builder::default()
}
}
pub mod get_backend_api_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) resource_config: std::option::Option<crate::model::BackendApiResourceConfig>,
pub(crate) resource_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn resource_config(mut self, input: crate::model::BackendApiResourceConfig) -> Self {
self.resource_config = Some(input);
self
}
pub fn set_resource_config(
mut self,
input: std::option::Option<crate::model::BackendApiResourceConfig>,
) -> Self {
self.resource_config = input;
self
}
pub fn resource_name(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_name = Some(input.into());
self
}
pub fn set_resource_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetBackendApiInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetBackendApiInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
resource_config: self.resource_config,
resource_name: self.resource_name,
})
}
}
}
impl GetBackendApiInput {
#[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::GetBackendAPI,
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::GetBackendApiInput,
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.backend_environment_name;
let input_22 = input_22.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_22,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/api/{BackendEnvironmentName}/details",
AppId = app_id,
BackendEnvironmentName = backend_environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetBackendApiInput,
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_get_backend_api(&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::GetBackendAPI::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetBackendAPI",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_backend_api_input::Builder {
crate::input::get_backend_api_input::Builder::default()
}
}
pub mod get_backend_api_models_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) resource_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn resource_name(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_name = Some(input.into());
self
}
pub fn set_resource_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetBackendApiModelsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetBackendApiModelsInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
resource_name: self.resource_name,
})
}
}
}
impl GetBackendApiModelsInput {
#[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::GetBackendAPIModels,
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::GetBackendApiModelsInput,
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.backend_environment_name;
let input_24 = input_24.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_24,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/api/{BackendEnvironmentName}/getModels",
AppId = app_id,
BackendEnvironmentName = backend_environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetBackendApiModelsInput,
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_get_backend_api_models(
&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::GetBackendAPIModels::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetBackendAPIModels",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_backend_api_models_input::Builder {
crate::input::get_backend_api_models_input::Builder::default()
}
}
pub mod get_backend_auth_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) resource_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn resource_name(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_name = Some(input.into());
self
}
pub fn set_resource_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetBackendAuthInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetBackendAuthInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
resource_name: self.resource_name,
})
}
}
}
impl GetBackendAuthInput {
#[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::GetBackendAuth,
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::GetBackendAuthInput,
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.backend_environment_name;
let input_26 = input_26.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_26,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/auth/{BackendEnvironmentName}/details",
AppId = app_id,
BackendEnvironmentName = backend_environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetBackendAuthInput,
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_get_backend_auth(&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::GetBackendAuth::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetBackendAuth",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_backend_auth_input::Builder {
crate::input::get_backend_auth_input::Builder::default()
}
}
pub mod get_backend_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) backend_environment_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_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::GetBackendJobInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetBackendJobInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
job_id: self.job_id,
})
}
}
}
impl GetBackendJobInput {
#[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::GetBackendJob,
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::GetBackendJobInput,
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.backend_environment_name;
let input_28 = input_28.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_28,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_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,
"/backend/{AppId}/job/{BackendEnvironmentName}/{JobId}",
AppId = app_id,
BackendEnvironmentName = backend_environment_name,
JobId = job_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetBackendJobInput,
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::GetBackendJob::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetBackendJob",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_backend_job_input::Builder {
crate::input::get_backend_job_input::Builder::default()
}
}
pub mod get_backend_storage_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) resource_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn resource_name(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_name = Some(input.into());
self
}
pub fn set_resource_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetBackendStorageInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetBackendStorageInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
resource_name: self.resource_name,
})
}
}
}
impl GetBackendStorageInput {
#[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::GetBackendStorage,
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::GetBackendStorageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_30 = &_input.app_id;
let input_30 = input_30.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_30,
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_31 = &_input.backend_environment_name;
let input_31 = input_31.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_31,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/storage/{BackendEnvironmentName}/details",
AppId = app_id,
BackendEnvironmentName = backend_environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetBackendStorageInput,
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_get_backend_storage(&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::GetBackendStorage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetBackendStorage",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_backend_storage_input::Builder {
crate::input::get_backend_storage_input::Builder::default()
}
}
pub mod get_token_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) session_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 session_id(mut self, input: impl Into<std::string::String>) -> Self {
self.session_id = Some(input.into());
self
}
pub fn set_session_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.session_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetTokenInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetTokenInput {
app_id: self.app_id,
session_id: self.session_id,
})
}
}
}
impl GetTokenInput {
#[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::GetToken,
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::GetTokenInput,
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.session_id;
let input_33 = input_33.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"session_id",
"cannot be empty or unset",
)
})?;
let session_id = aws_smithy_http::label::fmt_string(
input_33,
aws_smithy_http::label::EncodingStrategy::Default,
);
if session_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"session_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/challenge/{SessionId}",
AppId = app_id,
SessionId = session_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetTokenInput,
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::GetToken::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetToken",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_token_input::Builder {
crate::input::get_token_input::Builder::default()
}
}
pub mod import_backend_auth_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) identity_pool_id: std::option::Option<std::string::String>,
pub(crate) native_client_id: std::option::Option<std::string::String>,
pub(crate) user_pool_id: std::option::Option<std::string::String>,
pub(crate) web_client_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn identity_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_pool_id = Some(input.into());
self
}
pub fn set_identity_pool_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_pool_id = input;
self
}
pub fn native_client_id(mut self, input: impl Into<std::string::String>) -> Self {
self.native_client_id = Some(input.into());
self
}
pub fn set_native_client_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.native_client_id = input;
self
}
pub fn user_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.user_pool_id = Some(input.into());
self
}
pub fn set_user_pool_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.user_pool_id = input;
self
}
pub fn web_client_id(mut self, input: impl Into<std::string::String>) -> Self {
self.web_client_id = Some(input.into());
self
}
pub fn set_web_client_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.web_client_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ImportBackendAuthInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ImportBackendAuthInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
identity_pool_id: self.identity_pool_id,
native_client_id: self.native_client_id,
user_pool_id: self.user_pool_id,
web_client_id: self.web_client_id,
})
}
}
}
impl ImportBackendAuthInput {
#[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::ImportBackendAuth,
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::ImportBackendAuthInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_34 = &_input.app_id;
let input_34 = input_34.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_34,
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_35 = &_input.backend_environment_name;
let input_35 = input_35.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_35,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/auth/{BackendEnvironmentName}/import",
AppId = app_id,
BackendEnvironmentName = backend_environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ImportBackendAuthInput,
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_import_backend_auth(&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::ImportBackendAuth::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ImportBackendAuth",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::import_backend_auth_input::Builder {
crate::input::import_backend_auth_input::Builder::default()
}
}
pub mod import_backend_storage_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) bucket_name: std::option::Option<std::string::String>,
pub(crate) service_name: std::option::Option<crate::model::ServiceName>,
}
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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn bucket_name(mut self, input: impl Into<std::string::String>) -> Self {
self.bucket_name = Some(input.into());
self
}
pub fn set_bucket_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.bucket_name = input;
self
}
pub fn service_name(mut self, input: crate::model::ServiceName) -> Self {
self.service_name = Some(input);
self
}
pub fn set_service_name(
mut self,
input: std::option::Option<crate::model::ServiceName>,
) -> Self {
self.service_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ImportBackendStorageInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ImportBackendStorageInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
bucket_name: self.bucket_name,
service_name: self.service_name,
})
}
}
}
impl ImportBackendStorageInput {
#[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::ImportBackendStorage,
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::ImportBackendStorageInput,
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",
),
);
}
let input_37 = &_input.backend_environment_name;
let input_37 = input_37.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_37,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/storage/{BackendEnvironmentName}/import",
AppId = app_id,
BackendEnvironmentName = backend_environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ImportBackendStorageInput,
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_import_backend_storage(
&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::ImportBackendStorage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ImportBackendStorage",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::import_backend_storage_input::Builder {
crate::input::import_backend_storage_input::Builder::default()
}
}
pub mod list_backend_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) job_id: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) operation: std::option::Option<std::string::String>,
pub(crate) status: 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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_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 max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn operation(mut self, input: impl Into<std::string::String>) -> Self {
self.operation = Some(input.into());
self
}
pub fn set_operation(mut self, input: std::option::Option<std::string::String>) -> Self {
self.operation = input;
self
}
pub fn status(mut self, input: impl Into<std::string::String>) -> Self {
self.status = Some(input.into());
self
}
pub fn set_status(mut self, input: std::option::Option<std::string::String>) -> Self {
self.status = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListBackendJobsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListBackendJobsInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
job_id: self.job_id,
max_results: self.max_results.unwrap_or_default(),
next_token: self.next_token,
operation: self.operation,
status: self.status,
})
}
}
}
impl ListBackendJobsInput {
#[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::ListBackendJobs,
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::ListBackendJobsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_38 = &_input.app_id;
let input_38 = input_38.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_38,
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_39 = &_input.backend_environment_name;
let input_39 = input_39.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_39,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/job/{BackendEnvironmentName}",
AppId = app_id,
BackendEnvironmentName = backend_environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListBackendJobsInput,
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_list_backend_jobs(&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::ListBackendJobs::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListBackendJobs",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_backend_jobs_input::Builder {
crate::input::list_backend_jobs_input::Builder::default()
}
}
pub mod list_s3_buckets_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>,
}
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 build(
self,
) -> Result<crate::input::ListS3BucketsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListS3BucketsInput {
next_token: self.next_token,
})
}
}
}
impl ListS3BucketsInput {
#[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::ListS3Buckets,
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::ListS3BucketsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/s3Buckets").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListS3BucketsInput,
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_list_s3_buckets(&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::ListS3Buckets::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListS3Buckets",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_s3_buckets_input::Builder {
crate::input::list_s3_buckets_input::Builder::default()
}
}
pub mod remove_all_backends_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) clean_amplify_app: std::option::Option<bool>,
}
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 clean_amplify_app(mut self, input: bool) -> Self {
self.clean_amplify_app = Some(input);
self
}
pub fn set_clean_amplify_app(mut self, input: std::option::Option<bool>) -> Self {
self.clean_amplify_app = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::RemoveAllBackendsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::RemoveAllBackendsInput {
app_id: self.app_id,
clean_amplify_app: self.clean_amplify_app.unwrap_or_default(),
})
}
}
}
impl RemoveAllBackendsInput {
#[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::RemoveAllBackends,
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::RemoveAllBackendsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_40 = &_input.app_id;
let input_40 = input_40.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_40,
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, "/backend/{AppId}/remove", AppId = app_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RemoveAllBackendsInput,
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_remove_all_backends(&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::RemoveAllBackends::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RemoveAllBackends",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::remove_all_backends_input::Builder {
crate::input::remove_all_backends_input::Builder::default()
}
}
pub mod remove_backend_config_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::RemoveBackendConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::RemoveBackendConfigInput {
app_id: self.app_id,
})
}
}
}
impl RemoveBackendConfigInput {
#[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::RemoveBackendConfig,
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::RemoveBackendConfigInput,
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, "/backend/{AppId}/config/remove", AppId = app_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RemoveBackendConfigInput,
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
};
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::RemoveBackendConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RemoveBackendConfig",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::remove_backend_config_input::Builder {
crate::input::remove_backend_config_input::Builder::default()
}
}
pub mod update_backend_api_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) resource_config: std::option::Option<crate::model::BackendApiResourceConfig>,
pub(crate) resource_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn resource_config(mut self, input: crate::model::BackendApiResourceConfig) -> Self {
self.resource_config = Some(input);
self
}
pub fn set_resource_config(
mut self,
input: std::option::Option<crate::model::BackendApiResourceConfig>,
) -> Self {
self.resource_config = input;
self
}
pub fn resource_name(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_name = Some(input.into());
self
}
pub fn set_resource_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateBackendApiInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateBackendApiInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
resource_config: self.resource_config,
resource_name: self.resource_name,
})
}
}
}
impl UpdateBackendApiInput {
#[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::UpdateBackendAPI,
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::UpdateBackendApiInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_42 = &_input.app_id;
let input_42 = input_42.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_42,
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_43 = &_input.backend_environment_name;
let input_43 = input_43.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_43,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/api/{BackendEnvironmentName}",
AppId = app_id,
BackendEnvironmentName = backend_environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateBackendApiInput,
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_backend_api(&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::UpdateBackendAPI::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateBackendAPI",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_backend_api_input::Builder {
crate::input::update_backend_api_input::Builder::default()
}
}
pub mod update_backend_auth_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) resource_config:
std::option::Option<crate::model::UpdateBackendAuthResourceConfig>,
pub(crate) resource_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn resource_config(
mut self,
input: crate::model::UpdateBackendAuthResourceConfig,
) -> Self {
self.resource_config = Some(input);
self
}
pub fn set_resource_config(
mut self,
input: std::option::Option<crate::model::UpdateBackendAuthResourceConfig>,
) -> Self {
self.resource_config = input;
self
}
pub fn resource_name(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_name = Some(input.into());
self
}
pub fn set_resource_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateBackendAuthInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateBackendAuthInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
resource_config: self.resource_config,
resource_name: self.resource_name,
})
}
}
}
impl UpdateBackendAuthInput {
#[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::UpdateBackendAuth,
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::UpdateBackendAuthInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_44 = &_input.app_id;
let input_44 = input_44.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_44,
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_45 = &_input.backend_environment_name;
let input_45 = input_45.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_45,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/auth/{BackendEnvironmentName}",
AppId = app_id,
BackendEnvironmentName = backend_environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateBackendAuthInput,
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_backend_auth(&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::UpdateBackendAuth::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateBackendAuth",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_backend_auth_input::Builder {
crate::input::update_backend_auth_input::Builder::default()
}
}
pub mod update_backend_config_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) login_auth_config: std::option::Option<crate::model::LoginAuthConfigReqObj>,
}
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 login_auth_config(mut self, input: crate::model::LoginAuthConfigReqObj) -> Self {
self.login_auth_config = Some(input);
self
}
pub fn set_login_auth_config(
mut self,
input: std::option::Option<crate::model::LoginAuthConfigReqObj>,
) -> Self {
self.login_auth_config = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateBackendConfigInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateBackendConfigInput {
app_id: self.app_id,
login_auth_config: self.login_auth_config,
})
}
}
}
impl UpdateBackendConfigInput {
#[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::UpdateBackendConfig,
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::UpdateBackendConfigInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_46 = &_input.app_id;
let input_46 = input_46.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_46,
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, "/backend/{AppId}/config/update", AppId = app_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateBackendConfigInput,
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_backend_config(&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::UpdateBackendConfig::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateBackendConfig",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_backend_config_input::Builder {
crate::input::update_backend_config_input::Builder::default()
}
}
pub mod update_backend_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) job_id: std::option::Option<std::string::String>,
pub(crate) operation: std::option::Option<std::string::String>,
pub(crate) status: 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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_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 operation(mut self, input: impl Into<std::string::String>) -> Self {
self.operation = Some(input.into());
self
}
pub fn set_operation(mut self, input: std::option::Option<std::string::String>) -> Self {
self.operation = input;
self
}
pub fn status(mut self, input: impl Into<std::string::String>) -> Self {
self.status = Some(input.into());
self
}
pub fn set_status(mut self, input: std::option::Option<std::string::String>) -> Self {
self.status = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateBackendJobInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateBackendJobInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
job_id: self.job_id,
operation: self.operation,
status: self.status,
})
}
}
}
impl UpdateBackendJobInput {
#[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::UpdateBackendJob,
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::UpdateBackendJobInput,
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",
),
);
}
let input_48 = &_input.backend_environment_name;
let input_48 = input_48.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_48,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
),
);
}
let input_49 = &_input.job_id;
let input_49 = input_49.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_49,
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,
"/backend/{AppId}/job/{BackendEnvironmentName}/{JobId}",
AppId = app_id,
BackendEnvironmentName = backend_environment_name,
JobId = job_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateBackendJobInput,
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_backend_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::UpdateBackendJob::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateBackendJob",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_backend_job_input::Builder {
crate::input::update_backend_job_input::Builder::default()
}
}
pub mod update_backend_storage_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) backend_environment_name: std::option::Option<std::string::String>,
pub(crate) resource_config:
std::option::Option<crate::model::UpdateBackendStorageResourceConfig>,
pub(crate) resource_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 backend_environment_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backend_environment_name = Some(input.into());
self
}
pub fn set_backend_environment_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backend_environment_name = input;
self
}
pub fn resource_config(
mut self,
input: crate::model::UpdateBackendStorageResourceConfig,
) -> Self {
self.resource_config = Some(input);
self
}
pub fn set_resource_config(
mut self,
input: std::option::Option<crate::model::UpdateBackendStorageResourceConfig>,
) -> Self {
self.resource_config = input;
self
}
pub fn resource_name(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_name = Some(input.into());
self
}
pub fn set_resource_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateBackendStorageInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateBackendStorageInput {
app_id: self.app_id,
backend_environment_name: self.backend_environment_name,
resource_config: self.resource_config,
resource_name: self.resource_name,
})
}
}
}
impl UpdateBackendStorageInput {
#[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::UpdateBackendStorage,
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::UpdateBackendStorageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_50 = &_input.app_id;
let input_50 = input_50.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_50,
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_51 = &_input.backend_environment_name;
let input_51 = input_51.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
)
})?;
let backend_environment_name = aws_smithy_http::label::fmt_string(
input_51,
aws_smithy_http::label::EncodingStrategy::Default,
);
if backend_environment_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"backend_environment_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/backend/{AppId}/storage/{BackendEnvironmentName}",
AppId = app_id,
BackendEnvironmentName = backend_environment_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateBackendStorageInput,
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_backend_storage(
&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::UpdateBackendStorage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateBackendStorage",
"amplifybackend",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_backend_storage_input::Builder {
crate::input::update_backend_storage_input::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateBackendStorageInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_config: std::option::Option<crate::model::UpdateBackendStorageResourceConfig>,
#[doc(hidden)]
pub resource_name: std::option::Option<std::string::String>,
}
impl UpdateBackendStorageInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn resource_config(
&self,
) -> std::option::Option<&crate::model::UpdateBackendStorageResourceConfig> {
self.resource_config.as_ref()
}
pub fn resource_name(&self) -> std::option::Option<&str> {
self.resource_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateBackendJobInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub job_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub operation: std::option::Option<std::string::String>,
#[doc(hidden)]
pub status: std::option::Option<std::string::String>,
}
impl UpdateBackendJobInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn job_id(&self) -> std::option::Option<&str> {
self.job_id.as_deref()
}
pub fn operation(&self) -> std::option::Option<&str> {
self.operation.as_deref()
}
pub fn status(&self) -> std::option::Option<&str> {
self.status.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateBackendConfigInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub login_auth_config: std::option::Option<crate::model::LoginAuthConfigReqObj>,
}
impl UpdateBackendConfigInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn login_auth_config(&self) -> std::option::Option<&crate::model::LoginAuthConfigReqObj> {
self.login_auth_config.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateBackendAuthInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_config: std::option::Option<crate::model::UpdateBackendAuthResourceConfig>,
#[doc(hidden)]
pub resource_name: std::option::Option<std::string::String>,
}
impl UpdateBackendAuthInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn resource_config(
&self,
) -> std::option::Option<&crate::model::UpdateBackendAuthResourceConfig> {
self.resource_config.as_ref()
}
pub fn resource_name(&self) -> std::option::Option<&str> {
self.resource_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateBackendApiInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_config: std::option::Option<crate::model::BackendApiResourceConfig>,
#[doc(hidden)]
pub resource_name: std::option::Option<std::string::String>,
}
impl UpdateBackendApiInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn resource_config(&self) -> std::option::Option<&crate::model::BackendApiResourceConfig> {
self.resource_config.as_ref()
}
pub fn resource_name(&self) -> std::option::Option<&str> {
self.resource_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RemoveBackendConfigInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
}
impl RemoveBackendConfigInput {
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 RemoveAllBackendsInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub clean_amplify_app: bool,
}
impl RemoveAllBackendsInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn clean_amplify_app(&self) -> bool {
self.clean_amplify_app
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListS3BucketsInput {
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListS3BucketsInput {
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListBackendJobsInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub job_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub operation: std::option::Option<std::string::String>,
#[doc(hidden)]
pub status: std::option::Option<std::string::String>,
}
impl ListBackendJobsInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn job_id(&self) -> std::option::Option<&str> {
self.job_id.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn operation(&self) -> std::option::Option<&str> {
self.operation.as_deref()
}
pub fn status(&self) -> std::option::Option<&str> {
self.status.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ImportBackendStorageInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub bucket_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub service_name: std::option::Option<crate::model::ServiceName>,
}
impl ImportBackendStorageInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn bucket_name(&self) -> std::option::Option<&str> {
self.bucket_name.as_deref()
}
pub fn service_name(&self) -> std::option::Option<&crate::model::ServiceName> {
self.service_name.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ImportBackendAuthInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub identity_pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub native_client_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub user_pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub web_client_id: std::option::Option<std::string::String>,
}
impl ImportBackendAuthInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn identity_pool_id(&self) -> std::option::Option<&str> {
self.identity_pool_id.as_deref()
}
pub fn native_client_id(&self) -> std::option::Option<&str> {
self.native_client_id.as_deref()
}
pub fn user_pool_id(&self) -> std::option::Option<&str> {
self.user_pool_id.as_deref()
}
pub fn web_client_id(&self) -> std::option::Option<&str> {
self.web_client_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetTokenInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub session_id: std::option::Option<std::string::String>,
}
impl GetTokenInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn session_id(&self) -> std::option::Option<&str> {
self.session_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetBackendStorageInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_name: std::option::Option<std::string::String>,
}
impl GetBackendStorageInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn resource_name(&self) -> std::option::Option<&str> {
self.resource_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetBackendJobInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub job_id: std::option::Option<std::string::String>,
}
impl GetBackendJobInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_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 GetBackendAuthInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_name: std::option::Option<std::string::String>,
}
impl GetBackendAuthInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn resource_name(&self) -> std::option::Option<&str> {
self.resource_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetBackendApiModelsInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_name: std::option::Option<std::string::String>,
}
impl GetBackendApiModelsInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn resource_name(&self) -> std::option::Option<&str> {
self.resource_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetBackendApiInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_config: std::option::Option<crate::model::BackendApiResourceConfig>,
#[doc(hidden)]
pub resource_name: std::option::Option<std::string::String>,
}
impl GetBackendApiInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn resource_config(&self) -> std::option::Option<&crate::model::BackendApiResourceConfig> {
self.resource_config.as_ref()
}
pub fn resource_name(&self) -> std::option::Option<&str> {
self.resource_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetBackendInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
}
impl GetBackendInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GenerateBackendApiModelsInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_name: std::option::Option<std::string::String>,
}
impl GenerateBackendApiModelsInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn resource_name(&self) -> std::option::Option<&str> {
self.resource_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteTokenInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub session_id: std::option::Option<std::string::String>,
}
impl DeleteTokenInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn session_id(&self) -> std::option::Option<&str> {
self.session_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteBackendStorageInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub service_name: std::option::Option<crate::model::ServiceName>,
}
impl DeleteBackendStorageInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn resource_name(&self) -> std::option::Option<&str> {
self.resource_name.as_deref()
}
pub fn service_name(&self) -> std::option::Option<&crate::model::ServiceName> {
self.service_name.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteBackendAuthInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_name: std::option::Option<std::string::String>,
}
impl DeleteBackendAuthInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn resource_name(&self) -> std::option::Option<&str> {
self.resource_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteBackendApiInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_config: std::option::Option<crate::model::BackendApiResourceConfig>,
#[doc(hidden)]
pub resource_name: std::option::Option<std::string::String>,
}
impl DeleteBackendApiInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn resource_config(&self) -> std::option::Option<&crate::model::BackendApiResourceConfig> {
self.resource_config.as_ref()
}
pub fn resource_name(&self) -> std::option::Option<&str> {
self.resource_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteBackendInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
}
impl DeleteBackendInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateTokenInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
}
impl CreateTokenInput {
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 CreateBackendStorageInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_config: std::option::Option<crate::model::CreateBackendStorageResourceConfig>,
#[doc(hidden)]
pub resource_name: std::option::Option<std::string::String>,
}
impl CreateBackendStorageInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn resource_config(
&self,
) -> std::option::Option<&crate::model::CreateBackendStorageResourceConfig> {
self.resource_config.as_ref()
}
pub fn resource_name(&self) -> std::option::Option<&str> {
self.resource_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateBackendConfigInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_manager_app_id: std::option::Option<std::string::String>,
}
impl CreateBackendConfigInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_manager_app_id(&self) -> std::option::Option<&str> {
self.backend_manager_app_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateBackendAuthInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_config: std::option::Option<crate::model::CreateBackendAuthResourceConfig>,
#[doc(hidden)]
pub resource_name: std::option::Option<std::string::String>,
}
impl CreateBackendAuthInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn resource_config(
&self,
) -> std::option::Option<&crate::model::CreateBackendAuthResourceConfig> {
self.resource_config.as_ref()
}
pub fn resource_name(&self) -> std::option::Option<&str> {
self.resource_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateBackendApiInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_config: std::option::Option<crate::model::BackendApiResourceConfig>,
#[doc(hidden)]
pub resource_name: std::option::Option<std::string::String>,
}
impl CreateBackendApiInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn resource_config(&self) -> std::option::Option<&crate::model::BackendApiResourceConfig> {
self.resource_config.as_ref()
}
pub fn resource_name(&self) -> std::option::Option<&str> {
self.resource_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateBackendInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub app_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub resource_config: std::option::Option<crate::model::ResourceConfig>,
#[doc(hidden)]
pub resource_name: std::option::Option<std::string::String>,
}
impl CreateBackendInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn app_name(&self) -> std::option::Option<&str> {
self.app_name.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn resource_config(&self) -> std::option::Option<&crate::model::ResourceConfig> {
self.resource_config.as_ref()
}
pub fn resource_name(&self) -> std::option::Option<&str> {
self.resource_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CloneBackendInput {
#[doc(hidden)]
pub app_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub backend_environment_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub target_environment_name: std::option::Option<std::string::String>,
}
impl CloneBackendInput {
pub fn app_id(&self) -> std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn backend_environment_name(&self) -> std::option::Option<&str> {
self.backend_environment_name.as_deref()
}
pub fn target_environment_name(&self) -> std::option::Option<&str> {
self.target_environment_name.as_deref()
}
}