aws_sdk_pcaconnectorad/types/error/
_conflict_exception.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ConflictException {
7 #[allow(missing_docs)] pub message: ::std::string::String,
9 pub resource_id: ::std::string::String,
11 pub resource_type: ::std::string::String,
13 pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
14}
15impl ConflictException {
16 pub fn resource_id(&self) -> &str {
18 use std::ops::Deref;
19 self.resource_id.deref()
20 }
21 pub fn resource_type(&self) -> &str {
23 use std::ops::Deref;
24 self.resource_type.deref()
25 }
26}
27impl ConflictException {
28 pub fn message(&self) -> &str {
30 &self.message
31 }
32}
33impl ::std::fmt::Display for ConflictException {
34 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
35 ::std::write!(f, "ConflictException")?;
36 {
37 ::std::write!(f, ": {}", &self.message)?;
38 }
39 Ok(())
40 }
41}
42impl ::std::error::Error for ConflictException {}
43impl ::aws_types::request_id::RequestId for crate::types::error::ConflictException {
44 fn request_id(&self) -> Option<&str> {
45 use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
46 self.meta().request_id()
47 }
48}
49impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ConflictException {
50 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
51 &self.meta
52 }
53}
54impl ConflictException {
55 pub fn builder() -> crate::types::error::builders::ConflictExceptionBuilder {
57 crate::types::error::builders::ConflictExceptionBuilder::default()
58 }
59}
60
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
63#[non_exhaustive]
64pub struct ConflictExceptionBuilder {
65 pub(crate) message: ::std::option::Option<::std::string::String>,
66 pub(crate) resource_id: ::std::option::Option<::std::string::String>,
67 pub(crate) resource_type: ::std::option::Option<::std::string::String>,
68 meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
69}
70impl ConflictExceptionBuilder {
71 #[allow(missing_docs)] pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74 self.message = ::std::option::Option::Some(input.into());
75 self
76 }
77 #[allow(missing_docs)] pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79 self.message = input;
80 self
81 }
82 #[allow(missing_docs)] pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
84 &self.message
85 }
86 pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89 self.resource_id = ::std::option::Option::Some(input.into());
90 self
91 }
92 pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94 self.resource_id = input;
95 self
96 }
97 pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> {
99 &self.resource_id
100 }
101 pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.resource_type = ::std::option::Option::Some(input.into());
105 self
106 }
107 pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.resource_type = input;
110 self
111 }
112 pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> {
114 &self.resource_type
115 }
116 pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
118 self.meta = Some(meta);
119 self
120 }
121
122 pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
124 self.meta = meta;
125 self
126 }
127 pub fn build(self) -> ::std::result::Result<crate::types::error::ConflictException, ::aws_smithy_types::error::operation::BuildError> {
133 ::std::result::Result::Ok(crate::types::error::ConflictException {
134 message: self.message.ok_or_else(|| {
135 ::aws_smithy_types::error::operation::BuildError::missing_field(
136 "message",
137 "message was not specified but it is required when building ConflictException",
138 )
139 })?,
140 resource_id: self.resource_id.ok_or_else(|| {
141 ::aws_smithy_types::error::operation::BuildError::missing_field(
142 "resource_id",
143 "resource_id was not specified but it is required when building ConflictException",
144 )
145 })?,
146 resource_type: self.resource_type.ok_or_else(|| {
147 ::aws_smithy_types::error::operation::BuildError::missing_field(
148 "resource_type",
149 "resource_type was not specified but it is required when building ConflictException",
150 )
151 })?,
152 meta: self.meta.unwrap_or_default(),
153 })
154 }
155}