1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct PostCommentForComparedCommit;
6impl PostCommentForComparedCommit {
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::post_comment_for_compared_commit::PostCommentForComparedCommitInput,
14 ) -> ::std::result::Result<
15 crate::operation::post_comment_for_compared_commit::PostCommentForComparedCommitOutput,
16 ::aws_smithy_runtime_api::client::result::SdkError<
17 crate::operation::post_comment_for_compared_commit::PostCommentForComparedCommitError,
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::post_comment_for_compared_commit::PostCommentForComparedCommitError>()
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::post_comment_for_compared_commit::PostCommentForComparedCommitOutput>()
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::post_comment_for_compared_commit::PostCommentForComparedCommitInput,
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(
55 "CodeCommit",
56 "PostCommentForComparedCommit",
57 input,
58 runtime_plugins,
59 stop_point,
60 )
61 .instrument(::tracing::debug_span!(
64 "CodeCommit.PostCommentForComparedCommit",
65 "rpc.service" = "CodeCommit",
66 "rpc.method" = "PostCommentForComparedCommit",
67 "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
68 "rpc.system" = "aws-api",
69 ))
70 .await
71 }
72
73 pub(crate) fn operation_runtime_plugins(
74 client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
75 client_config: &crate::config::Config,
76 config_override: ::std::option::Option<crate::config::Builder>,
77 ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
78 let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
79 runtime_plugins = runtime_plugins.with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new(
80 |token_provider, input| {
81 let input: &mut crate::operation::post_comment_for_compared_commit::PostCommentForComparedCommitInput =
82 input.downcast_mut().expect("correct type");
83 if input.client_request_token.is_none() {
84 input.client_request_token = ::std::option::Option::Some(token_provider.make_idempotency_token());
85 }
86 },
87 ));
88 if let ::std::option::Option::Some(config_override) = config_override {
89 for plugin in config_override.runtime_plugins.iter().cloned() {
90 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
91 }
92 runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
93 config_override,
94 client_config.config.clone(),
95 &client_config.runtime_components,
96 ));
97 }
98 runtime_plugins
99 }
100}
101impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for PostCommentForComparedCommit {
102 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
103 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("PostCommentForComparedCommit");
104
105 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
106 PostCommentForComparedCommitRequestSerializer,
107 ));
108 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
109 PostCommentForComparedCommitResponseDeserializer,
110 ));
111
112 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
113 crate::config::auth::Params::builder()
114 .operation_name("PostCommentForComparedCommit")
115 .build()
116 .expect("required fields set"),
117 ));
118
119 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
120 "PostCommentForComparedCommit",
121 "CodeCommit",
122 ));
123 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
124 signing_options.double_uri_encode = true;
125 signing_options.content_sha256_header = false;
126 signing_options.normalize_uri_path = true;
127 signing_options.payload_override = None;
128
129 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
130 signing_options,
131 ..::std::default::Default::default()
132 });
133
134 ::std::option::Option::Some(cfg.freeze())
135 }
136
137 fn runtime_components(
138 &self,
139 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
140 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
141 #[allow(unused_mut)]
142 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("PostCommentForComparedCommit")
143 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
144 PostCommentForComparedCommitTelemetryInputCaptureInterceptor,
145 ))
146 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
147 ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
148 ))
149 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
150 PostCommentForComparedCommitEndpointParamsInterceptor,
151 ))
152 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
153 crate::operation::post_comment_for_compared_commit::PostCommentForComparedCommitError,
154 >::new())
155 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
156 crate::operation::post_comment_for_compared_commit::PostCommentForComparedCommitError,
157 >::new())
158 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
159 crate::operation::post_comment_for_compared_commit::PostCommentForComparedCommitError,
160 >::new());
161
162 ::std::borrow::Cow::Owned(rcb)
163 }
164}
165
166#[derive(Debug)]
167struct PostCommentForComparedCommitTelemetryInputCaptureInterceptor;
168
169#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
170impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PostCommentForComparedCommitTelemetryInputCaptureInterceptor {
171 fn name(&self) -> &'static str {
172 "PostCommentForComparedCommitTelemetryInputCaptureInterceptor"
173 }
174
175 fn read_before_execution(
176 &self,
177 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
178 '_,
179 ::aws_smithy_runtime_api::client::interceptors::context::Input,
180 ::aws_smithy_runtime_api::client::interceptors::context::Output,
181 ::aws_smithy_runtime_api::client::interceptors::context::Error,
182 >,
183 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
184 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
185 let ::std::option::Option::Some(requested) = cfg
187 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
188 .filter(|r| !r.is_empty())
189 else {
190 return ::std::result::Result::Ok(());
191 };
192
193 let ::std::option::Option::Some(input) = context.input().downcast_ref::<PostCommentForComparedCommitInput>() else {
194 return ::std::result::Result::Ok(());
196 };
197
198 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
199 if requested.should_capture("repositoryName") {
200 if let ::std::option::Option::Some(value) = input.repository_name.as_deref() {
201 captured.insert("repositoryName", value);
202 }
203 }
204 if requested.should_capture("beforeCommitId") {
205 if let ::std::option::Option::Some(value) = input.before_commit_id.as_deref() {
206 captured.insert("beforeCommitId", value);
207 }
208 }
209 if requested.should_capture("afterCommitId") {
210 if let ::std::option::Option::Some(value) = input.after_commit_id.as_deref() {
211 captured.insert("afterCommitId", value);
212 }
213 }
214 if requested.should_capture("content") {
215 if let ::std::option::Option::Some(value) = input.content.as_deref() {
216 captured.insert("content", value);
217 }
218 }
219 if requested.should_capture("clientRequestToken") {
220 if let ::std::option::Option::Some(value) = input.client_request_token.as_deref() {
221 captured.insert("clientRequestToken", value);
222 }
223 }
224
225 cfg.interceptor_state().store_put(captured);
226 ::std::result::Result::Ok(())
227 }
228}
229#[derive(Debug)]
230struct PostCommentForComparedCommitResponseDeserializer;
231impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for PostCommentForComparedCommitResponseDeserializer {
232 fn deserialize_nonstreaming_with_config(
233 &self,
234 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
235 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
236 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
237 let (success, status) = (response.status().is_success(), response.status().as_u16());
238 let headers = response.headers();
239 let body = response.body().bytes().expect("body loaded");
240 #[allow(unused_mut)]
241 let mut force_error = false;
242 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
243 let parse_result = if !success && status != 200 || force_error {
244 crate::protocol_serde::shape_post_comment_for_compared_commit::de_post_comment_for_compared_commit_http_error(status, headers, body)
245 } else {
246 crate::protocol_serde::shape_post_comment_for_compared_commit::de_post_comment_for_compared_commit_http_response(status, headers, body)
247 };
248 crate::protocol_serde::type_erase_result(parse_result)
249 }
250}
251#[derive(Debug)]
252struct PostCommentForComparedCommitRequestSerializer;
253impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for PostCommentForComparedCommitRequestSerializer {
254 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
255 fn serialize_input(
256 &self,
257 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
258 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
259 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
260 let input = input
261 .downcast::<crate::operation::post_comment_for_compared_commit::PostCommentForComparedCommitInput>()
262 .expect("correct type");
263 let _header_serialization_settings = _cfg
264 .load::<crate::serialization_settings::HeaderSerializationSettings>()
265 .cloned()
266 .unwrap_or_default();
267 let mut request_builder = {
268 #[allow(clippy::uninlined_format_args)]
269 fn uri_base(
270 _input: &crate::operation::post_comment_for_compared_commit::PostCommentForComparedCommitInput,
271 output: &mut ::std::string::String,
272 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
273 use ::std::fmt::Write as _;
274 ::std::write!(output, "/").expect("formatting should succeed");
275 ::std::result::Result::Ok(())
276 }
277 #[allow(clippy::unnecessary_wraps)]
278 fn update_http_builder(
279 input: &crate::operation::post_comment_for_compared_commit::PostCommentForComparedCommitInput,
280 builder: ::http_1x::request::Builder,
281 ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
282 let mut uri = ::std::string::String::new();
283 uri_base(input, &mut uri)?;
284 ::std::result::Result::Ok(builder.method("POST").uri(uri))
285 }
286 let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
287 builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
288 builder = _header_serialization_settings.set_default_header(
289 builder,
290 ::http_1x::header::HeaderName::from_static("x-amz-target"),
291 "CodeCommit_20150413.PostCommentForComparedCommit",
292 );
293 builder
294 };
295 let body = ::aws_smithy_types::body::SdkBody::from(
296 crate::protocol_serde::shape_post_comment_for_compared_commit::ser_post_comment_for_compared_commit_input(&input)?,
297 );
298 if let Some(content_length) = body.content_length() {
299 let content_length = content_length.to_string();
300 request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
301 }
302 ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
303 }
304}
305#[derive(Debug)]
306struct PostCommentForComparedCommitEndpointParamsInterceptor;
307
308#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
309impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PostCommentForComparedCommitEndpointParamsInterceptor {
310 fn name(&self) -> &'static str {
311 "PostCommentForComparedCommitEndpointParamsInterceptor"
312 }
313
314 fn read_before_execution(
315 &self,
316 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
317 '_,
318 ::aws_smithy_runtime_api::client::interceptors::context::Input,
319 ::aws_smithy_runtime_api::client::interceptors::context::Output,
320 ::aws_smithy_runtime_api::client::interceptors::context::Error,
321 >,
322 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
323 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
324 let _input = context
325 .input()
326 .downcast_ref::<PostCommentForComparedCommitInput>()
327 .ok_or("failed to downcast to PostCommentForComparedCommitInput")?;
328
329 let params = crate::config::endpoint::Params::builder()
330 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
331 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
332 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
333 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
334 .build()
335 .map_err(|err| {
336 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
337 })?;
338 cfg.interceptor_state()
339 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
340 ::std::result::Result::Ok(())
341 }
342}
343
344#[non_exhaustive]
349#[derive(::std::fmt::Debug)]
350pub enum PostCommentForComparedCommitError {
351 BeforeCommitIdAndAfterCommitIdAreSameException(crate::types::error::BeforeCommitIdAndAfterCommitIdAreSameException),
353 ClientRequestTokenRequiredException(crate::types::error::ClientRequestTokenRequiredException),
355 CommentContentRequiredException(crate::types::error::CommentContentRequiredException),
357 CommentContentSizeLimitExceededException(crate::types::error::CommentContentSizeLimitExceededException),
359 CommitDoesNotExistException(crate::types::error::CommitDoesNotExistException),
361 CommitIdRequiredException(crate::types::error::CommitIdRequiredException),
363 EncryptionIntegrityChecksFailedException(crate::types::error::EncryptionIntegrityChecksFailedException),
365 EncryptionKeyAccessDeniedException(crate::types::error::EncryptionKeyAccessDeniedException),
367 EncryptionKeyDisabledException(crate::types::error::EncryptionKeyDisabledException),
369 EncryptionKeyNotFoundException(crate::types::error::EncryptionKeyNotFoundException),
371 EncryptionKeyUnavailableException(crate::types::error::EncryptionKeyUnavailableException),
373 IdempotencyParameterMismatchException(crate::types::error::IdempotencyParameterMismatchException),
375 InvalidClientRequestTokenException(crate::types::error::InvalidClientRequestTokenException),
377 InvalidCommitIdException(crate::types::error::InvalidCommitIdException),
379 InvalidFileLocationException(crate::types::error::InvalidFileLocationException),
381 InvalidFilePositionException(crate::types::error::InvalidFilePositionException),
383 InvalidPathException(crate::types::error::InvalidPathException),
385 InvalidRelativeFileVersionEnumException(crate::types::error::InvalidRelativeFileVersionEnumException),
387 InvalidRepositoryNameException(crate::types::error::InvalidRepositoryNameException),
391 PathDoesNotExistException(crate::types::error::PathDoesNotExistException),
393 PathRequiredException(crate::types::error::PathRequiredException),
395 RepositoryDoesNotExistException(crate::types::error::RepositoryDoesNotExistException),
397 RepositoryNameRequiredException(crate::types::error::RepositoryNameRequiredException),
399 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
401 variable wildcard pattern and check `.code()`:
402 \
403 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
404 \
405 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-PostCommentForComparedCommitError) for what information is available for the error.")]
406 Unhandled(crate::error::sealed_unhandled::Unhandled),
407}
408impl PostCommentForComparedCommitError {
409 pub fn unhandled(
411 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
412 ) -> Self {
413 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
414 source: err.into(),
415 meta: ::std::default::Default::default(),
416 })
417 }
418
419 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
421 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
422 source: err.clone().into(),
423 meta: err,
424 })
425 }
426 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
431 match self {
432 Self::BeforeCommitIdAndAfterCommitIdAreSameException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
433 Self::ClientRequestTokenRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
434 Self::CommentContentRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
435 Self::CommentContentSizeLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
436 Self::CommitDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
437 Self::CommitIdRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
438 Self::EncryptionIntegrityChecksFailedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
439 Self::EncryptionKeyAccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
440 Self::EncryptionKeyDisabledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
441 Self::EncryptionKeyNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
442 Self::EncryptionKeyUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
443 Self::IdempotencyParameterMismatchException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
444 Self::InvalidClientRequestTokenException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
445 Self::InvalidCommitIdException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
446 Self::InvalidFileLocationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
447 Self::InvalidFilePositionException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
448 Self::InvalidPathException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
449 Self::InvalidRelativeFileVersionEnumException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
450 Self::InvalidRepositoryNameException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
451 Self::PathDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
452 Self::PathRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
453 Self::RepositoryDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
454 Self::RepositoryNameRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
455 Self::Unhandled(e) => &e.meta,
456 }
457 }
458 pub fn is_before_commit_id_and_after_commit_id_are_same_exception(&self) -> bool {
460 matches!(self, Self::BeforeCommitIdAndAfterCommitIdAreSameException(_))
461 }
462 pub fn is_client_request_token_required_exception(&self) -> bool {
464 matches!(self, Self::ClientRequestTokenRequiredException(_))
465 }
466 pub fn is_comment_content_required_exception(&self) -> bool {
468 matches!(self, Self::CommentContentRequiredException(_))
469 }
470 pub fn is_comment_content_size_limit_exceeded_exception(&self) -> bool {
472 matches!(self, Self::CommentContentSizeLimitExceededException(_))
473 }
474 pub fn is_commit_does_not_exist_exception(&self) -> bool {
476 matches!(self, Self::CommitDoesNotExistException(_))
477 }
478 pub fn is_commit_id_required_exception(&self) -> bool {
480 matches!(self, Self::CommitIdRequiredException(_))
481 }
482 pub fn is_encryption_integrity_checks_failed_exception(&self) -> bool {
484 matches!(self, Self::EncryptionIntegrityChecksFailedException(_))
485 }
486 pub fn is_encryption_key_access_denied_exception(&self) -> bool {
488 matches!(self, Self::EncryptionKeyAccessDeniedException(_))
489 }
490 pub fn is_encryption_key_disabled_exception(&self) -> bool {
492 matches!(self, Self::EncryptionKeyDisabledException(_))
493 }
494 pub fn is_encryption_key_not_found_exception(&self) -> bool {
496 matches!(self, Self::EncryptionKeyNotFoundException(_))
497 }
498 pub fn is_encryption_key_unavailable_exception(&self) -> bool {
500 matches!(self, Self::EncryptionKeyUnavailableException(_))
501 }
502 pub fn is_idempotency_parameter_mismatch_exception(&self) -> bool {
504 matches!(self, Self::IdempotencyParameterMismatchException(_))
505 }
506 pub fn is_invalid_client_request_token_exception(&self) -> bool {
508 matches!(self, Self::InvalidClientRequestTokenException(_))
509 }
510 pub fn is_invalid_commit_id_exception(&self) -> bool {
512 matches!(self, Self::InvalidCommitIdException(_))
513 }
514 pub fn is_invalid_file_location_exception(&self) -> bool {
516 matches!(self, Self::InvalidFileLocationException(_))
517 }
518 pub fn is_invalid_file_position_exception(&self) -> bool {
520 matches!(self, Self::InvalidFilePositionException(_))
521 }
522 pub fn is_invalid_path_exception(&self) -> bool {
524 matches!(self, Self::InvalidPathException(_))
525 }
526 pub fn is_invalid_relative_file_version_enum_exception(&self) -> bool {
528 matches!(self, Self::InvalidRelativeFileVersionEnumException(_))
529 }
530 pub fn is_invalid_repository_name_exception(&self) -> bool {
532 matches!(self, Self::InvalidRepositoryNameException(_))
533 }
534 pub fn is_path_does_not_exist_exception(&self) -> bool {
536 matches!(self, Self::PathDoesNotExistException(_))
537 }
538 pub fn is_path_required_exception(&self) -> bool {
540 matches!(self, Self::PathRequiredException(_))
541 }
542 pub fn is_repository_does_not_exist_exception(&self) -> bool {
544 matches!(self, Self::RepositoryDoesNotExistException(_))
545 }
546 pub fn is_repository_name_required_exception(&self) -> bool {
548 matches!(self, Self::RepositoryNameRequiredException(_))
549 }
550}
551impl ::std::error::Error for PostCommentForComparedCommitError {
552 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
553 match self {
554 Self::BeforeCommitIdAndAfterCommitIdAreSameException(_inner) => ::std::option::Option::Some(_inner),
555 Self::ClientRequestTokenRequiredException(_inner) => ::std::option::Option::Some(_inner),
556 Self::CommentContentRequiredException(_inner) => ::std::option::Option::Some(_inner),
557 Self::CommentContentSizeLimitExceededException(_inner) => ::std::option::Option::Some(_inner),
558 Self::CommitDoesNotExistException(_inner) => ::std::option::Option::Some(_inner),
559 Self::CommitIdRequiredException(_inner) => ::std::option::Option::Some(_inner),
560 Self::EncryptionIntegrityChecksFailedException(_inner) => ::std::option::Option::Some(_inner),
561 Self::EncryptionKeyAccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
562 Self::EncryptionKeyDisabledException(_inner) => ::std::option::Option::Some(_inner),
563 Self::EncryptionKeyNotFoundException(_inner) => ::std::option::Option::Some(_inner),
564 Self::EncryptionKeyUnavailableException(_inner) => ::std::option::Option::Some(_inner),
565 Self::IdempotencyParameterMismatchException(_inner) => ::std::option::Option::Some(_inner),
566 Self::InvalidClientRequestTokenException(_inner) => ::std::option::Option::Some(_inner),
567 Self::InvalidCommitIdException(_inner) => ::std::option::Option::Some(_inner),
568 Self::InvalidFileLocationException(_inner) => ::std::option::Option::Some(_inner),
569 Self::InvalidFilePositionException(_inner) => ::std::option::Option::Some(_inner),
570 Self::InvalidPathException(_inner) => ::std::option::Option::Some(_inner),
571 Self::InvalidRelativeFileVersionEnumException(_inner) => ::std::option::Option::Some(_inner),
572 Self::InvalidRepositoryNameException(_inner) => ::std::option::Option::Some(_inner),
573 Self::PathDoesNotExistException(_inner) => ::std::option::Option::Some(_inner),
574 Self::PathRequiredException(_inner) => ::std::option::Option::Some(_inner),
575 Self::RepositoryDoesNotExistException(_inner) => ::std::option::Option::Some(_inner),
576 Self::RepositoryNameRequiredException(_inner) => ::std::option::Option::Some(_inner),
577 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
578 }
579 }
580}
581impl ::std::fmt::Display for PostCommentForComparedCommitError {
582 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
583 match self {
584 Self::BeforeCommitIdAndAfterCommitIdAreSameException(_inner) => _inner.fmt(f),
585 Self::ClientRequestTokenRequiredException(_inner) => _inner.fmt(f),
586 Self::CommentContentRequiredException(_inner) => _inner.fmt(f),
587 Self::CommentContentSizeLimitExceededException(_inner) => _inner.fmt(f),
588 Self::CommitDoesNotExistException(_inner) => _inner.fmt(f),
589 Self::CommitIdRequiredException(_inner) => _inner.fmt(f),
590 Self::EncryptionIntegrityChecksFailedException(_inner) => _inner.fmt(f),
591 Self::EncryptionKeyAccessDeniedException(_inner) => _inner.fmt(f),
592 Self::EncryptionKeyDisabledException(_inner) => _inner.fmt(f),
593 Self::EncryptionKeyNotFoundException(_inner) => _inner.fmt(f),
594 Self::EncryptionKeyUnavailableException(_inner) => _inner.fmt(f),
595 Self::IdempotencyParameterMismatchException(_inner) => _inner.fmt(f),
596 Self::InvalidClientRequestTokenException(_inner) => _inner.fmt(f),
597 Self::InvalidCommitIdException(_inner) => _inner.fmt(f),
598 Self::InvalidFileLocationException(_inner) => _inner.fmt(f),
599 Self::InvalidFilePositionException(_inner) => _inner.fmt(f),
600 Self::InvalidPathException(_inner) => _inner.fmt(f),
601 Self::InvalidRelativeFileVersionEnumException(_inner) => _inner.fmt(f),
602 Self::InvalidRepositoryNameException(_inner) => _inner.fmt(f),
603 Self::PathDoesNotExistException(_inner) => _inner.fmt(f),
604 Self::PathRequiredException(_inner) => _inner.fmt(f),
605 Self::RepositoryDoesNotExistException(_inner) => _inner.fmt(f),
606 Self::RepositoryNameRequiredException(_inner) => _inner.fmt(f),
607 Self::Unhandled(_inner) => {
608 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
609 write!(f, "unhandled error ({code})")
610 } else {
611 f.write_str("unhandled error")
612 }
613 }
614 }
615 }
616}
617impl ::aws_smithy_types::retry::ProvideErrorKind for PostCommentForComparedCommitError {
618 fn code(&self) -> ::std::option::Option<&str> {
619 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
620 }
621 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
622 ::std::option::Option::None
623 }
624}
625impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for PostCommentForComparedCommitError {
626 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
627 match self {
628 Self::BeforeCommitIdAndAfterCommitIdAreSameException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
629 Self::ClientRequestTokenRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
630 Self::CommentContentRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
631 Self::CommentContentSizeLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
632 Self::CommitDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
633 Self::CommitIdRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
634 Self::EncryptionIntegrityChecksFailedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
635 Self::EncryptionKeyAccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
636 Self::EncryptionKeyDisabledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
637 Self::EncryptionKeyNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
638 Self::EncryptionKeyUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
639 Self::IdempotencyParameterMismatchException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
640 Self::InvalidClientRequestTokenException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
641 Self::InvalidCommitIdException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
642 Self::InvalidFileLocationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
643 Self::InvalidFilePositionException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
644 Self::InvalidPathException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
645 Self::InvalidRelativeFileVersionEnumException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
646 Self::InvalidRepositoryNameException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
647 Self::PathDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
648 Self::PathRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
649 Self::RepositoryDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
650 Self::RepositoryNameRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
651 Self::Unhandled(_inner) => &_inner.meta,
652 }
653 }
654}
655impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for PostCommentForComparedCommitError {
656 fn create_unhandled_error(
657 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
658 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
659 ) -> Self {
660 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
661 source,
662 meta: meta.unwrap_or_default(),
663 })
664 }
665}
666impl ::aws_types::request_id::RequestId for crate::operation::post_comment_for_compared_commit::PostCommentForComparedCommitError {
667 fn request_id(&self) -> Option<&str> {
668 self.meta().request_id()
669 }
670}
671
672pub use crate::operation::post_comment_for_compared_commit::_post_comment_for_compared_commit_input::PostCommentForComparedCommitInput;
673
674pub use crate::operation::post_comment_for_compared_commit::_post_comment_for_compared_commit_output::PostCommentForComparedCommitOutput;
675
676mod _post_comment_for_compared_commit_input;
677
678mod _post_comment_for_compared_commit_output;
679
680pub mod builders;