use std::fmt::Write;
pub mod associate_api_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) domain_name: std::option::Option<std::string::String>,
pub(crate) api_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn domain_name(mut self, input: impl Into<std::string::String>) -> Self {
self.domain_name = Some(input.into());
self
}
pub fn set_domain_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.domain_name = input;
self
}
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::AssociateApiInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::AssociateApiInput {
domain_name: self.domain_name,
api_id: self.api_id,
})
}
}
}
impl AssociateApiInput {
#[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::AssociateApi,
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::AssociateApiInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_1 = &_input.domain_name;
let input_1 = input_1.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
)
})?;
let domain_name = aws_smithy_http::label::fmt_string(
input_1,
aws_smithy_http::label::EncodingStrategy::Default,
);
if domain_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/domainnames/{domainName}/apiassociation",
domainName = domain_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::AssociateApiInput,
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_associate_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::AssociateApi::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"AssociateApi",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::associate_api_input::Builder {
crate::input::associate_api_input::Builder::default()
}
}
pub mod create_api_cache_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) ttl: std::option::Option<i64>,
pub(crate) transit_encryption_enabled: std::option::Option<bool>,
pub(crate) at_rest_encryption_enabled: std::option::Option<bool>,
pub(crate) api_caching_behavior: std::option::Option<crate::model::ApiCachingBehavior>,
pub(crate) r#type: std::option::Option<crate::model::ApiCacheType>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn ttl(mut self, input: i64) -> Self {
self.ttl = Some(input);
self
}
pub fn set_ttl(mut self, input: std::option::Option<i64>) -> Self {
self.ttl = input;
self
}
pub fn transit_encryption_enabled(mut self, input: bool) -> Self {
self.transit_encryption_enabled = Some(input);
self
}
pub fn set_transit_encryption_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.transit_encryption_enabled = input;
self
}
pub fn at_rest_encryption_enabled(mut self, input: bool) -> Self {
self.at_rest_encryption_enabled = Some(input);
self
}
pub fn set_at_rest_encryption_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.at_rest_encryption_enabled = input;
self
}
pub fn api_caching_behavior(mut self, input: crate::model::ApiCachingBehavior) -> Self {
self.api_caching_behavior = Some(input);
self
}
pub fn set_api_caching_behavior(
mut self,
input: std::option::Option<crate::model::ApiCachingBehavior>,
) -> Self {
self.api_caching_behavior = input;
self
}
pub fn r#type(mut self, input: crate::model::ApiCacheType) -> Self {
self.r#type = Some(input);
self
}
pub fn set_type(mut self, input: std::option::Option<crate::model::ApiCacheType>) -> Self {
self.r#type = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateApiCacheInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateApiCacheInput {
api_id: self.api_id,
ttl: self.ttl.unwrap_or_default(),
transit_encryption_enabled: self.transit_encryption_enabled.unwrap_or_default(),
at_rest_encryption_enabled: self.at_rest_encryption_enabled.unwrap_or_default(),
api_caching_behavior: self.api_caching_behavior,
r#type: self.r#type,
})
}
}
}
impl CreateApiCacheInput {
#[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::CreateApiCache,
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::CreateApiCacheInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_2 = &_input.api_id;
let input_2 = input_2.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_2,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}/ApiCaches", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateApiCacheInput,
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_api_cache(&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::CreateApiCache::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateApiCache",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_api_cache_input::Builder {
crate::input::create_api_cache_input::Builder::default()
}
}
pub mod create_api_key_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) expires: std::option::Option<i64>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn expires(mut self, input: i64) -> Self {
self.expires = Some(input);
self
}
pub fn set_expires(mut self, input: std::option::Option<i64>) -> Self {
self.expires = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateApiKeyInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateApiKeyInput {
api_id: self.api_id,
description: self.description,
expires: self.expires.unwrap_or_default(),
})
}
}
}
impl CreateApiKeyInput {
#[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::CreateApiKey,
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::CreateApiKeyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_3 = &_input.api_id;
let input_3 = input_3.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_3,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}/apikeys", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateApiKeyInput,
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_api_key(&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::CreateApiKey::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateApiKey",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_api_key_input::Builder {
crate::input::create_api_key_input::Builder::default()
}
}
pub mod create_data_source_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) r#type: std::option::Option<crate::model::DataSourceType>,
pub(crate) service_role_arn: std::option::Option<std::string::String>,
pub(crate) dynamodb_config: std::option::Option<crate::model::DynamodbDataSourceConfig>,
pub(crate) lambda_config: std::option::Option<crate::model::LambdaDataSourceConfig>,
pub(crate) elasticsearch_config:
std::option::Option<crate::model::ElasticsearchDataSourceConfig>,
pub(crate) open_search_service_config:
std::option::Option<crate::model::OpenSearchServiceDataSourceConfig>,
pub(crate) http_config: std::option::Option<crate::model::HttpDataSourceConfig>,
pub(crate) relational_database_config:
std::option::Option<crate::model::RelationalDatabaseDataSourceConfig>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn r#type(mut self, input: crate::model::DataSourceType) -> Self {
self.r#type = Some(input);
self
}
pub fn set_type(
mut self,
input: std::option::Option<crate::model::DataSourceType>,
) -> Self {
self.r#type = input;
self
}
pub fn service_role_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.service_role_arn = Some(input.into());
self
}
pub fn set_service_role_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.service_role_arn = input;
self
}
pub fn dynamodb_config(mut self, input: crate::model::DynamodbDataSourceConfig) -> Self {
self.dynamodb_config = Some(input);
self
}
pub fn set_dynamodb_config(
mut self,
input: std::option::Option<crate::model::DynamodbDataSourceConfig>,
) -> Self {
self.dynamodb_config = input;
self
}
pub fn lambda_config(mut self, input: crate::model::LambdaDataSourceConfig) -> Self {
self.lambda_config = Some(input);
self
}
pub fn set_lambda_config(
mut self,
input: std::option::Option<crate::model::LambdaDataSourceConfig>,
) -> Self {
self.lambda_config = input;
self
}
pub fn elasticsearch_config(
mut self,
input: crate::model::ElasticsearchDataSourceConfig,
) -> Self {
self.elasticsearch_config = Some(input);
self
}
pub fn set_elasticsearch_config(
mut self,
input: std::option::Option<crate::model::ElasticsearchDataSourceConfig>,
) -> Self {
self.elasticsearch_config = input;
self
}
pub fn open_search_service_config(
mut self,
input: crate::model::OpenSearchServiceDataSourceConfig,
) -> Self {
self.open_search_service_config = Some(input);
self
}
pub fn set_open_search_service_config(
mut self,
input: std::option::Option<crate::model::OpenSearchServiceDataSourceConfig>,
) -> Self {
self.open_search_service_config = input;
self
}
pub fn http_config(mut self, input: crate::model::HttpDataSourceConfig) -> Self {
self.http_config = Some(input);
self
}
pub fn set_http_config(
mut self,
input: std::option::Option<crate::model::HttpDataSourceConfig>,
) -> Self {
self.http_config = input;
self
}
pub fn relational_database_config(
mut self,
input: crate::model::RelationalDatabaseDataSourceConfig,
) -> Self {
self.relational_database_config = Some(input);
self
}
pub fn set_relational_database_config(
mut self,
input: std::option::Option<crate::model::RelationalDatabaseDataSourceConfig>,
) -> Self {
self.relational_database_config = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateDataSourceInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateDataSourceInput {
api_id: self.api_id,
name: self.name,
description: self.description,
r#type: self.r#type,
service_role_arn: self.service_role_arn,
dynamodb_config: self.dynamodb_config,
lambda_config: self.lambda_config,
elasticsearch_config: self.elasticsearch_config,
open_search_service_config: self.open_search_service_config,
http_config: self.http_config,
relational_database_config: self.relational_database_config,
})
}
}
}
impl CreateDataSourceInput {
#[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::CreateDataSource,
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::CreateDataSourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_4 = &_input.api_id;
let input_4 = input_4.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_4,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}/datasources", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateDataSourceInput,
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_data_source(&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::CreateDataSource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateDataSource",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_data_source_input::Builder {
crate::input::create_data_source_input::Builder::default()
}
}
pub mod create_domain_name_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) domain_name: std::option::Option<std::string::String>,
pub(crate) certificate_arn: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
}
impl Builder {
pub fn domain_name(mut self, input: impl Into<std::string::String>) -> Self {
self.domain_name = Some(input.into());
self
}
pub fn set_domain_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.domain_name = input;
self
}
pub fn certificate_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.certificate_arn = Some(input.into());
self
}
pub fn set_certificate_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.certificate_arn = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateDomainNameInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateDomainNameInput {
domain_name: self.domain_name,
certificate_arn: self.certificate_arn,
description: self.description,
})
}
}
}
impl CreateDomainNameInput {
#[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::CreateDomainName,
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::CreateDomainNameInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/v1/domainnames").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateDomainNameInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_domain_name(&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::CreateDomainName::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateDomainName",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_domain_name_input::Builder {
crate::input::create_domain_name_input::Builder::default()
}
}
pub mod create_function_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) data_source_name: std::option::Option<std::string::String>,
pub(crate) request_mapping_template: std::option::Option<std::string::String>,
pub(crate) response_mapping_template: std::option::Option<std::string::String>,
pub(crate) function_version: std::option::Option<std::string::String>,
pub(crate) sync_config: std::option::Option<crate::model::SyncConfig>,
pub(crate) max_batch_size: std::option::Option<i32>,
pub(crate) runtime: std::option::Option<crate::model::AppSyncRuntime>,
pub(crate) code: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn data_source_name(mut self, input: impl Into<std::string::String>) -> Self {
self.data_source_name = Some(input.into());
self
}
pub fn set_data_source_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.data_source_name = input;
self
}
pub fn request_mapping_template(mut self, input: impl Into<std::string::String>) -> Self {
self.request_mapping_template = Some(input.into());
self
}
pub fn set_request_mapping_template(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.request_mapping_template = input;
self
}
pub fn response_mapping_template(mut self, input: impl Into<std::string::String>) -> Self {
self.response_mapping_template = Some(input.into());
self
}
pub fn set_response_mapping_template(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.response_mapping_template = input;
self
}
pub fn function_version(mut self, input: impl Into<std::string::String>) -> Self {
self.function_version = Some(input.into());
self
}
pub fn set_function_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_version = input;
self
}
pub fn sync_config(mut self, input: crate::model::SyncConfig) -> Self {
self.sync_config = Some(input);
self
}
pub fn set_sync_config(
mut self,
input: std::option::Option<crate::model::SyncConfig>,
) -> Self {
self.sync_config = input;
self
}
pub fn max_batch_size(mut self, input: i32) -> Self {
self.max_batch_size = Some(input);
self
}
pub fn set_max_batch_size(mut self, input: std::option::Option<i32>) -> Self {
self.max_batch_size = input;
self
}
pub fn runtime(mut self, input: crate::model::AppSyncRuntime) -> Self {
self.runtime = Some(input);
self
}
pub fn set_runtime(
mut self,
input: std::option::Option<crate::model::AppSyncRuntime>,
) -> Self {
self.runtime = input;
self
}
pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
self.code = Some(input.into());
self
}
pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.code = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateFunctionInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateFunctionInput {
api_id: self.api_id,
name: self.name,
description: self.description,
data_source_name: self.data_source_name,
request_mapping_template: self.request_mapping_template,
response_mapping_template: self.response_mapping_template,
function_version: self.function_version,
sync_config: self.sync_config,
max_batch_size: self.max_batch_size.unwrap_or_default(),
runtime: self.runtime,
code: self.code,
})
}
}
}
impl CreateFunctionInput {
#[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::CreateFunction,
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::CreateFunctionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_5 = &_input.api_id;
let input_5 = input_5.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_5,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}/functions", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateFunctionInput,
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_function(&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::CreateFunction::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateFunction",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_function_input::Builder {
crate::input::create_function_input::Builder::default()
}
}
pub mod create_graphql_api_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) log_config: std::option::Option<crate::model::LogConfig>,
pub(crate) authentication_type: std::option::Option<crate::model::AuthenticationType>,
pub(crate) user_pool_config: std::option::Option<crate::model::UserPoolConfig>,
pub(crate) open_id_connect_config: std::option::Option<crate::model::OpenIdConnectConfig>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) additional_authentication_providers:
std::option::Option<std::vec::Vec<crate::model::AdditionalAuthenticationProvider>>,
pub(crate) xray_enabled: std::option::Option<bool>,
pub(crate) lambda_authorizer_config:
std::option::Option<crate::model::LambdaAuthorizerConfig>,
}
impl Builder {
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn log_config(mut self, input: crate::model::LogConfig) -> Self {
self.log_config = Some(input);
self
}
pub fn set_log_config(
mut self,
input: std::option::Option<crate::model::LogConfig>,
) -> Self {
self.log_config = input;
self
}
pub fn authentication_type(mut self, input: crate::model::AuthenticationType) -> Self {
self.authentication_type = Some(input);
self
}
pub fn set_authentication_type(
mut self,
input: std::option::Option<crate::model::AuthenticationType>,
) -> Self {
self.authentication_type = input;
self
}
pub fn user_pool_config(mut self, input: crate::model::UserPoolConfig) -> Self {
self.user_pool_config = Some(input);
self
}
pub fn set_user_pool_config(
mut self,
input: std::option::Option<crate::model::UserPoolConfig>,
) -> Self {
self.user_pool_config = input;
self
}
pub fn open_id_connect_config(mut self, input: crate::model::OpenIdConnectConfig) -> Self {
self.open_id_connect_config = Some(input);
self
}
pub fn set_open_id_connect_config(
mut self,
input: std::option::Option<crate::model::OpenIdConnectConfig>,
) -> Self {
self.open_id_connect_config = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn additional_authentication_providers(
mut self,
input: crate::model::AdditionalAuthenticationProvider,
) -> Self {
let mut v = self.additional_authentication_providers.unwrap_or_default();
v.push(input);
self.additional_authentication_providers = Some(v);
self
}
pub fn set_additional_authentication_providers(
mut self,
input: std::option::Option<
std::vec::Vec<crate::model::AdditionalAuthenticationProvider>,
>,
) -> Self {
self.additional_authentication_providers = input;
self
}
pub fn xray_enabled(mut self, input: bool) -> Self {
self.xray_enabled = Some(input);
self
}
pub fn set_xray_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.xray_enabled = input;
self
}
pub fn lambda_authorizer_config(
mut self,
input: crate::model::LambdaAuthorizerConfig,
) -> Self {
self.lambda_authorizer_config = Some(input);
self
}
pub fn set_lambda_authorizer_config(
mut self,
input: std::option::Option<crate::model::LambdaAuthorizerConfig>,
) -> Self {
self.lambda_authorizer_config = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateGraphqlApiInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateGraphqlApiInput {
name: self.name,
log_config: self.log_config,
authentication_type: self.authentication_type,
user_pool_config: self.user_pool_config,
open_id_connect_config: self.open_id_connect_config,
tags: self.tags,
additional_authentication_providers: self.additional_authentication_providers,
xray_enabled: self.xray_enabled.unwrap_or_default(),
lambda_authorizer_config: self.lambda_authorizer_config,
})
}
}
}
impl CreateGraphqlApiInput {
#[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::CreateGraphqlApi,
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::CreateGraphqlApiInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/v1/apis").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateGraphqlApiInput,
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_graphql_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::CreateGraphqlApi::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateGraphqlApi",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_graphql_api_input::Builder {
crate::input::create_graphql_api_input::Builder::default()
}
}
pub mod create_resolver_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) type_name: std::option::Option<std::string::String>,
pub(crate) field_name: std::option::Option<std::string::String>,
pub(crate) data_source_name: std::option::Option<std::string::String>,
pub(crate) request_mapping_template: std::option::Option<std::string::String>,
pub(crate) response_mapping_template: std::option::Option<std::string::String>,
pub(crate) kind: std::option::Option<crate::model::ResolverKind>,
pub(crate) pipeline_config: std::option::Option<crate::model::PipelineConfig>,
pub(crate) sync_config: std::option::Option<crate::model::SyncConfig>,
pub(crate) caching_config: std::option::Option<crate::model::CachingConfig>,
pub(crate) max_batch_size: std::option::Option<i32>,
pub(crate) runtime: std::option::Option<crate::model::AppSyncRuntime>,
pub(crate) code: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn type_name(mut self, input: impl Into<std::string::String>) -> Self {
self.type_name = Some(input.into());
self
}
pub fn set_type_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.type_name = input;
self
}
pub fn field_name(mut self, input: impl Into<std::string::String>) -> Self {
self.field_name = Some(input.into());
self
}
pub fn set_field_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.field_name = input;
self
}
pub fn data_source_name(mut self, input: impl Into<std::string::String>) -> Self {
self.data_source_name = Some(input.into());
self
}
pub fn set_data_source_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.data_source_name = input;
self
}
pub fn request_mapping_template(mut self, input: impl Into<std::string::String>) -> Self {
self.request_mapping_template = Some(input.into());
self
}
pub fn set_request_mapping_template(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.request_mapping_template = input;
self
}
pub fn response_mapping_template(mut self, input: impl Into<std::string::String>) -> Self {
self.response_mapping_template = Some(input.into());
self
}
pub fn set_response_mapping_template(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.response_mapping_template = input;
self
}
pub fn kind(mut self, input: crate::model::ResolverKind) -> Self {
self.kind = Some(input);
self
}
pub fn set_kind(mut self, input: std::option::Option<crate::model::ResolverKind>) -> Self {
self.kind = input;
self
}
pub fn pipeline_config(mut self, input: crate::model::PipelineConfig) -> Self {
self.pipeline_config = Some(input);
self
}
pub fn set_pipeline_config(
mut self,
input: std::option::Option<crate::model::PipelineConfig>,
) -> Self {
self.pipeline_config = input;
self
}
pub fn sync_config(mut self, input: crate::model::SyncConfig) -> Self {
self.sync_config = Some(input);
self
}
pub fn set_sync_config(
mut self,
input: std::option::Option<crate::model::SyncConfig>,
) -> Self {
self.sync_config = input;
self
}
pub fn caching_config(mut self, input: crate::model::CachingConfig) -> Self {
self.caching_config = Some(input);
self
}
pub fn set_caching_config(
mut self,
input: std::option::Option<crate::model::CachingConfig>,
) -> Self {
self.caching_config = input;
self
}
pub fn max_batch_size(mut self, input: i32) -> Self {
self.max_batch_size = Some(input);
self
}
pub fn set_max_batch_size(mut self, input: std::option::Option<i32>) -> Self {
self.max_batch_size = input;
self
}
pub fn runtime(mut self, input: crate::model::AppSyncRuntime) -> Self {
self.runtime = Some(input);
self
}
pub fn set_runtime(
mut self,
input: std::option::Option<crate::model::AppSyncRuntime>,
) -> Self {
self.runtime = input;
self
}
pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
self.code = Some(input.into());
self
}
pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.code = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateResolverInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateResolverInput {
api_id: self.api_id,
type_name: self.type_name,
field_name: self.field_name,
data_source_name: self.data_source_name,
request_mapping_template: self.request_mapping_template,
response_mapping_template: self.response_mapping_template,
kind: self.kind,
pipeline_config: self.pipeline_config,
sync_config: self.sync_config,
caching_config: self.caching_config,
max_batch_size: self.max_batch_size.unwrap_or_default(),
runtime: self.runtime,
code: self.code,
})
}
}
}
impl CreateResolverInput {
#[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::CreateResolver,
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::CreateResolverInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_6 = &_input.api_id;
let input_6 = input_6.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_6,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
let input_7 = &_input.type_name;
let input_7 = input_7.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"type_name",
"cannot be empty or unset",
)
})?;
let type_name = aws_smithy_http::label::fmt_string(
input_7,
aws_smithy_http::label::EncodingStrategy::Default,
);
if type_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"type_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/apis/{apiId}/types/{typeName}/resolvers",
apiId = api_id,
typeName = type_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateResolverInput,
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_resolver(&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::CreateResolver::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateResolver",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_resolver_input::Builder {
crate::input::create_resolver_input::Builder::default()
}
}
pub mod create_type_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) definition: std::option::Option<std::string::String>,
pub(crate) format: std::option::Option<crate::model::TypeDefinitionFormat>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn definition(mut self, input: impl Into<std::string::String>) -> Self {
self.definition = Some(input.into());
self
}
pub fn set_definition(mut self, input: std::option::Option<std::string::String>) -> Self {
self.definition = input;
self
}
pub fn format(mut self, input: crate::model::TypeDefinitionFormat) -> Self {
self.format = Some(input);
self
}
pub fn set_format(
mut self,
input: std::option::Option<crate::model::TypeDefinitionFormat>,
) -> Self {
self.format = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateTypeInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateTypeInput {
api_id: self.api_id,
definition: self.definition,
format: self.format,
})
}
}
}
impl CreateTypeInput {
#[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::CreateType,
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::CreateTypeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_8 = &_input.api_id;
let input_8 = input_8.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_8,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}/types", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateTypeInput,
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_type(&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::CreateType::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateType",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_type_input::Builder {
crate::input::create_type_input::Builder::default()
}
}
pub mod delete_api_cache_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteApiCacheInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteApiCacheInput {
api_id: self.api_id,
})
}
}
}
impl DeleteApiCacheInput {
#[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::DeleteApiCache,
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::DeleteApiCacheInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_9 = &_input.api_id;
let input_9 = input_9.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_9,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}/ApiCaches", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteApiCacheInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteApiCache::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteApiCache",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_api_cache_input::Builder {
crate::input::delete_api_cache_input::Builder::default()
}
}
pub mod delete_api_key_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
self.id = Some(input.into());
self
}
pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteApiKeyInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteApiKeyInput {
api_id: self.api_id,
id: self.id,
})
}
}
}
impl DeleteApiKeyInput {
#[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::DeleteApiKey,
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::DeleteApiKeyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_10 = &_input.api_id;
let input_10 = input_10.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_10,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
let input_11 = &_input.id;
let input_11 = input_11.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"id",
"cannot be empty or unset",
)
})?;
let id = aws_smithy_http::label::fmt_string(
input_11,
aws_smithy_http::label::EncodingStrategy::Default,
);
if id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/apis/{apiId}/apikeys/{id}",
apiId = api_id,
id = id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteApiKeyInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteApiKey::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteApiKey",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_api_key_input::Builder {
crate::input::delete_api_key_input::Builder::default()
}
}
pub mod delete_data_source_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteDataSourceInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteDataSourceInput {
api_id: self.api_id,
name: self.name,
})
}
}
}
impl DeleteDataSourceInput {
#[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::DeleteDataSource,
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::DeleteDataSourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_12 = &_input.api_id;
let input_12 = input_12.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_12,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
let input_13 = &_input.name;
let input_13 = input_13.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"name",
"cannot be empty or unset",
)
})?;
let name = aws_smithy_http::label::fmt_string(
input_13,
aws_smithy_http::label::EncodingStrategy::Default,
);
if name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/apis/{apiId}/datasources/{name}",
apiId = api_id,
name = name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteDataSourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteDataSource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteDataSource",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_data_source_input::Builder {
crate::input::delete_data_source_input::Builder::default()
}
}
pub mod delete_domain_name_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) domain_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn domain_name(mut self, input: impl Into<std::string::String>) -> Self {
self.domain_name = Some(input.into());
self
}
pub fn set_domain_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.domain_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteDomainNameInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteDomainNameInput {
domain_name: self.domain_name,
})
}
}
}
impl DeleteDomainNameInput {
#[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::DeleteDomainName,
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::DeleteDomainNameInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_14 = &_input.domain_name;
let input_14 = input_14.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
)
})?;
let domain_name = aws_smithy_http::label::fmt_string(
input_14,
aws_smithy_http::label::EncodingStrategy::Default,
);
if domain_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/domainnames/{domainName}",
domainName = domain_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteDomainNameInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteDomainName::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteDomainName",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_domain_name_input::Builder {
crate::input::delete_domain_name_input::Builder::default()
}
}
pub mod delete_function_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) function_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn function_id(mut self, input: impl Into<std::string::String>) -> Self {
self.function_id = Some(input.into());
self
}
pub fn set_function_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.function_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteFunctionInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteFunctionInput {
api_id: self.api_id,
function_id: self.function_id,
})
}
}
}
impl DeleteFunctionInput {
#[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::DeleteFunction,
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::DeleteFunctionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_15 = &_input.api_id;
let input_15 = input_15.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_15,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
let input_16 = &_input.function_id;
let input_16 = input_16.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_id",
"cannot be empty or unset",
)
})?;
let function_id = aws_smithy_http::label::fmt_string(
input_16,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/apis/{apiId}/functions/{functionId}",
apiId = api_id,
functionId = function_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteFunctionInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteFunction::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteFunction",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_function_input::Builder {
crate::input::delete_function_input::Builder::default()
}
}
pub mod delete_graphql_api_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteGraphqlApiInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteGraphqlApiInput {
api_id: self.api_id,
})
}
}
}
impl DeleteGraphqlApiInput {
#[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::DeleteGraphqlApi,
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::DeleteGraphqlApiInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_17 = &_input.api_id;
let input_17 = input_17.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_17,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteGraphqlApiInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteGraphqlApi::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteGraphqlApi",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_graphql_api_input::Builder {
crate::input::delete_graphql_api_input::Builder::default()
}
}
pub mod delete_resolver_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) type_name: std::option::Option<std::string::String>,
pub(crate) field_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn type_name(mut self, input: impl Into<std::string::String>) -> Self {
self.type_name = Some(input.into());
self
}
pub fn set_type_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.type_name = input;
self
}
pub fn field_name(mut self, input: impl Into<std::string::String>) -> Self {
self.field_name = Some(input.into());
self
}
pub fn set_field_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.field_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteResolverInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteResolverInput {
api_id: self.api_id,
type_name: self.type_name,
field_name: self.field_name,
})
}
}
}
impl DeleteResolverInput {
#[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::DeleteResolver,
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::DeleteResolverInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_18 = &_input.api_id;
let input_18 = input_18.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_18,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
let input_19 = &_input.type_name;
let input_19 = input_19.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"type_name",
"cannot be empty or unset",
)
})?;
let type_name = aws_smithy_http::label::fmt_string(
input_19,
aws_smithy_http::label::EncodingStrategy::Default,
);
if type_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"type_name",
"cannot be empty or unset",
),
);
}
let input_20 = &_input.field_name;
let input_20 = input_20.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"field_name",
"cannot be empty or unset",
)
})?;
let field_name = aws_smithy_http::label::fmt_string(
input_20,
aws_smithy_http::label::EncodingStrategy::Default,
);
if field_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"field_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/apis/{apiId}/types/{typeName}/resolvers/{fieldName}",
apiId = api_id,
typeName = type_name,
fieldName = field_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteResolverInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteResolver::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteResolver",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_resolver_input::Builder {
crate::input::delete_resolver_input::Builder::default()
}
}
pub mod delete_type_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) type_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn type_name(mut self, input: impl Into<std::string::String>) -> Self {
self.type_name = Some(input.into());
self
}
pub fn set_type_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.type_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteTypeInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteTypeInput {
api_id: self.api_id,
type_name: self.type_name,
})
}
}
}
impl DeleteTypeInput {
#[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::DeleteType,
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::DeleteTypeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_21 = &_input.api_id;
let input_21 = input_21.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_21,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
let input_22 = &_input.type_name;
let input_22 = input_22.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"type_name",
"cannot be empty or unset",
)
})?;
let type_name = aws_smithy_http::label::fmt_string(
input_22,
aws_smithy_http::label::EncodingStrategy::Default,
);
if type_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"type_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/apis/{apiId}/types/{typeName}",
apiId = api_id,
typeName = type_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteTypeInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteType::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteType",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_type_input::Builder {
crate::input::delete_type_input::Builder::default()
}
}
pub mod disassociate_api_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) domain_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn domain_name(mut self, input: impl Into<std::string::String>) -> Self {
self.domain_name = Some(input.into());
self
}
pub fn set_domain_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.domain_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DisassociateApiInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DisassociateApiInput {
domain_name: self.domain_name,
})
}
}
}
impl DisassociateApiInput {
#[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::DisassociateApi,
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::DisassociateApiInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_23 = &_input.domain_name;
let input_23 = input_23.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
)
})?;
let domain_name = aws_smithy_http::label::fmt_string(
input_23,
aws_smithy_http::label::EncodingStrategy::Default,
);
if domain_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/domainnames/{domainName}/apiassociation",
domainName = domain_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DisassociateApiInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DisassociateApi::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DisassociateApi",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::disassociate_api_input::Builder {
crate::input::disassociate_api_input::Builder::default()
}
}
pub mod evaluate_code_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) runtime: std::option::Option<crate::model::AppSyncRuntime>,
pub(crate) code: std::option::Option<std::string::String>,
pub(crate) context: std::option::Option<std::string::String>,
pub(crate) function: std::option::Option<std::string::String>,
}
impl Builder {
pub fn runtime(mut self, input: crate::model::AppSyncRuntime) -> Self {
self.runtime = Some(input);
self
}
pub fn set_runtime(
mut self,
input: std::option::Option<crate::model::AppSyncRuntime>,
) -> Self {
self.runtime = input;
self
}
pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
self.code = Some(input.into());
self
}
pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.code = input;
self
}
pub fn context(mut self, input: impl Into<std::string::String>) -> Self {
self.context = Some(input.into());
self
}
pub fn set_context(mut self, input: std::option::Option<std::string::String>) -> Self {
self.context = input;
self
}
pub fn function(mut self, input: impl Into<std::string::String>) -> Self {
self.function = Some(input.into());
self
}
pub fn set_function(mut self, input: std::option::Option<std::string::String>) -> Self {
self.function = input;
self
}
pub fn build(
self,
) -> Result<crate::input::EvaluateCodeInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::EvaluateCodeInput {
runtime: self.runtime,
code: self.code,
context: self.context,
function: self.function,
})
}
}
}
impl EvaluateCodeInput {
#[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::EvaluateCode,
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::EvaluateCodeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/v1/dataplane-evaluatecode").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::EvaluateCodeInput,
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_evaluate_code(&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::EvaluateCode::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"EvaluateCode",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::evaluate_code_input::Builder {
crate::input::evaluate_code_input::Builder::default()
}
}
pub mod evaluate_mapping_template_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) template: std::option::Option<std::string::String>,
pub(crate) context: std::option::Option<std::string::String>,
}
impl Builder {
pub fn template(mut self, input: impl Into<std::string::String>) -> Self {
self.template = Some(input.into());
self
}
pub fn set_template(mut self, input: std::option::Option<std::string::String>) -> Self {
self.template = input;
self
}
pub fn context(mut self, input: impl Into<std::string::String>) -> Self {
self.context = Some(input.into());
self
}
pub fn set_context(mut self, input: std::option::Option<std::string::String>) -> Self {
self.context = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::EvaluateMappingTemplateInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::EvaluateMappingTemplateInput {
template: self.template,
context: self.context,
})
}
}
}
impl EvaluateMappingTemplateInput {
#[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::EvaluateMappingTemplate,
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::EvaluateMappingTemplateInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/v1/dataplane-evaluatetemplate")
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::EvaluateMappingTemplateInput,
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_evaluate_mapping_template(
&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::EvaluateMappingTemplate::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"EvaluateMappingTemplate",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::evaluate_mapping_template_input::Builder {
crate::input::evaluate_mapping_template_input::Builder::default()
}
}
pub mod flush_api_cache_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::FlushApiCacheInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::FlushApiCacheInput {
api_id: self.api_id,
})
}
}
}
impl FlushApiCacheInput {
#[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::FlushApiCache,
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::FlushApiCacheInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_24 = &_input.api_id;
let input_24 = input_24.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_24,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}/FlushCache", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::FlushApiCacheInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::FlushApiCache::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"FlushApiCache",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::flush_api_cache_input::Builder {
crate::input::flush_api_cache_input::Builder::default()
}
}
pub mod get_api_association_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) domain_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn domain_name(mut self, input: impl Into<std::string::String>) -> Self {
self.domain_name = Some(input.into());
self
}
pub fn set_domain_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.domain_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetApiAssociationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetApiAssociationInput {
domain_name: self.domain_name,
})
}
}
}
impl GetApiAssociationInput {
#[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::GetApiAssociation,
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::GetApiAssociationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_25 = &_input.domain_name;
let input_25 = input_25.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
)
})?;
let domain_name = aws_smithy_http::label::fmt_string(
input_25,
aws_smithy_http::label::EncodingStrategy::Default,
);
if domain_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/domainnames/{domainName}/apiassociation",
domainName = domain_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetApiAssociationInput,
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::GetApiAssociation::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetApiAssociation",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_api_association_input::Builder {
crate::input::get_api_association_input::Builder::default()
}
}
pub mod get_api_cache_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetApiCacheInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetApiCacheInput {
api_id: self.api_id,
})
}
}
}
impl GetApiCacheInput {
#[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::GetApiCache,
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::GetApiCacheInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_26 = &_input.api_id;
let input_26 = input_26.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_26,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}/ApiCaches", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetApiCacheInput,
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::GetApiCache::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetApiCache",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_api_cache_input::Builder {
crate::input::get_api_cache_input::Builder::default()
}
}
pub mod get_data_source_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetDataSourceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetDataSourceInput {
api_id: self.api_id,
name: self.name,
})
}
}
}
impl GetDataSourceInput {
#[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::GetDataSource,
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::GetDataSourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_27 = &_input.api_id;
let input_27 = input_27.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_27,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
let input_28 = &_input.name;
let input_28 = input_28.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"name",
"cannot be empty or unset",
)
})?;
let name = aws_smithy_http::label::fmt_string(
input_28,
aws_smithy_http::label::EncodingStrategy::Default,
);
if name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/apis/{apiId}/datasources/{name}",
apiId = api_id,
name = name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetDataSourceInput,
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::GetDataSource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetDataSource",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_data_source_input::Builder {
crate::input::get_data_source_input::Builder::default()
}
}
pub mod get_domain_name_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) domain_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn domain_name(mut self, input: impl Into<std::string::String>) -> Self {
self.domain_name = Some(input.into());
self
}
pub fn set_domain_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.domain_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetDomainNameInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetDomainNameInput {
domain_name: self.domain_name,
})
}
}
}
impl GetDomainNameInput {
#[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::GetDomainName,
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::GetDomainNameInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_29 = &_input.domain_name;
let input_29 = input_29.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
)
})?;
let domain_name = aws_smithy_http::label::fmt_string(
input_29,
aws_smithy_http::label::EncodingStrategy::Default,
);
if domain_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/domainnames/{domainName}",
domainName = domain_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetDomainNameInput,
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::GetDomainName::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetDomainName",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_domain_name_input::Builder {
crate::input::get_domain_name_input::Builder::default()
}
}
pub mod get_function_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) function_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn function_id(mut self, input: impl Into<std::string::String>) -> Self {
self.function_id = Some(input.into());
self
}
pub fn set_function_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.function_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetFunctionInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetFunctionInput {
api_id: self.api_id,
function_id: self.function_id,
})
}
}
}
impl GetFunctionInput {
#[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::GetFunction,
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::GetFunctionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_30 = &_input.api_id;
let input_30 = input_30.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_30,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
let input_31 = &_input.function_id;
let input_31 = input_31.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_id",
"cannot be empty or unset",
)
})?;
let function_id = aws_smithy_http::label::fmt_string(
input_31,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/apis/{apiId}/functions/{functionId}",
apiId = api_id,
functionId = function_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetFunctionInput,
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::GetFunction::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetFunction",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_function_input::Builder {
crate::input::get_function_input::Builder::default()
}
}
pub mod get_graphql_api_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetGraphqlApiInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetGraphqlApiInput {
api_id: self.api_id,
})
}
}
}
impl GetGraphqlApiInput {
#[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::GetGraphqlApi,
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::GetGraphqlApiInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_32 = &_input.api_id;
let input_32 = input_32.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_32,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetGraphqlApiInput,
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::GetGraphqlApi::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetGraphqlApi",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_graphql_api_input::Builder {
crate::input::get_graphql_api_input::Builder::default()
}
}
pub mod get_introspection_schema_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) format: std::option::Option<crate::model::OutputType>,
pub(crate) include_directives: std::option::Option<bool>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn format(mut self, input: crate::model::OutputType) -> Self {
self.format = Some(input);
self
}
pub fn set_format(mut self, input: std::option::Option<crate::model::OutputType>) -> Self {
self.format = input;
self
}
pub fn include_directives(mut self, input: bool) -> Self {
self.include_directives = Some(input);
self
}
pub fn set_include_directives(mut self, input: std::option::Option<bool>) -> Self {
self.include_directives = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetIntrospectionSchemaInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetIntrospectionSchemaInput {
api_id: self.api_id,
format: self.format,
include_directives: self.include_directives,
})
}
}
}
impl GetIntrospectionSchemaInput {
#[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::GetIntrospectionSchema,
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::GetIntrospectionSchemaInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_33 = &_input.api_id;
let input_33 = input_33.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_33,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}/schema", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetIntrospectionSchemaInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_34 = &_input.format;
let inner_34 = inner_34.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"format",
"cannot be empty or unset",
)
})?;
query.push_kv("format", &aws_smithy_http::query::fmt_string(&inner_34));
if let Some(inner_35) = &_input.include_directives {
if *inner_35 {
query.push_kv(
"includeDirectives",
aws_smithy_types::primitive::Encoder::from(*inner_35).encode(),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetIntrospectionSchemaInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetIntrospectionSchema::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetIntrospectionSchema",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_introspection_schema_input::Builder {
crate::input::get_introspection_schema_input::Builder::default()
}
}
pub mod get_resolver_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) type_name: std::option::Option<std::string::String>,
pub(crate) field_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn type_name(mut self, input: impl Into<std::string::String>) -> Self {
self.type_name = Some(input.into());
self
}
pub fn set_type_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.type_name = input;
self
}
pub fn field_name(mut self, input: impl Into<std::string::String>) -> Self {
self.field_name = Some(input.into());
self
}
pub fn set_field_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.field_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetResolverInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetResolverInput {
api_id: self.api_id,
type_name: self.type_name,
field_name: self.field_name,
})
}
}
}
impl GetResolverInput {
#[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::GetResolver,
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::GetResolverInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_36 = &_input.api_id;
let input_36 = input_36.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_36,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
let input_37 = &_input.type_name;
let input_37 = input_37.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"type_name",
"cannot be empty or unset",
)
})?;
let type_name = aws_smithy_http::label::fmt_string(
input_37,
aws_smithy_http::label::EncodingStrategy::Default,
);
if type_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"type_name",
"cannot be empty or unset",
),
);
}
let input_38 = &_input.field_name;
let input_38 = input_38.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"field_name",
"cannot be empty or unset",
)
})?;
let field_name = aws_smithy_http::label::fmt_string(
input_38,
aws_smithy_http::label::EncodingStrategy::Default,
);
if field_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"field_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/apis/{apiId}/types/{typeName}/resolvers/{fieldName}",
apiId = api_id,
typeName = type_name,
fieldName = field_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetResolverInput,
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::GetResolver::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetResolver",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_resolver_input::Builder {
crate::input::get_resolver_input::Builder::default()
}
}
pub mod get_schema_creation_status_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetSchemaCreationStatusInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetSchemaCreationStatusInput {
api_id: self.api_id,
})
}
}
}
impl GetSchemaCreationStatusInput {
#[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::GetSchemaCreationStatus,
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::GetSchemaCreationStatusInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_39 = &_input.api_id;
let input_39 = input_39.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_39,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}/schemacreation", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetSchemaCreationStatusInput,
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::GetSchemaCreationStatus::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetSchemaCreationStatus",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_schema_creation_status_input::Builder {
crate::input::get_schema_creation_status_input::Builder::default()
}
}
pub mod get_type_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) type_name: std::option::Option<std::string::String>,
pub(crate) format: std::option::Option<crate::model::TypeDefinitionFormat>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn type_name(mut self, input: impl Into<std::string::String>) -> Self {
self.type_name = Some(input.into());
self
}
pub fn set_type_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.type_name = input;
self
}
pub fn format(mut self, input: crate::model::TypeDefinitionFormat) -> Self {
self.format = Some(input);
self
}
pub fn set_format(
mut self,
input: std::option::Option<crate::model::TypeDefinitionFormat>,
) -> Self {
self.format = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetTypeInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetTypeInput {
api_id: self.api_id,
type_name: self.type_name,
format: self.format,
})
}
}
}
impl GetTypeInput {
#[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::GetType,
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::GetTypeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_40 = &_input.api_id;
let input_40 = input_40.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_40,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
let input_41 = &_input.type_name;
let input_41 = input_41.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"type_name",
"cannot be empty or unset",
)
})?;
let type_name = aws_smithy_http::label::fmt_string(
input_41,
aws_smithy_http::label::EncodingStrategy::Default,
);
if type_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"type_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/apis/{apiId}/types/{typeName}",
apiId = api_id,
typeName = type_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetTypeInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_42 = &_input.format;
let inner_42 = inner_42.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"format",
"cannot be empty or unset",
)
})?;
query.push_kv("format", &aws_smithy_http::query::fmt_string(&inner_42));
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetTypeInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::GetType::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetType", "appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_type_input::Builder {
crate::input::get_type_input::Builder::default()
}
}
pub mod list_api_keys_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListApiKeysInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListApiKeysInput {
api_id: self.api_id,
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
})
}
}
}
impl ListApiKeysInput {
#[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::ListApiKeys,
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::ListApiKeysInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_43 = &_input.api_id;
let input_43 = input_43.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_43,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}/apikeys", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListApiKeysInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_44) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_44));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListApiKeysInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListApiKeys::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListApiKeys",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_api_keys_input::Builder {
crate::input::list_api_keys_input::Builder::default()
}
}
pub mod list_data_sources_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListDataSourcesInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListDataSourcesInput {
api_id: self.api_id,
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
})
}
}
}
impl ListDataSourcesInput {
#[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::ListDataSources,
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::ListDataSourcesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_45 = &_input.api_id;
let input_45 = input_45.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_45,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}/datasources", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListDataSourcesInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_46) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_46));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListDataSourcesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListDataSources::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListDataSources",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_data_sources_input::Builder {
crate::input::list_data_sources_input::Builder::default()
}
}
pub mod list_domain_names_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListDomainNamesInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListDomainNamesInput {
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
})
}
}
}
impl ListDomainNamesInput {
#[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::ListDomainNames,
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::ListDomainNamesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/v1/domainnames").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListDomainNamesInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_47) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_47));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListDomainNamesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListDomainNames::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListDomainNames",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_domain_names_input::Builder {
crate::input::list_domain_names_input::Builder::default()
}
}
pub mod list_functions_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListFunctionsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListFunctionsInput {
api_id: self.api_id,
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
})
}
}
}
impl ListFunctionsInput {
#[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::ListFunctions,
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::ListFunctionsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_48 = &_input.api_id;
let input_48 = input_48.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_48,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}/functions", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListFunctionsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_49) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_49));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListFunctionsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListFunctions::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListFunctions",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_functions_input::Builder {
crate::input::list_functions_input::Builder::default()
}
}
pub mod list_graphql_apis_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListGraphqlApisInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListGraphqlApisInput {
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
})
}
}
}
impl ListGraphqlApisInput {
#[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::ListGraphqlApis,
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::ListGraphqlApisInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/v1/apis").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListGraphqlApisInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_50) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_50));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListGraphqlApisInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListGraphqlApis::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListGraphqlApis",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_graphql_apis_input::Builder {
crate::input::list_graphql_apis_input::Builder::default()
}
}
pub mod list_resolvers_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) type_name: std::option::Option<std::string::String>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn type_name(mut self, input: impl Into<std::string::String>) -> Self {
self.type_name = Some(input.into());
self
}
pub fn set_type_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.type_name = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListResolversInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListResolversInput {
api_id: self.api_id,
type_name: self.type_name,
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
})
}
}
}
impl ListResolversInput {
#[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::ListResolvers,
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::ListResolversInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_51 = &_input.api_id;
let input_51 = input_51.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_51,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
let input_52 = &_input.type_name;
let input_52 = input_52.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"type_name",
"cannot be empty or unset",
)
})?;
let type_name = aws_smithy_http::label::fmt_string(
input_52,
aws_smithy_http::label::EncodingStrategy::Default,
);
if type_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"type_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/apis/{apiId}/types/{typeName}/resolvers",
apiId = api_id,
typeName = type_name
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListResolversInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_53) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_53));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListResolversInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListResolvers::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListResolvers",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_resolvers_input::Builder {
crate::input::list_resolvers_input::Builder::default()
}
}
pub mod list_resolvers_by_function_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) function_id: std::option::Option<std::string::String>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn function_id(mut self, input: impl Into<std::string::String>) -> Self {
self.function_id = Some(input.into());
self
}
pub fn set_function_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.function_id = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListResolversByFunctionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListResolversByFunctionInput {
api_id: self.api_id,
function_id: self.function_id,
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
})
}
}
}
impl ListResolversByFunctionInput {
#[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::ListResolversByFunction,
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::ListResolversByFunctionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_54 = &_input.api_id;
let input_54 = input_54.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_54,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
let input_55 = &_input.function_id;
let input_55 = input_55.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_id",
"cannot be empty or unset",
)
})?;
let function_id = aws_smithy_http::label::fmt_string(
input_55,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/apis/{apiId}/functions/{functionId}/resolvers",
apiId = api_id,
functionId = function_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListResolversByFunctionInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_56) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_56));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListResolversByFunctionInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListResolversByFunction::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListResolversByFunction",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_resolvers_by_function_input::Builder {
crate::input::list_resolvers_by_function_input::Builder::default()
}
}
pub mod list_tags_for_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListTagsForResourceInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListTagsForResourceInput {
resource_arn: self.resource_arn,
})
}
}
}
impl ListTagsForResourceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListTagsForResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListTagsForResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_57 = &_input.resource_arn;
let input_57 = input_57.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
)
})?;
let resource_arn = aws_smithy_http::label::fmt_string(
input_57,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/tags/{resourceArn}", resourceArn = resource_arn)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListTagsForResourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListTagsForResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListTagsForResource",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_tags_for_resource_input::Builder {
crate::input::list_tags_for_resource_input::Builder::default()
}
}
pub mod list_types_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) format: std::option::Option<crate::model::TypeDefinitionFormat>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn format(mut self, input: crate::model::TypeDefinitionFormat) -> Self {
self.format = Some(input);
self
}
pub fn set_format(
mut self,
input: std::option::Option<crate::model::TypeDefinitionFormat>,
) -> Self {
self.format = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListTypesInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListTypesInput {
api_id: self.api_id,
format: self.format,
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
})
}
}
}
impl ListTypesInput {
#[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::ListTypes,
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::ListTypesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_58 = &_input.api_id;
let input_58 = input_58.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_58,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}/types", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListTypesInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_59 = &_input.format;
let inner_59 = inner_59.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"format",
"cannot be empty or unset",
)
})?;
query.push_kv("format", &aws_smithy_http::query::fmt_string(&inner_59));
if let Some(inner_60) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_60));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListTypesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::ListTypes::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListTypes",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_types_input::Builder {
crate::input::list_types_input::Builder::default()
}
}
pub mod start_schema_creation_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) definition: std::option::Option<aws_smithy_types::Blob>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn definition(mut self, input: aws_smithy_types::Blob) -> Self {
self.definition = Some(input);
self
}
pub fn set_definition(
mut self,
input: std::option::Option<aws_smithy_types::Blob>,
) -> Self {
self.definition = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::StartSchemaCreationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::StartSchemaCreationInput {
api_id: self.api_id,
definition: self.definition,
})
}
}
}
impl StartSchemaCreationInput {
#[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::StartSchemaCreation,
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::StartSchemaCreationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_61 = &_input.api_id;
let input_61 = input_61.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_61,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}/schemacreation", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::StartSchemaCreationInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_start_schema_creation(&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::StartSchemaCreation::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"StartSchemaCreation",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::start_schema_creation_input::Builder {
crate::input::start_schema_creation_input::Builder::default()
}
}
pub mod tag_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_arn: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> Result<crate::input::TagResourceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::TagResourceInput {
resource_arn: self.resource_arn,
tags: self.tags,
})
}
}
}
impl TagResourceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::TagResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::TagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_62 = &_input.resource_arn;
let input_62 = input_62.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
)
})?;
let resource_arn = aws_smithy_http::label::fmt_string(
input_62,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/tags/{resourceArn}", resourceArn = resource_arn)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::TagResourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_tag_resource(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::TagResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"TagResource",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::tag_resource_input::Builder {
crate::input::tag_resource_input::Builder::default()
}
}
pub mod untag_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_arn: std::option::Option<std::string::String>,
pub(crate) tag_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn tag_keys(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.tag_keys.unwrap_or_default();
v.push(input.into());
self.tag_keys = Some(v);
self
}
pub fn set_tag_keys(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.tag_keys = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UntagResourceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UntagResourceInput {
resource_arn: self.resource_arn,
tag_keys: self.tag_keys,
})
}
}
}
impl UntagResourceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UntagResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UntagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_63 = &_input.resource_arn;
let input_63 = input_63.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
)
})?;
let resource_arn = aws_smithy_http::label::fmt_string(
input_63,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/tags/{resourceArn}", resourceArn = resource_arn)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::UntagResourceInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_64 = &_input.tag_keys;
let inner_64 = inner_64.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"tag_keys",
"cannot be empty or unset",
)
})?;
for inner_65 in inner_64 {
query.push_kv("tagKeys", &aws_smithy_http::query::fmt_string(&inner_65));
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UntagResourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UntagResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UntagResource",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::untag_resource_input::Builder {
crate::input::untag_resource_input::Builder::default()
}
}
pub mod update_api_cache_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) ttl: std::option::Option<i64>,
pub(crate) api_caching_behavior: std::option::Option<crate::model::ApiCachingBehavior>,
pub(crate) r#type: std::option::Option<crate::model::ApiCacheType>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn ttl(mut self, input: i64) -> Self {
self.ttl = Some(input);
self
}
pub fn set_ttl(mut self, input: std::option::Option<i64>) -> Self {
self.ttl = input;
self
}
pub fn api_caching_behavior(mut self, input: crate::model::ApiCachingBehavior) -> Self {
self.api_caching_behavior = Some(input);
self
}
pub fn set_api_caching_behavior(
mut self,
input: std::option::Option<crate::model::ApiCachingBehavior>,
) -> Self {
self.api_caching_behavior = input;
self
}
pub fn r#type(mut self, input: crate::model::ApiCacheType) -> Self {
self.r#type = Some(input);
self
}
pub fn set_type(mut self, input: std::option::Option<crate::model::ApiCacheType>) -> Self {
self.r#type = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateApiCacheInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateApiCacheInput {
api_id: self.api_id,
ttl: self.ttl.unwrap_or_default(),
api_caching_behavior: self.api_caching_behavior,
r#type: self.r#type,
})
}
}
}
impl UpdateApiCacheInput {
#[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::UpdateApiCache,
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::UpdateApiCacheInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_66 = &_input.api_id;
let input_66 = input_66.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_66,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}/ApiCaches/update", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateApiCacheInput,
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_api_cache(&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::UpdateApiCache::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateApiCache",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_api_cache_input::Builder {
crate::input::update_api_cache_input::Builder::default()
}
}
pub mod update_api_key_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) expires: std::option::Option<i64>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
self.id = Some(input.into());
self
}
pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.id = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn expires(mut self, input: i64) -> Self {
self.expires = Some(input);
self
}
pub fn set_expires(mut self, input: std::option::Option<i64>) -> Self {
self.expires = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateApiKeyInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateApiKeyInput {
api_id: self.api_id,
id: self.id,
description: self.description,
expires: self.expires.unwrap_or_default(),
})
}
}
}
impl UpdateApiKeyInput {
#[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::UpdateApiKey,
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::UpdateApiKeyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_67 = &_input.api_id;
let input_67 = input_67.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_67,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
let input_68 = &_input.id;
let input_68 = input_68.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"id",
"cannot be empty or unset",
)
})?;
let id = aws_smithy_http::label::fmt_string(
input_68,
aws_smithy_http::label::EncodingStrategy::Default,
);
if id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/apis/{apiId}/apikeys/{id}",
apiId = api_id,
id = id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateApiKeyInput,
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_api_key(&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::UpdateApiKey::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateApiKey",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_api_key_input::Builder {
crate::input::update_api_key_input::Builder::default()
}
}
pub mod update_data_source_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) r#type: std::option::Option<crate::model::DataSourceType>,
pub(crate) service_role_arn: std::option::Option<std::string::String>,
pub(crate) dynamodb_config: std::option::Option<crate::model::DynamodbDataSourceConfig>,
pub(crate) lambda_config: std::option::Option<crate::model::LambdaDataSourceConfig>,
pub(crate) elasticsearch_config:
std::option::Option<crate::model::ElasticsearchDataSourceConfig>,
pub(crate) open_search_service_config:
std::option::Option<crate::model::OpenSearchServiceDataSourceConfig>,
pub(crate) http_config: std::option::Option<crate::model::HttpDataSourceConfig>,
pub(crate) relational_database_config:
std::option::Option<crate::model::RelationalDatabaseDataSourceConfig>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn r#type(mut self, input: crate::model::DataSourceType) -> Self {
self.r#type = Some(input);
self
}
pub fn set_type(
mut self,
input: std::option::Option<crate::model::DataSourceType>,
) -> Self {
self.r#type = input;
self
}
pub fn service_role_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.service_role_arn = Some(input.into());
self
}
pub fn set_service_role_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.service_role_arn = input;
self
}
pub fn dynamodb_config(mut self, input: crate::model::DynamodbDataSourceConfig) -> Self {
self.dynamodb_config = Some(input);
self
}
pub fn set_dynamodb_config(
mut self,
input: std::option::Option<crate::model::DynamodbDataSourceConfig>,
) -> Self {
self.dynamodb_config = input;
self
}
pub fn lambda_config(mut self, input: crate::model::LambdaDataSourceConfig) -> Self {
self.lambda_config = Some(input);
self
}
pub fn set_lambda_config(
mut self,
input: std::option::Option<crate::model::LambdaDataSourceConfig>,
) -> Self {
self.lambda_config = input;
self
}
pub fn elasticsearch_config(
mut self,
input: crate::model::ElasticsearchDataSourceConfig,
) -> Self {
self.elasticsearch_config = Some(input);
self
}
pub fn set_elasticsearch_config(
mut self,
input: std::option::Option<crate::model::ElasticsearchDataSourceConfig>,
) -> Self {
self.elasticsearch_config = input;
self
}
pub fn open_search_service_config(
mut self,
input: crate::model::OpenSearchServiceDataSourceConfig,
) -> Self {
self.open_search_service_config = Some(input);
self
}
pub fn set_open_search_service_config(
mut self,
input: std::option::Option<crate::model::OpenSearchServiceDataSourceConfig>,
) -> Self {
self.open_search_service_config = input;
self
}
pub fn http_config(mut self, input: crate::model::HttpDataSourceConfig) -> Self {
self.http_config = Some(input);
self
}
pub fn set_http_config(
mut self,
input: std::option::Option<crate::model::HttpDataSourceConfig>,
) -> Self {
self.http_config = input;
self
}
pub fn relational_database_config(
mut self,
input: crate::model::RelationalDatabaseDataSourceConfig,
) -> Self {
self.relational_database_config = Some(input);
self
}
pub fn set_relational_database_config(
mut self,
input: std::option::Option<crate::model::RelationalDatabaseDataSourceConfig>,
) -> Self {
self.relational_database_config = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateDataSourceInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateDataSourceInput {
api_id: self.api_id,
name: self.name,
description: self.description,
r#type: self.r#type,
service_role_arn: self.service_role_arn,
dynamodb_config: self.dynamodb_config,
lambda_config: self.lambda_config,
elasticsearch_config: self.elasticsearch_config,
open_search_service_config: self.open_search_service_config,
http_config: self.http_config,
relational_database_config: self.relational_database_config,
})
}
}
}
impl UpdateDataSourceInput {
#[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::UpdateDataSource,
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::UpdateDataSourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_69 = &_input.api_id;
let input_69 = input_69.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_69,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
let input_70 = &_input.name;
let input_70 = input_70.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"name",
"cannot be empty or unset",
)
})?;
let name = aws_smithy_http::label::fmt_string(
input_70,
aws_smithy_http::label::EncodingStrategy::Default,
);
if name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/apis/{apiId}/datasources/{name}",
apiId = api_id,
name = name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateDataSourceInput,
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_data_source(&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::UpdateDataSource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateDataSource",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_data_source_input::Builder {
crate::input::update_data_source_input::Builder::default()
}
}
pub mod update_domain_name_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) domain_name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
}
impl Builder {
pub fn domain_name(mut self, input: impl Into<std::string::String>) -> Self {
self.domain_name = Some(input.into());
self
}
pub fn set_domain_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.domain_name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateDomainNameInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateDomainNameInput {
domain_name: self.domain_name,
description: self.description,
})
}
}
}
impl UpdateDomainNameInput {
#[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::UpdateDomainName,
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::UpdateDomainNameInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_71 = &_input.domain_name;
let input_71 = input_71.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
)
})?;
let domain_name = aws_smithy_http::label::fmt_string(
input_71,
aws_smithy_http::label::EncodingStrategy::Default,
);
if domain_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"domain_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/domainnames/{domainName}",
domainName = domain_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateDomainNameInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_domain_name(&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::UpdateDomainName::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateDomainName",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_domain_name_input::Builder {
crate::input::update_domain_name_input::Builder::default()
}
}
pub mod update_function_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) function_id: std::option::Option<std::string::String>,
pub(crate) data_source_name: std::option::Option<std::string::String>,
pub(crate) request_mapping_template: std::option::Option<std::string::String>,
pub(crate) response_mapping_template: std::option::Option<std::string::String>,
pub(crate) function_version: std::option::Option<std::string::String>,
pub(crate) sync_config: std::option::Option<crate::model::SyncConfig>,
pub(crate) max_batch_size: std::option::Option<i32>,
pub(crate) runtime: std::option::Option<crate::model::AppSyncRuntime>,
pub(crate) code: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn function_id(mut self, input: impl Into<std::string::String>) -> Self {
self.function_id = Some(input.into());
self
}
pub fn set_function_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.function_id = input;
self
}
pub fn data_source_name(mut self, input: impl Into<std::string::String>) -> Self {
self.data_source_name = Some(input.into());
self
}
pub fn set_data_source_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.data_source_name = input;
self
}
pub fn request_mapping_template(mut self, input: impl Into<std::string::String>) -> Self {
self.request_mapping_template = Some(input.into());
self
}
pub fn set_request_mapping_template(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.request_mapping_template = input;
self
}
pub fn response_mapping_template(mut self, input: impl Into<std::string::String>) -> Self {
self.response_mapping_template = Some(input.into());
self
}
pub fn set_response_mapping_template(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.response_mapping_template = input;
self
}
pub fn function_version(mut self, input: impl Into<std::string::String>) -> Self {
self.function_version = Some(input.into());
self
}
pub fn set_function_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.function_version = input;
self
}
pub fn sync_config(mut self, input: crate::model::SyncConfig) -> Self {
self.sync_config = Some(input);
self
}
pub fn set_sync_config(
mut self,
input: std::option::Option<crate::model::SyncConfig>,
) -> Self {
self.sync_config = input;
self
}
pub fn max_batch_size(mut self, input: i32) -> Self {
self.max_batch_size = Some(input);
self
}
pub fn set_max_batch_size(mut self, input: std::option::Option<i32>) -> Self {
self.max_batch_size = input;
self
}
pub fn runtime(mut self, input: crate::model::AppSyncRuntime) -> Self {
self.runtime = Some(input);
self
}
pub fn set_runtime(
mut self,
input: std::option::Option<crate::model::AppSyncRuntime>,
) -> Self {
self.runtime = input;
self
}
pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
self.code = Some(input.into());
self
}
pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.code = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateFunctionInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateFunctionInput {
api_id: self.api_id,
name: self.name,
description: self.description,
function_id: self.function_id,
data_source_name: self.data_source_name,
request_mapping_template: self.request_mapping_template,
response_mapping_template: self.response_mapping_template,
function_version: self.function_version,
sync_config: self.sync_config,
max_batch_size: self.max_batch_size.unwrap_or_default(),
runtime: self.runtime,
code: self.code,
})
}
}
}
impl UpdateFunctionInput {
#[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::UpdateFunction,
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::UpdateFunctionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_72 = &_input.api_id;
let input_72 = input_72.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_72,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
let input_73 = &_input.function_id;
let input_73 = input_73.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"function_id",
"cannot be empty or unset",
)
})?;
let function_id = aws_smithy_http::label::fmt_string(
input_73,
aws_smithy_http::label::EncodingStrategy::Default,
);
if function_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"function_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/apis/{apiId}/functions/{functionId}",
apiId = api_id,
functionId = function_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateFunctionInput,
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_function(&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::UpdateFunction::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateFunction",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_function_input::Builder {
crate::input::update_function_input::Builder::default()
}
}
pub mod update_graphql_api_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) log_config: std::option::Option<crate::model::LogConfig>,
pub(crate) authentication_type: std::option::Option<crate::model::AuthenticationType>,
pub(crate) user_pool_config: std::option::Option<crate::model::UserPoolConfig>,
pub(crate) open_id_connect_config: std::option::Option<crate::model::OpenIdConnectConfig>,
pub(crate) additional_authentication_providers:
std::option::Option<std::vec::Vec<crate::model::AdditionalAuthenticationProvider>>,
pub(crate) xray_enabled: std::option::Option<bool>,
pub(crate) lambda_authorizer_config:
std::option::Option<crate::model::LambdaAuthorizerConfig>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn log_config(mut self, input: crate::model::LogConfig) -> Self {
self.log_config = Some(input);
self
}
pub fn set_log_config(
mut self,
input: std::option::Option<crate::model::LogConfig>,
) -> Self {
self.log_config = input;
self
}
pub fn authentication_type(mut self, input: crate::model::AuthenticationType) -> Self {
self.authentication_type = Some(input);
self
}
pub fn set_authentication_type(
mut self,
input: std::option::Option<crate::model::AuthenticationType>,
) -> Self {
self.authentication_type = input;
self
}
pub fn user_pool_config(mut self, input: crate::model::UserPoolConfig) -> Self {
self.user_pool_config = Some(input);
self
}
pub fn set_user_pool_config(
mut self,
input: std::option::Option<crate::model::UserPoolConfig>,
) -> Self {
self.user_pool_config = input;
self
}
pub fn open_id_connect_config(mut self, input: crate::model::OpenIdConnectConfig) -> Self {
self.open_id_connect_config = Some(input);
self
}
pub fn set_open_id_connect_config(
mut self,
input: std::option::Option<crate::model::OpenIdConnectConfig>,
) -> Self {
self.open_id_connect_config = input;
self
}
pub fn additional_authentication_providers(
mut self,
input: crate::model::AdditionalAuthenticationProvider,
) -> Self {
let mut v = self.additional_authentication_providers.unwrap_or_default();
v.push(input);
self.additional_authentication_providers = Some(v);
self
}
pub fn set_additional_authentication_providers(
mut self,
input: std::option::Option<
std::vec::Vec<crate::model::AdditionalAuthenticationProvider>,
>,
) -> Self {
self.additional_authentication_providers = input;
self
}
pub fn xray_enabled(mut self, input: bool) -> Self {
self.xray_enabled = Some(input);
self
}
pub fn set_xray_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.xray_enabled = input;
self
}
pub fn lambda_authorizer_config(
mut self,
input: crate::model::LambdaAuthorizerConfig,
) -> Self {
self.lambda_authorizer_config = Some(input);
self
}
pub fn set_lambda_authorizer_config(
mut self,
input: std::option::Option<crate::model::LambdaAuthorizerConfig>,
) -> Self {
self.lambda_authorizer_config = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateGraphqlApiInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateGraphqlApiInput {
api_id: self.api_id,
name: self.name,
log_config: self.log_config,
authentication_type: self.authentication_type,
user_pool_config: self.user_pool_config,
open_id_connect_config: self.open_id_connect_config,
additional_authentication_providers: self.additional_authentication_providers,
xray_enabled: self.xray_enabled.unwrap_or_default(),
lambda_authorizer_config: self.lambda_authorizer_config,
})
}
}
}
impl UpdateGraphqlApiInput {
#[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::UpdateGraphqlApi,
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::UpdateGraphqlApiInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_74 = &_input.api_id;
let input_74 = input_74.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_74,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/apis/{apiId}", apiId = api_id)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateGraphqlApiInput,
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_graphql_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::UpdateGraphqlApi::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateGraphqlApi",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_graphql_api_input::Builder {
crate::input::update_graphql_api_input::Builder::default()
}
}
pub mod update_resolver_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) type_name: std::option::Option<std::string::String>,
pub(crate) field_name: std::option::Option<std::string::String>,
pub(crate) data_source_name: std::option::Option<std::string::String>,
pub(crate) request_mapping_template: std::option::Option<std::string::String>,
pub(crate) response_mapping_template: std::option::Option<std::string::String>,
pub(crate) kind: std::option::Option<crate::model::ResolverKind>,
pub(crate) pipeline_config: std::option::Option<crate::model::PipelineConfig>,
pub(crate) sync_config: std::option::Option<crate::model::SyncConfig>,
pub(crate) caching_config: std::option::Option<crate::model::CachingConfig>,
pub(crate) max_batch_size: std::option::Option<i32>,
pub(crate) runtime: std::option::Option<crate::model::AppSyncRuntime>,
pub(crate) code: std::option::Option<std::string::String>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn type_name(mut self, input: impl Into<std::string::String>) -> Self {
self.type_name = Some(input.into());
self
}
pub fn set_type_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.type_name = input;
self
}
pub fn field_name(mut self, input: impl Into<std::string::String>) -> Self {
self.field_name = Some(input.into());
self
}
pub fn set_field_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.field_name = input;
self
}
pub fn data_source_name(mut self, input: impl Into<std::string::String>) -> Self {
self.data_source_name = Some(input.into());
self
}
pub fn set_data_source_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.data_source_name = input;
self
}
pub fn request_mapping_template(mut self, input: impl Into<std::string::String>) -> Self {
self.request_mapping_template = Some(input.into());
self
}
pub fn set_request_mapping_template(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.request_mapping_template = input;
self
}
pub fn response_mapping_template(mut self, input: impl Into<std::string::String>) -> Self {
self.response_mapping_template = Some(input.into());
self
}
pub fn set_response_mapping_template(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.response_mapping_template = input;
self
}
pub fn kind(mut self, input: crate::model::ResolverKind) -> Self {
self.kind = Some(input);
self
}
pub fn set_kind(mut self, input: std::option::Option<crate::model::ResolverKind>) -> Self {
self.kind = input;
self
}
pub fn pipeline_config(mut self, input: crate::model::PipelineConfig) -> Self {
self.pipeline_config = Some(input);
self
}
pub fn set_pipeline_config(
mut self,
input: std::option::Option<crate::model::PipelineConfig>,
) -> Self {
self.pipeline_config = input;
self
}
pub fn sync_config(mut self, input: crate::model::SyncConfig) -> Self {
self.sync_config = Some(input);
self
}
pub fn set_sync_config(
mut self,
input: std::option::Option<crate::model::SyncConfig>,
) -> Self {
self.sync_config = input;
self
}
pub fn caching_config(mut self, input: crate::model::CachingConfig) -> Self {
self.caching_config = Some(input);
self
}
pub fn set_caching_config(
mut self,
input: std::option::Option<crate::model::CachingConfig>,
) -> Self {
self.caching_config = input;
self
}
pub fn max_batch_size(mut self, input: i32) -> Self {
self.max_batch_size = Some(input);
self
}
pub fn set_max_batch_size(mut self, input: std::option::Option<i32>) -> Self {
self.max_batch_size = input;
self
}
pub fn runtime(mut self, input: crate::model::AppSyncRuntime) -> Self {
self.runtime = Some(input);
self
}
pub fn set_runtime(
mut self,
input: std::option::Option<crate::model::AppSyncRuntime>,
) -> Self {
self.runtime = input;
self
}
pub fn code(mut self, input: impl Into<std::string::String>) -> Self {
self.code = Some(input.into());
self
}
pub fn set_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.code = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateResolverInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateResolverInput {
api_id: self.api_id,
type_name: self.type_name,
field_name: self.field_name,
data_source_name: self.data_source_name,
request_mapping_template: self.request_mapping_template,
response_mapping_template: self.response_mapping_template,
kind: self.kind,
pipeline_config: self.pipeline_config,
sync_config: self.sync_config,
caching_config: self.caching_config,
max_batch_size: self.max_batch_size.unwrap_or_default(),
runtime: self.runtime,
code: self.code,
})
}
}
}
impl UpdateResolverInput {
#[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::UpdateResolver,
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::UpdateResolverInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_75 = &_input.api_id;
let input_75 = input_75.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_75,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
let input_76 = &_input.type_name;
let input_76 = input_76.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"type_name",
"cannot be empty or unset",
)
})?;
let type_name = aws_smithy_http::label::fmt_string(
input_76,
aws_smithy_http::label::EncodingStrategy::Default,
);
if type_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"type_name",
"cannot be empty or unset",
),
);
}
let input_77 = &_input.field_name;
let input_77 = input_77.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"field_name",
"cannot be empty or unset",
)
})?;
let field_name = aws_smithy_http::label::fmt_string(
input_77,
aws_smithy_http::label::EncodingStrategy::Default,
);
if field_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"field_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/apis/{apiId}/types/{typeName}/resolvers/{fieldName}",
apiId = api_id,
typeName = type_name,
fieldName = field_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateResolverInput,
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_resolver(&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::UpdateResolver::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateResolver",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_resolver_input::Builder {
crate::input::update_resolver_input::Builder::default()
}
}
pub mod update_type_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) api_id: std::option::Option<std::string::String>,
pub(crate) type_name: std::option::Option<std::string::String>,
pub(crate) definition: std::option::Option<std::string::String>,
pub(crate) format: std::option::Option<crate::model::TypeDefinitionFormat>,
}
impl Builder {
pub fn api_id(mut self, input: impl Into<std::string::String>) -> Self {
self.api_id = Some(input.into());
self
}
pub fn set_api_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.api_id = input;
self
}
pub fn type_name(mut self, input: impl Into<std::string::String>) -> Self {
self.type_name = Some(input.into());
self
}
pub fn set_type_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.type_name = input;
self
}
pub fn definition(mut self, input: impl Into<std::string::String>) -> Self {
self.definition = Some(input.into());
self
}
pub fn set_definition(mut self, input: std::option::Option<std::string::String>) -> Self {
self.definition = input;
self
}
pub fn format(mut self, input: crate::model::TypeDefinitionFormat) -> Self {
self.format = Some(input);
self
}
pub fn set_format(
mut self,
input: std::option::Option<crate::model::TypeDefinitionFormat>,
) -> Self {
self.format = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateTypeInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateTypeInput {
api_id: self.api_id,
type_name: self.type_name,
definition: self.definition,
format: self.format,
})
}
}
}
impl UpdateTypeInput {
#[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::UpdateType,
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::UpdateTypeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_78 = &_input.api_id;
let input_78 = input_78.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
)
})?;
let api_id = aws_smithy_http::label::fmt_string(
input_78,
aws_smithy_http::label::EncodingStrategy::Default,
);
if api_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"api_id",
"cannot be empty or unset",
),
);
}
let input_79 = &_input.type_name;
let input_79 = input_79.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"type_name",
"cannot be empty or unset",
)
})?;
let type_name = aws_smithy_http::label::fmt_string(
input_79,
aws_smithy_http::label::EncodingStrategy::Default,
);
if type_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"type_name",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/apis/{apiId}/types/{typeName}",
apiId = api_id,
typeName = type_name
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateTypeInput,
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_type(&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::UpdateType::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateType",
"appsync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_type_input::Builder {
crate::input::update_type_input::Builder::default()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateTypeInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub type_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub definition: std::option::Option<std::string::String>,
#[doc(hidden)]
pub format: std::option::Option<crate::model::TypeDefinitionFormat>,
}
impl UpdateTypeInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn type_name(&self) -> std::option::Option<&str> {
self.type_name.as_deref()
}
pub fn definition(&self) -> std::option::Option<&str> {
self.definition.as_deref()
}
pub fn format(&self) -> std::option::Option<&crate::model::TypeDefinitionFormat> {
self.format.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateResolverInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub type_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub field_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub data_source_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub request_mapping_template: std::option::Option<std::string::String>,
#[doc(hidden)]
pub response_mapping_template: std::option::Option<std::string::String>,
#[doc(hidden)]
pub kind: std::option::Option<crate::model::ResolverKind>,
#[doc(hidden)]
pub pipeline_config: std::option::Option<crate::model::PipelineConfig>,
#[doc(hidden)]
pub sync_config: std::option::Option<crate::model::SyncConfig>,
#[doc(hidden)]
pub caching_config: std::option::Option<crate::model::CachingConfig>,
#[doc(hidden)]
pub max_batch_size: i32,
#[doc(hidden)]
pub runtime: std::option::Option<crate::model::AppSyncRuntime>,
#[doc(hidden)]
pub code: std::option::Option<std::string::String>,
}
impl UpdateResolverInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn type_name(&self) -> std::option::Option<&str> {
self.type_name.as_deref()
}
pub fn field_name(&self) -> std::option::Option<&str> {
self.field_name.as_deref()
}
pub fn data_source_name(&self) -> std::option::Option<&str> {
self.data_source_name.as_deref()
}
pub fn request_mapping_template(&self) -> std::option::Option<&str> {
self.request_mapping_template.as_deref()
}
pub fn response_mapping_template(&self) -> std::option::Option<&str> {
self.response_mapping_template.as_deref()
}
pub fn kind(&self) -> std::option::Option<&crate::model::ResolverKind> {
self.kind.as_ref()
}
pub fn pipeline_config(&self) -> std::option::Option<&crate::model::PipelineConfig> {
self.pipeline_config.as_ref()
}
pub fn sync_config(&self) -> std::option::Option<&crate::model::SyncConfig> {
self.sync_config.as_ref()
}
pub fn caching_config(&self) -> std::option::Option<&crate::model::CachingConfig> {
self.caching_config.as_ref()
}
pub fn max_batch_size(&self) -> i32 {
self.max_batch_size
}
pub fn runtime(&self) -> std::option::Option<&crate::model::AppSyncRuntime> {
self.runtime.as_ref()
}
pub fn code(&self) -> std::option::Option<&str> {
self.code.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateGraphqlApiInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub log_config: std::option::Option<crate::model::LogConfig>,
#[doc(hidden)]
pub authentication_type: std::option::Option<crate::model::AuthenticationType>,
#[doc(hidden)]
pub user_pool_config: std::option::Option<crate::model::UserPoolConfig>,
#[doc(hidden)]
pub open_id_connect_config: std::option::Option<crate::model::OpenIdConnectConfig>,
#[doc(hidden)]
pub additional_authentication_providers:
std::option::Option<std::vec::Vec<crate::model::AdditionalAuthenticationProvider>>,
#[doc(hidden)]
pub xray_enabled: bool,
#[doc(hidden)]
pub lambda_authorizer_config: std::option::Option<crate::model::LambdaAuthorizerConfig>,
}
impl UpdateGraphqlApiInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn log_config(&self) -> std::option::Option<&crate::model::LogConfig> {
self.log_config.as_ref()
}
pub fn authentication_type(&self) -> std::option::Option<&crate::model::AuthenticationType> {
self.authentication_type.as_ref()
}
pub fn user_pool_config(&self) -> std::option::Option<&crate::model::UserPoolConfig> {
self.user_pool_config.as_ref()
}
pub fn open_id_connect_config(
&self,
) -> std::option::Option<&crate::model::OpenIdConnectConfig> {
self.open_id_connect_config.as_ref()
}
pub fn additional_authentication_providers(
&self,
) -> std::option::Option<&[crate::model::AdditionalAuthenticationProvider]> {
self.additional_authentication_providers.as_deref()
}
pub fn xray_enabled(&self) -> bool {
self.xray_enabled
}
pub fn lambda_authorizer_config(
&self,
) -> std::option::Option<&crate::model::LambdaAuthorizerConfig> {
self.lambda_authorizer_config.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateFunctionInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub function_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub data_source_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub request_mapping_template: std::option::Option<std::string::String>,
#[doc(hidden)]
pub response_mapping_template: std::option::Option<std::string::String>,
#[doc(hidden)]
pub function_version: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sync_config: std::option::Option<crate::model::SyncConfig>,
#[doc(hidden)]
pub max_batch_size: i32,
#[doc(hidden)]
pub runtime: std::option::Option<crate::model::AppSyncRuntime>,
#[doc(hidden)]
pub code: std::option::Option<std::string::String>,
}
impl UpdateFunctionInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn function_id(&self) -> std::option::Option<&str> {
self.function_id.as_deref()
}
pub fn data_source_name(&self) -> std::option::Option<&str> {
self.data_source_name.as_deref()
}
pub fn request_mapping_template(&self) -> std::option::Option<&str> {
self.request_mapping_template.as_deref()
}
pub fn response_mapping_template(&self) -> std::option::Option<&str> {
self.response_mapping_template.as_deref()
}
pub fn function_version(&self) -> std::option::Option<&str> {
self.function_version.as_deref()
}
pub fn sync_config(&self) -> std::option::Option<&crate::model::SyncConfig> {
self.sync_config.as_ref()
}
pub fn max_batch_size(&self) -> i32 {
self.max_batch_size
}
pub fn runtime(&self) -> std::option::Option<&crate::model::AppSyncRuntime> {
self.runtime.as_ref()
}
pub fn code(&self) -> std::option::Option<&str> {
self.code.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateDomainNameInput {
#[doc(hidden)]
pub domain_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
}
impl UpdateDomainNameInput {
pub fn domain_name(&self) -> std::option::Option<&str> {
self.domain_name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateDataSourceInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub r#type: std::option::Option<crate::model::DataSourceType>,
#[doc(hidden)]
pub service_role_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub dynamodb_config: std::option::Option<crate::model::DynamodbDataSourceConfig>,
#[doc(hidden)]
pub lambda_config: std::option::Option<crate::model::LambdaDataSourceConfig>,
#[doc(hidden)]
pub elasticsearch_config: std::option::Option<crate::model::ElasticsearchDataSourceConfig>,
#[doc(hidden)]
pub open_search_service_config:
std::option::Option<crate::model::OpenSearchServiceDataSourceConfig>,
#[doc(hidden)]
pub http_config: std::option::Option<crate::model::HttpDataSourceConfig>,
#[doc(hidden)]
pub relational_database_config:
std::option::Option<crate::model::RelationalDatabaseDataSourceConfig>,
}
impl UpdateDataSourceInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn r#type(&self) -> std::option::Option<&crate::model::DataSourceType> {
self.r#type.as_ref()
}
pub fn service_role_arn(&self) -> std::option::Option<&str> {
self.service_role_arn.as_deref()
}
pub fn dynamodb_config(&self) -> std::option::Option<&crate::model::DynamodbDataSourceConfig> {
self.dynamodb_config.as_ref()
}
pub fn lambda_config(&self) -> std::option::Option<&crate::model::LambdaDataSourceConfig> {
self.lambda_config.as_ref()
}
pub fn elasticsearch_config(
&self,
) -> std::option::Option<&crate::model::ElasticsearchDataSourceConfig> {
self.elasticsearch_config.as_ref()
}
pub fn open_search_service_config(
&self,
) -> std::option::Option<&crate::model::OpenSearchServiceDataSourceConfig> {
self.open_search_service_config.as_ref()
}
pub fn http_config(&self) -> std::option::Option<&crate::model::HttpDataSourceConfig> {
self.http_config.as_ref()
}
pub fn relational_database_config(
&self,
) -> std::option::Option<&crate::model::RelationalDatabaseDataSourceConfig> {
self.relational_database_config.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateApiKeyInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub expires: i64,
}
impl UpdateApiKeyInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn id(&self) -> std::option::Option<&str> {
self.id.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn expires(&self) -> i64 {
self.expires
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateApiCacheInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub ttl: i64,
#[doc(hidden)]
pub api_caching_behavior: std::option::Option<crate::model::ApiCachingBehavior>,
#[doc(hidden)]
pub r#type: std::option::Option<crate::model::ApiCacheType>,
}
impl UpdateApiCacheInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn ttl(&self) -> i64 {
self.ttl
}
pub fn api_caching_behavior(&self) -> std::option::Option<&crate::model::ApiCachingBehavior> {
self.api_caching_behavior.as_ref()
}
pub fn r#type(&self) -> std::option::Option<&crate::model::ApiCacheType> {
self.r#type.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UntagResourceInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tag_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl UntagResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn tag_keys(&self) -> std::option::Option<&[std::string::String]> {
self.tag_keys.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct TagResourceInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl TagResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct StartSchemaCreationInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub definition: std::option::Option<aws_smithy_types::Blob>,
}
impl StartSchemaCreationInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn definition(&self) -> std::option::Option<&aws_smithy_types::Blob> {
self.definition.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListTypesInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub format: std::option::Option<crate::model::TypeDefinitionFormat>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
}
impl ListTypesInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn format(&self) -> std::option::Option<&crate::model::TypeDefinitionFormat> {
self.format.as_ref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListTagsForResourceInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
}
impl ListTagsForResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListResolversByFunctionInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub function_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
}
impl ListResolversByFunctionInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn function_id(&self) -> std::option::Option<&str> {
self.function_id.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListResolversInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub type_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
}
impl ListResolversInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn type_name(&self) -> std::option::Option<&str> {
self.type_name.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListGraphqlApisInput {
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
}
impl ListGraphqlApisInput {
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListFunctionsInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
}
impl ListFunctionsInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListDomainNamesInput {
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
}
impl ListDomainNamesInput {
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListDataSourcesInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
}
impl ListDataSourcesInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListApiKeysInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
}
impl ListApiKeysInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetTypeInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub type_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub format: std::option::Option<crate::model::TypeDefinitionFormat>,
}
impl GetTypeInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn type_name(&self) -> std::option::Option<&str> {
self.type_name.as_deref()
}
pub fn format(&self) -> std::option::Option<&crate::model::TypeDefinitionFormat> {
self.format.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetSchemaCreationStatusInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
}
impl GetSchemaCreationStatusInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetResolverInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub type_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub field_name: std::option::Option<std::string::String>,
}
impl GetResolverInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn type_name(&self) -> std::option::Option<&str> {
self.type_name.as_deref()
}
pub fn field_name(&self) -> std::option::Option<&str> {
self.field_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetIntrospectionSchemaInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub format: std::option::Option<crate::model::OutputType>,
#[doc(hidden)]
pub include_directives: std::option::Option<bool>,
}
impl GetIntrospectionSchemaInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn format(&self) -> std::option::Option<&crate::model::OutputType> {
self.format.as_ref()
}
pub fn include_directives(&self) -> std::option::Option<bool> {
self.include_directives
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetGraphqlApiInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
}
impl GetGraphqlApiInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetFunctionInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub function_id: std::option::Option<std::string::String>,
}
impl GetFunctionInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn function_id(&self) -> std::option::Option<&str> {
self.function_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetDomainNameInput {
#[doc(hidden)]
pub domain_name: std::option::Option<std::string::String>,
}
impl GetDomainNameInput {
pub fn domain_name(&self) -> std::option::Option<&str> {
self.domain_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetDataSourceInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
}
impl GetDataSourceInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetApiCacheInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
}
impl GetApiCacheInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetApiAssociationInput {
#[doc(hidden)]
pub domain_name: std::option::Option<std::string::String>,
}
impl GetApiAssociationInput {
pub fn domain_name(&self) -> std::option::Option<&str> {
self.domain_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct FlushApiCacheInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
}
impl FlushApiCacheInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct EvaluateMappingTemplateInput {
#[doc(hidden)]
pub template: std::option::Option<std::string::String>,
#[doc(hidden)]
pub context: std::option::Option<std::string::String>,
}
impl EvaluateMappingTemplateInput {
pub fn template(&self) -> std::option::Option<&str> {
self.template.as_deref()
}
pub fn context(&self) -> std::option::Option<&str> {
self.context.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct EvaluateCodeInput {
#[doc(hidden)]
pub runtime: std::option::Option<crate::model::AppSyncRuntime>,
#[doc(hidden)]
pub code: std::option::Option<std::string::String>,
#[doc(hidden)]
pub context: std::option::Option<std::string::String>,
#[doc(hidden)]
pub function: std::option::Option<std::string::String>,
}
impl EvaluateCodeInput {
pub fn runtime(&self) -> std::option::Option<&crate::model::AppSyncRuntime> {
self.runtime.as_ref()
}
pub fn code(&self) -> std::option::Option<&str> {
self.code.as_deref()
}
pub fn context(&self) -> std::option::Option<&str> {
self.context.as_deref()
}
pub fn function(&self) -> std::option::Option<&str> {
self.function.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DisassociateApiInput {
#[doc(hidden)]
pub domain_name: std::option::Option<std::string::String>,
}
impl DisassociateApiInput {
pub fn domain_name(&self) -> std::option::Option<&str> {
self.domain_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteTypeInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub type_name: std::option::Option<std::string::String>,
}
impl DeleteTypeInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn type_name(&self) -> std::option::Option<&str> {
self.type_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteResolverInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub type_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub field_name: std::option::Option<std::string::String>,
}
impl DeleteResolverInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn type_name(&self) -> std::option::Option<&str> {
self.type_name.as_deref()
}
pub fn field_name(&self) -> std::option::Option<&str> {
self.field_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteGraphqlApiInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
}
impl DeleteGraphqlApiInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteFunctionInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub function_id: std::option::Option<std::string::String>,
}
impl DeleteFunctionInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn function_id(&self) -> std::option::Option<&str> {
self.function_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteDomainNameInput {
#[doc(hidden)]
pub domain_name: std::option::Option<std::string::String>,
}
impl DeleteDomainNameInput {
pub fn domain_name(&self) -> std::option::Option<&str> {
self.domain_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteDataSourceInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
}
impl DeleteDataSourceInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteApiKeyInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub id: std::option::Option<std::string::String>,
}
impl DeleteApiKeyInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn id(&self) -> std::option::Option<&str> {
self.id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteApiCacheInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
}
impl DeleteApiCacheInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateTypeInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub definition: std::option::Option<std::string::String>,
#[doc(hidden)]
pub format: std::option::Option<crate::model::TypeDefinitionFormat>,
}
impl CreateTypeInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn definition(&self) -> std::option::Option<&str> {
self.definition.as_deref()
}
pub fn format(&self) -> std::option::Option<&crate::model::TypeDefinitionFormat> {
self.format.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateResolverInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub type_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub field_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub data_source_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub request_mapping_template: std::option::Option<std::string::String>,
#[doc(hidden)]
pub response_mapping_template: std::option::Option<std::string::String>,
#[doc(hidden)]
pub kind: std::option::Option<crate::model::ResolverKind>,
#[doc(hidden)]
pub pipeline_config: std::option::Option<crate::model::PipelineConfig>,
#[doc(hidden)]
pub sync_config: std::option::Option<crate::model::SyncConfig>,
#[doc(hidden)]
pub caching_config: std::option::Option<crate::model::CachingConfig>,
#[doc(hidden)]
pub max_batch_size: i32,
#[doc(hidden)]
pub runtime: std::option::Option<crate::model::AppSyncRuntime>,
#[doc(hidden)]
pub code: std::option::Option<std::string::String>,
}
impl CreateResolverInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn type_name(&self) -> std::option::Option<&str> {
self.type_name.as_deref()
}
pub fn field_name(&self) -> std::option::Option<&str> {
self.field_name.as_deref()
}
pub fn data_source_name(&self) -> std::option::Option<&str> {
self.data_source_name.as_deref()
}
pub fn request_mapping_template(&self) -> std::option::Option<&str> {
self.request_mapping_template.as_deref()
}
pub fn response_mapping_template(&self) -> std::option::Option<&str> {
self.response_mapping_template.as_deref()
}
pub fn kind(&self) -> std::option::Option<&crate::model::ResolverKind> {
self.kind.as_ref()
}
pub fn pipeline_config(&self) -> std::option::Option<&crate::model::PipelineConfig> {
self.pipeline_config.as_ref()
}
pub fn sync_config(&self) -> std::option::Option<&crate::model::SyncConfig> {
self.sync_config.as_ref()
}
pub fn caching_config(&self) -> std::option::Option<&crate::model::CachingConfig> {
self.caching_config.as_ref()
}
pub fn max_batch_size(&self) -> i32 {
self.max_batch_size
}
pub fn runtime(&self) -> std::option::Option<&crate::model::AppSyncRuntime> {
self.runtime.as_ref()
}
pub fn code(&self) -> std::option::Option<&str> {
self.code.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateGraphqlApiInput {
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub log_config: std::option::Option<crate::model::LogConfig>,
#[doc(hidden)]
pub authentication_type: std::option::Option<crate::model::AuthenticationType>,
#[doc(hidden)]
pub user_pool_config: std::option::Option<crate::model::UserPoolConfig>,
#[doc(hidden)]
pub open_id_connect_config: std::option::Option<crate::model::OpenIdConnectConfig>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub additional_authentication_providers:
std::option::Option<std::vec::Vec<crate::model::AdditionalAuthenticationProvider>>,
#[doc(hidden)]
pub xray_enabled: bool,
#[doc(hidden)]
pub lambda_authorizer_config: std::option::Option<crate::model::LambdaAuthorizerConfig>,
}
impl CreateGraphqlApiInput {
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn log_config(&self) -> std::option::Option<&crate::model::LogConfig> {
self.log_config.as_ref()
}
pub fn authentication_type(&self) -> std::option::Option<&crate::model::AuthenticationType> {
self.authentication_type.as_ref()
}
pub fn user_pool_config(&self) -> std::option::Option<&crate::model::UserPoolConfig> {
self.user_pool_config.as_ref()
}
pub fn open_id_connect_config(
&self,
) -> std::option::Option<&crate::model::OpenIdConnectConfig> {
self.open_id_connect_config.as_ref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
pub fn additional_authentication_providers(
&self,
) -> std::option::Option<&[crate::model::AdditionalAuthenticationProvider]> {
self.additional_authentication_providers.as_deref()
}
pub fn xray_enabled(&self) -> bool {
self.xray_enabled
}
pub fn lambda_authorizer_config(
&self,
) -> std::option::Option<&crate::model::LambdaAuthorizerConfig> {
self.lambda_authorizer_config.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateFunctionInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub data_source_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub request_mapping_template: std::option::Option<std::string::String>,
#[doc(hidden)]
pub response_mapping_template: std::option::Option<std::string::String>,
#[doc(hidden)]
pub function_version: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sync_config: std::option::Option<crate::model::SyncConfig>,
#[doc(hidden)]
pub max_batch_size: i32,
#[doc(hidden)]
pub runtime: std::option::Option<crate::model::AppSyncRuntime>,
#[doc(hidden)]
pub code: std::option::Option<std::string::String>,
}
impl CreateFunctionInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn data_source_name(&self) -> std::option::Option<&str> {
self.data_source_name.as_deref()
}
pub fn request_mapping_template(&self) -> std::option::Option<&str> {
self.request_mapping_template.as_deref()
}
pub fn response_mapping_template(&self) -> std::option::Option<&str> {
self.response_mapping_template.as_deref()
}
pub fn function_version(&self) -> std::option::Option<&str> {
self.function_version.as_deref()
}
pub fn sync_config(&self) -> std::option::Option<&crate::model::SyncConfig> {
self.sync_config.as_ref()
}
pub fn max_batch_size(&self) -> i32 {
self.max_batch_size
}
pub fn runtime(&self) -> std::option::Option<&crate::model::AppSyncRuntime> {
self.runtime.as_ref()
}
pub fn code(&self) -> std::option::Option<&str> {
self.code.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateDomainNameInput {
#[doc(hidden)]
pub domain_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub certificate_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
}
impl CreateDomainNameInput {
pub fn domain_name(&self) -> std::option::Option<&str> {
self.domain_name.as_deref()
}
pub fn certificate_arn(&self) -> std::option::Option<&str> {
self.certificate_arn.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateDataSourceInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub r#type: std::option::Option<crate::model::DataSourceType>,
#[doc(hidden)]
pub service_role_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub dynamodb_config: std::option::Option<crate::model::DynamodbDataSourceConfig>,
#[doc(hidden)]
pub lambda_config: std::option::Option<crate::model::LambdaDataSourceConfig>,
#[doc(hidden)]
pub elasticsearch_config: std::option::Option<crate::model::ElasticsearchDataSourceConfig>,
#[doc(hidden)]
pub open_search_service_config:
std::option::Option<crate::model::OpenSearchServiceDataSourceConfig>,
#[doc(hidden)]
pub http_config: std::option::Option<crate::model::HttpDataSourceConfig>,
#[doc(hidden)]
pub relational_database_config:
std::option::Option<crate::model::RelationalDatabaseDataSourceConfig>,
}
impl CreateDataSourceInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn r#type(&self) -> std::option::Option<&crate::model::DataSourceType> {
self.r#type.as_ref()
}
pub fn service_role_arn(&self) -> std::option::Option<&str> {
self.service_role_arn.as_deref()
}
pub fn dynamodb_config(&self) -> std::option::Option<&crate::model::DynamodbDataSourceConfig> {
self.dynamodb_config.as_ref()
}
pub fn lambda_config(&self) -> std::option::Option<&crate::model::LambdaDataSourceConfig> {
self.lambda_config.as_ref()
}
pub fn elasticsearch_config(
&self,
) -> std::option::Option<&crate::model::ElasticsearchDataSourceConfig> {
self.elasticsearch_config.as_ref()
}
pub fn open_search_service_config(
&self,
) -> std::option::Option<&crate::model::OpenSearchServiceDataSourceConfig> {
self.open_search_service_config.as_ref()
}
pub fn http_config(&self) -> std::option::Option<&crate::model::HttpDataSourceConfig> {
self.http_config.as_ref()
}
pub fn relational_database_config(
&self,
) -> std::option::Option<&crate::model::RelationalDatabaseDataSourceConfig> {
self.relational_database_config.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateApiKeyInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub expires: i64,
}
impl CreateApiKeyInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn expires(&self) -> i64 {
self.expires
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateApiCacheInput {
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub ttl: i64,
#[doc(hidden)]
pub transit_encryption_enabled: bool,
#[doc(hidden)]
pub at_rest_encryption_enabled: bool,
#[doc(hidden)]
pub api_caching_behavior: std::option::Option<crate::model::ApiCachingBehavior>,
#[doc(hidden)]
pub r#type: std::option::Option<crate::model::ApiCacheType>,
}
impl CreateApiCacheInput {
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
pub fn ttl(&self) -> i64 {
self.ttl
}
pub fn transit_encryption_enabled(&self) -> bool {
self.transit_encryption_enabled
}
pub fn at_rest_encryption_enabled(&self) -> bool {
self.at_rest_encryption_enabled
}
pub fn api_caching_behavior(&self) -> std::option::Option<&crate::model::ApiCachingBehavior> {
self.api_caching_behavior.as_ref()
}
pub fn r#type(&self) -> std::option::Option<&crate::model::ApiCacheType> {
self.r#type.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AssociateApiInput {
#[doc(hidden)]
pub domain_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub api_id: std::option::Option<std::string::String>,
}
impl AssociateApiInput {
pub fn domain_name(&self) -> std::option::Option<&str> {
self.domain_name.as_deref()
}
pub fn api_id(&self) -> std::option::Option<&str> {
self.api_id.as_deref()
}
}