1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct MergeBranchesBySquash;
6impl MergeBranchesBySquash {
7 pub fn new() -> Self {
9 Self
10 }
11 pub(crate) async fn orchestrate(
12 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
13 input: crate::operation::merge_branches_by_squash::MergeBranchesBySquashInput,
14 ) -> ::std::result::Result<
15 crate::operation::merge_branches_by_squash::MergeBranchesBySquashOutput,
16 ::aws_smithy_runtime_api::client::result::SdkError<
17 crate::operation::merge_branches_by_squash::MergeBranchesBySquashError,
18 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
19 >,
20 > {
21 let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
22 ::aws_smithy_runtime_api::client::interceptors::context::Error,
23 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
24 >| {
25 err.map_service_error(|err| {
26 err.downcast::<crate::operation::merge_branches_by_squash::MergeBranchesBySquashError>()
27 .expect("correct error type")
28 })
29 };
30 let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
31 .await
32 .map_err(map_err)?;
33 let output = context.finalize().map_err(map_err)?;
34 ::std::result::Result::Ok(
35 output
36 .downcast::<crate::operation::merge_branches_by_squash::MergeBranchesBySquashOutput>()
37 .expect("correct output type"),
38 )
39 }
40
41 pub(crate) async fn orchestrate_with_stop_point(
42 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
43 input: crate::operation::merge_branches_by_squash::MergeBranchesBySquashInput,
44 stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
45 ) -> ::std::result::Result<
46 ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
47 ::aws_smithy_runtime_api::client::result::SdkError<
48 ::aws_smithy_runtime_api::client::interceptors::context::Error,
49 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
50 >,
51 > {
52 let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
53 use ::tracing::Instrument;
54 ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("CodeCommit", "MergeBranchesBySquash", input, runtime_plugins, stop_point)
55 .instrument(::tracing::debug_span!(
58 "CodeCommit.MergeBranchesBySquash",
59 "rpc.service" = "CodeCommit",
60 "rpc.method" = "MergeBranchesBySquash",
61 "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
62 "rpc.system" = "aws-api",
63 ))
64 .await
65 }
66
67 pub(crate) fn operation_runtime_plugins(
68 client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
69 client_config: &crate::config::Config,
70 config_override: ::std::option::Option<crate::config::Builder>,
71 ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
72 let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
73
74 if let ::std::option::Option::Some(config_override) = config_override {
75 for plugin in config_override.runtime_plugins.iter().cloned() {
76 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
77 }
78 runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
79 config_override,
80 client_config.config.clone(),
81 &client_config.runtime_components,
82 ));
83 }
84 runtime_plugins
85 }
86}
87impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for MergeBranchesBySquash {
88 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
89 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("MergeBranchesBySquash");
90
91 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
92 MergeBranchesBySquashRequestSerializer,
93 ));
94 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
95 MergeBranchesBySquashResponseDeserializer,
96 ));
97
98 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
99 crate::config::auth::Params::builder()
100 .operation_name("MergeBranchesBySquash")
101 .build()
102 .expect("required fields set"),
103 ));
104
105 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
106 "MergeBranchesBySquash",
107 "CodeCommit",
108 ));
109 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
110 signing_options.double_uri_encode = true;
111 signing_options.content_sha256_header = false;
112 signing_options.normalize_uri_path = true;
113 signing_options.payload_override = None;
114
115 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
116 signing_options,
117 ..::std::default::Default::default()
118 });
119
120 ::std::option::Option::Some(cfg.freeze())
121 }
122
123 fn runtime_components(
124 &self,
125 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
126 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
127 #[allow(unused_mut)]
128 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("MergeBranchesBySquash")
129 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
130 MergeBranchesBySquashTelemetryInputCaptureInterceptor,
131 ))
132 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
133 ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
134 ))
135 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
136 MergeBranchesBySquashEndpointParamsInterceptor,
137 ))
138 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
139 crate::operation::merge_branches_by_squash::MergeBranchesBySquashError,
140 >::new())
141 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
142 crate::operation::merge_branches_by_squash::MergeBranchesBySquashError,
143 >::new())
144 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
145 crate::operation::merge_branches_by_squash::MergeBranchesBySquashError,
146 >::new())
147 .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
148 crate::operation::merge_branches_by_squash::MergeBranchesBySquashError,
149 >::new());
150
151 ::std::borrow::Cow::Owned(rcb)
152 }
153}
154
155#[derive(Debug)]
156struct MergeBranchesBySquashTelemetryInputCaptureInterceptor;
157
158#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
159impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MergeBranchesBySquashTelemetryInputCaptureInterceptor {
160 fn name(&self) -> &'static str {
161 "MergeBranchesBySquashTelemetryInputCaptureInterceptor"
162 }
163
164 fn read_before_execution(
165 &self,
166 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
167 '_,
168 ::aws_smithy_runtime_api::client::interceptors::context::Input,
169 ::aws_smithy_runtime_api::client::interceptors::context::Output,
170 ::aws_smithy_runtime_api::client::interceptors::context::Error,
171 >,
172 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
173 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
174 let ::std::option::Option::Some(requested) = cfg
176 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
177 .filter(|r| !r.is_empty())
178 else {
179 return ::std::result::Result::Ok(());
180 };
181
182 let ::std::option::Option::Some(input) = context.input().downcast_ref::<MergeBranchesBySquashInput>() else {
183 return ::std::result::Result::Ok(());
185 };
186
187 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
188 if requested.should_capture("repositoryName") {
189 if let ::std::option::Option::Some(value) = input.repository_name.as_deref() {
190 captured.insert("repositoryName", value);
191 }
192 }
193 if requested.should_capture("sourceCommitSpecifier") {
194 if let ::std::option::Option::Some(value) = input.source_commit_specifier.as_deref() {
195 captured.insert("sourceCommitSpecifier", value);
196 }
197 }
198 if requested.should_capture("destinationCommitSpecifier") {
199 if let ::std::option::Option::Some(value) = input.destination_commit_specifier.as_deref() {
200 captured.insert("destinationCommitSpecifier", value);
201 }
202 }
203 if requested.should_capture("targetBranch") {
204 if let ::std::option::Option::Some(value) = input.target_branch.as_deref() {
205 captured.insert("targetBranch", value);
206 }
207 }
208 if requested.should_capture("authorName") {
209 if let ::std::option::Option::Some(value) = input.author_name.as_deref() {
210 captured.insert("authorName", value);
211 }
212 }
213 if requested.should_capture("email") {
214 if let ::std::option::Option::Some(value) = input.email.as_deref() {
215 captured.insert("email", value);
216 }
217 }
218 if requested.should_capture("commitMessage") {
219 if let ::std::option::Option::Some(value) = input.commit_message.as_deref() {
220 captured.insert("commitMessage", value);
221 }
222 }
223
224 cfg.interceptor_state().store_put(captured);
225 ::std::result::Result::Ok(())
226 }
227}
228#[derive(Debug)]
229struct MergeBranchesBySquashResponseDeserializer;
230impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MergeBranchesBySquashResponseDeserializer {
231 fn deserialize_nonstreaming_with_config(
232 &self,
233 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
234 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
235 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
236 let (success, status) = (response.status().is_success(), response.status().as_u16());
237 let headers = response.headers();
238 let body = response.body().bytes().expect("body loaded");
239 #[allow(unused_mut)]
240 let mut force_error = false;
241 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
242 let parse_result = if !success && status != 200 || force_error {
243 crate::protocol_serde::shape_merge_branches_by_squash::de_merge_branches_by_squash_http_error(status, headers, body)
244 } else {
245 crate::protocol_serde::shape_merge_branches_by_squash::de_merge_branches_by_squash_http_response(status, headers, body)
246 };
247 crate::protocol_serde::type_erase_result(parse_result)
248 }
249}
250#[derive(Debug)]
251struct MergeBranchesBySquashRequestSerializer;
252impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MergeBranchesBySquashRequestSerializer {
253 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
254 fn serialize_input(
255 &self,
256 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
257 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
258 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
259 let input = input
260 .downcast::<crate::operation::merge_branches_by_squash::MergeBranchesBySquashInput>()
261 .expect("correct type");
262 let _header_serialization_settings = _cfg
263 .load::<crate::serialization_settings::HeaderSerializationSettings>()
264 .cloned()
265 .unwrap_or_default();
266 let mut request_builder = {
267 #[allow(clippy::uninlined_format_args)]
268 fn uri_base(
269 _input: &crate::operation::merge_branches_by_squash::MergeBranchesBySquashInput,
270 output: &mut ::std::string::String,
271 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
272 use ::std::fmt::Write as _;
273 ::std::write!(output, "/").expect("formatting should succeed");
274 ::std::result::Result::Ok(())
275 }
276 #[allow(clippy::unnecessary_wraps)]
277 fn update_http_builder(
278 input: &crate::operation::merge_branches_by_squash::MergeBranchesBySquashInput,
279 builder: ::http_1x::request::Builder,
280 ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
281 let mut uri = ::std::string::String::new();
282 uri_base(input, &mut uri)?;
283 ::std::result::Result::Ok(builder.method("POST").uri(uri))
284 }
285 let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
286 builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
287 builder = _header_serialization_settings.set_default_header(
288 builder,
289 ::http_1x::header::HeaderName::from_static("x-amz-target"),
290 "CodeCommit_20150413.MergeBranchesBySquash",
291 );
292 builder
293 };
294 let body = ::aws_smithy_types::body::SdkBody::from(
295 crate::protocol_serde::shape_merge_branches_by_squash::ser_merge_branches_by_squash_input(&input)?,
296 );
297 if let Some(content_length) = body.content_length() {
298 let content_length = content_length.to_string();
299 request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
300 }
301 ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
302 }
303}
304#[derive(Debug)]
305struct MergeBranchesBySquashEndpointParamsInterceptor;
306
307#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
308impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MergeBranchesBySquashEndpointParamsInterceptor {
309 fn name(&self) -> &'static str {
310 "MergeBranchesBySquashEndpointParamsInterceptor"
311 }
312
313 fn read_before_execution(
314 &self,
315 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
316 '_,
317 ::aws_smithy_runtime_api::client::interceptors::context::Input,
318 ::aws_smithy_runtime_api::client::interceptors::context::Output,
319 ::aws_smithy_runtime_api::client::interceptors::context::Error,
320 >,
321 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
322 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
323 let _input = context
324 .input()
325 .downcast_ref::<MergeBranchesBySquashInput>()
326 .ok_or("failed to downcast to MergeBranchesBySquashInput")?;
327
328 let params = crate::config::endpoint::Params::builder()
329 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
330 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
331 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
332 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
333 .build()
334 .map_err(|err| {
335 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
336 })?;
337 cfg.interceptor_state()
338 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
339 ::std::result::Result::Ok(())
340 }
341}
342
343#[non_exhaustive]
348#[derive(::std::fmt::Debug)]
349pub enum MergeBranchesBySquashError {
350 BranchDoesNotExistException(crate::types::error::BranchDoesNotExistException),
352 BranchNameIsTagNameException(crate::types::error::BranchNameIsTagNameException),
354 BranchNameRequiredException(crate::types::error::BranchNameRequiredException),
356 CommitDoesNotExistException(crate::types::error::CommitDoesNotExistException),
358 CommitMessageLengthExceededException(crate::types::error::CommitMessageLengthExceededException),
360 CommitRequiredException(crate::types::error::CommitRequiredException),
362 ConcurrentReferenceUpdateException(crate::types::error::ConcurrentReferenceUpdateException),
364 EncryptionIntegrityChecksFailedException(crate::types::error::EncryptionIntegrityChecksFailedException),
366 EncryptionKeyAccessDeniedException(crate::types::error::EncryptionKeyAccessDeniedException),
368 EncryptionKeyDisabledException(crate::types::error::EncryptionKeyDisabledException),
370 EncryptionKeyNotFoundException(crate::types::error::EncryptionKeyNotFoundException),
372 EncryptionKeyUnavailableException(crate::types::error::EncryptionKeyUnavailableException),
374 FileContentSizeLimitExceededException(crate::types::error::FileContentSizeLimitExceededException),
376 FileModeRequiredException(crate::types::error::FileModeRequiredException),
378 FolderContentSizeLimitExceededException(crate::types::error::FolderContentSizeLimitExceededException),
380 InvalidBranchNameException(crate::types::error::InvalidBranchNameException),
382 InvalidCommitException(crate::types::error::InvalidCommitException),
384 InvalidConflictDetailLevelException(crate::types::error::InvalidConflictDetailLevelException),
386 InvalidConflictResolutionException(crate::types::error::InvalidConflictResolutionException),
388 InvalidConflictResolutionStrategyException(crate::types::error::InvalidConflictResolutionStrategyException),
390 InvalidEmailException(crate::types::error::InvalidEmailException),
392 InvalidFileModeException(crate::types::error::InvalidFileModeException),
394 InvalidPathException(crate::types::error::InvalidPathException),
396 InvalidReplacementContentException(crate::types::error::InvalidReplacementContentException),
398 InvalidReplacementTypeException(crate::types::error::InvalidReplacementTypeException),
400 InvalidRepositoryNameException(crate::types::error::InvalidRepositoryNameException),
404 InvalidTargetBranchException(crate::types::error::InvalidTargetBranchException),
406 ManualMergeRequiredException(crate::types::error::ManualMergeRequiredException),
408 MaximumConflictResolutionEntriesExceededException(crate::types::error::MaximumConflictResolutionEntriesExceededException),
410 MaximumFileContentToLoadExceededException(crate::types::error::MaximumFileContentToLoadExceededException),
412 MaximumItemsToCompareExceededException(crate::types::error::MaximumItemsToCompareExceededException),
414 MultipleConflictResolutionEntriesException(crate::types::error::MultipleConflictResolutionEntriesException),
416 NameLengthExceededException(crate::types::error::NameLengthExceededException),
418 PathRequiredException(crate::types::error::PathRequiredException),
420 ReplacementContentRequiredException(crate::types::error::ReplacementContentRequiredException),
422 ReplacementTypeRequiredException(crate::types::error::ReplacementTypeRequiredException),
424 RepositoryDoesNotExistException(crate::types::error::RepositoryDoesNotExistException),
426 RepositoryNameRequiredException(crate::types::error::RepositoryNameRequiredException),
428 TipsDivergenceExceededException(crate::types::error::TipsDivergenceExceededException),
430 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
432 variable wildcard pattern and check `.code()`:
433 \
434 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
435 \
436 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-MergeBranchesBySquashError) for what information is available for the error.")]
437 Unhandled(crate::error::sealed_unhandled::Unhandled),
438}
439impl MergeBranchesBySquashError {
440 pub fn unhandled(
442 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
443 ) -> Self {
444 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
445 source: err.into(),
446 meta: ::std::default::Default::default(),
447 })
448 }
449
450 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
452 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
453 source: err.clone().into(),
454 meta: err,
455 })
456 }
457 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
462 match self {
463 Self::BranchDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
464 Self::BranchNameIsTagNameException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
465 Self::BranchNameRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
466 Self::CommitDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
467 Self::CommitMessageLengthExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
468 Self::CommitRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
469 Self::ConcurrentReferenceUpdateException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
470 Self::EncryptionIntegrityChecksFailedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
471 Self::EncryptionKeyAccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
472 Self::EncryptionKeyDisabledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
473 Self::EncryptionKeyNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
474 Self::EncryptionKeyUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
475 Self::FileContentSizeLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
476 Self::FileModeRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
477 Self::FolderContentSizeLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
478 Self::InvalidBranchNameException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
479 Self::InvalidCommitException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
480 Self::InvalidConflictDetailLevelException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
481 Self::InvalidConflictResolutionException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
482 Self::InvalidConflictResolutionStrategyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
483 Self::InvalidEmailException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
484 Self::InvalidFileModeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
485 Self::InvalidPathException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
486 Self::InvalidReplacementContentException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
487 Self::InvalidReplacementTypeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
488 Self::InvalidRepositoryNameException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
489 Self::InvalidTargetBranchException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
490 Self::ManualMergeRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
491 Self::MaximumConflictResolutionEntriesExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
492 Self::MaximumFileContentToLoadExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
493 Self::MaximumItemsToCompareExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
494 Self::MultipleConflictResolutionEntriesException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
495 Self::NameLengthExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
496 Self::PathRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
497 Self::ReplacementContentRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
498 Self::ReplacementTypeRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
499 Self::RepositoryDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
500 Self::RepositoryNameRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
501 Self::TipsDivergenceExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
502 Self::Unhandled(e) => &e.meta,
503 }
504 }
505 pub fn is_branch_does_not_exist_exception(&self) -> bool {
507 matches!(self, Self::BranchDoesNotExistException(_))
508 }
509 pub fn is_branch_name_is_tag_name_exception(&self) -> bool {
511 matches!(self, Self::BranchNameIsTagNameException(_))
512 }
513 pub fn is_branch_name_required_exception(&self) -> bool {
515 matches!(self, Self::BranchNameRequiredException(_))
516 }
517 pub fn is_commit_does_not_exist_exception(&self) -> bool {
519 matches!(self, Self::CommitDoesNotExistException(_))
520 }
521 pub fn is_commit_message_length_exceeded_exception(&self) -> bool {
523 matches!(self, Self::CommitMessageLengthExceededException(_))
524 }
525 pub fn is_commit_required_exception(&self) -> bool {
527 matches!(self, Self::CommitRequiredException(_))
528 }
529 pub fn is_concurrent_reference_update_exception(&self) -> bool {
531 matches!(self, Self::ConcurrentReferenceUpdateException(_))
532 }
533 pub fn is_encryption_integrity_checks_failed_exception(&self) -> bool {
535 matches!(self, Self::EncryptionIntegrityChecksFailedException(_))
536 }
537 pub fn is_encryption_key_access_denied_exception(&self) -> bool {
539 matches!(self, Self::EncryptionKeyAccessDeniedException(_))
540 }
541 pub fn is_encryption_key_disabled_exception(&self) -> bool {
543 matches!(self, Self::EncryptionKeyDisabledException(_))
544 }
545 pub fn is_encryption_key_not_found_exception(&self) -> bool {
547 matches!(self, Self::EncryptionKeyNotFoundException(_))
548 }
549 pub fn is_encryption_key_unavailable_exception(&self) -> bool {
551 matches!(self, Self::EncryptionKeyUnavailableException(_))
552 }
553 pub fn is_file_content_size_limit_exceeded_exception(&self) -> bool {
555 matches!(self, Self::FileContentSizeLimitExceededException(_))
556 }
557 pub fn is_file_mode_required_exception(&self) -> bool {
559 matches!(self, Self::FileModeRequiredException(_))
560 }
561 pub fn is_folder_content_size_limit_exceeded_exception(&self) -> bool {
563 matches!(self, Self::FolderContentSizeLimitExceededException(_))
564 }
565 pub fn is_invalid_branch_name_exception(&self) -> bool {
567 matches!(self, Self::InvalidBranchNameException(_))
568 }
569 pub fn is_invalid_commit_exception(&self) -> bool {
571 matches!(self, Self::InvalidCommitException(_))
572 }
573 pub fn is_invalid_conflict_detail_level_exception(&self) -> bool {
575 matches!(self, Self::InvalidConflictDetailLevelException(_))
576 }
577 pub fn is_invalid_conflict_resolution_exception(&self) -> bool {
579 matches!(self, Self::InvalidConflictResolutionException(_))
580 }
581 pub fn is_invalid_conflict_resolution_strategy_exception(&self) -> bool {
583 matches!(self, Self::InvalidConflictResolutionStrategyException(_))
584 }
585 pub fn is_invalid_email_exception(&self) -> bool {
587 matches!(self, Self::InvalidEmailException(_))
588 }
589 pub fn is_invalid_file_mode_exception(&self) -> bool {
591 matches!(self, Self::InvalidFileModeException(_))
592 }
593 pub fn is_invalid_path_exception(&self) -> bool {
595 matches!(self, Self::InvalidPathException(_))
596 }
597 pub fn is_invalid_replacement_content_exception(&self) -> bool {
599 matches!(self, Self::InvalidReplacementContentException(_))
600 }
601 pub fn is_invalid_replacement_type_exception(&self) -> bool {
603 matches!(self, Self::InvalidReplacementTypeException(_))
604 }
605 pub fn is_invalid_repository_name_exception(&self) -> bool {
607 matches!(self, Self::InvalidRepositoryNameException(_))
608 }
609 pub fn is_invalid_target_branch_exception(&self) -> bool {
611 matches!(self, Self::InvalidTargetBranchException(_))
612 }
613 pub fn is_manual_merge_required_exception(&self) -> bool {
615 matches!(self, Self::ManualMergeRequiredException(_))
616 }
617 pub fn is_maximum_conflict_resolution_entries_exceeded_exception(&self) -> bool {
619 matches!(self, Self::MaximumConflictResolutionEntriesExceededException(_))
620 }
621 pub fn is_maximum_file_content_to_load_exceeded_exception(&self) -> bool {
623 matches!(self, Self::MaximumFileContentToLoadExceededException(_))
624 }
625 pub fn is_maximum_items_to_compare_exceeded_exception(&self) -> bool {
627 matches!(self, Self::MaximumItemsToCompareExceededException(_))
628 }
629 pub fn is_multiple_conflict_resolution_entries_exception(&self) -> bool {
631 matches!(self, Self::MultipleConflictResolutionEntriesException(_))
632 }
633 pub fn is_name_length_exceeded_exception(&self) -> bool {
635 matches!(self, Self::NameLengthExceededException(_))
636 }
637 pub fn is_path_required_exception(&self) -> bool {
639 matches!(self, Self::PathRequiredException(_))
640 }
641 pub fn is_replacement_content_required_exception(&self) -> bool {
643 matches!(self, Self::ReplacementContentRequiredException(_))
644 }
645 pub fn is_replacement_type_required_exception(&self) -> bool {
647 matches!(self, Self::ReplacementTypeRequiredException(_))
648 }
649 pub fn is_repository_does_not_exist_exception(&self) -> bool {
651 matches!(self, Self::RepositoryDoesNotExistException(_))
652 }
653 pub fn is_repository_name_required_exception(&self) -> bool {
655 matches!(self, Self::RepositoryNameRequiredException(_))
656 }
657 pub fn is_tips_divergence_exceeded_exception(&self) -> bool {
659 matches!(self, Self::TipsDivergenceExceededException(_))
660 }
661}
662impl ::std::error::Error for MergeBranchesBySquashError {
663 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
664 match self {
665 Self::BranchDoesNotExistException(_inner) => ::std::option::Option::Some(_inner),
666 Self::BranchNameIsTagNameException(_inner) => ::std::option::Option::Some(_inner),
667 Self::BranchNameRequiredException(_inner) => ::std::option::Option::Some(_inner),
668 Self::CommitDoesNotExistException(_inner) => ::std::option::Option::Some(_inner),
669 Self::CommitMessageLengthExceededException(_inner) => ::std::option::Option::Some(_inner),
670 Self::CommitRequiredException(_inner) => ::std::option::Option::Some(_inner),
671 Self::ConcurrentReferenceUpdateException(_inner) => ::std::option::Option::Some(_inner),
672 Self::EncryptionIntegrityChecksFailedException(_inner) => ::std::option::Option::Some(_inner),
673 Self::EncryptionKeyAccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
674 Self::EncryptionKeyDisabledException(_inner) => ::std::option::Option::Some(_inner),
675 Self::EncryptionKeyNotFoundException(_inner) => ::std::option::Option::Some(_inner),
676 Self::EncryptionKeyUnavailableException(_inner) => ::std::option::Option::Some(_inner),
677 Self::FileContentSizeLimitExceededException(_inner) => ::std::option::Option::Some(_inner),
678 Self::FileModeRequiredException(_inner) => ::std::option::Option::Some(_inner),
679 Self::FolderContentSizeLimitExceededException(_inner) => ::std::option::Option::Some(_inner),
680 Self::InvalidBranchNameException(_inner) => ::std::option::Option::Some(_inner),
681 Self::InvalidCommitException(_inner) => ::std::option::Option::Some(_inner),
682 Self::InvalidConflictDetailLevelException(_inner) => ::std::option::Option::Some(_inner),
683 Self::InvalidConflictResolutionException(_inner) => ::std::option::Option::Some(_inner),
684 Self::InvalidConflictResolutionStrategyException(_inner) => ::std::option::Option::Some(_inner),
685 Self::InvalidEmailException(_inner) => ::std::option::Option::Some(_inner),
686 Self::InvalidFileModeException(_inner) => ::std::option::Option::Some(_inner),
687 Self::InvalidPathException(_inner) => ::std::option::Option::Some(_inner),
688 Self::InvalidReplacementContentException(_inner) => ::std::option::Option::Some(_inner),
689 Self::InvalidReplacementTypeException(_inner) => ::std::option::Option::Some(_inner),
690 Self::InvalidRepositoryNameException(_inner) => ::std::option::Option::Some(_inner),
691 Self::InvalidTargetBranchException(_inner) => ::std::option::Option::Some(_inner),
692 Self::ManualMergeRequiredException(_inner) => ::std::option::Option::Some(_inner),
693 Self::MaximumConflictResolutionEntriesExceededException(_inner) => ::std::option::Option::Some(_inner),
694 Self::MaximumFileContentToLoadExceededException(_inner) => ::std::option::Option::Some(_inner),
695 Self::MaximumItemsToCompareExceededException(_inner) => ::std::option::Option::Some(_inner),
696 Self::MultipleConflictResolutionEntriesException(_inner) => ::std::option::Option::Some(_inner),
697 Self::NameLengthExceededException(_inner) => ::std::option::Option::Some(_inner),
698 Self::PathRequiredException(_inner) => ::std::option::Option::Some(_inner),
699 Self::ReplacementContentRequiredException(_inner) => ::std::option::Option::Some(_inner),
700 Self::ReplacementTypeRequiredException(_inner) => ::std::option::Option::Some(_inner),
701 Self::RepositoryDoesNotExistException(_inner) => ::std::option::Option::Some(_inner),
702 Self::RepositoryNameRequiredException(_inner) => ::std::option::Option::Some(_inner),
703 Self::TipsDivergenceExceededException(_inner) => ::std::option::Option::Some(_inner),
704 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
705 }
706 }
707}
708impl ::std::fmt::Display for MergeBranchesBySquashError {
709 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
710 match self {
711 Self::BranchDoesNotExistException(_inner) => _inner.fmt(f),
712 Self::BranchNameIsTagNameException(_inner) => _inner.fmt(f),
713 Self::BranchNameRequiredException(_inner) => _inner.fmt(f),
714 Self::CommitDoesNotExistException(_inner) => _inner.fmt(f),
715 Self::CommitMessageLengthExceededException(_inner) => _inner.fmt(f),
716 Self::CommitRequiredException(_inner) => _inner.fmt(f),
717 Self::ConcurrentReferenceUpdateException(_inner) => _inner.fmt(f),
718 Self::EncryptionIntegrityChecksFailedException(_inner) => _inner.fmt(f),
719 Self::EncryptionKeyAccessDeniedException(_inner) => _inner.fmt(f),
720 Self::EncryptionKeyDisabledException(_inner) => _inner.fmt(f),
721 Self::EncryptionKeyNotFoundException(_inner) => _inner.fmt(f),
722 Self::EncryptionKeyUnavailableException(_inner) => _inner.fmt(f),
723 Self::FileContentSizeLimitExceededException(_inner) => _inner.fmt(f),
724 Self::FileModeRequiredException(_inner) => _inner.fmt(f),
725 Self::FolderContentSizeLimitExceededException(_inner) => _inner.fmt(f),
726 Self::InvalidBranchNameException(_inner) => _inner.fmt(f),
727 Self::InvalidCommitException(_inner) => _inner.fmt(f),
728 Self::InvalidConflictDetailLevelException(_inner) => _inner.fmt(f),
729 Self::InvalidConflictResolutionException(_inner) => _inner.fmt(f),
730 Self::InvalidConflictResolutionStrategyException(_inner) => _inner.fmt(f),
731 Self::InvalidEmailException(_inner) => _inner.fmt(f),
732 Self::InvalidFileModeException(_inner) => _inner.fmt(f),
733 Self::InvalidPathException(_inner) => _inner.fmt(f),
734 Self::InvalidReplacementContentException(_inner) => _inner.fmt(f),
735 Self::InvalidReplacementTypeException(_inner) => _inner.fmt(f),
736 Self::InvalidRepositoryNameException(_inner) => _inner.fmt(f),
737 Self::InvalidTargetBranchException(_inner) => _inner.fmt(f),
738 Self::ManualMergeRequiredException(_inner) => _inner.fmt(f),
739 Self::MaximumConflictResolutionEntriesExceededException(_inner) => _inner.fmt(f),
740 Self::MaximumFileContentToLoadExceededException(_inner) => _inner.fmt(f),
741 Self::MaximumItemsToCompareExceededException(_inner) => _inner.fmt(f),
742 Self::MultipleConflictResolutionEntriesException(_inner) => _inner.fmt(f),
743 Self::NameLengthExceededException(_inner) => _inner.fmt(f),
744 Self::PathRequiredException(_inner) => _inner.fmt(f),
745 Self::ReplacementContentRequiredException(_inner) => _inner.fmt(f),
746 Self::ReplacementTypeRequiredException(_inner) => _inner.fmt(f),
747 Self::RepositoryDoesNotExistException(_inner) => _inner.fmt(f),
748 Self::RepositoryNameRequiredException(_inner) => _inner.fmt(f),
749 Self::TipsDivergenceExceededException(_inner) => _inner.fmt(f),
750 Self::Unhandled(_inner) => {
751 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
752 write!(f, "unhandled error ({code})")
753 } else {
754 f.write_str("unhandled error")
755 }
756 }
757 }
758 }
759}
760impl ::aws_smithy_types::retry::ProvideErrorKind for MergeBranchesBySquashError {
761 fn code(&self) -> ::std::option::Option<&str> {
762 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
763 }
764 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
765 ::std::option::Option::None
766 }
767}
768impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for MergeBranchesBySquashError {
769 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
770 match self {
771 Self::BranchDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
772 Self::BranchNameIsTagNameException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
773 Self::BranchNameRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
774 Self::CommitDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
775 Self::CommitMessageLengthExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
776 Self::CommitRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
777 Self::ConcurrentReferenceUpdateException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
778 Self::EncryptionIntegrityChecksFailedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
779 Self::EncryptionKeyAccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
780 Self::EncryptionKeyDisabledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
781 Self::EncryptionKeyNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
782 Self::EncryptionKeyUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
783 Self::FileContentSizeLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
784 Self::FileModeRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
785 Self::FolderContentSizeLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
786 Self::InvalidBranchNameException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
787 Self::InvalidCommitException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
788 Self::InvalidConflictDetailLevelException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
789 Self::InvalidConflictResolutionException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
790 Self::InvalidConflictResolutionStrategyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
791 Self::InvalidEmailException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
792 Self::InvalidFileModeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
793 Self::InvalidPathException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
794 Self::InvalidReplacementContentException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
795 Self::InvalidReplacementTypeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
796 Self::InvalidRepositoryNameException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
797 Self::InvalidTargetBranchException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
798 Self::ManualMergeRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
799 Self::MaximumConflictResolutionEntriesExceededException(_inner) => {
800 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
801 }
802 Self::MaximumFileContentToLoadExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
803 Self::MaximumItemsToCompareExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
804 Self::MultipleConflictResolutionEntriesException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
805 Self::NameLengthExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
806 Self::PathRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
807 Self::ReplacementContentRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
808 Self::ReplacementTypeRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
809 Self::RepositoryDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
810 Self::RepositoryNameRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
811 Self::TipsDivergenceExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
812 Self::Unhandled(_inner) => &_inner.meta,
813 }
814 }
815}
816impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for MergeBranchesBySquashError {
817 fn create_unhandled_error(
818 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
819 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
820 ) -> Self {
821 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
822 source,
823 meta: meta.unwrap_or_default(),
824 })
825 }
826}
827impl ::aws_types::request_id::RequestId for crate::operation::merge_branches_by_squash::MergeBranchesBySquashError {
828 fn request_id(&self) -> Option<&str> {
829 self.meta().request_id()
830 }
831}
832
833pub use crate::operation::merge_branches_by_squash::_merge_branches_by_squash_input::MergeBranchesBySquashInput;
834
835pub use crate::operation::merge_branches_by_squash::_merge_branches_by_squash_output::MergeBranchesBySquashOutput;
836
837mod _merge_branches_by_squash_input;
838
839mod _merge_branches_by_squash_output;
840
841pub mod builders;