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 .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
162 crate::operation::post_comment_for_compared_commit::PostCommentForComparedCommitError,
163 >::new());
164
165 ::std::borrow::Cow::Owned(rcb)
166 }
167}
168
169#[derive(Debug)]
170struct PostCommentForComparedCommitTelemetryInputCaptureInterceptor;
171
172#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
173impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PostCommentForComparedCommitTelemetryInputCaptureInterceptor {
174 fn name(&self) -> &'static str {
175 "PostCommentForComparedCommitTelemetryInputCaptureInterceptor"
176 }
177
178 fn read_before_execution(
179 &self,
180 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
181 '_,
182 ::aws_smithy_runtime_api::client::interceptors::context::Input,
183 ::aws_smithy_runtime_api::client::interceptors::context::Output,
184 ::aws_smithy_runtime_api::client::interceptors::context::Error,
185 >,
186 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
187 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
188 let ::std::option::Option::Some(requested) = cfg
190 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
191 .filter(|r| !r.is_empty())
192 else {
193 return ::std::result::Result::Ok(());
194 };
195
196 let ::std::option::Option::Some(input) = context.input().downcast_ref::<PostCommentForComparedCommitInput>() else {
197 return ::std::result::Result::Ok(());
199 };
200
201 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
202 if requested.should_capture("repositoryName") {
203 if let ::std::option::Option::Some(value) = input.repository_name.as_deref() {
204 captured.insert("repositoryName", value);
205 }
206 }
207 if requested.should_capture("beforeCommitId") {
208 if let ::std::option::Option::Some(value) = input.before_commit_id.as_deref() {
209 captured.insert("beforeCommitId", value);
210 }
211 }
212 if requested.should_capture("afterCommitId") {
213 if let ::std::option::Option::Some(value) = input.after_commit_id.as_deref() {
214 captured.insert("afterCommitId", value);
215 }
216 }
217 if requested.should_capture("content") {
218 if let ::std::option::Option::Some(value) = input.content.as_deref() {
219 captured.insert("content", value);
220 }
221 }
222 if requested.should_capture("clientRequestToken") {
223 if let ::std::option::Option::Some(value) = input.client_request_token.as_deref() {
224 captured.insert("clientRequestToken", value);
225 }
226 }
227
228 cfg.interceptor_state().store_put(captured);
229 ::std::result::Result::Ok(())
230 }
231}
232#[derive(Debug)]
233struct PostCommentForComparedCommitResponseDeserializer;
234impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for PostCommentForComparedCommitResponseDeserializer {
235 fn deserialize_nonstreaming_with_config(
236 &self,
237 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
238 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
239 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
240 let (success, status) = (response.status().is_success(), response.status().as_u16());
241 let headers = response.headers();
242 let body = response.body().bytes().expect("body loaded");
243 #[allow(unused_mut)]
244 let mut force_error = false;
245 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
246 let parse_result = if !success && status != 200 || force_error {
247 crate::protocol_serde::shape_post_comment_for_compared_commit::de_post_comment_for_compared_commit_http_error(status, headers, body)
248 } else {
249 crate::protocol_serde::shape_post_comment_for_compared_commit::de_post_comment_for_compared_commit_http_response(status, headers, body)
250 };
251 crate::protocol_serde::type_erase_result(parse_result)
252 }
253}
254#[derive(Debug)]
255struct PostCommentForComparedCommitRequestSerializer;
256impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for PostCommentForComparedCommitRequestSerializer {
257 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
258 fn serialize_input(
259 &self,
260 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
261 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
262 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
263 let input = input
264 .downcast::<crate::operation::post_comment_for_compared_commit::PostCommentForComparedCommitInput>()
265 .expect("correct type");
266 let _header_serialization_settings = _cfg
267 .load::<crate::serialization_settings::HeaderSerializationSettings>()
268 .cloned()
269 .unwrap_or_default();
270 let mut request_builder = {
271 #[allow(clippy::uninlined_format_args)]
272 fn uri_base(
273 _input: &crate::operation::post_comment_for_compared_commit::PostCommentForComparedCommitInput,
274 output: &mut ::std::string::String,
275 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
276 use ::std::fmt::Write as _;
277 ::std::write!(output, "/").expect("formatting should succeed");
278 ::std::result::Result::Ok(())
279 }
280 #[allow(clippy::unnecessary_wraps)]
281 fn update_http_builder(
282 input: &crate::operation::post_comment_for_compared_commit::PostCommentForComparedCommitInput,
283 builder: ::http_1x::request::Builder,
284 ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
285 let mut uri = ::std::string::String::new();
286 uri_base(input, &mut uri)?;
287 ::std::result::Result::Ok(builder.method("POST").uri(uri))
288 }
289 let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
290 builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
291 builder = _header_serialization_settings.set_default_header(
292 builder,
293 ::http_1x::header::HeaderName::from_static("x-amz-target"),
294 "CodeCommit_20150413.PostCommentForComparedCommit",
295 );
296 builder
297 };
298 let body = ::aws_smithy_types::body::SdkBody::from(
299 crate::protocol_serde::shape_post_comment_for_compared_commit::ser_post_comment_for_compared_commit_input(&input)?,
300 );
301 if let Some(content_length) = body.content_length() {
302 let content_length = content_length.to_string();
303 request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
304 }
305 ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
306 }
307}
308#[derive(Debug)]
309struct PostCommentForComparedCommitEndpointParamsInterceptor;
310
311#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
312impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PostCommentForComparedCommitEndpointParamsInterceptor {
313 fn name(&self) -> &'static str {
314 "PostCommentForComparedCommitEndpointParamsInterceptor"
315 }
316
317 fn read_before_execution(
318 &self,
319 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
320 '_,
321 ::aws_smithy_runtime_api::client::interceptors::context::Input,
322 ::aws_smithy_runtime_api::client::interceptors::context::Output,
323 ::aws_smithy_runtime_api::client::interceptors::context::Error,
324 >,
325 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
326 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
327 let _input = context
328 .input()
329 .downcast_ref::<PostCommentForComparedCommitInput>()
330 .ok_or("failed to downcast to PostCommentForComparedCommitInput")?;
331
332 let params = crate::config::endpoint::Params::builder()
333 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
334 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
335 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
336 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
337 .build()
338 .map_err(|err| {
339 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
340 })?;
341 cfg.interceptor_state()
342 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
343 ::std::result::Result::Ok(())
344 }
345}
346
347#[non_exhaustive]
352#[derive(::std::fmt::Debug)]
353pub enum PostCommentForComparedCommitError {
354 BeforeCommitIdAndAfterCommitIdAreSameException(crate::types::error::BeforeCommitIdAndAfterCommitIdAreSameException),
356 ClientRequestTokenRequiredException(crate::types::error::ClientRequestTokenRequiredException),
358 CommentContentRequiredException(crate::types::error::CommentContentRequiredException),
360 CommentContentSizeLimitExceededException(crate::types::error::CommentContentSizeLimitExceededException),
362 CommitDoesNotExistException(crate::types::error::CommitDoesNotExistException),
364 CommitIdRequiredException(crate::types::error::CommitIdRequiredException),
366 EncryptionIntegrityChecksFailedException(crate::types::error::EncryptionIntegrityChecksFailedException),
368 EncryptionKeyAccessDeniedException(crate::types::error::EncryptionKeyAccessDeniedException),
370 EncryptionKeyDisabledException(crate::types::error::EncryptionKeyDisabledException),
372 EncryptionKeyNotFoundException(crate::types::error::EncryptionKeyNotFoundException),
374 EncryptionKeyUnavailableException(crate::types::error::EncryptionKeyUnavailableException),
376 IdempotencyParameterMismatchException(crate::types::error::IdempotencyParameterMismatchException),
378 InvalidClientRequestTokenException(crate::types::error::InvalidClientRequestTokenException),
380 InvalidCommitIdException(crate::types::error::InvalidCommitIdException),
382 InvalidFileLocationException(crate::types::error::InvalidFileLocationException),
384 InvalidFilePositionException(crate::types::error::InvalidFilePositionException),
386 InvalidPathException(crate::types::error::InvalidPathException),
388 InvalidRelativeFileVersionEnumException(crate::types::error::InvalidRelativeFileVersionEnumException),
390 InvalidRepositoryNameException(crate::types::error::InvalidRepositoryNameException),
394 PathDoesNotExistException(crate::types::error::PathDoesNotExistException),
396 PathRequiredException(crate::types::error::PathRequiredException),
398 RepositoryDoesNotExistException(crate::types::error::RepositoryDoesNotExistException),
400 RepositoryNameRequiredException(crate::types::error::RepositoryNameRequiredException),
402 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
404 variable wildcard pattern and check `.code()`:
405 \
406 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
407 \
408 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-PostCommentForComparedCommitError) for what information is available for the error.")]
409 Unhandled(crate::error::sealed_unhandled::Unhandled),
410}
411impl PostCommentForComparedCommitError {
412 pub fn unhandled(
414 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
415 ) -> Self {
416 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
417 source: err.into(),
418 meta: ::std::default::Default::default(),
419 })
420 }
421
422 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
424 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
425 source: err.clone().into(),
426 meta: err,
427 })
428 }
429 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
434 match self {
435 Self::BeforeCommitIdAndAfterCommitIdAreSameException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
436 Self::ClientRequestTokenRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
437 Self::CommentContentRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
438 Self::CommentContentSizeLimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
439 Self::CommitDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
440 Self::CommitIdRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
441 Self::EncryptionIntegrityChecksFailedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
442 Self::EncryptionKeyAccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
443 Self::EncryptionKeyDisabledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
444 Self::EncryptionKeyNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
445 Self::EncryptionKeyUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
446 Self::IdempotencyParameterMismatchException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
447 Self::InvalidClientRequestTokenException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
448 Self::InvalidCommitIdException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
449 Self::InvalidFileLocationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
450 Self::InvalidFilePositionException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
451 Self::InvalidPathException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
452 Self::InvalidRelativeFileVersionEnumException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
453 Self::InvalidRepositoryNameException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
454 Self::PathDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
455 Self::PathRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
456 Self::RepositoryDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
457 Self::RepositoryNameRequiredException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
458 Self::Unhandled(e) => &e.meta,
459 }
460 }
461 pub fn is_before_commit_id_and_after_commit_id_are_same_exception(&self) -> bool {
463 matches!(self, Self::BeforeCommitIdAndAfterCommitIdAreSameException(_))
464 }
465 pub fn is_client_request_token_required_exception(&self) -> bool {
467 matches!(self, Self::ClientRequestTokenRequiredException(_))
468 }
469 pub fn is_comment_content_required_exception(&self) -> bool {
471 matches!(self, Self::CommentContentRequiredException(_))
472 }
473 pub fn is_comment_content_size_limit_exceeded_exception(&self) -> bool {
475 matches!(self, Self::CommentContentSizeLimitExceededException(_))
476 }
477 pub fn is_commit_does_not_exist_exception(&self) -> bool {
479 matches!(self, Self::CommitDoesNotExistException(_))
480 }
481 pub fn is_commit_id_required_exception(&self) -> bool {
483 matches!(self, Self::CommitIdRequiredException(_))
484 }
485 pub fn is_encryption_integrity_checks_failed_exception(&self) -> bool {
487 matches!(self, Self::EncryptionIntegrityChecksFailedException(_))
488 }
489 pub fn is_encryption_key_access_denied_exception(&self) -> bool {
491 matches!(self, Self::EncryptionKeyAccessDeniedException(_))
492 }
493 pub fn is_encryption_key_disabled_exception(&self) -> bool {
495 matches!(self, Self::EncryptionKeyDisabledException(_))
496 }
497 pub fn is_encryption_key_not_found_exception(&self) -> bool {
499 matches!(self, Self::EncryptionKeyNotFoundException(_))
500 }
501 pub fn is_encryption_key_unavailable_exception(&self) -> bool {
503 matches!(self, Self::EncryptionKeyUnavailableException(_))
504 }
505 pub fn is_idempotency_parameter_mismatch_exception(&self) -> bool {
507 matches!(self, Self::IdempotencyParameterMismatchException(_))
508 }
509 pub fn is_invalid_client_request_token_exception(&self) -> bool {
511 matches!(self, Self::InvalidClientRequestTokenException(_))
512 }
513 pub fn is_invalid_commit_id_exception(&self) -> bool {
515 matches!(self, Self::InvalidCommitIdException(_))
516 }
517 pub fn is_invalid_file_location_exception(&self) -> bool {
519 matches!(self, Self::InvalidFileLocationException(_))
520 }
521 pub fn is_invalid_file_position_exception(&self) -> bool {
523 matches!(self, Self::InvalidFilePositionException(_))
524 }
525 pub fn is_invalid_path_exception(&self) -> bool {
527 matches!(self, Self::InvalidPathException(_))
528 }
529 pub fn is_invalid_relative_file_version_enum_exception(&self) -> bool {
531 matches!(self, Self::InvalidRelativeFileVersionEnumException(_))
532 }
533 pub fn is_invalid_repository_name_exception(&self) -> bool {
535 matches!(self, Self::InvalidRepositoryNameException(_))
536 }
537 pub fn is_path_does_not_exist_exception(&self) -> bool {
539 matches!(self, Self::PathDoesNotExistException(_))
540 }
541 pub fn is_path_required_exception(&self) -> bool {
543 matches!(self, Self::PathRequiredException(_))
544 }
545 pub fn is_repository_does_not_exist_exception(&self) -> bool {
547 matches!(self, Self::RepositoryDoesNotExistException(_))
548 }
549 pub fn is_repository_name_required_exception(&self) -> bool {
551 matches!(self, Self::RepositoryNameRequiredException(_))
552 }
553}
554impl ::std::error::Error for PostCommentForComparedCommitError {
555 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
556 match self {
557 Self::BeforeCommitIdAndAfterCommitIdAreSameException(_inner) => ::std::option::Option::Some(_inner),
558 Self::ClientRequestTokenRequiredException(_inner) => ::std::option::Option::Some(_inner),
559 Self::CommentContentRequiredException(_inner) => ::std::option::Option::Some(_inner),
560 Self::CommentContentSizeLimitExceededException(_inner) => ::std::option::Option::Some(_inner),
561 Self::CommitDoesNotExistException(_inner) => ::std::option::Option::Some(_inner),
562 Self::CommitIdRequiredException(_inner) => ::std::option::Option::Some(_inner),
563 Self::EncryptionIntegrityChecksFailedException(_inner) => ::std::option::Option::Some(_inner),
564 Self::EncryptionKeyAccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
565 Self::EncryptionKeyDisabledException(_inner) => ::std::option::Option::Some(_inner),
566 Self::EncryptionKeyNotFoundException(_inner) => ::std::option::Option::Some(_inner),
567 Self::EncryptionKeyUnavailableException(_inner) => ::std::option::Option::Some(_inner),
568 Self::IdempotencyParameterMismatchException(_inner) => ::std::option::Option::Some(_inner),
569 Self::InvalidClientRequestTokenException(_inner) => ::std::option::Option::Some(_inner),
570 Self::InvalidCommitIdException(_inner) => ::std::option::Option::Some(_inner),
571 Self::InvalidFileLocationException(_inner) => ::std::option::Option::Some(_inner),
572 Self::InvalidFilePositionException(_inner) => ::std::option::Option::Some(_inner),
573 Self::InvalidPathException(_inner) => ::std::option::Option::Some(_inner),
574 Self::InvalidRelativeFileVersionEnumException(_inner) => ::std::option::Option::Some(_inner),
575 Self::InvalidRepositoryNameException(_inner) => ::std::option::Option::Some(_inner),
576 Self::PathDoesNotExistException(_inner) => ::std::option::Option::Some(_inner),
577 Self::PathRequiredException(_inner) => ::std::option::Option::Some(_inner),
578 Self::RepositoryDoesNotExistException(_inner) => ::std::option::Option::Some(_inner),
579 Self::RepositoryNameRequiredException(_inner) => ::std::option::Option::Some(_inner),
580 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
581 }
582 }
583}
584impl ::std::fmt::Display for PostCommentForComparedCommitError {
585 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
586 match self {
587 Self::BeforeCommitIdAndAfterCommitIdAreSameException(_inner) => _inner.fmt(f),
588 Self::ClientRequestTokenRequiredException(_inner) => _inner.fmt(f),
589 Self::CommentContentRequiredException(_inner) => _inner.fmt(f),
590 Self::CommentContentSizeLimitExceededException(_inner) => _inner.fmt(f),
591 Self::CommitDoesNotExistException(_inner) => _inner.fmt(f),
592 Self::CommitIdRequiredException(_inner) => _inner.fmt(f),
593 Self::EncryptionIntegrityChecksFailedException(_inner) => _inner.fmt(f),
594 Self::EncryptionKeyAccessDeniedException(_inner) => _inner.fmt(f),
595 Self::EncryptionKeyDisabledException(_inner) => _inner.fmt(f),
596 Self::EncryptionKeyNotFoundException(_inner) => _inner.fmt(f),
597 Self::EncryptionKeyUnavailableException(_inner) => _inner.fmt(f),
598 Self::IdempotencyParameterMismatchException(_inner) => _inner.fmt(f),
599 Self::InvalidClientRequestTokenException(_inner) => _inner.fmt(f),
600 Self::InvalidCommitIdException(_inner) => _inner.fmt(f),
601 Self::InvalidFileLocationException(_inner) => _inner.fmt(f),
602 Self::InvalidFilePositionException(_inner) => _inner.fmt(f),
603 Self::InvalidPathException(_inner) => _inner.fmt(f),
604 Self::InvalidRelativeFileVersionEnumException(_inner) => _inner.fmt(f),
605 Self::InvalidRepositoryNameException(_inner) => _inner.fmt(f),
606 Self::PathDoesNotExistException(_inner) => _inner.fmt(f),
607 Self::PathRequiredException(_inner) => _inner.fmt(f),
608 Self::RepositoryDoesNotExistException(_inner) => _inner.fmt(f),
609 Self::RepositoryNameRequiredException(_inner) => _inner.fmt(f),
610 Self::Unhandled(_inner) => {
611 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
612 write!(f, "unhandled error ({code})")
613 } else {
614 f.write_str("unhandled error")
615 }
616 }
617 }
618 }
619}
620impl ::aws_smithy_types::retry::ProvideErrorKind for PostCommentForComparedCommitError {
621 fn code(&self) -> ::std::option::Option<&str> {
622 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
623 }
624 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
625 ::std::option::Option::None
626 }
627}
628impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for PostCommentForComparedCommitError {
629 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
630 match self {
631 Self::BeforeCommitIdAndAfterCommitIdAreSameException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
632 Self::ClientRequestTokenRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
633 Self::CommentContentRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
634 Self::CommentContentSizeLimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
635 Self::CommitDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
636 Self::CommitIdRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
637 Self::EncryptionIntegrityChecksFailedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
638 Self::EncryptionKeyAccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
639 Self::EncryptionKeyDisabledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
640 Self::EncryptionKeyNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
641 Self::EncryptionKeyUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
642 Self::IdempotencyParameterMismatchException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
643 Self::InvalidClientRequestTokenException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
644 Self::InvalidCommitIdException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
645 Self::InvalidFileLocationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
646 Self::InvalidFilePositionException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
647 Self::InvalidPathException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
648 Self::InvalidRelativeFileVersionEnumException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
649 Self::InvalidRepositoryNameException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
650 Self::PathDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
651 Self::PathRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
652 Self::RepositoryDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
653 Self::RepositoryNameRequiredException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
654 Self::Unhandled(_inner) => &_inner.meta,
655 }
656 }
657}
658impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for PostCommentForComparedCommitError {
659 fn create_unhandled_error(
660 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
661 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
662 ) -> Self {
663 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
664 source,
665 meta: meta.unwrap_or_default(),
666 })
667 }
668}
669impl ::aws_types::request_id::RequestId for crate::operation::post_comment_for_compared_commit::PostCommentForComparedCommitError {
670 fn request_id(&self) -> Option<&str> {
671 self.meta().request_id()
672 }
673}
674
675pub use crate::operation::post_comment_for_compared_commit::_post_comment_for_compared_commit_input::PostCommentForComparedCommitInput;
676
677pub use crate::operation::post_comment_for_compared_commit::_post_comment_for_compared_commit_output::PostCommentForComparedCommitOutput;
678
679mod _post_comment_for_compared_commit_input;
680
681mod _post_comment_for_compared_commit_output;
682
683pub mod builders;