1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 |
|
3 3 | /// <p>The request could not be processed because of conflict in the current state of the resource.</p>
|
4 4 | #[non_exhaustive]
|
5 5 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6 6 | pub struct ConflictException {
|
7 7 | /// <p>The existing task ARNs which are already associated with the <code>clientToken</code>.</p>
|
8 8 | pub resource_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
9 9 | /// <p>Message that describes the cause of the exception.</p>
|
10 10 | pub message: ::std::option::Option<::std::string::String>,
|
11 11 | pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
|
12 12 | }
|
13 13 | impl ConflictException {
|
14 14 | /// <p>The existing task ARNs which are already associated with the <code>clientToken</code>.</p>
|
15 15 | ///
|
16 16 | /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_ids.is_none()`.
|
17 17 | pub fn resource_ids(&self) -> &[::std::string::String] {
|
18 18 | self.resource_ids.as_deref().unwrap_or_default()
|
19 19 | }
|
20 20 | }
|
21 21 | static CONFLICTEXCEPTION_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
|
22 22 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ecs#ConflictException", "com.amazonaws.ecs", "ConflictException");
|
23 23 | static CONFLICTEXCEPTION_MEMBER_RESOURCE_IDS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
24 24 | ::aws_smithy_schema::ShapeId::from_static(
|
25 25 | "com.amazonaws.ecs#ConflictException$resourceIds",
|
26 26 | "com.amazonaws.ecs",
|
27 27 | "ConflictException",
|
28 28 | ),
|
29 29 | ::aws_smithy_schema::ShapeType::List,
|
30 - | "resource_ids",
|
30 + | "resourceIds",
|
31 31 | 0,
|
32 32 | );
|
33 33 | static CONFLICTEXCEPTION_MEMBER_MESSAGE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
34 34 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ecs#ConflictException$message", "com.amazonaws.ecs", "ConflictException"),
|
35 35 | ::aws_smithy_schema::ShapeType::String,
|
36 36 | "message",
|
37 37 | 1,
|
38 38 | );
|
39 39 | static CONFLICTEXCEPTION_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
40 40 | CONFLICTEXCEPTION_SCHEMA_ID,
|
41 41 | ::aws_smithy_schema::ShapeType::Structure,
|
42 42 | &[&CONFLICTEXCEPTION_MEMBER_RESOURCE_IDS, &CONFLICTEXCEPTION_MEMBER_MESSAGE],
|
43 43 | );
|
44 44 | impl ConflictException {
|
45 45 | /// The schema for this shape.
|
46 46 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CONFLICTEXCEPTION_SCHEMA;
|
47 47 | }
|
48 48 | impl ::aws_smithy_schema::serde::SerializableStruct for ConflictException {
|
49 49 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
50 50 | fn serialize_members(
|
51 51 | &self,
|
52 52 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
53 53 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
54 54 | if let Some(ref val) = self.resource_ids {
|
55 55 | ser.write_list(
|
56 56 | &CONFLICTEXCEPTION_MEMBER_RESOURCE_IDS,
|
57 57 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
58 58 | for item in val {
|
59 59 | ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
|
60 60 | }
|
61 61 | Ok(())
|
62 62 | },
|
63 63 | )?;
|
64 64 | }
|
65 65 | if let Some(ref val) = self.message {
|
66 66 | ser.write_string(&CONFLICTEXCEPTION_MEMBER_MESSAGE, val)?;
|
67 67 | }
|
68 68 | Ok(())
|
69 69 | }
|
70 70 | }
|
71 71 | impl ConflictException {
|
72 72 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
73 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
74 - | deserializer: &mut D,
|
73 + | pub fn deserialize(
|
74 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
75 75 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
76 76 | #[allow(unused_variables, unused_mut)]
|
77 77 | let mut builder = Self::builder();
|
78 78 | #[allow(
|
79 79 | unused_variables,
|
80 80 | unreachable_code,
|
81 81 | clippy::single_match,
|
82 82 | clippy::match_single_binding,
|
83 83 | clippy::diverging_sub_expression
|
84 84 | )]
|
85 - | deserializer.read_struct(&CONFLICTEXCEPTION_SCHEMA, (), |_, member, deser| {
|
85 + | deserializer.read_struct(&CONFLICTEXCEPTION_SCHEMA, &mut |member, deser| {
|
86 86 | match member.member_index() {
|
87 87 | Some(0) => {
|
88 - | builder.resource_ids = Some({
|
89 - | let container = if let Some(cap) = deser.container_size() {
|
90 - | Vec::with_capacity(cap)
|
91 - | } else {
|
92 - | Vec::new()
|
93 - | };
|
94 - | deser.read_list(member, container, |mut list, deser| {
|
95 - | list.push(deser.read_string(member)?);
|
96 - | Ok(list)
|
97 - | })?
|
98 - | });
|
88 + | builder.resource_ids = Some(deser.read_string_list(member)?);
|
99 89 | }
|
100 90 | Some(1) => {
|
101 91 | builder.message = Some(deser.read_string(member)?);
|
102 92 | }
|
103 93 | _ => {}
|
104 94 | }
|
105 95 | Ok(())
|
106 96 | })?;
|
107 97 | Ok(builder.build())
|
108 98 | }
|
109 99 | }
|
100 + | impl ConflictException {
|
101 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
102 + | pub fn deserialize_with_response(
|
103 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
104 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
105 + | _status: u16,
|
106 + | _body: &[u8],
|
107 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
108 + | Self::deserialize(deserializer)
|
109 + | }
|
110 + | }
|
110 111 | impl ConflictException {
|
111 112 | /// Returns the error message.
|
112 113 | pub fn message(&self) -> ::std::option::Option<&str> {
|
113 114 | self.message.as_deref()
|
114 115 | }
|
115 116 | }
|
116 117 | impl ::std::fmt::Display for ConflictException {
|
117 118 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
118 119 | ::std::write!(f, "ConflictException")?;
|
119 120 | if let ::std::option::Option::Some(inner_1) = &self.message {
|