use std::fmt::Write;
pub mod associate_approval_rule_template_with_repository_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) approval_rule_template_name: std::option::Option<std::string::String>,
pub(crate) repository_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn approval_rule_template_name(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.approval_rule_template_name = Some(input.into());
self
}
pub fn set_approval_rule_template_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.approval_rule_template_name = input;
self
}
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::AssociateApprovalRuleTemplateWithRepositoryInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(
crate::input::AssociateApprovalRuleTemplateWithRepositoryInput {
approval_rule_template_name: self.approval_rule_template_name,
repository_name: self.repository_name,
},
)
}
}
}
impl AssociateApprovalRuleTemplateWithRepositoryInput {
#[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::AssociateApprovalRuleTemplateWithRepository,
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::AssociateApprovalRuleTemplateWithRepositoryInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::AssociateApprovalRuleTemplateWithRepositoryInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.AssociateApprovalRuleTemplateWithRepository",
);
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_approval_rule_template_with_repository(&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::AssociateApprovalRuleTemplateWithRepository::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"AssociateApprovalRuleTemplateWithRepository",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::associate_approval_rule_template_with_repository_input::Builder
{
crate::input::associate_approval_rule_template_with_repository_input::Builder::default()
}
}
pub mod batch_associate_approval_rule_template_with_repositories_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) approval_rule_template_name: std::option::Option<std::string::String>,
pub(crate) repository_names: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
pub fn approval_rule_template_name(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.approval_rule_template_name = Some(input.into());
self
}
pub fn set_approval_rule_template_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.approval_rule_template_name = input;
self
}
pub fn repository_names(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.repository_names.unwrap_or_default();
v.push(input.into());
self.repository_names = Some(v);
self
}
pub fn set_repository_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.repository_names = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::BatchAssociateApprovalRuleTemplateWithRepositoriesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(
crate::input::BatchAssociateApprovalRuleTemplateWithRepositoriesInput {
approval_rule_template_name: self.approval_rule_template_name,
repository_names: self.repository_names,
},
)
}
}
}
impl BatchAssociateApprovalRuleTemplateWithRepositoriesInput {
#[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::BatchAssociateApprovalRuleTemplateWithRepositories,
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::BatchAssociateApprovalRuleTemplateWithRepositoriesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::BatchAssociateApprovalRuleTemplateWithRepositoriesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.BatchAssociateApprovalRuleTemplateWithRepositories",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_batch_associate_approval_rule_template_with_repositories(&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::BatchAssociateApprovalRuleTemplateWithRepositories::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"BatchAssociateApprovalRuleTemplateWithRepositories",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder(
) -> crate::input::batch_associate_approval_rule_template_with_repositories_input::Builder {
crate::input::batch_associate_approval_rule_template_with_repositories_input::Builder::default()
}
}
pub mod batch_describe_merge_conflicts_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) destination_commit_specifier: std::option::Option<std::string::String>,
pub(crate) source_commit_specifier: std::option::Option<std::string::String>,
pub(crate) merge_option: std::option::Option<crate::model::MergeOptionTypeEnum>,
pub(crate) max_merge_hunks: std::option::Option<i32>,
pub(crate) max_conflict_files: std::option::Option<i32>,
pub(crate) file_paths: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) conflict_detail_level:
std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
pub(crate) conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn destination_commit_specifier(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.destination_commit_specifier = Some(input.into());
self
}
pub fn set_destination_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.destination_commit_specifier = input;
self
}
pub fn source_commit_specifier(mut self, input: impl Into<std::string::String>) -> Self {
self.source_commit_specifier = Some(input.into());
self
}
pub fn set_source_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.source_commit_specifier = input;
self
}
pub fn merge_option(mut self, input: crate::model::MergeOptionTypeEnum) -> Self {
self.merge_option = Some(input);
self
}
pub fn set_merge_option(
mut self,
input: std::option::Option<crate::model::MergeOptionTypeEnum>,
) -> Self {
self.merge_option = input;
self
}
pub fn max_merge_hunks(mut self, input: i32) -> Self {
self.max_merge_hunks = Some(input);
self
}
pub fn set_max_merge_hunks(mut self, input: std::option::Option<i32>) -> Self {
self.max_merge_hunks = input;
self
}
pub fn max_conflict_files(mut self, input: i32) -> Self {
self.max_conflict_files = Some(input);
self
}
pub fn set_max_conflict_files(mut self, input: std::option::Option<i32>) -> Self {
self.max_conflict_files = input;
self
}
pub fn file_paths(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.file_paths.unwrap_or_default();
v.push(input.into());
self.file_paths = Some(v);
self
}
pub fn set_file_paths(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.file_paths = input;
self
}
pub fn conflict_detail_level(
mut self,
input: crate::model::ConflictDetailLevelTypeEnum,
) -> Self {
self.conflict_detail_level = Some(input);
self
}
pub fn set_conflict_detail_level(
mut self,
input: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
) -> Self {
self.conflict_detail_level = input;
self
}
pub fn conflict_resolution_strategy(
mut self,
input: crate::model::ConflictResolutionStrategyTypeEnum,
) -> Self {
self.conflict_resolution_strategy = Some(input);
self
}
pub fn set_conflict_resolution_strategy(
mut self,
input: std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
) -> Self {
self.conflict_resolution_strategy = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::BatchDescribeMergeConflictsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::BatchDescribeMergeConflictsInput {
repository_name: self.repository_name,
destination_commit_specifier: self.destination_commit_specifier,
source_commit_specifier: self.source_commit_specifier,
merge_option: self.merge_option,
max_merge_hunks: self.max_merge_hunks,
max_conflict_files: self.max_conflict_files,
file_paths: self.file_paths,
conflict_detail_level: self.conflict_detail_level,
conflict_resolution_strategy: self.conflict_resolution_strategy,
next_token: self.next_token,
})
}
}
}
impl BatchDescribeMergeConflictsInput {
#[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::BatchDescribeMergeConflicts,
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::BatchDescribeMergeConflictsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::BatchDescribeMergeConflictsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.BatchDescribeMergeConflicts",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_batch_describe_merge_conflicts(&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::BatchDescribeMergeConflicts::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"BatchDescribeMergeConflicts",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::batch_describe_merge_conflicts_input::Builder {
crate::input::batch_describe_merge_conflicts_input::Builder::default()
}
}
pub mod batch_disassociate_approval_rule_template_from_repositories_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) approval_rule_template_name: std::option::Option<std::string::String>,
pub(crate) repository_names: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
pub fn approval_rule_template_name(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.approval_rule_template_name = Some(input.into());
self
}
pub fn set_approval_rule_template_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.approval_rule_template_name = input;
self
}
pub fn repository_names(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.repository_names.unwrap_or_default();
v.push(input.into());
self.repository_names = Some(v);
self
}
pub fn set_repository_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.repository_names = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::BatchDisassociateApprovalRuleTemplateFromRepositoriesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(
crate::input::BatchDisassociateApprovalRuleTemplateFromRepositoriesInput {
approval_rule_template_name: self.approval_rule_template_name,
repository_names: self.repository_names,
},
)
}
}
}
impl BatchDisassociateApprovalRuleTemplateFromRepositoriesInput {
#[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::BatchDisassociateApprovalRuleTemplateFromRepositories,
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::BatchDisassociateApprovalRuleTemplateFromRepositoriesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::BatchDisassociateApprovalRuleTemplateFromRepositoriesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.BatchDisassociateApprovalRuleTemplateFromRepositories",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_batch_disassociate_approval_rule_template_from_repositories(&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::BatchDisassociateApprovalRuleTemplateFromRepositories::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"BatchDisassociateApprovalRuleTemplateFromRepositories",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder(
) -> crate::input::batch_disassociate_approval_rule_template_from_repositories_input::Builder
{
crate::input::batch_disassociate_approval_rule_template_from_repositories_input::Builder::default()
}
}
pub mod batch_get_commits_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) commit_ids: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) repository_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn commit_ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.commit_ids.unwrap_or_default();
v.push(input.into());
self.commit_ids = Some(v);
self
}
pub fn set_commit_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.commit_ids = input;
self
}
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::BatchGetCommitsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::BatchGetCommitsInput {
commit_ids: self.commit_ids,
repository_name: self.repository_name,
})
}
}
}
impl BatchGetCommitsInput {
#[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::BatchGetCommits,
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::BatchGetCommitsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::BatchGetCommitsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.BatchGetCommits",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_batch_get_commits(&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::BatchGetCommits::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"BatchGetCommits",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::batch_get_commits_input::Builder {
crate::input::batch_get_commits_input::Builder::default()
}
}
pub mod batch_get_repositories_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_names: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
pub fn repository_names(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.repository_names.unwrap_or_default();
v.push(input.into());
self.repository_names = Some(v);
self
}
pub fn set_repository_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.repository_names = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::BatchGetRepositoriesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::BatchGetRepositoriesInput {
repository_names: self.repository_names,
})
}
}
}
impl BatchGetRepositoriesInput {
#[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::BatchGetRepositories,
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::BatchGetRepositoriesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::BatchGetRepositoriesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.BatchGetRepositories",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_batch_get_repositories(
&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::BatchGetRepositories::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"BatchGetRepositories",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::batch_get_repositories_input::Builder {
crate::input::batch_get_repositories_input::Builder::default()
}
}
pub mod create_approval_rule_template_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) approval_rule_template_name: std::option::Option<std::string::String>,
pub(crate) approval_rule_template_content: std::option::Option<std::string::String>,
pub(crate) approval_rule_template_description: std::option::Option<std::string::String>,
}
impl Builder {
pub fn approval_rule_template_name(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.approval_rule_template_name = Some(input.into());
self
}
pub fn set_approval_rule_template_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.approval_rule_template_name = input;
self
}
pub fn approval_rule_template_content(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.approval_rule_template_content = Some(input.into());
self
}
pub fn set_approval_rule_template_content(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.approval_rule_template_content = input;
self
}
pub fn approval_rule_template_description(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.approval_rule_template_description = Some(input.into());
self
}
pub fn set_approval_rule_template_description(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.approval_rule_template_description = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateApprovalRuleTemplateInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateApprovalRuleTemplateInput {
approval_rule_template_name: self.approval_rule_template_name,
approval_rule_template_content: self.approval_rule_template_content,
approval_rule_template_description: self.approval_rule_template_description,
})
}
}
}
impl CreateApprovalRuleTemplateInput {
#[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::CreateApprovalRuleTemplate,
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::CreateApprovalRuleTemplateInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateApprovalRuleTemplateInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.CreateApprovalRuleTemplate",
);
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_approval_rule_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::CreateApprovalRuleTemplate::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateApprovalRuleTemplate",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_approval_rule_template_input::Builder {
crate::input::create_approval_rule_template_input::Builder::default()
}
}
pub mod create_branch_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
pub(crate) commit_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn commit_id(mut self, input: impl Into<std::string::String>) -> Self {
self.commit_id = Some(input.into());
self
}
pub fn set_commit_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.commit_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateBranchInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateBranchInput {
repository_name: self.repository_name,
branch_name: self.branch_name,
commit_id: self.commit_id,
})
}
}
}
impl CreateBranchInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateBranch,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::CreateBranchInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateBranchInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.CreateBranch",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_branch(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateBranch::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateBranch",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_branch_input::Builder {
crate::input::create_branch_input::Builder::default()
}
}
pub mod create_commit_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
pub(crate) parent_commit_id: std::option::Option<std::string::String>,
pub(crate) author_name: std::option::Option<std::string::String>,
pub(crate) email: std::option::Option<std::string::String>,
pub(crate) commit_message: std::option::Option<std::string::String>,
pub(crate) keep_empty_folders: std::option::Option<bool>,
pub(crate) put_files: std::option::Option<std::vec::Vec<crate::model::PutFileEntry>>,
pub(crate) delete_files: std::option::Option<std::vec::Vec<crate::model::DeleteFileEntry>>,
pub(crate) set_file_modes:
std::option::Option<std::vec::Vec<crate::model::SetFileModeEntry>>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn parent_commit_id(mut self, input: impl Into<std::string::String>) -> Self {
self.parent_commit_id = Some(input.into());
self
}
pub fn set_parent_commit_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.parent_commit_id = input;
self
}
pub fn author_name(mut self, input: impl Into<std::string::String>) -> Self {
self.author_name = Some(input.into());
self
}
pub fn set_author_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.author_name = input;
self
}
pub fn email(mut self, input: impl Into<std::string::String>) -> Self {
self.email = Some(input.into());
self
}
pub fn set_email(mut self, input: std::option::Option<std::string::String>) -> Self {
self.email = input;
self
}
pub fn commit_message(mut self, input: impl Into<std::string::String>) -> Self {
self.commit_message = Some(input.into());
self
}
pub fn set_commit_message(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.commit_message = input;
self
}
pub fn keep_empty_folders(mut self, input: bool) -> Self {
self.keep_empty_folders = Some(input);
self
}
pub fn set_keep_empty_folders(mut self, input: std::option::Option<bool>) -> Self {
self.keep_empty_folders = input;
self
}
pub fn put_files(mut self, input: crate::model::PutFileEntry) -> Self {
let mut v = self.put_files.unwrap_or_default();
v.push(input);
self.put_files = Some(v);
self
}
pub fn set_put_files(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::PutFileEntry>>,
) -> Self {
self.put_files = input;
self
}
pub fn delete_files(mut self, input: crate::model::DeleteFileEntry) -> Self {
let mut v = self.delete_files.unwrap_or_default();
v.push(input);
self.delete_files = Some(v);
self
}
pub fn set_delete_files(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::DeleteFileEntry>>,
) -> Self {
self.delete_files = input;
self
}
pub fn set_file_modes(mut self, input: crate::model::SetFileModeEntry) -> Self {
let mut v = self.set_file_modes.unwrap_or_default();
v.push(input);
self.set_file_modes = Some(v);
self
}
pub fn set_set_file_modes(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::SetFileModeEntry>>,
) -> Self {
self.set_file_modes = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateCommitInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateCommitInput {
repository_name: self.repository_name,
branch_name: self.branch_name,
parent_commit_id: self.parent_commit_id,
author_name: self.author_name,
email: self.email,
commit_message: self.commit_message,
keep_empty_folders: self.keep_empty_folders.unwrap_or_default(),
put_files: self.put_files,
delete_files: self.delete_files,
set_file_modes: self.set_file_modes,
})
}
}
}
impl CreateCommitInput {
#[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::CreateCommit,
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::CreateCommitInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateCommitInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.CreateCommit",
);
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_commit(&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::CreateCommit::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateCommit",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_commit_input::Builder {
crate::input::create_commit_input::Builder::default()
}
}
pub mod create_pull_request_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) title: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) targets: std::option::Option<std::vec::Vec<crate::model::Target>>,
pub(crate) client_request_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn title(mut self, input: impl Into<std::string::String>) -> Self {
self.title = Some(input.into());
self
}
pub fn set_title(mut self, input: std::option::Option<std::string::String>) -> Self {
self.title = 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 targets(mut self, input: crate::model::Target) -> Self {
let mut v = self.targets.unwrap_or_default();
v.push(input);
self.targets = Some(v);
self
}
pub fn set_targets(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Target>>,
) -> Self {
self.targets = input;
self
}
pub fn client_request_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_request_token = Some(input.into());
self
}
pub fn set_client_request_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_request_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreatePullRequestInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreatePullRequestInput {
title: self.title,
description: self.description,
targets: self.targets,
client_request_token: self.client_request_token,
})
}
}
}
impl CreatePullRequestInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreatePullRequest,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
if self.client_request_token.is_none() {
self.client_request_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::CreatePullRequestInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreatePullRequestInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.CreatePullRequest",
);
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_pull_request(&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::CreatePullRequest::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreatePullRequest",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_pull_request_input::Builder {
crate::input::create_pull_request_input::Builder::default()
}
}
pub mod create_pull_request_approval_rule_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
pub(crate) approval_rule_name: std::option::Option<std::string::String>,
pub(crate) approval_rule_content: std::option::Option<std::string::String>,
}
impl Builder {
pub fn pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_id = input;
self
}
pub fn approval_rule_name(mut self, input: impl Into<std::string::String>) -> Self {
self.approval_rule_name = Some(input.into());
self
}
pub fn set_approval_rule_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.approval_rule_name = input;
self
}
pub fn approval_rule_content(mut self, input: impl Into<std::string::String>) -> Self {
self.approval_rule_content = Some(input.into());
self
}
pub fn set_approval_rule_content(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.approval_rule_content = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreatePullRequestApprovalRuleInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreatePullRequestApprovalRuleInput {
pull_request_id: self.pull_request_id,
approval_rule_name: self.approval_rule_name,
approval_rule_content: self.approval_rule_content,
})
}
}
}
impl CreatePullRequestApprovalRuleInput {
#[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::CreatePullRequestApprovalRule,
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::CreatePullRequestApprovalRuleInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreatePullRequestApprovalRuleInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.CreatePullRequestApprovalRule",
);
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_pull_request_approval_rule(&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::CreatePullRequestApprovalRule::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreatePullRequestApprovalRule",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_pull_request_approval_rule_input::Builder {
crate::input::create_pull_request_approval_rule_input::Builder::default()
}
}
pub mod create_repository_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) repository_description: 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 repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn repository_description(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_description = Some(input.into());
self
}
pub fn set_repository_description(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_description = 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::CreateRepositoryInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateRepositoryInput {
repository_name: self.repository_name,
repository_description: self.repository_description,
tags: self.tags,
})
}
}
}
impl CreateRepositoryInput {
#[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::CreateRepository,
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::CreateRepositoryInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateRepositoryInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.CreateRepository",
);
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_repository(&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::CreateRepository::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateRepository",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_repository_input::Builder {
crate::input::create_repository_input::Builder::default()
}
}
pub mod create_unreferenced_merge_commit_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) source_commit_specifier: std::option::Option<std::string::String>,
pub(crate) destination_commit_specifier: std::option::Option<std::string::String>,
pub(crate) merge_option: std::option::Option<crate::model::MergeOptionTypeEnum>,
pub(crate) conflict_detail_level:
std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
pub(crate) conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
pub(crate) author_name: std::option::Option<std::string::String>,
pub(crate) email: std::option::Option<std::string::String>,
pub(crate) commit_message: std::option::Option<std::string::String>,
pub(crate) keep_empty_folders: std::option::Option<bool>,
pub(crate) conflict_resolution: std::option::Option<crate::model::ConflictResolution>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn source_commit_specifier(mut self, input: impl Into<std::string::String>) -> Self {
self.source_commit_specifier = Some(input.into());
self
}
pub fn set_source_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.source_commit_specifier = input;
self
}
pub fn destination_commit_specifier(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.destination_commit_specifier = Some(input.into());
self
}
pub fn set_destination_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.destination_commit_specifier = input;
self
}
pub fn merge_option(mut self, input: crate::model::MergeOptionTypeEnum) -> Self {
self.merge_option = Some(input);
self
}
pub fn set_merge_option(
mut self,
input: std::option::Option<crate::model::MergeOptionTypeEnum>,
) -> Self {
self.merge_option = input;
self
}
pub fn conflict_detail_level(
mut self,
input: crate::model::ConflictDetailLevelTypeEnum,
) -> Self {
self.conflict_detail_level = Some(input);
self
}
pub fn set_conflict_detail_level(
mut self,
input: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
) -> Self {
self.conflict_detail_level = input;
self
}
pub fn conflict_resolution_strategy(
mut self,
input: crate::model::ConflictResolutionStrategyTypeEnum,
) -> Self {
self.conflict_resolution_strategy = Some(input);
self
}
pub fn set_conflict_resolution_strategy(
mut self,
input: std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
) -> Self {
self.conflict_resolution_strategy = input;
self
}
pub fn author_name(mut self, input: impl Into<std::string::String>) -> Self {
self.author_name = Some(input.into());
self
}
pub fn set_author_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.author_name = input;
self
}
pub fn email(mut self, input: impl Into<std::string::String>) -> Self {
self.email = Some(input.into());
self
}
pub fn set_email(mut self, input: std::option::Option<std::string::String>) -> Self {
self.email = input;
self
}
pub fn commit_message(mut self, input: impl Into<std::string::String>) -> Self {
self.commit_message = Some(input.into());
self
}
pub fn set_commit_message(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.commit_message = input;
self
}
pub fn keep_empty_folders(mut self, input: bool) -> Self {
self.keep_empty_folders = Some(input);
self
}
pub fn set_keep_empty_folders(mut self, input: std::option::Option<bool>) -> Self {
self.keep_empty_folders = input;
self
}
pub fn conflict_resolution(mut self, input: crate::model::ConflictResolution) -> Self {
self.conflict_resolution = Some(input);
self
}
pub fn set_conflict_resolution(
mut self,
input: std::option::Option<crate::model::ConflictResolution>,
) -> Self {
self.conflict_resolution = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateUnreferencedMergeCommitInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateUnreferencedMergeCommitInput {
repository_name: self.repository_name,
source_commit_specifier: self.source_commit_specifier,
destination_commit_specifier: self.destination_commit_specifier,
merge_option: self.merge_option,
conflict_detail_level: self.conflict_detail_level,
conflict_resolution_strategy: self.conflict_resolution_strategy,
author_name: self.author_name,
email: self.email,
commit_message: self.commit_message,
keep_empty_folders: self.keep_empty_folders.unwrap_or_default(),
conflict_resolution: self.conflict_resolution,
})
}
}
}
impl CreateUnreferencedMergeCommitInput {
#[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::CreateUnreferencedMergeCommit,
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::CreateUnreferencedMergeCommitInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateUnreferencedMergeCommitInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.CreateUnreferencedMergeCommit",
);
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_unreferenced_merge_commit(&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::CreateUnreferencedMergeCommit::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateUnreferencedMergeCommit",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_unreferenced_merge_commit_input::Builder {
crate::input::create_unreferenced_merge_commit_input::Builder::default()
}
}
pub mod delete_approval_rule_template_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) approval_rule_template_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn approval_rule_template_name(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.approval_rule_template_name = Some(input.into());
self
}
pub fn set_approval_rule_template_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.approval_rule_template_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteApprovalRuleTemplateInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteApprovalRuleTemplateInput {
approval_rule_template_name: self.approval_rule_template_name,
})
}
}
}
impl DeleteApprovalRuleTemplateInput {
#[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::DeleteApprovalRuleTemplate,
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::DeleteApprovalRuleTemplateInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteApprovalRuleTemplateInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.DeleteApprovalRuleTemplate",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_delete_approval_rule_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::DeleteApprovalRuleTemplate::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteApprovalRuleTemplate",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_approval_rule_template_input::Builder {
crate::input::delete_approval_rule_template_input::Builder::default()
}
}
pub mod delete_branch_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteBranchInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteBranchInput {
repository_name: self.repository_name,
branch_name: self.branch_name,
})
}
}
}
impl DeleteBranchInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteBranch,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteBranchInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteBranchInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.DeleteBranch",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_delete_branch(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteBranch::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteBranch",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_branch_input::Builder {
crate::input::delete_branch_input::Builder::default()
}
}
pub mod delete_comment_content_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) comment_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn comment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.comment_id = Some(input.into());
self
}
pub fn set_comment_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.comment_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteCommentContentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteCommentContentInput {
comment_id: self.comment_id,
})
}
}
}
impl DeleteCommentContentInput {
#[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::DeleteCommentContent,
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::DeleteCommentContentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteCommentContentInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.DeleteCommentContent",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_delete_comment_content(
&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::DeleteCommentContent::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteCommentContent",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_comment_content_input::Builder {
crate::input::delete_comment_content_input::Builder::default()
}
}
pub mod delete_file_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
pub(crate) file_path: std::option::Option<std::string::String>,
pub(crate) parent_commit_id: std::option::Option<std::string::String>,
pub(crate) keep_empty_folders: std::option::Option<bool>,
pub(crate) commit_message: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) email: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn file_path(mut self, input: impl Into<std::string::String>) -> Self {
self.file_path = Some(input.into());
self
}
pub fn set_file_path(mut self, input: std::option::Option<std::string::String>) -> Self {
self.file_path = input;
self
}
pub fn parent_commit_id(mut self, input: impl Into<std::string::String>) -> Self {
self.parent_commit_id = Some(input.into());
self
}
pub fn set_parent_commit_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.parent_commit_id = input;
self
}
pub fn keep_empty_folders(mut self, input: bool) -> Self {
self.keep_empty_folders = Some(input);
self
}
pub fn set_keep_empty_folders(mut self, input: std::option::Option<bool>) -> Self {
self.keep_empty_folders = input;
self
}
pub fn commit_message(mut self, input: impl Into<std::string::String>) -> Self {
self.commit_message = Some(input.into());
self
}
pub fn set_commit_message(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.commit_message = input;
self
}
pub fn 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 email(mut self, input: impl Into<std::string::String>) -> Self {
self.email = Some(input.into());
self
}
pub fn set_email(mut self, input: std::option::Option<std::string::String>) -> Self {
self.email = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteFileInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteFileInput {
repository_name: self.repository_name,
branch_name: self.branch_name,
file_path: self.file_path,
parent_commit_id: self.parent_commit_id,
keep_empty_folders: self.keep_empty_folders.unwrap_or_default(),
commit_message: self.commit_message,
name: self.name,
email: self.email,
})
}
}
}
impl DeleteFileInput {
#[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::DeleteFile,
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::DeleteFileInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteFileInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.DeleteFile",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_delete_file(&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::DeleteFile::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteFile",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_file_input::Builder {
crate::input::delete_file_input::Builder::default()
}
}
pub mod delete_pull_request_approval_rule_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
pub(crate) approval_rule_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_id = input;
self
}
pub fn approval_rule_name(mut self, input: impl Into<std::string::String>) -> Self {
self.approval_rule_name = Some(input.into());
self
}
pub fn set_approval_rule_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.approval_rule_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeletePullRequestApprovalRuleInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeletePullRequestApprovalRuleInput {
pull_request_id: self.pull_request_id,
approval_rule_name: self.approval_rule_name,
})
}
}
}
impl DeletePullRequestApprovalRuleInput {
#[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::DeletePullRequestApprovalRule,
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::DeletePullRequestApprovalRuleInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeletePullRequestApprovalRuleInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.DeletePullRequestApprovalRule",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_delete_pull_request_approval_rule(&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::DeletePullRequestApprovalRule::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeletePullRequestApprovalRule",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_pull_request_approval_rule_input::Builder {
crate::input::delete_pull_request_approval_rule_input::Builder::default()
}
}
pub mod delete_repository_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteRepositoryInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteRepositoryInput {
repository_name: self.repository_name,
})
}
}
}
impl DeleteRepositoryInput {
#[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::DeleteRepository,
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::DeleteRepositoryInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteRepositoryInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.DeleteRepository",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_delete_repository(&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::DeleteRepository::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteRepository",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_repository_input::Builder {
crate::input::delete_repository_input::Builder::default()
}
}
pub mod describe_merge_conflicts_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) destination_commit_specifier: std::option::Option<std::string::String>,
pub(crate) source_commit_specifier: std::option::Option<std::string::String>,
pub(crate) merge_option: std::option::Option<crate::model::MergeOptionTypeEnum>,
pub(crate) max_merge_hunks: std::option::Option<i32>,
pub(crate) file_path: std::option::Option<std::string::String>,
pub(crate) conflict_detail_level:
std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
pub(crate) conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn destination_commit_specifier(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.destination_commit_specifier = Some(input.into());
self
}
pub fn set_destination_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.destination_commit_specifier = input;
self
}
pub fn source_commit_specifier(mut self, input: impl Into<std::string::String>) -> Self {
self.source_commit_specifier = Some(input.into());
self
}
pub fn set_source_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.source_commit_specifier = input;
self
}
pub fn merge_option(mut self, input: crate::model::MergeOptionTypeEnum) -> Self {
self.merge_option = Some(input);
self
}
pub fn set_merge_option(
mut self,
input: std::option::Option<crate::model::MergeOptionTypeEnum>,
) -> Self {
self.merge_option = input;
self
}
pub fn max_merge_hunks(mut self, input: i32) -> Self {
self.max_merge_hunks = Some(input);
self
}
pub fn set_max_merge_hunks(mut self, input: std::option::Option<i32>) -> Self {
self.max_merge_hunks = input;
self
}
pub fn file_path(mut self, input: impl Into<std::string::String>) -> Self {
self.file_path = Some(input.into());
self
}
pub fn set_file_path(mut self, input: std::option::Option<std::string::String>) -> Self {
self.file_path = input;
self
}
pub fn conflict_detail_level(
mut self,
input: crate::model::ConflictDetailLevelTypeEnum,
) -> Self {
self.conflict_detail_level = Some(input);
self
}
pub fn set_conflict_detail_level(
mut self,
input: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
) -> Self {
self.conflict_detail_level = input;
self
}
pub fn conflict_resolution_strategy(
mut self,
input: crate::model::ConflictResolutionStrategyTypeEnum,
) -> Self {
self.conflict_resolution_strategy = Some(input);
self
}
pub fn set_conflict_resolution_strategy(
mut self,
input: std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
) -> Self {
self.conflict_resolution_strategy = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeMergeConflictsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeMergeConflictsInput {
repository_name: self.repository_name,
destination_commit_specifier: self.destination_commit_specifier,
source_commit_specifier: self.source_commit_specifier,
merge_option: self.merge_option,
max_merge_hunks: self.max_merge_hunks,
file_path: self.file_path,
conflict_detail_level: self.conflict_detail_level,
conflict_resolution_strategy: self.conflict_resolution_strategy,
next_token: self.next_token,
})
}
}
}
impl DescribeMergeConflictsInput {
#[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::DescribeMergeConflicts,
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::DescribeMergeConflictsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeMergeConflictsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.DescribeMergeConflicts",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_describe_merge_conflicts(
&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::DescribeMergeConflicts::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeMergeConflicts",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_merge_conflicts_input::Builder {
crate::input::describe_merge_conflicts_input::Builder::default()
}
}
pub mod describe_pull_request_events_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
pub(crate) pull_request_event_type: std::option::Option<crate::model::PullRequestEventType>,
pub(crate) actor_arn: 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 pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_id = input;
self
}
pub fn pull_request_event_type(
mut self,
input: crate::model::PullRequestEventType,
) -> Self {
self.pull_request_event_type = Some(input);
self
}
pub fn set_pull_request_event_type(
mut self,
input: std::option::Option<crate::model::PullRequestEventType>,
) -> Self {
self.pull_request_event_type = input;
self
}
pub fn actor_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.actor_arn = Some(input.into());
self
}
pub fn set_actor_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.actor_arn = 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::DescribePullRequestEventsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribePullRequestEventsInput {
pull_request_id: self.pull_request_id,
pull_request_event_type: self.pull_request_event_type,
actor_arn: self.actor_arn,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl DescribePullRequestEventsInput {
#[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::DescribePullRequestEvents,
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::DescribePullRequestEventsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribePullRequestEventsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.DescribePullRequestEvents",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_describe_pull_request_events(
&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::DescribePullRequestEvents::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribePullRequestEvents",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_pull_request_events_input::Builder {
crate::input::describe_pull_request_events_input::Builder::default()
}
}
pub mod disassociate_approval_rule_template_from_repository_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) approval_rule_template_name: std::option::Option<std::string::String>,
pub(crate) repository_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn approval_rule_template_name(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.approval_rule_template_name = Some(input.into());
self
}
pub fn set_approval_rule_template_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.approval_rule_template_name = input;
self
}
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DisassociateApprovalRuleTemplateFromRepositoryInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(
crate::input::DisassociateApprovalRuleTemplateFromRepositoryInput {
approval_rule_template_name: self.approval_rule_template_name,
repository_name: self.repository_name,
},
)
}
}
}
impl DisassociateApprovalRuleTemplateFromRepositoryInput {
#[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::DisassociateApprovalRuleTemplateFromRepository,
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::DisassociateApprovalRuleTemplateFromRepositoryInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DisassociateApprovalRuleTemplateFromRepositoryInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.DisassociateApprovalRuleTemplateFromRepository",
);
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_disassociate_approval_rule_template_from_repository(&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::DisassociateApprovalRuleTemplateFromRepository::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DisassociateApprovalRuleTemplateFromRepository",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder(
) -> crate::input::disassociate_approval_rule_template_from_repository_input::Builder {
crate::input::disassociate_approval_rule_template_from_repository_input::Builder::default()
}
}
pub mod evaluate_pull_request_approval_rules_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
pub(crate) revision_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_id = input;
self
}
pub fn revision_id(mut self, input: impl Into<std::string::String>) -> Self {
self.revision_id = Some(input.into());
self
}
pub fn set_revision_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.revision_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::EvaluatePullRequestApprovalRulesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::EvaluatePullRequestApprovalRulesInput {
pull_request_id: self.pull_request_id,
revision_id: self.revision_id,
})
}
}
}
impl EvaluatePullRequestApprovalRulesInput {
#[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::EvaluatePullRequestApprovalRules,
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::EvaluatePullRequestApprovalRulesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::EvaluatePullRequestApprovalRulesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.EvaluatePullRequestApprovalRules",
);
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_pull_request_approval_rules(&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::EvaluatePullRequestApprovalRules::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"EvaluatePullRequestApprovalRules",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::evaluate_pull_request_approval_rules_input::Builder {
crate::input::evaluate_pull_request_approval_rules_input::Builder::default()
}
}
pub mod get_approval_rule_template_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) approval_rule_template_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn approval_rule_template_name(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.approval_rule_template_name = Some(input.into());
self
}
pub fn set_approval_rule_template_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.approval_rule_template_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetApprovalRuleTemplateInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetApprovalRuleTemplateInput {
approval_rule_template_name: self.approval_rule_template_name,
})
}
}
}
impl GetApprovalRuleTemplateInput {
#[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::GetApprovalRuleTemplate,
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::GetApprovalRuleTemplateInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetApprovalRuleTemplateInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetApprovalRuleTemplate",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_approval_rule_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::GetApprovalRuleTemplate::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetApprovalRuleTemplate",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_approval_rule_template_input::Builder {
crate::input::get_approval_rule_template_input::Builder::default()
}
}
pub mod get_blob_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) blob_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn blob_id(mut self, input: impl Into<std::string::String>) -> Self {
self.blob_id = Some(input.into());
self
}
pub fn set_blob_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.blob_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetBlobInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetBlobInput {
repository_name: self.repository_name,
blob_id: self.blob_id,
})
}
}
}
impl GetBlobInput {
#[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::GetBlob,
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::GetBlobInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetBlobInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetBlob",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_blob(&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::GetBlob::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetBlob",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_blob_input::Builder {
crate::input::get_blob_input::Builder::default()
}
}
pub mod get_branch_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetBranchInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetBranchInput {
repository_name: self.repository_name,
branch_name: self.branch_name,
})
}
}
}
impl GetBranchInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetBranch,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetBranchInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetBranchInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetBranch",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_branch(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::GetBranch::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetBranch",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_branch_input::Builder {
crate::input::get_branch_input::Builder::default()
}
}
pub mod get_comment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) comment_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn comment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.comment_id = Some(input.into());
self
}
pub fn set_comment_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.comment_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetCommentInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetCommentInput {
comment_id: self.comment_id,
})
}
}
}
impl GetCommentInput {
#[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::GetComment,
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::GetCommentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetCommentInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetComment",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_comment(&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::GetComment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetComment",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_comment_input::Builder {
crate::input::get_comment_input::Builder::default()
}
}
pub mod get_comment_reactions_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) comment_id: std::option::Option<std::string::String>,
pub(crate) reaction_user_arn: 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 comment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.comment_id = Some(input.into());
self
}
pub fn set_comment_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.comment_id = input;
self
}
pub fn reaction_user_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.reaction_user_arn = Some(input.into());
self
}
pub fn set_reaction_user_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.reaction_user_arn = 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::GetCommentReactionsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetCommentReactionsInput {
comment_id: self.comment_id,
reaction_user_arn: self.reaction_user_arn,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl GetCommentReactionsInput {
#[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::GetCommentReactions,
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::GetCommentReactionsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetCommentReactionsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetCommentReactions",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_comment_reactions(&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::GetCommentReactions::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetCommentReactions",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_comment_reactions_input::Builder {
crate::input::get_comment_reactions_input::Builder::default()
}
}
pub mod get_comments_for_compared_commit_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) before_commit_id: std::option::Option<std::string::String>,
pub(crate) after_commit_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 repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn before_commit_id(mut self, input: impl Into<std::string::String>) -> Self {
self.before_commit_id = Some(input.into());
self
}
pub fn set_before_commit_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.before_commit_id = input;
self
}
pub fn after_commit_id(mut self, input: impl Into<std::string::String>) -> Self {
self.after_commit_id = Some(input.into());
self
}
pub fn set_after_commit_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.after_commit_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::GetCommentsForComparedCommitInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetCommentsForComparedCommitInput {
repository_name: self.repository_name,
before_commit_id: self.before_commit_id,
after_commit_id: self.after_commit_id,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl GetCommentsForComparedCommitInput {
#[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::GetCommentsForComparedCommit,
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::GetCommentsForComparedCommitInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetCommentsForComparedCommitInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetCommentsForComparedCommit",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_comments_for_compared_commit(&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::GetCommentsForComparedCommit::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetCommentsForComparedCommit",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_comments_for_compared_commit_input::Builder {
crate::input::get_comments_for_compared_commit_input::Builder::default()
}
}
pub mod get_comments_for_pull_request_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) before_commit_id: std::option::Option<std::string::String>,
pub(crate) after_commit_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 pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_id = input;
self
}
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn before_commit_id(mut self, input: impl Into<std::string::String>) -> Self {
self.before_commit_id = Some(input.into());
self
}
pub fn set_before_commit_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.before_commit_id = input;
self
}
pub fn after_commit_id(mut self, input: impl Into<std::string::String>) -> Self {
self.after_commit_id = Some(input.into());
self
}
pub fn set_after_commit_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.after_commit_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::GetCommentsForPullRequestInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetCommentsForPullRequestInput {
pull_request_id: self.pull_request_id,
repository_name: self.repository_name,
before_commit_id: self.before_commit_id,
after_commit_id: self.after_commit_id,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl GetCommentsForPullRequestInput {
#[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::GetCommentsForPullRequest,
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::GetCommentsForPullRequestInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetCommentsForPullRequestInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetCommentsForPullRequest",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_comments_for_pull_request(&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::GetCommentsForPullRequest::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetCommentsForPullRequest",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_comments_for_pull_request_input::Builder {
crate::input::get_comments_for_pull_request_input::Builder::default()
}
}
pub mod get_commit_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) commit_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn commit_id(mut self, input: impl Into<std::string::String>) -> Self {
self.commit_id = Some(input.into());
self
}
pub fn set_commit_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.commit_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetCommitInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetCommitInput {
repository_name: self.repository_name,
commit_id: self.commit_id,
})
}
}
}
impl GetCommitInput {
#[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::GetCommit,
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::GetCommitInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetCommitInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetCommit",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_commit(&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::GetCommit::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetCommit",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_commit_input::Builder {
crate::input::get_commit_input::Builder::default()
}
}
pub mod get_differences_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) before_commit_specifier: std::option::Option<std::string::String>,
pub(crate) after_commit_specifier: std::option::Option<std::string::String>,
pub(crate) before_path: std::option::Option<std::string::String>,
pub(crate) after_path: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn before_commit_specifier(mut self, input: impl Into<std::string::String>) -> Self {
self.before_commit_specifier = Some(input.into());
self
}
pub fn set_before_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.before_commit_specifier = input;
self
}
pub fn after_commit_specifier(mut self, input: impl Into<std::string::String>) -> Self {
self.after_commit_specifier = Some(input.into());
self
}
pub fn set_after_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.after_commit_specifier = input;
self
}
pub fn before_path(mut self, input: impl Into<std::string::String>) -> Self {
self.before_path = Some(input.into());
self
}
pub fn set_before_path(mut self, input: std::option::Option<std::string::String>) -> Self {
self.before_path = input;
self
}
pub fn after_path(mut self, input: impl Into<std::string::String>) -> Self {
self.after_path = Some(input.into());
self
}
pub fn set_after_path(mut self, input: std::option::Option<std::string::String>) -> Self {
self.after_path = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetDifferencesInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetDifferencesInput {
repository_name: self.repository_name,
before_commit_specifier: self.before_commit_specifier,
after_commit_specifier: self.after_commit_specifier,
before_path: self.before_path,
after_path: self.after_path,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
}
impl GetDifferencesInput {
#[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::GetDifferences,
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::GetDifferencesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetDifferencesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetDifferences",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_differences(&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::GetDifferences::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetDifferences",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_differences_input::Builder {
crate::input::get_differences_input::Builder::default()
}
}
pub mod get_file_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) commit_specifier: std::option::Option<std::string::String>,
pub(crate) file_path: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn commit_specifier(mut self, input: impl Into<std::string::String>) -> Self {
self.commit_specifier = Some(input.into());
self
}
pub fn set_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.commit_specifier = input;
self
}
pub fn file_path(mut self, input: impl Into<std::string::String>) -> Self {
self.file_path = Some(input.into());
self
}
pub fn set_file_path(mut self, input: std::option::Option<std::string::String>) -> Self {
self.file_path = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetFileInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetFileInput {
repository_name: self.repository_name,
commit_specifier: self.commit_specifier,
file_path: self.file_path,
})
}
}
}
impl GetFileInput {
#[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::GetFile,
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::GetFileInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetFileInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetFile",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_file(&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::GetFile::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetFile",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_file_input::Builder {
crate::input::get_file_input::Builder::default()
}
}
pub mod get_folder_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) commit_specifier: std::option::Option<std::string::String>,
pub(crate) folder_path: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn commit_specifier(mut self, input: impl Into<std::string::String>) -> Self {
self.commit_specifier = Some(input.into());
self
}
pub fn set_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.commit_specifier = input;
self
}
pub fn folder_path(mut self, input: impl Into<std::string::String>) -> Self {
self.folder_path = Some(input.into());
self
}
pub fn set_folder_path(mut self, input: std::option::Option<std::string::String>) -> Self {
self.folder_path = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetFolderInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetFolderInput {
repository_name: self.repository_name,
commit_specifier: self.commit_specifier,
folder_path: self.folder_path,
})
}
}
}
impl GetFolderInput {
#[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::GetFolder,
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::GetFolderInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetFolderInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetFolder",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_folder(&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::GetFolder::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetFolder",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_folder_input::Builder {
crate::input::get_folder_input::Builder::default()
}
}
pub mod get_merge_commit_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) source_commit_specifier: std::option::Option<std::string::String>,
pub(crate) destination_commit_specifier: std::option::Option<std::string::String>,
pub(crate) conflict_detail_level:
std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
pub(crate) conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn source_commit_specifier(mut self, input: impl Into<std::string::String>) -> Self {
self.source_commit_specifier = Some(input.into());
self
}
pub fn set_source_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.source_commit_specifier = input;
self
}
pub fn destination_commit_specifier(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.destination_commit_specifier = Some(input.into());
self
}
pub fn set_destination_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.destination_commit_specifier = input;
self
}
pub fn conflict_detail_level(
mut self,
input: crate::model::ConflictDetailLevelTypeEnum,
) -> Self {
self.conflict_detail_level = Some(input);
self
}
pub fn set_conflict_detail_level(
mut self,
input: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
) -> Self {
self.conflict_detail_level = input;
self
}
pub fn conflict_resolution_strategy(
mut self,
input: crate::model::ConflictResolutionStrategyTypeEnum,
) -> Self {
self.conflict_resolution_strategy = Some(input);
self
}
pub fn set_conflict_resolution_strategy(
mut self,
input: std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
) -> Self {
self.conflict_resolution_strategy = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetMergeCommitInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetMergeCommitInput {
repository_name: self.repository_name,
source_commit_specifier: self.source_commit_specifier,
destination_commit_specifier: self.destination_commit_specifier,
conflict_detail_level: self.conflict_detail_level,
conflict_resolution_strategy: self.conflict_resolution_strategy,
})
}
}
}
impl GetMergeCommitInput {
#[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::GetMergeCommit,
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::GetMergeCommitInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetMergeCommitInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetMergeCommit",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_merge_commit(&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::GetMergeCommit::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetMergeCommit",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_merge_commit_input::Builder {
crate::input::get_merge_commit_input::Builder::default()
}
}
pub mod get_merge_conflicts_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) destination_commit_specifier: std::option::Option<std::string::String>,
pub(crate) source_commit_specifier: std::option::Option<std::string::String>,
pub(crate) merge_option: std::option::Option<crate::model::MergeOptionTypeEnum>,
pub(crate) conflict_detail_level:
std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
pub(crate) max_conflict_files: std::option::Option<i32>,
pub(crate) conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn destination_commit_specifier(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.destination_commit_specifier = Some(input.into());
self
}
pub fn set_destination_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.destination_commit_specifier = input;
self
}
pub fn source_commit_specifier(mut self, input: impl Into<std::string::String>) -> Self {
self.source_commit_specifier = Some(input.into());
self
}
pub fn set_source_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.source_commit_specifier = input;
self
}
pub fn merge_option(mut self, input: crate::model::MergeOptionTypeEnum) -> Self {
self.merge_option = Some(input);
self
}
pub fn set_merge_option(
mut self,
input: std::option::Option<crate::model::MergeOptionTypeEnum>,
) -> Self {
self.merge_option = input;
self
}
pub fn conflict_detail_level(
mut self,
input: crate::model::ConflictDetailLevelTypeEnum,
) -> Self {
self.conflict_detail_level = Some(input);
self
}
pub fn set_conflict_detail_level(
mut self,
input: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
) -> Self {
self.conflict_detail_level = input;
self
}
pub fn max_conflict_files(mut self, input: i32) -> Self {
self.max_conflict_files = Some(input);
self
}
pub fn set_max_conflict_files(mut self, input: std::option::Option<i32>) -> Self {
self.max_conflict_files = input;
self
}
pub fn conflict_resolution_strategy(
mut self,
input: crate::model::ConflictResolutionStrategyTypeEnum,
) -> Self {
self.conflict_resolution_strategy = Some(input);
self
}
pub fn set_conflict_resolution_strategy(
mut self,
input: std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
) -> Self {
self.conflict_resolution_strategy = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetMergeConflictsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetMergeConflictsInput {
repository_name: self.repository_name,
destination_commit_specifier: self.destination_commit_specifier,
source_commit_specifier: self.source_commit_specifier,
merge_option: self.merge_option,
conflict_detail_level: self.conflict_detail_level,
max_conflict_files: self.max_conflict_files,
conflict_resolution_strategy: self.conflict_resolution_strategy,
next_token: self.next_token,
})
}
}
}
impl GetMergeConflictsInput {
#[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::GetMergeConflicts,
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::GetMergeConflictsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetMergeConflictsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetMergeConflicts",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_merge_conflicts(&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::GetMergeConflicts::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetMergeConflicts",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_merge_conflicts_input::Builder {
crate::input::get_merge_conflicts_input::Builder::default()
}
}
pub mod get_merge_options_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) source_commit_specifier: std::option::Option<std::string::String>,
pub(crate) destination_commit_specifier: std::option::Option<std::string::String>,
pub(crate) conflict_detail_level:
std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
pub(crate) conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn source_commit_specifier(mut self, input: impl Into<std::string::String>) -> Self {
self.source_commit_specifier = Some(input.into());
self
}
pub fn set_source_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.source_commit_specifier = input;
self
}
pub fn destination_commit_specifier(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.destination_commit_specifier = Some(input.into());
self
}
pub fn set_destination_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.destination_commit_specifier = input;
self
}
pub fn conflict_detail_level(
mut self,
input: crate::model::ConflictDetailLevelTypeEnum,
) -> Self {
self.conflict_detail_level = Some(input);
self
}
pub fn set_conflict_detail_level(
mut self,
input: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
) -> Self {
self.conflict_detail_level = input;
self
}
pub fn conflict_resolution_strategy(
mut self,
input: crate::model::ConflictResolutionStrategyTypeEnum,
) -> Self {
self.conflict_resolution_strategy = Some(input);
self
}
pub fn set_conflict_resolution_strategy(
mut self,
input: std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
) -> Self {
self.conflict_resolution_strategy = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetMergeOptionsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetMergeOptionsInput {
repository_name: self.repository_name,
source_commit_specifier: self.source_commit_specifier,
destination_commit_specifier: self.destination_commit_specifier,
conflict_detail_level: self.conflict_detail_level,
conflict_resolution_strategy: self.conflict_resolution_strategy,
})
}
}
}
impl GetMergeOptionsInput {
#[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::GetMergeOptions,
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::GetMergeOptionsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetMergeOptionsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetMergeOptions",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_merge_options(&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::GetMergeOptions::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetMergeOptions",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_merge_options_input::Builder {
crate::input::get_merge_options_input::Builder::default()
}
}
pub mod get_pull_request_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetPullRequestInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetPullRequestInput {
pull_request_id: self.pull_request_id,
})
}
}
}
impl GetPullRequestInput {
#[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::GetPullRequest,
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::GetPullRequestInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetPullRequestInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetPullRequest",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_pull_request(&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::GetPullRequest::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetPullRequest",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_pull_request_input::Builder {
crate::input::get_pull_request_input::Builder::default()
}
}
pub mod get_pull_request_approval_states_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
pub(crate) revision_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_id = input;
self
}
pub fn revision_id(mut self, input: impl Into<std::string::String>) -> Self {
self.revision_id = Some(input.into());
self
}
pub fn set_revision_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.revision_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetPullRequestApprovalStatesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetPullRequestApprovalStatesInput {
pull_request_id: self.pull_request_id,
revision_id: self.revision_id,
})
}
}
}
impl GetPullRequestApprovalStatesInput {
#[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::GetPullRequestApprovalStates,
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::GetPullRequestApprovalStatesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetPullRequestApprovalStatesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetPullRequestApprovalStates",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_pull_request_approval_states(&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::GetPullRequestApprovalStates::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetPullRequestApprovalStates",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_pull_request_approval_states_input::Builder {
crate::input::get_pull_request_approval_states_input::Builder::default()
}
}
pub mod get_pull_request_override_state_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
pub(crate) revision_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_id = input;
self
}
pub fn revision_id(mut self, input: impl Into<std::string::String>) -> Self {
self.revision_id = Some(input.into());
self
}
pub fn set_revision_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.revision_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetPullRequestOverrideStateInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetPullRequestOverrideStateInput {
pull_request_id: self.pull_request_id,
revision_id: self.revision_id,
})
}
}
}
impl GetPullRequestOverrideStateInput {
#[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::GetPullRequestOverrideState,
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::GetPullRequestOverrideStateInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetPullRequestOverrideStateInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetPullRequestOverrideState",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_pull_request_override_state(&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::GetPullRequestOverrideState::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetPullRequestOverrideState",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_pull_request_override_state_input::Builder {
crate::input::get_pull_request_override_state_input::Builder::default()
}
}
pub mod get_repository_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::GetRepositoryInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::GetRepositoryInput {
repository_name: self.repository_name,
})
}
}
}
impl GetRepositoryInput {
#[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::GetRepository,
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::GetRepositoryInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetRepositoryInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetRepository",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_repository(&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::GetRepository::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetRepository",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_repository_input::Builder {
crate::input::get_repository_input::Builder::default()
}
}
pub mod get_repository_triggers_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetRepositoryTriggersInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetRepositoryTriggersInput {
repository_name: self.repository_name,
})
}
}
}
impl GetRepositoryTriggersInput {
#[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::GetRepositoryTriggers,
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::GetRepositoryTriggersInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetRepositoryTriggersInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.GetRepositoryTriggers",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_get_repository_triggers(
&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::GetRepositoryTriggers::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetRepositoryTriggers",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_repository_triggers_input::Builder {
crate::input::get_repository_triggers_input::Builder::default()
}
}
pub mod list_approval_rule_templates_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::ListApprovalRuleTemplatesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListApprovalRuleTemplatesInput {
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl ListApprovalRuleTemplatesInput {
#[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::ListApprovalRuleTemplates,
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::ListApprovalRuleTemplatesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListApprovalRuleTemplatesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.ListApprovalRuleTemplates",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_list_approval_rule_templates(
&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::ListApprovalRuleTemplates::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListApprovalRuleTemplates",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_approval_rule_templates_input::Builder {
crate::input::list_approval_rule_templates_input::Builder::default()
}
}
pub mod list_associated_approval_rule_templates_for_repository_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_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 repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_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::ListAssociatedApprovalRuleTemplatesForRepositoryInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(
crate::input::ListAssociatedApprovalRuleTemplatesForRepositoryInput {
repository_name: self.repository_name,
next_token: self.next_token,
max_results: self.max_results,
},
)
}
}
}
impl ListAssociatedApprovalRuleTemplatesForRepositoryInput {
#[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::ListAssociatedApprovalRuleTemplatesForRepository,
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::ListAssociatedApprovalRuleTemplatesForRepositoryInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListAssociatedApprovalRuleTemplatesForRepositoryInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.ListAssociatedApprovalRuleTemplatesForRepository",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_list_associated_approval_rule_templates_for_repository(&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::ListAssociatedApprovalRuleTemplatesForRepository::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListAssociatedApprovalRuleTemplatesForRepository",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder(
) -> crate::input::list_associated_approval_rule_templates_for_repository_input::Builder {
crate::input::list_associated_approval_rule_templates_for_repository_input::Builder::default(
)
}
}
pub mod list_branches_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_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 build(
self,
) -> Result<crate::input::ListBranchesInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListBranchesInput {
repository_name: self.repository_name,
next_token: self.next_token,
})
}
}
}
impl ListBranchesInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListBranches,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListBranchesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListBranchesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.ListBranches",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_list_branches(&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::ListBranches::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListBranches",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_branches_input::Builder {
crate::input::list_branches_input::Builder::default()
}
}
pub mod list_pull_requests_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) author_arn: std::option::Option<std::string::String>,
pub(crate) pull_request_status: std::option::Option<crate::model::PullRequestStatusEnum>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn author_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.author_arn = Some(input.into());
self
}
pub fn set_author_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.author_arn = input;
self
}
pub fn pull_request_status(mut self, input: crate::model::PullRequestStatusEnum) -> Self {
self.pull_request_status = Some(input);
self
}
pub fn set_pull_request_status(
mut self,
input: std::option::Option<crate::model::PullRequestStatusEnum>,
) -> Self {
self.pull_request_status = 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::ListPullRequestsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListPullRequestsInput {
repository_name: self.repository_name,
author_arn: self.author_arn,
pull_request_status: self.pull_request_status,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl ListPullRequestsInput {
#[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::ListPullRequests,
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::ListPullRequestsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListPullRequestsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.ListPullRequests",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_list_pull_requests(&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::ListPullRequests::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListPullRequests",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_pull_requests_input::Builder {
crate::input::list_pull_requests_input::Builder::default()
}
}
pub mod list_repositories_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) sort_by: std::option::Option<crate::model::SortByEnum>,
pub(crate) order: std::option::Option<crate::model::OrderEnum>,
}
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 sort_by(mut self, input: crate::model::SortByEnum) -> Self {
self.sort_by = Some(input);
self
}
pub fn set_sort_by(mut self, input: std::option::Option<crate::model::SortByEnum>) -> Self {
self.sort_by = input;
self
}
pub fn order(mut self, input: crate::model::OrderEnum) -> Self {
self.order = Some(input);
self
}
pub fn set_order(mut self, input: std::option::Option<crate::model::OrderEnum>) -> Self {
self.order = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListRepositoriesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListRepositoriesInput {
next_token: self.next_token,
sort_by: self.sort_by,
order: self.order,
})
}
}
}
impl ListRepositoriesInput {
#[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::ListRepositories,
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::ListRepositoriesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListRepositoriesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.ListRepositories",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_list_repositories(&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::ListRepositories::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListRepositories",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_repositories_input::Builder {
crate::input::list_repositories_input::Builder::default()
}
}
pub mod list_repositories_for_approval_rule_template_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) approval_rule_template_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 approval_rule_template_name(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.approval_rule_template_name = Some(input.into());
self
}
pub fn set_approval_rule_template_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.approval_rule_template_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::ListRepositoriesForApprovalRuleTemplateInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListRepositoriesForApprovalRuleTemplateInput {
approval_rule_template_name: self.approval_rule_template_name,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl ListRepositoriesForApprovalRuleTemplateInput {
#[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::ListRepositoriesForApprovalRuleTemplate,
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::ListRepositoriesForApprovalRuleTemplateInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListRepositoriesForApprovalRuleTemplateInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.ListRepositoriesForApprovalRuleTemplate",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_list_repositories_for_approval_rule_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::ListRepositoriesForApprovalRuleTemplate::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListRepositoriesForApprovalRuleTemplate",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_repositories_for_approval_rule_template_input::Builder {
crate::input::list_repositories_for_approval_rule_template_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>,
pub(crate) next_token: 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 next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListTagsForResourceInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListTagsForResourceInput {
resource_arn: self.resource_arn,
next_token: self.next_token,
})
}
}
}
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> {
write!(output, "/").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("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.ListTagsForResource",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_list_tags_for_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::ListTagsForResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListTagsForResource",
"codecommit",
));
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 merge_branches_by_fast_forward_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) source_commit_specifier: std::option::Option<std::string::String>,
pub(crate) destination_commit_specifier: std::option::Option<std::string::String>,
pub(crate) target_branch: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn source_commit_specifier(mut self, input: impl Into<std::string::String>) -> Self {
self.source_commit_specifier = Some(input.into());
self
}
pub fn set_source_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.source_commit_specifier = input;
self
}
pub fn destination_commit_specifier(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.destination_commit_specifier = Some(input.into());
self
}
pub fn set_destination_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.destination_commit_specifier = input;
self
}
pub fn target_branch(mut self, input: impl Into<std::string::String>) -> Self {
self.target_branch = Some(input.into());
self
}
pub fn set_target_branch(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.target_branch = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::MergeBranchesByFastForwardInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::MergeBranchesByFastForwardInput {
repository_name: self.repository_name,
source_commit_specifier: self.source_commit_specifier,
destination_commit_specifier: self.destination_commit_specifier,
target_branch: self.target_branch,
})
}
}
}
impl MergeBranchesByFastForwardInput {
#[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::MergeBranchesByFastForward,
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::MergeBranchesByFastForwardInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::MergeBranchesByFastForwardInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.MergeBranchesByFastForward",
);
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_merge_branches_by_fast_forward(&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::MergeBranchesByFastForward::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"MergeBranchesByFastForward",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::merge_branches_by_fast_forward_input::Builder {
crate::input::merge_branches_by_fast_forward_input::Builder::default()
}
}
pub mod merge_branches_by_squash_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) source_commit_specifier: std::option::Option<std::string::String>,
pub(crate) destination_commit_specifier: std::option::Option<std::string::String>,
pub(crate) target_branch: std::option::Option<std::string::String>,
pub(crate) conflict_detail_level:
std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
pub(crate) conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
pub(crate) author_name: std::option::Option<std::string::String>,
pub(crate) email: std::option::Option<std::string::String>,
pub(crate) commit_message: std::option::Option<std::string::String>,
pub(crate) keep_empty_folders: std::option::Option<bool>,
pub(crate) conflict_resolution: std::option::Option<crate::model::ConflictResolution>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn source_commit_specifier(mut self, input: impl Into<std::string::String>) -> Self {
self.source_commit_specifier = Some(input.into());
self
}
pub fn set_source_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.source_commit_specifier = input;
self
}
pub fn destination_commit_specifier(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.destination_commit_specifier = Some(input.into());
self
}
pub fn set_destination_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.destination_commit_specifier = input;
self
}
pub fn target_branch(mut self, input: impl Into<std::string::String>) -> Self {
self.target_branch = Some(input.into());
self
}
pub fn set_target_branch(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.target_branch = input;
self
}
pub fn conflict_detail_level(
mut self,
input: crate::model::ConflictDetailLevelTypeEnum,
) -> Self {
self.conflict_detail_level = Some(input);
self
}
pub fn set_conflict_detail_level(
mut self,
input: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
) -> Self {
self.conflict_detail_level = input;
self
}
pub fn conflict_resolution_strategy(
mut self,
input: crate::model::ConflictResolutionStrategyTypeEnum,
) -> Self {
self.conflict_resolution_strategy = Some(input);
self
}
pub fn set_conflict_resolution_strategy(
mut self,
input: std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
) -> Self {
self.conflict_resolution_strategy = input;
self
}
pub fn author_name(mut self, input: impl Into<std::string::String>) -> Self {
self.author_name = Some(input.into());
self
}
pub fn set_author_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.author_name = input;
self
}
pub fn email(mut self, input: impl Into<std::string::String>) -> Self {
self.email = Some(input.into());
self
}
pub fn set_email(mut self, input: std::option::Option<std::string::String>) -> Self {
self.email = input;
self
}
pub fn commit_message(mut self, input: impl Into<std::string::String>) -> Self {
self.commit_message = Some(input.into());
self
}
pub fn set_commit_message(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.commit_message = input;
self
}
pub fn keep_empty_folders(mut self, input: bool) -> Self {
self.keep_empty_folders = Some(input);
self
}
pub fn set_keep_empty_folders(mut self, input: std::option::Option<bool>) -> Self {
self.keep_empty_folders = input;
self
}
pub fn conflict_resolution(mut self, input: crate::model::ConflictResolution) -> Self {
self.conflict_resolution = Some(input);
self
}
pub fn set_conflict_resolution(
mut self,
input: std::option::Option<crate::model::ConflictResolution>,
) -> Self {
self.conflict_resolution = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::MergeBranchesBySquashInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::MergeBranchesBySquashInput {
repository_name: self.repository_name,
source_commit_specifier: self.source_commit_specifier,
destination_commit_specifier: self.destination_commit_specifier,
target_branch: self.target_branch,
conflict_detail_level: self.conflict_detail_level,
conflict_resolution_strategy: self.conflict_resolution_strategy,
author_name: self.author_name,
email: self.email,
commit_message: self.commit_message,
keep_empty_folders: self.keep_empty_folders.unwrap_or_default(),
conflict_resolution: self.conflict_resolution,
})
}
}
}
impl MergeBranchesBySquashInput {
#[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::MergeBranchesBySquash,
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::MergeBranchesBySquashInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::MergeBranchesBySquashInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.MergeBranchesBySquash",
);
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_merge_branches_by_squash(
&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::MergeBranchesBySquash::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"MergeBranchesBySquash",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::merge_branches_by_squash_input::Builder {
crate::input::merge_branches_by_squash_input::Builder::default()
}
}
pub mod merge_branches_by_three_way_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) source_commit_specifier: std::option::Option<std::string::String>,
pub(crate) destination_commit_specifier: std::option::Option<std::string::String>,
pub(crate) target_branch: std::option::Option<std::string::String>,
pub(crate) conflict_detail_level:
std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
pub(crate) conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
pub(crate) author_name: std::option::Option<std::string::String>,
pub(crate) email: std::option::Option<std::string::String>,
pub(crate) commit_message: std::option::Option<std::string::String>,
pub(crate) keep_empty_folders: std::option::Option<bool>,
pub(crate) conflict_resolution: std::option::Option<crate::model::ConflictResolution>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn source_commit_specifier(mut self, input: impl Into<std::string::String>) -> Self {
self.source_commit_specifier = Some(input.into());
self
}
pub fn set_source_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.source_commit_specifier = input;
self
}
pub fn destination_commit_specifier(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.destination_commit_specifier = Some(input.into());
self
}
pub fn set_destination_commit_specifier(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.destination_commit_specifier = input;
self
}
pub fn target_branch(mut self, input: impl Into<std::string::String>) -> Self {
self.target_branch = Some(input.into());
self
}
pub fn set_target_branch(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.target_branch = input;
self
}
pub fn conflict_detail_level(
mut self,
input: crate::model::ConflictDetailLevelTypeEnum,
) -> Self {
self.conflict_detail_level = Some(input);
self
}
pub fn set_conflict_detail_level(
mut self,
input: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
) -> Self {
self.conflict_detail_level = input;
self
}
pub fn conflict_resolution_strategy(
mut self,
input: crate::model::ConflictResolutionStrategyTypeEnum,
) -> Self {
self.conflict_resolution_strategy = Some(input);
self
}
pub fn set_conflict_resolution_strategy(
mut self,
input: std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
) -> Self {
self.conflict_resolution_strategy = input;
self
}
pub fn author_name(mut self, input: impl Into<std::string::String>) -> Self {
self.author_name = Some(input.into());
self
}
pub fn set_author_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.author_name = input;
self
}
pub fn email(mut self, input: impl Into<std::string::String>) -> Self {
self.email = Some(input.into());
self
}
pub fn set_email(mut self, input: std::option::Option<std::string::String>) -> Self {
self.email = input;
self
}
pub fn commit_message(mut self, input: impl Into<std::string::String>) -> Self {
self.commit_message = Some(input.into());
self
}
pub fn set_commit_message(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.commit_message = input;
self
}
pub fn keep_empty_folders(mut self, input: bool) -> Self {
self.keep_empty_folders = Some(input);
self
}
pub fn set_keep_empty_folders(mut self, input: std::option::Option<bool>) -> Self {
self.keep_empty_folders = input;
self
}
pub fn conflict_resolution(mut self, input: crate::model::ConflictResolution) -> Self {
self.conflict_resolution = Some(input);
self
}
pub fn set_conflict_resolution(
mut self,
input: std::option::Option<crate::model::ConflictResolution>,
) -> Self {
self.conflict_resolution = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::MergeBranchesByThreeWayInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::MergeBranchesByThreeWayInput {
repository_name: self.repository_name,
source_commit_specifier: self.source_commit_specifier,
destination_commit_specifier: self.destination_commit_specifier,
target_branch: self.target_branch,
conflict_detail_level: self.conflict_detail_level,
conflict_resolution_strategy: self.conflict_resolution_strategy,
author_name: self.author_name,
email: self.email,
commit_message: self.commit_message,
keep_empty_folders: self.keep_empty_folders.unwrap_or_default(),
conflict_resolution: self.conflict_resolution,
})
}
}
}
impl MergeBranchesByThreeWayInput {
#[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::MergeBranchesByThreeWay,
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::MergeBranchesByThreeWayInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::MergeBranchesByThreeWayInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.MergeBranchesByThreeWay",
);
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_merge_branches_by_three_way(
&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::MergeBranchesByThreeWay::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"MergeBranchesByThreeWay",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::merge_branches_by_three_way_input::Builder {
crate::input::merge_branches_by_three_way_input::Builder::default()
}
}
pub mod merge_pull_request_by_fast_forward_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) source_commit_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_id = input;
self
}
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn source_commit_id(mut self, input: impl Into<std::string::String>) -> Self {
self.source_commit_id = Some(input.into());
self
}
pub fn set_source_commit_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.source_commit_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::MergePullRequestByFastForwardInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::MergePullRequestByFastForwardInput {
pull_request_id: self.pull_request_id,
repository_name: self.repository_name,
source_commit_id: self.source_commit_id,
})
}
}
}
impl MergePullRequestByFastForwardInput {
#[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::MergePullRequestByFastForward,
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::MergePullRequestByFastForwardInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::MergePullRequestByFastForwardInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.MergePullRequestByFastForward",
);
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_merge_pull_request_by_fast_forward(&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::MergePullRequestByFastForward::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"MergePullRequestByFastForward",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::merge_pull_request_by_fast_forward_input::Builder {
crate::input::merge_pull_request_by_fast_forward_input::Builder::default()
}
}
pub mod merge_pull_request_by_squash_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) source_commit_id: std::option::Option<std::string::String>,
pub(crate) conflict_detail_level:
std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
pub(crate) conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
pub(crate) commit_message: std::option::Option<std::string::String>,
pub(crate) author_name: std::option::Option<std::string::String>,
pub(crate) email: std::option::Option<std::string::String>,
pub(crate) keep_empty_folders: std::option::Option<bool>,
pub(crate) conflict_resolution: std::option::Option<crate::model::ConflictResolution>,
}
impl Builder {
pub fn pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_id = input;
self
}
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn source_commit_id(mut self, input: impl Into<std::string::String>) -> Self {
self.source_commit_id = Some(input.into());
self
}
pub fn set_source_commit_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.source_commit_id = input;
self
}
pub fn conflict_detail_level(
mut self,
input: crate::model::ConflictDetailLevelTypeEnum,
) -> Self {
self.conflict_detail_level = Some(input);
self
}
pub fn set_conflict_detail_level(
mut self,
input: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
) -> Self {
self.conflict_detail_level = input;
self
}
pub fn conflict_resolution_strategy(
mut self,
input: crate::model::ConflictResolutionStrategyTypeEnum,
) -> Self {
self.conflict_resolution_strategy = Some(input);
self
}
pub fn set_conflict_resolution_strategy(
mut self,
input: std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
) -> Self {
self.conflict_resolution_strategy = input;
self
}
pub fn commit_message(mut self, input: impl Into<std::string::String>) -> Self {
self.commit_message = Some(input.into());
self
}
pub fn set_commit_message(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.commit_message = input;
self
}
pub fn author_name(mut self, input: impl Into<std::string::String>) -> Self {
self.author_name = Some(input.into());
self
}
pub fn set_author_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.author_name = input;
self
}
pub fn email(mut self, input: impl Into<std::string::String>) -> Self {
self.email = Some(input.into());
self
}
pub fn set_email(mut self, input: std::option::Option<std::string::String>) -> Self {
self.email = input;
self
}
pub fn keep_empty_folders(mut self, input: bool) -> Self {
self.keep_empty_folders = Some(input);
self
}
pub fn set_keep_empty_folders(mut self, input: std::option::Option<bool>) -> Self {
self.keep_empty_folders = input;
self
}
pub fn conflict_resolution(mut self, input: crate::model::ConflictResolution) -> Self {
self.conflict_resolution = Some(input);
self
}
pub fn set_conflict_resolution(
mut self,
input: std::option::Option<crate::model::ConflictResolution>,
) -> Self {
self.conflict_resolution = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::MergePullRequestBySquashInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::MergePullRequestBySquashInput {
pull_request_id: self.pull_request_id,
repository_name: self.repository_name,
source_commit_id: self.source_commit_id,
conflict_detail_level: self.conflict_detail_level,
conflict_resolution_strategy: self.conflict_resolution_strategy,
commit_message: self.commit_message,
author_name: self.author_name,
email: self.email,
keep_empty_folders: self.keep_empty_folders.unwrap_or_default(),
conflict_resolution: self.conflict_resolution,
})
}
}
}
impl MergePullRequestBySquashInput {
#[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::MergePullRequestBySquash,
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::MergePullRequestBySquashInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::MergePullRequestBySquashInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.MergePullRequestBySquash",
);
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_merge_pull_request_by_squash(
&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::MergePullRequestBySquash::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"MergePullRequestBySquash",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::merge_pull_request_by_squash_input::Builder {
crate::input::merge_pull_request_by_squash_input::Builder::default()
}
}
pub mod merge_pull_request_by_three_way_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) source_commit_id: std::option::Option<std::string::String>,
pub(crate) conflict_detail_level:
std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
pub(crate) conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
pub(crate) commit_message: std::option::Option<std::string::String>,
pub(crate) author_name: std::option::Option<std::string::String>,
pub(crate) email: std::option::Option<std::string::String>,
pub(crate) keep_empty_folders: std::option::Option<bool>,
pub(crate) conflict_resolution: std::option::Option<crate::model::ConflictResolution>,
}
impl Builder {
pub fn pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_id = input;
self
}
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn source_commit_id(mut self, input: impl Into<std::string::String>) -> Self {
self.source_commit_id = Some(input.into());
self
}
pub fn set_source_commit_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.source_commit_id = input;
self
}
pub fn conflict_detail_level(
mut self,
input: crate::model::ConflictDetailLevelTypeEnum,
) -> Self {
self.conflict_detail_level = Some(input);
self
}
pub fn set_conflict_detail_level(
mut self,
input: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
) -> Self {
self.conflict_detail_level = input;
self
}
pub fn conflict_resolution_strategy(
mut self,
input: crate::model::ConflictResolutionStrategyTypeEnum,
) -> Self {
self.conflict_resolution_strategy = Some(input);
self
}
pub fn set_conflict_resolution_strategy(
mut self,
input: std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
) -> Self {
self.conflict_resolution_strategy = input;
self
}
pub fn commit_message(mut self, input: impl Into<std::string::String>) -> Self {
self.commit_message = Some(input.into());
self
}
pub fn set_commit_message(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.commit_message = input;
self
}
pub fn author_name(mut self, input: impl Into<std::string::String>) -> Self {
self.author_name = Some(input.into());
self
}
pub fn set_author_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.author_name = input;
self
}
pub fn email(mut self, input: impl Into<std::string::String>) -> Self {
self.email = Some(input.into());
self
}
pub fn set_email(mut self, input: std::option::Option<std::string::String>) -> Self {
self.email = input;
self
}
pub fn keep_empty_folders(mut self, input: bool) -> Self {
self.keep_empty_folders = Some(input);
self
}
pub fn set_keep_empty_folders(mut self, input: std::option::Option<bool>) -> Self {
self.keep_empty_folders = input;
self
}
pub fn conflict_resolution(mut self, input: crate::model::ConflictResolution) -> Self {
self.conflict_resolution = Some(input);
self
}
pub fn set_conflict_resolution(
mut self,
input: std::option::Option<crate::model::ConflictResolution>,
) -> Self {
self.conflict_resolution = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::MergePullRequestByThreeWayInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::MergePullRequestByThreeWayInput {
pull_request_id: self.pull_request_id,
repository_name: self.repository_name,
source_commit_id: self.source_commit_id,
conflict_detail_level: self.conflict_detail_level,
conflict_resolution_strategy: self.conflict_resolution_strategy,
commit_message: self.commit_message,
author_name: self.author_name,
email: self.email,
keep_empty_folders: self.keep_empty_folders.unwrap_or_default(),
conflict_resolution: self.conflict_resolution,
})
}
}
}
impl MergePullRequestByThreeWayInput {
#[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::MergePullRequestByThreeWay,
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::MergePullRequestByThreeWayInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::MergePullRequestByThreeWayInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.MergePullRequestByThreeWay",
);
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_merge_pull_request_by_three_way(&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::MergePullRequestByThreeWay::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"MergePullRequestByThreeWay",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::merge_pull_request_by_three_way_input::Builder {
crate::input::merge_pull_request_by_three_way_input::Builder::default()
}
}
pub mod override_pull_request_approval_rules_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
pub(crate) revision_id: std::option::Option<std::string::String>,
pub(crate) override_status: std::option::Option<crate::model::OverrideStatus>,
}
impl Builder {
pub fn pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_id = input;
self
}
pub fn revision_id(mut self, input: impl Into<std::string::String>) -> Self {
self.revision_id = Some(input.into());
self
}
pub fn set_revision_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.revision_id = input;
self
}
pub fn override_status(mut self, input: crate::model::OverrideStatus) -> Self {
self.override_status = Some(input);
self
}
pub fn set_override_status(
mut self,
input: std::option::Option<crate::model::OverrideStatus>,
) -> Self {
self.override_status = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::OverridePullRequestApprovalRulesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::OverridePullRequestApprovalRulesInput {
pull_request_id: self.pull_request_id,
revision_id: self.revision_id,
override_status: self.override_status,
})
}
}
}
impl OverridePullRequestApprovalRulesInput {
#[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::OverridePullRequestApprovalRules,
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::OverridePullRequestApprovalRulesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::OverridePullRequestApprovalRulesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.OverridePullRequestApprovalRules",
);
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_override_pull_request_approval_rules(&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::OverridePullRequestApprovalRules::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"OverridePullRequestApprovalRules",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::override_pull_request_approval_rules_input::Builder {
crate::input::override_pull_request_approval_rules_input::Builder::default()
}
}
pub mod post_comment_for_compared_commit_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) before_commit_id: std::option::Option<std::string::String>,
pub(crate) after_commit_id: std::option::Option<std::string::String>,
pub(crate) location: std::option::Option<crate::model::Location>,
pub(crate) content: std::option::Option<std::string::String>,
pub(crate) client_request_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn before_commit_id(mut self, input: impl Into<std::string::String>) -> Self {
self.before_commit_id = Some(input.into());
self
}
pub fn set_before_commit_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.before_commit_id = input;
self
}
pub fn after_commit_id(mut self, input: impl Into<std::string::String>) -> Self {
self.after_commit_id = Some(input.into());
self
}
pub fn set_after_commit_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.after_commit_id = input;
self
}
pub fn location(mut self, input: crate::model::Location) -> Self {
self.location = Some(input);
self
}
pub fn set_location(mut self, input: std::option::Option<crate::model::Location>) -> Self {
self.location = input;
self
}
pub fn content(mut self, input: impl Into<std::string::String>) -> Self {
self.content = Some(input.into());
self
}
pub fn set_content(mut self, input: std::option::Option<std::string::String>) -> Self {
self.content = input;
self
}
pub fn client_request_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_request_token = Some(input.into());
self
}
pub fn set_client_request_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_request_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::PostCommentForComparedCommitInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::PostCommentForComparedCommitInput {
repository_name: self.repository_name,
before_commit_id: self.before_commit_id,
after_commit_id: self.after_commit_id,
location: self.location,
content: self.content,
client_request_token: self.client_request_token,
})
}
}
}
impl PostCommentForComparedCommitInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::PostCommentForComparedCommit,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
if self.client_request_token.is_none() {
self.client_request_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::PostCommentForComparedCommitInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PostCommentForComparedCommitInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.PostCommentForComparedCommit",
);
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_post_comment_for_compared_commit(&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::PostCommentForComparedCommit::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PostCommentForComparedCommit",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::post_comment_for_compared_commit_input::Builder {
crate::input::post_comment_for_compared_commit_input::Builder::default()
}
}
pub mod post_comment_for_pull_request_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) before_commit_id: std::option::Option<std::string::String>,
pub(crate) after_commit_id: std::option::Option<std::string::String>,
pub(crate) location: std::option::Option<crate::model::Location>,
pub(crate) content: std::option::Option<std::string::String>,
pub(crate) client_request_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_id = input;
self
}
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn before_commit_id(mut self, input: impl Into<std::string::String>) -> Self {
self.before_commit_id = Some(input.into());
self
}
pub fn set_before_commit_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.before_commit_id = input;
self
}
pub fn after_commit_id(mut self, input: impl Into<std::string::String>) -> Self {
self.after_commit_id = Some(input.into());
self
}
pub fn set_after_commit_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.after_commit_id = input;
self
}
pub fn location(mut self, input: crate::model::Location) -> Self {
self.location = Some(input);
self
}
pub fn set_location(mut self, input: std::option::Option<crate::model::Location>) -> Self {
self.location = input;
self
}
pub fn content(mut self, input: impl Into<std::string::String>) -> Self {
self.content = Some(input.into());
self
}
pub fn set_content(mut self, input: std::option::Option<std::string::String>) -> Self {
self.content = input;
self
}
pub fn client_request_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_request_token = Some(input.into());
self
}
pub fn set_client_request_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_request_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::PostCommentForPullRequestInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::PostCommentForPullRequestInput {
pull_request_id: self.pull_request_id,
repository_name: self.repository_name,
before_commit_id: self.before_commit_id,
after_commit_id: self.after_commit_id,
location: self.location,
content: self.content,
client_request_token: self.client_request_token,
})
}
}
}
impl PostCommentForPullRequestInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::PostCommentForPullRequest,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
if self.client_request_token.is_none() {
self.client_request_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::PostCommentForPullRequestInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PostCommentForPullRequestInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.PostCommentForPullRequest",
);
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_post_comment_for_pull_request(&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::PostCommentForPullRequest::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PostCommentForPullRequest",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::post_comment_for_pull_request_input::Builder {
crate::input::post_comment_for_pull_request_input::Builder::default()
}
}
pub mod post_comment_reply_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) in_reply_to: std::option::Option<std::string::String>,
pub(crate) client_request_token: std::option::Option<std::string::String>,
pub(crate) content: std::option::Option<std::string::String>,
}
impl Builder {
pub fn in_reply_to(mut self, input: impl Into<std::string::String>) -> Self {
self.in_reply_to = Some(input.into());
self
}
pub fn set_in_reply_to(mut self, input: std::option::Option<std::string::String>) -> Self {
self.in_reply_to = input;
self
}
pub fn client_request_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_request_token = Some(input.into());
self
}
pub fn set_client_request_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_request_token = input;
self
}
pub fn content(mut self, input: impl Into<std::string::String>) -> Self {
self.content = Some(input.into());
self
}
pub fn set_content(mut self, input: std::option::Option<std::string::String>) -> Self {
self.content = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::PostCommentReplyInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::PostCommentReplyInput {
in_reply_to: self.in_reply_to,
client_request_token: self.client_request_token,
content: self.content,
})
}
}
}
impl PostCommentReplyInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::PostCommentReply,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
if self.client_request_token.is_none() {
self.client_request_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::PostCommentReplyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PostCommentReplyInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.PostCommentReply",
);
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_post_comment_reply(&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::PostCommentReply::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PostCommentReply",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::post_comment_reply_input::Builder {
crate::input::post_comment_reply_input::Builder::default()
}
}
pub mod put_comment_reaction_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) comment_id: std::option::Option<std::string::String>,
pub(crate) reaction_value: std::option::Option<std::string::String>,
}
impl Builder {
pub fn comment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.comment_id = Some(input.into());
self
}
pub fn set_comment_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.comment_id = input;
self
}
pub fn reaction_value(mut self, input: impl Into<std::string::String>) -> Self {
self.reaction_value = Some(input.into());
self
}
pub fn set_reaction_value(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.reaction_value = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::PutCommentReactionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::PutCommentReactionInput {
comment_id: self.comment_id,
reaction_value: self.reaction_value,
})
}
}
}
impl PutCommentReactionInput {
#[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::PutCommentReaction,
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::PutCommentReactionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PutCommentReactionInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.PutCommentReaction",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_put_comment_reaction(&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::PutCommentReaction::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PutCommentReaction",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::put_comment_reaction_input::Builder {
crate::input::put_comment_reaction_input::Builder::default()
}
}
pub mod put_file_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) branch_name: std::option::Option<std::string::String>,
pub(crate) file_content: std::option::Option<aws_smithy_types::Blob>,
pub(crate) file_path: std::option::Option<std::string::String>,
pub(crate) file_mode: std::option::Option<crate::model::FileModeTypeEnum>,
pub(crate) parent_commit_id: std::option::Option<std::string::String>,
pub(crate) commit_message: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) email: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.branch_name = Some(input.into());
self
}
pub fn set_branch_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.branch_name = input;
self
}
pub fn file_content(mut self, input: aws_smithy_types::Blob) -> Self {
self.file_content = Some(input);
self
}
pub fn set_file_content(
mut self,
input: std::option::Option<aws_smithy_types::Blob>,
) -> Self {
self.file_content = input;
self
}
pub fn file_path(mut self, input: impl Into<std::string::String>) -> Self {
self.file_path = Some(input.into());
self
}
pub fn set_file_path(mut self, input: std::option::Option<std::string::String>) -> Self {
self.file_path = input;
self
}
pub fn file_mode(mut self, input: crate::model::FileModeTypeEnum) -> Self {
self.file_mode = Some(input);
self
}
pub fn set_file_mode(
mut self,
input: std::option::Option<crate::model::FileModeTypeEnum>,
) -> Self {
self.file_mode = input;
self
}
pub fn parent_commit_id(mut self, input: impl Into<std::string::String>) -> Self {
self.parent_commit_id = Some(input.into());
self
}
pub fn set_parent_commit_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.parent_commit_id = input;
self
}
pub fn commit_message(mut self, input: impl Into<std::string::String>) -> Self {
self.commit_message = Some(input.into());
self
}
pub fn set_commit_message(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.commit_message = input;
self
}
pub fn 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 email(mut self, input: impl Into<std::string::String>) -> Self {
self.email = Some(input.into());
self
}
pub fn set_email(mut self, input: std::option::Option<std::string::String>) -> Self {
self.email = input;
self
}
pub fn build(
self,
) -> Result<crate::input::PutFileInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::PutFileInput {
repository_name: self.repository_name,
branch_name: self.branch_name,
file_content: self.file_content,
file_path: self.file_path,
file_mode: self.file_mode,
parent_commit_id: self.parent_commit_id,
commit_message: self.commit_message,
name: self.name,
email: self.email,
})
}
}
}
impl PutFileInput {
#[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::PutFile,
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::PutFileInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PutFileInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.PutFile",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_put_file(&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::PutFile::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PutFile",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::put_file_input::Builder {
crate::input::put_file_input::Builder::default()
}
}
pub mod put_repository_triggers_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) triggers: std::option::Option<std::vec::Vec<crate::model::RepositoryTrigger>>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn triggers(mut self, input: crate::model::RepositoryTrigger) -> Self {
let mut v = self.triggers.unwrap_or_default();
v.push(input);
self.triggers = Some(v);
self
}
pub fn set_triggers(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::RepositoryTrigger>>,
) -> Self {
self.triggers = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::PutRepositoryTriggersInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::PutRepositoryTriggersInput {
repository_name: self.repository_name,
triggers: self.triggers,
})
}
}
}
impl PutRepositoryTriggersInput {
#[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::PutRepositoryTriggers,
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::PutRepositoryTriggersInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PutRepositoryTriggersInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.PutRepositoryTriggers",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_put_repository_triggers(
&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::PutRepositoryTriggers::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PutRepositoryTriggers",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::put_repository_triggers_input::Builder {
crate::input::put_repository_triggers_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> {
write!(output, "/").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/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.TagResource",
);
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",
"codecommit",
));
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 test_repository_triggers_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) triggers: std::option::Option<std::vec::Vec<crate::model::RepositoryTrigger>>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn triggers(mut self, input: crate::model::RepositoryTrigger) -> Self {
let mut v = self.triggers.unwrap_or_default();
v.push(input);
self.triggers = Some(v);
self
}
pub fn set_triggers(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::RepositoryTrigger>>,
) -> Self {
self.triggers = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::TestRepositoryTriggersInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::TestRepositoryTriggersInput {
repository_name: self.repository_name,
triggers: self.triggers,
})
}
}
}
impl TestRepositoryTriggersInput {
#[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::TestRepositoryTriggers,
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::TestRepositoryTriggersInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::TestRepositoryTriggersInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.TestRepositoryTriggers",
);
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_test_repository_triggers(
&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::TestRepositoryTriggers::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"TestRepositoryTriggers",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::test_repository_triggers_input::Builder {
crate::input::test_repository_triggers_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> {
write!(output, "/").expect("formatting should succeed");
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)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.UntagResource",
);
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_untag_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::UntagResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UntagResource",
"codecommit",
));
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_approval_rule_template_content_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) approval_rule_template_name: std::option::Option<std::string::String>,
pub(crate) new_rule_content: std::option::Option<std::string::String>,
pub(crate) existing_rule_content_sha256: std::option::Option<std::string::String>,
}
impl Builder {
pub fn approval_rule_template_name(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.approval_rule_template_name = Some(input.into());
self
}
pub fn set_approval_rule_template_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.approval_rule_template_name = input;
self
}
pub fn new_rule_content(mut self, input: impl Into<std::string::String>) -> Self {
self.new_rule_content = Some(input.into());
self
}
pub fn set_new_rule_content(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.new_rule_content = input;
self
}
pub fn existing_rule_content_sha256(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.existing_rule_content_sha256 = Some(input.into());
self
}
pub fn set_existing_rule_content_sha256(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.existing_rule_content_sha256 = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateApprovalRuleTemplateContentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateApprovalRuleTemplateContentInput {
approval_rule_template_name: self.approval_rule_template_name,
new_rule_content: self.new_rule_content,
existing_rule_content_sha256: self.existing_rule_content_sha256,
})
}
}
}
impl UpdateApprovalRuleTemplateContentInput {
#[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::UpdateApprovalRuleTemplateContent,
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::UpdateApprovalRuleTemplateContentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateApprovalRuleTemplateContentInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.UpdateApprovalRuleTemplateContent",
);
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_approval_rule_template_content(&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::UpdateApprovalRuleTemplateContent::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateApprovalRuleTemplateContent",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_approval_rule_template_content_input::Builder {
crate::input::update_approval_rule_template_content_input::Builder::default()
}
}
pub mod update_approval_rule_template_description_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) approval_rule_template_name: std::option::Option<std::string::String>,
pub(crate) approval_rule_template_description: std::option::Option<std::string::String>,
}
impl Builder {
pub fn approval_rule_template_name(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.approval_rule_template_name = Some(input.into());
self
}
pub fn set_approval_rule_template_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.approval_rule_template_name = input;
self
}
pub fn approval_rule_template_description(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.approval_rule_template_description = Some(input.into());
self
}
pub fn set_approval_rule_template_description(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.approval_rule_template_description = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateApprovalRuleTemplateDescriptionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateApprovalRuleTemplateDescriptionInput {
approval_rule_template_name: self.approval_rule_template_name,
approval_rule_template_description: self.approval_rule_template_description,
})
}
}
}
impl UpdateApprovalRuleTemplateDescriptionInput {
#[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::UpdateApprovalRuleTemplateDescription,
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::UpdateApprovalRuleTemplateDescriptionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateApprovalRuleTemplateDescriptionInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.UpdateApprovalRuleTemplateDescription",
);
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_approval_rule_template_description(&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::UpdateApprovalRuleTemplateDescription::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateApprovalRuleTemplateDescription",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_approval_rule_template_description_input::Builder {
crate::input::update_approval_rule_template_description_input::Builder::default()
}
}
pub mod update_approval_rule_template_name_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) old_approval_rule_template_name: std::option::Option<std::string::String>,
pub(crate) new_approval_rule_template_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn old_approval_rule_template_name(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.old_approval_rule_template_name = Some(input.into());
self
}
pub fn set_old_approval_rule_template_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.old_approval_rule_template_name = input;
self
}
pub fn new_approval_rule_template_name(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.new_approval_rule_template_name = Some(input.into());
self
}
pub fn set_new_approval_rule_template_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.new_approval_rule_template_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateApprovalRuleTemplateNameInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateApprovalRuleTemplateNameInput {
old_approval_rule_template_name: self.old_approval_rule_template_name,
new_approval_rule_template_name: self.new_approval_rule_template_name,
})
}
}
}
impl UpdateApprovalRuleTemplateNameInput {
#[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::UpdateApprovalRuleTemplateName,
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::UpdateApprovalRuleTemplateNameInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateApprovalRuleTemplateNameInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.UpdateApprovalRuleTemplateName",
);
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_approval_rule_template_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::UpdateApprovalRuleTemplateName::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateApprovalRuleTemplateName",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_approval_rule_template_name_input::Builder {
crate::input::update_approval_rule_template_name_input::Builder::default()
}
}
pub mod update_comment_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) comment_id: std::option::Option<std::string::String>,
pub(crate) content: std::option::Option<std::string::String>,
}
impl Builder {
pub fn comment_id(mut self, input: impl Into<std::string::String>) -> Self {
self.comment_id = Some(input.into());
self
}
pub fn set_comment_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.comment_id = input;
self
}
pub fn content(mut self, input: impl Into<std::string::String>) -> Self {
self.content = Some(input.into());
self
}
pub fn set_content(mut self, input: std::option::Option<std::string::String>) -> Self {
self.content = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateCommentInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateCommentInput {
comment_id: self.comment_id,
content: self.content,
})
}
}
}
impl UpdateCommentInput {
#[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::UpdateComment,
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::UpdateCommentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateCommentInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.UpdateComment",
);
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_comment(&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::UpdateComment::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateComment",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_comment_input::Builder {
crate::input::update_comment_input::Builder::default()
}
}
pub mod update_default_branch_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) default_branch_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn default_branch_name(mut self, input: impl Into<std::string::String>) -> Self {
self.default_branch_name = Some(input.into());
self
}
pub fn set_default_branch_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.default_branch_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateDefaultBranchInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateDefaultBranchInput {
repository_name: self.repository_name,
default_branch_name: self.default_branch_name,
})
}
}
}
impl UpdateDefaultBranchInput {
#[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::UpdateDefaultBranch,
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::UpdateDefaultBranchInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateDefaultBranchInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.UpdateDefaultBranch",
);
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_default_branch(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateDefaultBranch::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateDefaultBranch",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_default_branch_input::Builder {
crate::input::update_default_branch_input::Builder::default()
}
}
pub mod update_pull_request_approval_rule_content_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
pub(crate) approval_rule_name: std::option::Option<std::string::String>,
pub(crate) existing_rule_content_sha256: std::option::Option<std::string::String>,
pub(crate) new_rule_content: std::option::Option<std::string::String>,
}
impl Builder {
pub fn pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_id = input;
self
}
pub fn approval_rule_name(mut self, input: impl Into<std::string::String>) -> Self {
self.approval_rule_name = Some(input.into());
self
}
pub fn set_approval_rule_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.approval_rule_name = input;
self
}
pub fn existing_rule_content_sha256(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.existing_rule_content_sha256 = Some(input.into());
self
}
pub fn set_existing_rule_content_sha256(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.existing_rule_content_sha256 = input;
self
}
pub fn new_rule_content(mut self, input: impl Into<std::string::String>) -> Self {
self.new_rule_content = Some(input.into());
self
}
pub fn set_new_rule_content(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.new_rule_content = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdatePullRequestApprovalRuleContentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdatePullRequestApprovalRuleContentInput {
pull_request_id: self.pull_request_id,
approval_rule_name: self.approval_rule_name,
existing_rule_content_sha256: self.existing_rule_content_sha256,
new_rule_content: self.new_rule_content,
})
}
}
}
impl UpdatePullRequestApprovalRuleContentInput {
#[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::UpdatePullRequestApprovalRuleContent,
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::UpdatePullRequestApprovalRuleContentInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdatePullRequestApprovalRuleContentInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.UpdatePullRequestApprovalRuleContent",
);
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_pull_request_approval_rule_content(&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::UpdatePullRequestApprovalRuleContent::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdatePullRequestApprovalRuleContent",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_pull_request_approval_rule_content_input::Builder {
crate::input::update_pull_request_approval_rule_content_input::Builder::default()
}
}
pub mod update_pull_request_approval_state_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
pub(crate) revision_id: std::option::Option<std::string::String>,
pub(crate) approval_state: std::option::Option<crate::model::ApprovalState>,
}
impl Builder {
pub fn pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_id = input;
self
}
pub fn revision_id(mut self, input: impl Into<std::string::String>) -> Self {
self.revision_id = Some(input.into());
self
}
pub fn set_revision_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.revision_id = input;
self
}
pub fn approval_state(mut self, input: crate::model::ApprovalState) -> Self {
self.approval_state = Some(input);
self
}
pub fn set_approval_state(
mut self,
input: std::option::Option<crate::model::ApprovalState>,
) -> Self {
self.approval_state = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdatePullRequestApprovalStateInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdatePullRequestApprovalStateInput {
pull_request_id: self.pull_request_id,
revision_id: self.revision_id,
approval_state: self.approval_state,
})
}
}
}
impl UpdatePullRequestApprovalStateInput {
#[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::UpdatePullRequestApprovalState,
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::UpdatePullRequestApprovalStateInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdatePullRequestApprovalStateInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.UpdatePullRequestApprovalState",
);
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_pull_request_approval_state(&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::UpdatePullRequestApprovalState::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdatePullRequestApprovalState",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_pull_request_approval_state_input::Builder {
crate::input::update_pull_request_approval_state_input::Builder::default()
}
}
pub mod update_pull_request_description_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
}
impl Builder {
pub fn pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_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 build(
self,
) -> Result<
crate::input::UpdatePullRequestDescriptionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdatePullRequestDescriptionInput {
pull_request_id: self.pull_request_id,
description: self.description,
})
}
}
}
impl UpdatePullRequestDescriptionInput {
#[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::UpdatePullRequestDescription,
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::UpdatePullRequestDescriptionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdatePullRequestDescriptionInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.UpdatePullRequestDescription",
);
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_pull_request_description(&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::UpdatePullRequestDescription::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdatePullRequestDescription",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_pull_request_description_input::Builder {
crate::input::update_pull_request_description_input::Builder::default()
}
}
pub mod update_pull_request_status_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
pub(crate) pull_request_status: std::option::Option<crate::model::PullRequestStatusEnum>,
}
impl Builder {
pub fn pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_id = input;
self
}
pub fn pull_request_status(mut self, input: crate::model::PullRequestStatusEnum) -> Self {
self.pull_request_status = Some(input);
self
}
pub fn set_pull_request_status(
mut self,
input: std::option::Option<crate::model::PullRequestStatusEnum>,
) -> Self {
self.pull_request_status = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdatePullRequestStatusInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdatePullRequestStatusInput {
pull_request_id: self.pull_request_id,
pull_request_status: self.pull_request_status,
})
}
}
}
impl UpdatePullRequestStatusInput {
#[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::UpdatePullRequestStatus,
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::UpdatePullRequestStatusInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdatePullRequestStatusInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.UpdatePullRequestStatus",
);
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_pull_request_status(
&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::UpdatePullRequestStatus::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdatePullRequestStatus",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_pull_request_status_input::Builder {
crate::input::update_pull_request_status_input::Builder::default()
}
}
pub mod update_pull_request_title_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pull_request_id: std::option::Option<std::string::String>,
pub(crate) title: std::option::Option<std::string::String>,
}
impl Builder {
pub fn pull_request_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pull_request_id = Some(input.into());
self
}
pub fn set_pull_request_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.pull_request_id = input;
self
}
pub fn title(mut self, input: impl Into<std::string::String>) -> Self {
self.title = Some(input.into());
self
}
pub fn set_title(mut self, input: std::option::Option<std::string::String>) -> Self {
self.title = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdatePullRequestTitleInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdatePullRequestTitleInput {
pull_request_id: self.pull_request_id,
title: self.title,
})
}
}
}
impl UpdatePullRequestTitleInput {
#[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::UpdatePullRequestTitle,
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::UpdatePullRequestTitleInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdatePullRequestTitleInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.UpdatePullRequestTitle",
);
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_pull_request_title(
&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::UpdatePullRequestTitle::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdatePullRequestTitle",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_pull_request_title_input::Builder {
crate::input::update_pull_request_title_input::Builder::default()
}
}
pub mod update_repository_description_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) repository_name: std::option::Option<std::string::String>,
pub(crate) repository_description: std::option::Option<std::string::String>,
}
impl Builder {
pub fn repository_name(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_name = Some(input.into());
self
}
pub fn set_repository_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_name = input;
self
}
pub fn repository_description(mut self, input: impl Into<std::string::String>) -> Self {
self.repository_description = Some(input.into());
self
}
pub fn set_repository_description(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.repository_description = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateRepositoryDescriptionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateRepositoryDescriptionInput {
repository_name: self.repository_name,
repository_description: self.repository_description,
})
}
}
}
impl UpdateRepositoryDescriptionInput {
#[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::UpdateRepositoryDescription,
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::UpdateRepositoryDescriptionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateRepositoryDescriptionInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.UpdateRepositoryDescription",
);
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_repository_description(&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::UpdateRepositoryDescription::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateRepositoryDescription",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_repository_description_input::Builder {
crate::input::update_repository_description_input::Builder::default()
}
}
pub mod update_repository_name_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) old_name: std::option::Option<std::string::String>,
pub(crate) new_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn old_name(mut self, input: impl Into<std::string::String>) -> Self {
self.old_name = Some(input.into());
self
}
pub fn set_old_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.old_name = input;
self
}
pub fn new_name(mut self, input: impl Into<std::string::String>) -> Self {
self.new_name = Some(input.into());
self
}
pub fn set_new_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.new_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateRepositoryNameInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateRepositoryNameInput {
old_name: self.old_name,
new_name: self.new_name,
})
}
}
}
impl UpdateRepositoryNameInput {
#[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::UpdateRepositoryName,
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::UpdateRepositoryNameInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateRepositoryNameInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"CodeCommit_20150413.UpdateRepositoryName",
);
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_repository_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::UpdateRepositoryName::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateRepositoryName",
"codecommit",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_repository_name_input::Builder {
crate::input::update_repository_name_input::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateRepositoryNameInput {
#[doc(hidden)]
pub old_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub new_name: std::option::Option<std::string::String>,
}
impl UpdateRepositoryNameInput {
pub fn old_name(&self) -> std::option::Option<&str> {
self.old_name.as_deref()
}
pub fn new_name(&self) -> std::option::Option<&str> {
self.new_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateRepositoryDescriptionInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub repository_description: std::option::Option<std::string::String>,
}
impl UpdateRepositoryDescriptionInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn repository_description(&self) -> std::option::Option<&str> {
self.repository_description.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdatePullRequestTitleInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub title: std::option::Option<std::string::String>,
}
impl UpdatePullRequestTitleInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.as_deref()
}
pub fn title(&self) -> std::option::Option<&str> {
self.title.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdatePullRequestStatusInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub pull_request_status: std::option::Option<crate::model::PullRequestStatusEnum>,
}
impl UpdatePullRequestStatusInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.as_deref()
}
pub fn pull_request_status(&self) -> std::option::Option<&crate::model::PullRequestStatusEnum> {
self.pull_request_status.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdatePullRequestDescriptionInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
}
impl UpdatePullRequestDescriptionInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.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 UpdatePullRequestApprovalStateInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub revision_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub approval_state: std::option::Option<crate::model::ApprovalState>,
}
impl UpdatePullRequestApprovalStateInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.as_deref()
}
pub fn revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
pub fn approval_state(&self) -> std::option::Option<&crate::model::ApprovalState> {
self.approval_state.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdatePullRequestApprovalRuleContentInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub approval_rule_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub existing_rule_content_sha256: std::option::Option<std::string::String>,
#[doc(hidden)]
pub new_rule_content: std::option::Option<std::string::String>,
}
impl UpdatePullRequestApprovalRuleContentInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.as_deref()
}
pub fn approval_rule_name(&self) -> std::option::Option<&str> {
self.approval_rule_name.as_deref()
}
pub fn existing_rule_content_sha256(&self) -> std::option::Option<&str> {
self.existing_rule_content_sha256.as_deref()
}
pub fn new_rule_content(&self) -> std::option::Option<&str> {
self.new_rule_content.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateDefaultBranchInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub default_branch_name: std::option::Option<std::string::String>,
}
impl UpdateDefaultBranchInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn default_branch_name(&self) -> std::option::Option<&str> {
self.default_branch_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateCommentInput {
#[doc(hidden)]
pub comment_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub content: std::option::Option<std::string::String>,
}
impl UpdateCommentInput {
pub fn comment_id(&self) -> std::option::Option<&str> {
self.comment_id.as_deref()
}
pub fn content(&self) -> std::option::Option<&str> {
self.content.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateApprovalRuleTemplateNameInput {
#[doc(hidden)]
pub old_approval_rule_template_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub new_approval_rule_template_name: std::option::Option<std::string::String>,
}
impl UpdateApprovalRuleTemplateNameInput {
pub fn old_approval_rule_template_name(&self) -> std::option::Option<&str> {
self.old_approval_rule_template_name.as_deref()
}
pub fn new_approval_rule_template_name(&self) -> std::option::Option<&str> {
self.new_approval_rule_template_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateApprovalRuleTemplateDescriptionInput {
#[doc(hidden)]
pub approval_rule_template_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub approval_rule_template_description: std::option::Option<std::string::String>,
}
impl UpdateApprovalRuleTemplateDescriptionInput {
pub fn approval_rule_template_name(&self) -> std::option::Option<&str> {
self.approval_rule_template_name.as_deref()
}
pub fn approval_rule_template_description(&self) -> std::option::Option<&str> {
self.approval_rule_template_description.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateApprovalRuleTemplateContentInput {
#[doc(hidden)]
pub approval_rule_template_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub new_rule_content: std::option::Option<std::string::String>,
#[doc(hidden)]
pub existing_rule_content_sha256: std::option::Option<std::string::String>,
}
impl UpdateApprovalRuleTemplateContentInput {
pub fn approval_rule_template_name(&self) -> std::option::Option<&str> {
self.approval_rule_template_name.as_deref()
}
pub fn new_rule_content(&self) -> std::option::Option<&str> {
self.new_rule_content.as_deref()
}
pub fn existing_rule_content_sha256(&self) -> std::option::Option<&str> {
self.existing_rule_content_sha256.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UntagResourceInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tag_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl UntagResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn tag_keys(&self) -> std::option::Option<&[std::string::String]> {
self.tag_keys.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct TestRepositoryTriggersInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub triggers: std::option::Option<std::vec::Vec<crate::model::RepositoryTrigger>>,
}
impl TestRepositoryTriggersInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn triggers(&self) -> std::option::Option<&[crate::model::RepositoryTrigger]> {
self.triggers.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()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PutRepositoryTriggersInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub triggers: std::option::Option<std::vec::Vec<crate::model::RepositoryTrigger>>,
}
impl PutRepositoryTriggersInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn triggers(&self) -> std::option::Option<&[crate::model::RepositoryTrigger]> {
self.triggers.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PutFileInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub file_content: std::option::Option<aws_smithy_types::Blob>,
#[doc(hidden)]
pub file_path: std::option::Option<std::string::String>,
#[doc(hidden)]
pub file_mode: std::option::Option<crate::model::FileModeTypeEnum>,
#[doc(hidden)]
pub parent_commit_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub commit_message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub email: std::option::Option<std::string::String>,
}
impl PutFileInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
pub fn file_content(&self) -> std::option::Option<&aws_smithy_types::Blob> {
self.file_content.as_ref()
}
pub fn file_path(&self) -> std::option::Option<&str> {
self.file_path.as_deref()
}
pub fn file_mode(&self) -> std::option::Option<&crate::model::FileModeTypeEnum> {
self.file_mode.as_ref()
}
pub fn parent_commit_id(&self) -> std::option::Option<&str> {
self.parent_commit_id.as_deref()
}
pub fn commit_message(&self) -> std::option::Option<&str> {
self.commit_message.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn email(&self) -> std::option::Option<&str> {
self.email.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PutCommentReactionInput {
#[doc(hidden)]
pub comment_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub reaction_value: std::option::Option<std::string::String>,
}
impl PutCommentReactionInput {
pub fn comment_id(&self) -> std::option::Option<&str> {
self.comment_id.as_deref()
}
pub fn reaction_value(&self) -> std::option::Option<&str> {
self.reaction_value.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PostCommentReplyInput {
#[doc(hidden)]
pub in_reply_to: std::option::Option<std::string::String>,
#[doc(hidden)]
pub client_request_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub content: std::option::Option<std::string::String>,
}
impl PostCommentReplyInput {
pub fn in_reply_to(&self) -> std::option::Option<&str> {
self.in_reply_to.as_deref()
}
pub fn client_request_token(&self) -> std::option::Option<&str> {
self.client_request_token.as_deref()
}
pub fn content(&self) -> std::option::Option<&str> {
self.content.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PostCommentForPullRequestInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub before_commit_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub after_commit_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub location: std::option::Option<crate::model::Location>,
#[doc(hidden)]
pub content: std::option::Option<std::string::String>,
#[doc(hidden)]
pub client_request_token: std::option::Option<std::string::String>,
}
impl PostCommentForPullRequestInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.as_deref()
}
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn before_commit_id(&self) -> std::option::Option<&str> {
self.before_commit_id.as_deref()
}
pub fn after_commit_id(&self) -> std::option::Option<&str> {
self.after_commit_id.as_deref()
}
pub fn location(&self) -> std::option::Option<&crate::model::Location> {
self.location.as_ref()
}
pub fn content(&self) -> std::option::Option<&str> {
self.content.as_deref()
}
pub fn client_request_token(&self) -> std::option::Option<&str> {
self.client_request_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PostCommentForComparedCommitInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub before_commit_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub after_commit_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub location: std::option::Option<crate::model::Location>,
#[doc(hidden)]
pub content: std::option::Option<std::string::String>,
#[doc(hidden)]
pub client_request_token: std::option::Option<std::string::String>,
}
impl PostCommentForComparedCommitInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn before_commit_id(&self) -> std::option::Option<&str> {
self.before_commit_id.as_deref()
}
pub fn after_commit_id(&self) -> std::option::Option<&str> {
self.after_commit_id.as_deref()
}
pub fn location(&self) -> std::option::Option<&crate::model::Location> {
self.location.as_ref()
}
pub fn content(&self) -> std::option::Option<&str> {
self.content.as_deref()
}
pub fn client_request_token(&self) -> std::option::Option<&str> {
self.client_request_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct OverridePullRequestApprovalRulesInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub revision_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub override_status: std::option::Option<crate::model::OverrideStatus>,
}
impl OverridePullRequestApprovalRulesInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.as_deref()
}
pub fn revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
pub fn override_status(&self) -> std::option::Option<&crate::model::OverrideStatus> {
self.override_status.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct MergePullRequestByThreeWayInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub source_commit_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub conflict_detail_level: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
#[doc(hidden)]
pub conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
#[doc(hidden)]
pub commit_message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub author_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub email: std::option::Option<std::string::String>,
#[doc(hidden)]
pub keep_empty_folders: bool,
#[doc(hidden)]
pub conflict_resolution: std::option::Option<crate::model::ConflictResolution>,
}
impl MergePullRequestByThreeWayInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.as_deref()
}
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn source_commit_id(&self) -> std::option::Option<&str> {
self.source_commit_id.as_deref()
}
pub fn conflict_detail_level(
&self,
) -> std::option::Option<&crate::model::ConflictDetailLevelTypeEnum> {
self.conflict_detail_level.as_ref()
}
pub fn conflict_resolution_strategy(
&self,
) -> std::option::Option<&crate::model::ConflictResolutionStrategyTypeEnum> {
self.conflict_resolution_strategy.as_ref()
}
pub fn commit_message(&self) -> std::option::Option<&str> {
self.commit_message.as_deref()
}
pub fn author_name(&self) -> std::option::Option<&str> {
self.author_name.as_deref()
}
pub fn email(&self) -> std::option::Option<&str> {
self.email.as_deref()
}
pub fn keep_empty_folders(&self) -> bool {
self.keep_empty_folders
}
pub fn conflict_resolution(&self) -> std::option::Option<&crate::model::ConflictResolution> {
self.conflict_resolution.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct MergePullRequestBySquashInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub source_commit_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub conflict_detail_level: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
#[doc(hidden)]
pub conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
#[doc(hidden)]
pub commit_message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub author_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub email: std::option::Option<std::string::String>,
#[doc(hidden)]
pub keep_empty_folders: bool,
#[doc(hidden)]
pub conflict_resolution: std::option::Option<crate::model::ConflictResolution>,
}
impl MergePullRequestBySquashInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.as_deref()
}
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn source_commit_id(&self) -> std::option::Option<&str> {
self.source_commit_id.as_deref()
}
pub fn conflict_detail_level(
&self,
) -> std::option::Option<&crate::model::ConflictDetailLevelTypeEnum> {
self.conflict_detail_level.as_ref()
}
pub fn conflict_resolution_strategy(
&self,
) -> std::option::Option<&crate::model::ConflictResolutionStrategyTypeEnum> {
self.conflict_resolution_strategy.as_ref()
}
pub fn commit_message(&self) -> std::option::Option<&str> {
self.commit_message.as_deref()
}
pub fn author_name(&self) -> std::option::Option<&str> {
self.author_name.as_deref()
}
pub fn email(&self) -> std::option::Option<&str> {
self.email.as_deref()
}
pub fn keep_empty_folders(&self) -> bool {
self.keep_empty_folders
}
pub fn conflict_resolution(&self) -> std::option::Option<&crate::model::ConflictResolution> {
self.conflict_resolution.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct MergePullRequestByFastForwardInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub source_commit_id: std::option::Option<std::string::String>,
}
impl MergePullRequestByFastForwardInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.as_deref()
}
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn source_commit_id(&self) -> std::option::Option<&str> {
self.source_commit_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct MergeBranchesByThreeWayInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub source_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub destination_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub target_branch: std::option::Option<std::string::String>,
#[doc(hidden)]
pub conflict_detail_level: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
#[doc(hidden)]
pub conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
#[doc(hidden)]
pub author_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub email: std::option::Option<std::string::String>,
#[doc(hidden)]
pub commit_message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub keep_empty_folders: bool,
#[doc(hidden)]
pub conflict_resolution: std::option::Option<crate::model::ConflictResolution>,
}
impl MergeBranchesByThreeWayInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn source_commit_specifier(&self) -> std::option::Option<&str> {
self.source_commit_specifier.as_deref()
}
pub fn destination_commit_specifier(&self) -> std::option::Option<&str> {
self.destination_commit_specifier.as_deref()
}
pub fn target_branch(&self) -> std::option::Option<&str> {
self.target_branch.as_deref()
}
pub fn conflict_detail_level(
&self,
) -> std::option::Option<&crate::model::ConflictDetailLevelTypeEnum> {
self.conflict_detail_level.as_ref()
}
pub fn conflict_resolution_strategy(
&self,
) -> std::option::Option<&crate::model::ConflictResolutionStrategyTypeEnum> {
self.conflict_resolution_strategy.as_ref()
}
pub fn author_name(&self) -> std::option::Option<&str> {
self.author_name.as_deref()
}
pub fn email(&self) -> std::option::Option<&str> {
self.email.as_deref()
}
pub fn commit_message(&self) -> std::option::Option<&str> {
self.commit_message.as_deref()
}
pub fn keep_empty_folders(&self) -> bool {
self.keep_empty_folders
}
pub fn conflict_resolution(&self) -> std::option::Option<&crate::model::ConflictResolution> {
self.conflict_resolution.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct MergeBranchesBySquashInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub source_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub destination_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub target_branch: std::option::Option<std::string::String>,
#[doc(hidden)]
pub conflict_detail_level: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
#[doc(hidden)]
pub conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
#[doc(hidden)]
pub author_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub email: std::option::Option<std::string::String>,
#[doc(hidden)]
pub commit_message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub keep_empty_folders: bool,
#[doc(hidden)]
pub conflict_resolution: std::option::Option<crate::model::ConflictResolution>,
}
impl MergeBranchesBySquashInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn source_commit_specifier(&self) -> std::option::Option<&str> {
self.source_commit_specifier.as_deref()
}
pub fn destination_commit_specifier(&self) -> std::option::Option<&str> {
self.destination_commit_specifier.as_deref()
}
pub fn target_branch(&self) -> std::option::Option<&str> {
self.target_branch.as_deref()
}
pub fn conflict_detail_level(
&self,
) -> std::option::Option<&crate::model::ConflictDetailLevelTypeEnum> {
self.conflict_detail_level.as_ref()
}
pub fn conflict_resolution_strategy(
&self,
) -> std::option::Option<&crate::model::ConflictResolutionStrategyTypeEnum> {
self.conflict_resolution_strategy.as_ref()
}
pub fn author_name(&self) -> std::option::Option<&str> {
self.author_name.as_deref()
}
pub fn email(&self) -> std::option::Option<&str> {
self.email.as_deref()
}
pub fn commit_message(&self) -> std::option::Option<&str> {
self.commit_message.as_deref()
}
pub fn keep_empty_folders(&self) -> bool {
self.keep_empty_folders
}
pub fn conflict_resolution(&self) -> std::option::Option<&crate::model::ConflictResolution> {
self.conflict_resolution.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct MergeBranchesByFastForwardInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub source_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub destination_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub target_branch: std::option::Option<std::string::String>,
}
impl MergeBranchesByFastForwardInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn source_commit_specifier(&self) -> std::option::Option<&str> {
self.source_commit_specifier.as_deref()
}
pub fn destination_commit_specifier(&self) -> std::option::Option<&str> {
self.destination_commit_specifier.as_deref()
}
pub fn target_branch(&self) -> std::option::Option<&str> {
self.target_branch.as_deref()
}
}
#[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>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListTagsForResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListRepositoriesForApprovalRuleTemplateInput {
#[doc(hidden)]
pub approval_rule_template_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl ListRepositoriesForApprovalRuleTemplateInput {
pub fn approval_rule_template_name(&self) -> std::option::Option<&str> {
self.approval_rule_template_name.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListRepositoriesInput {
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sort_by: std::option::Option<crate::model::SortByEnum>,
#[doc(hidden)]
pub order: std::option::Option<crate::model::OrderEnum>,
}
impl ListRepositoriesInput {
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn sort_by(&self) -> std::option::Option<&crate::model::SortByEnum> {
self.sort_by.as_ref()
}
pub fn order(&self) -> std::option::Option<&crate::model::OrderEnum> {
self.order.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListPullRequestsInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub author_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub pull_request_status: std::option::Option<crate::model::PullRequestStatusEnum>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl ListPullRequestsInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn author_arn(&self) -> std::option::Option<&str> {
self.author_arn.as_deref()
}
pub fn pull_request_status(&self) -> std::option::Option<&crate::model::PullRequestStatusEnum> {
self.pull_request_status.as_ref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListBranchesInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListBranchesInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListAssociatedApprovalRuleTemplatesForRepositoryInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl ListAssociatedApprovalRuleTemplatesForRepositoryInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListApprovalRuleTemplatesInput {
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl ListApprovalRuleTemplatesInput {
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetRepositoryTriggersInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
}
impl GetRepositoryTriggersInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetRepositoryInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
}
impl GetRepositoryInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetPullRequestOverrideStateInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub revision_id: std::option::Option<std::string::String>,
}
impl GetPullRequestOverrideStateInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.as_deref()
}
pub fn revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetPullRequestApprovalStatesInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub revision_id: std::option::Option<std::string::String>,
}
impl GetPullRequestApprovalStatesInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.as_deref()
}
pub fn revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetPullRequestInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
}
impl GetPullRequestInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetMergeOptionsInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub source_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub destination_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub conflict_detail_level: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
#[doc(hidden)]
pub conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
}
impl GetMergeOptionsInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn source_commit_specifier(&self) -> std::option::Option<&str> {
self.source_commit_specifier.as_deref()
}
pub fn destination_commit_specifier(&self) -> std::option::Option<&str> {
self.destination_commit_specifier.as_deref()
}
pub fn conflict_detail_level(
&self,
) -> std::option::Option<&crate::model::ConflictDetailLevelTypeEnum> {
self.conflict_detail_level.as_ref()
}
pub fn conflict_resolution_strategy(
&self,
) -> std::option::Option<&crate::model::ConflictResolutionStrategyTypeEnum> {
self.conflict_resolution_strategy.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetMergeConflictsInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub destination_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub source_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub merge_option: std::option::Option<crate::model::MergeOptionTypeEnum>,
#[doc(hidden)]
pub conflict_detail_level: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
#[doc(hidden)]
pub max_conflict_files: std::option::Option<i32>,
#[doc(hidden)]
pub conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl GetMergeConflictsInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn destination_commit_specifier(&self) -> std::option::Option<&str> {
self.destination_commit_specifier.as_deref()
}
pub fn source_commit_specifier(&self) -> std::option::Option<&str> {
self.source_commit_specifier.as_deref()
}
pub fn merge_option(&self) -> std::option::Option<&crate::model::MergeOptionTypeEnum> {
self.merge_option.as_ref()
}
pub fn conflict_detail_level(
&self,
) -> std::option::Option<&crate::model::ConflictDetailLevelTypeEnum> {
self.conflict_detail_level.as_ref()
}
pub fn max_conflict_files(&self) -> std::option::Option<i32> {
self.max_conflict_files
}
pub fn conflict_resolution_strategy(
&self,
) -> std::option::Option<&crate::model::ConflictResolutionStrategyTypeEnum> {
self.conflict_resolution_strategy.as_ref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetMergeCommitInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub source_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub destination_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub conflict_detail_level: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
#[doc(hidden)]
pub conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
}
impl GetMergeCommitInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn source_commit_specifier(&self) -> std::option::Option<&str> {
self.source_commit_specifier.as_deref()
}
pub fn destination_commit_specifier(&self) -> std::option::Option<&str> {
self.destination_commit_specifier.as_deref()
}
pub fn conflict_detail_level(
&self,
) -> std::option::Option<&crate::model::ConflictDetailLevelTypeEnum> {
self.conflict_detail_level.as_ref()
}
pub fn conflict_resolution_strategy(
&self,
) -> std::option::Option<&crate::model::ConflictResolutionStrategyTypeEnum> {
self.conflict_resolution_strategy.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetFolderInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub folder_path: std::option::Option<std::string::String>,
}
impl GetFolderInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn commit_specifier(&self) -> std::option::Option<&str> {
self.commit_specifier.as_deref()
}
pub fn folder_path(&self) -> std::option::Option<&str> {
self.folder_path.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetFileInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub file_path: std::option::Option<std::string::String>,
}
impl GetFileInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn commit_specifier(&self) -> std::option::Option<&str> {
self.commit_specifier.as_deref()
}
pub fn file_path(&self) -> std::option::Option<&str> {
self.file_path.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetDifferencesInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub before_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub after_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub before_path: std::option::Option<std::string::String>,
#[doc(hidden)]
pub after_path: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl GetDifferencesInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn before_commit_specifier(&self) -> std::option::Option<&str> {
self.before_commit_specifier.as_deref()
}
pub fn after_commit_specifier(&self) -> std::option::Option<&str> {
self.after_commit_specifier.as_deref()
}
pub fn before_path(&self) -> std::option::Option<&str> {
self.before_path.as_deref()
}
pub fn after_path(&self) -> std::option::Option<&str> {
self.after_path.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetCommitInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub commit_id: std::option::Option<std::string::String>,
}
impl GetCommitInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn commit_id(&self) -> std::option::Option<&str> {
self.commit_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetCommentsForPullRequestInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub before_commit_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub after_commit_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl GetCommentsForPullRequestInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.as_deref()
}
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn before_commit_id(&self) -> std::option::Option<&str> {
self.before_commit_id.as_deref()
}
pub fn after_commit_id(&self) -> std::option::Option<&str> {
self.after_commit_id.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetCommentsForComparedCommitInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub before_commit_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub after_commit_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl GetCommentsForComparedCommitInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn before_commit_id(&self) -> std::option::Option<&str> {
self.before_commit_id.as_deref()
}
pub fn after_commit_id(&self) -> std::option::Option<&str> {
self.after_commit_id.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetCommentReactionsInput {
#[doc(hidden)]
pub comment_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub reaction_user_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl GetCommentReactionsInput {
pub fn comment_id(&self) -> std::option::Option<&str> {
self.comment_id.as_deref()
}
pub fn reaction_user_arn(&self) -> std::option::Option<&str> {
self.reaction_user_arn.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetCommentInput {
#[doc(hidden)]
pub comment_id: std::option::Option<std::string::String>,
}
impl GetCommentInput {
pub fn comment_id(&self) -> std::option::Option<&str> {
self.comment_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetBranchInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
}
impl GetBranchInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetBlobInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub blob_id: std::option::Option<std::string::String>,
}
impl GetBlobInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn blob_id(&self) -> std::option::Option<&str> {
self.blob_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetApprovalRuleTemplateInput {
#[doc(hidden)]
pub approval_rule_template_name: std::option::Option<std::string::String>,
}
impl GetApprovalRuleTemplateInput {
pub fn approval_rule_template_name(&self) -> std::option::Option<&str> {
self.approval_rule_template_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct EvaluatePullRequestApprovalRulesInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub revision_id: std::option::Option<std::string::String>,
}
impl EvaluatePullRequestApprovalRulesInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.as_deref()
}
pub fn revision_id(&self) -> std::option::Option<&str> {
self.revision_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DisassociateApprovalRuleTemplateFromRepositoryInput {
#[doc(hidden)]
pub approval_rule_template_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
}
impl DisassociateApprovalRuleTemplateFromRepositoryInput {
pub fn approval_rule_template_name(&self) -> std::option::Option<&str> {
self.approval_rule_template_name.as_deref()
}
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribePullRequestEventsInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub pull_request_event_type: std::option::Option<crate::model::PullRequestEventType>,
#[doc(hidden)]
pub actor_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl DescribePullRequestEventsInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.as_deref()
}
pub fn pull_request_event_type(
&self,
) -> std::option::Option<&crate::model::PullRequestEventType> {
self.pull_request_event_type.as_ref()
}
pub fn actor_arn(&self) -> std::option::Option<&str> {
self.actor_arn.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeMergeConflictsInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub destination_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub source_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub merge_option: std::option::Option<crate::model::MergeOptionTypeEnum>,
#[doc(hidden)]
pub max_merge_hunks: std::option::Option<i32>,
#[doc(hidden)]
pub file_path: std::option::Option<std::string::String>,
#[doc(hidden)]
pub conflict_detail_level: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
#[doc(hidden)]
pub conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl DescribeMergeConflictsInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn destination_commit_specifier(&self) -> std::option::Option<&str> {
self.destination_commit_specifier.as_deref()
}
pub fn source_commit_specifier(&self) -> std::option::Option<&str> {
self.source_commit_specifier.as_deref()
}
pub fn merge_option(&self) -> std::option::Option<&crate::model::MergeOptionTypeEnum> {
self.merge_option.as_ref()
}
pub fn max_merge_hunks(&self) -> std::option::Option<i32> {
self.max_merge_hunks
}
pub fn file_path(&self) -> std::option::Option<&str> {
self.file_path.as_deref()
}
pub fn conflict_detail_level(
&self,
) -> std::option::Option<&crate::model::ConflictDetailLevelTypeEnum> {
self.conflict_detail_level.as_ref()
}
pub fn conflict_resolution_strategy(
&self,
) -> std::option::Option<&crate::model::ConflictResolutionStrategyTypeEnum> {
self.conflict_resolution_strategy.as_ref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteRepositoryInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
}
impl DeleteRepositoryInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeletePullRequestApprovalRuleInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub approval_rule_name: std::option::Option<std::string::String>,
}
impl DeletePullRequestApprovalRuleInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.as_deref()
}
pub fn approval_rule_name(&self) -> std::option::Option<&str> {
self.approval_rule_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteFileInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub file_path: std::option::Option<std::string::String>,
#[doc(hidden)]
pub parent_commit_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub keep_empty_folders: bool,
#[doc(hidden)]
pub commit_message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub email: std::option::Option<std::string::String>,
}
impl DeleteFileInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
pub fn file_path(&self) -> std::option::Option<&str> {
self.file_path.as_deref()
}
pub fn parent_commit_id(&self) -> std::option::Option<&str> {
self.parent_commit_id.as_deref()
}
pub fn keep_empty_folders(&self) -> bool {
self.keep_empty_folders
}
pub fn commit_message(&self) -> std::option::Option<&str> {
self.commit_message.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn email(&self) -> std::option::Option<&str> {
self.email.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteCommentContentInput {
#[doc(hidden)]
pub comment_id: std::option::Option<std::string::String>,
}
impl DeleteCommentContentInput {
pub fn comment_id(&self) -> std::option::Option<&str> {
self.comment_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteBranchInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
}
impl DeleteBranchInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteApprovalRuleTemplateInput {
#[doc(hidden)]
pub approval_rule_template_name: std::option::Option<std::string::String>,
}
impl DeleteApprovalRuleTemplateInput {
pub fn approval_rule_template_name(&self) -> std::option::Option<&str> {
self.approval_rule_template_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateUnreferencedMergeCommitInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub source_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub destination_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub merge_option: std::option::Option<crate::model::MergeOptionTypeEnum>,
#[doc(hidden)]
pub conflict_detail_level: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
#[doc(hidden)]
pub conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
#[doc(hidden)]
pub author_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub email: std::option::Option<std::string::String>,
#[doc(hidden)]
pub commit_message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub keep_empty_folders: bool,
#[doc(hidden)]
pub conflict_resolution: std::option::Option<crate::model::ConflictResolution>,
}
impl CreateUnreferencedMergeCommitInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn source_commit_specifier(&self) -> std::option::Option<&str> {
self.source_commit_specifier.as_deref()
}
pub fn destination_commit_specifier(&self) -> std::option::Option<&str> {
self.destination_commit_specifier.as_deref()
}
pub fn merge_option(&self) -> std::option::Option<&crate::model::MergeOptionTypeEnum> {
self.merge_option.as_ref()
}
pub fn conflict_detail_level(
&self,
) -> std::option::Option<&crate::model::ConflictDetailLevelTypeEnum> {
self.conflict_detail_level.as_ref()
}
pub fn conflict_resolution_strategy(
&self,
) -> std::option::Option<&crate::model::ConflictResolutionStrategyTypeEnum> {
self.conflict_resolution_strategy.as_ref()
}
pub fn author_name(&self) -> std::option::Option<&str> {
self.author_name.as_deref()
}
pub fn email(&self) -> std::option::Option<&str> {
self.email.as_deref()
}
pub fn commit_message(&self) -> std::option::Option<&str> {
self.commit_message.as_deref()
}
pub fn keep_empty_folders(&self) -> bool {
self.keep_empty_folders
}
pub fn conflict_resolution(&self) -> std::option::Option<&crate::model::ConflictResolution> {
self.conflict_resolution.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateRepositoryInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub repository_description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl CreateRepositoryInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn repository_description(&self) -> std::option::Option<&str> {
self.repository_description.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 CreatePullRequestApprovalRuleInput {
#[doc(hidden)]
pub pull_request_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub approval_rule_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub approval_rule_content: std::option::Option<std::string::String>,
}
impl CreatePullRequestApprovalRuleInput {
pub fn pull_request_id(&self) -> std::option::Option<&str> {
self.pull_request_id.as_deref()
}
pub fn approval_rule_name(&self) -> std::option::Option<&str> {
self.approval_rule_name.as_deref()
}
pub fn approval_rule_content(&self) -> std::option::Option<&str> {
self.approval_rule_content.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreatePullRequestInput {
#[doc(hidden)]
pub title: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub targets: std::option::Option<std::vec::Vec<crate::model::Target>>,
#[doc(hidden)]
pub client_request_token: std::option::Option<std::string::String>,
}
impl CreatePullRequestInput {
pub fn title(&self) -> std::option::Option<&str> {
self.title.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn targets(&self) -> std::option::Option<&[crate::model::Target]> {
self.targets.as_deref()
}
pub fn client_request_token(&self) -> std::option::Option<&str> {
self.client_request_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateCommitInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub parent_commit_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub author_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub email: std::option::Option<std::string::String>,
#[doc(hidden)]
pub commit_message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub keep_empty_folders: bool,
#[doc(hidden)]
pub put_files: std::option::Option<std::vec::Vec<crate::model::PutFileEntry>>,
#[doc(hidden)]
pub delete_files: std::option::Option<std::vec::Vec<crate::model::DeleteFileEntry>>,
#[doc(hidden)]
pub set_file_modes: std::option::Option<std::vec::Vec<crate::model::SetFileModeEntry>>,
}
impl CreateCommitInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
pub fn parent_commit_id(&self) -> std::option::Option<&str> {
self.parent_commit_id.as_deref()
}
pub fn author_name(&self) -> std::option::Option<&str> {
self.author_name.as_deref()
}
pub fn email(&self) -> std::option::Option<&str> {
self.email.as_deref()
}
pub fn commit_message(&self) -> std::option::Option<&str> {
self.commit_message.as_deref()
}
pub fn keep_empty_folders(&self) -> bool {
self.keep_empty_folders
}
pub fn put_files(&self) -> std::option::Option<&[crate::model::PutFileEntry]> {
self.put_files.as_deref()
}
pub fn delete_files(&self) -> std::option::Option<&[crate::model::DeleteFileEntry]> {
self.delete_files.as_deref()
}
pub fn set_file_modes(&self) -> std::option::Option<&[crate::model::SetFileModeEntry]> {
self.set_file_modes.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateBranchInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub branch_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub commit_id: std::option::Option<std::string::String>,
}
impl CreateBranchInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn branch_name(&self) -> std::option::Option<&str> {
self.branch_name.as_deref()
}
pub fn commit_id(&self) -> std::option::Option<&str> {
self.commit_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateApprovalRuleTemplateInput {
#[doc(hidden)]
pub approval_rule_template_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub approval_rule_template_content: std::option::Option<std::string::String>,
#[doc(hidden)]
pub approval_rule_template_description: std::option::Option<std::string::String>,
}
impl CreateApprovalRuleTemplateInput {
pub fn approval_rule_template_name(&self) -> std::option::Option<&str> {
self.approval_rule_template_name.as_deref()
}
pub fn approval_rule_template_content(&self) -> std::option::Option<&str> {
self.approval_rule_template_content.as_deref()
}
pub fn approval_rule_template_description(&self) -> std::option::Option<&str> {
self.approval_rule_template_description.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct BatchGetRepositoriesInput {
#[doc(hidden)]
pub repository_names: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl BatchGetRepositoriesInput {
pub fn repository_names(&self) -> std::option::Option<&[std::string::String]> {
self.repository_names.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct BatchGetCommitsInput {
#[doc(hidden)]
pub commit_ids: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
}
impl BatchGetCommitsInput {
pub fn commit_ids(&self) -> std::option::Option<&[std::string::String]> {
self.commit_ids.as_deref()
}
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct BatchDisassociateApprovalRuleTemplateFromRepositoriesInput {
#[doc(hidden)]
pub approval_rule_template_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub repository_names: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl BatchDisassociateApprovalRuleTemplateFromRepositoriesInput {
pub fn approval_rule_template_name(&self) -> std::option::Option<&str> {
self.approval_rule_template_name.as_deref()
}
pub fn repository_names(&self) -> std::option::Option<&[std::string::String]> {
self.repository_names.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct BatchDescribeMergeConflictsInput {
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub destination_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub source_commit_specifier: std::option::Option<std::string::String>,
#[doc(hidden)]
pub merge_option: std::option::Option<crate::model::MergeOptionTypeEnum>,
#[doc(hidden)]
pub max_merge_hunks: std::option::Option<i32>,
#[doc(hidden)]
pub max_conflict_files: std::option::Option<i32>,
#[doc(hidden)]
pub file_paths: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub conflict_detail_level: std::option::Option<crate::model::ConflictDetailLevelTypeEnum>,
#[doc(hidden)]
pub conflict_resolution_strategy:
std::option::Option<crate::model::ConflictResolutionStrategyTypeEnum>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl BatchDescribeMergeConflictsInput {
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
pub fn destination_commit_specifier(&self) -> std::option::Option<&str> {
self.destination_commit_specifier.as_deref()
}
pub fn source_commit_specifier(&self) -> std::option::Option<&str> {
self.source_commit_specifier.as_deref()
}
pub fn merge_option(&self) -> std::option::Option<&crate::model::MergeOptionTypeEnum> {
self.merge_option.as_ref()
}
pub fn max_merge_hunks(&self) -> std::option::Option<i32> {
self.max_merge_hunks
}
pub fn max_conflict_files(&self) -> std::option::Option<i32> {
self.max_conflict_files
}
pub fn file_paths(&self) -> std::option::Option<&[std::string::String]> {
self.file_paths.as_deref()
}
pub fn conflict_detail_level(
&self,
) -> std::option::Option<&crate::model::ConflictDetailLevelTypeEnum> {
self.conflict_detail_level.as_ref()
}
pub fn conflict_resolution_strategy(
&self,
) -> std::option::Option<&crate::model::ConflictResolutionStrategyTypeEnum> {
self.conflict_resolution_strategy.as_ref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct BatchAssociateApprovalRuleTemplateWithRepositoriesInput {
#[doc(hidden)]
pub approval_rule_template_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub repository_names: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl BatchAssociateApprovalRuleTemplateWithRepositoriesInput {
pub fn approval_rule_template_name(&self) -> std::option::Option<&str> {
self.approval_rule_template_name.as_deref()
}
pub fn repository_names(&self) -> std::option::Option<&[std::string::String]> {
self.repository_names.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AssociateApprovalRuleTemplateWithRepositoryInput {
#[doc(hidden)]
pub approval_rule_template_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub repository_name: std::option::Option<std::string::String>,
}
impl AssociateApprovalRuleTemplateWithRepositoryInput {
pub fn approval_rule_template_name(&self) -> std::option::Option<&str> {
self.approval_rule_template_name.as_deref()
}
pub fn repository_name(&self) -> std::option::Option<&str> {
self.repository_name.as_deref()
}
}