3 3 | /// <p>The sequence token is not valid. You can get the correct sequence token in the <code>expectedSequenceToken</code> field in the <code>InvalidSequenceTokenException</code> message.</p><important>
|
4 4 | /// <p><code>PutLogEvents</code> actions are now always accepted and never return <code>InvalidSequenceTokenException</code> regardless of receiving an invalid sequence token.</p>
|
5 5 | /// </important>
|
6 6 | #[non_exhaustive]
|
7 7 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
8 8 | pub struct InvalidSequenceTokenException {
|
9 9 | #[allow(missing_docs)] // documentation missing in model
|
10 10 | pub expected_sequence_token: ::std::option::Option<::std::string::String>,
|
11 11 | #[allow(missing_docs)] // documentation missing in model
|
12 12 | pub message: ::std::option::Option<::std::string::String>,
|
13 13 | pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
|
14 14 | }
|
15 15 | impl InvalidSequenceTokenException {
|
16 16 | #[allow(missing_docs)] // documentation missing in model
|
17 17 | pub fn expected_sequence_token(&self) -> ::std::option::Option<&str> {
|
18 18 | self.expected_sequence_token.as_deref()
|
19 19 | }
|
20 20 | }
|
21 21 | static INVALIDSEQUENCETOKENEXCEPTION_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
|
22 22 | "com.amazonaws.cloudwatchlogs#InvalidSequenceTokenException",
|
23 23 | "com.amazonaws.cloudwatchlogs",
|
24 24 | "InvalidSequenceTokenException",
|
25 25 | );
|
26 26 | static INVALIDSEQUENCETOKENEXCEPTION_MEMBER_EXPECTED_SEQUENCE_TOKEN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
27 27 | ::aws_smithy_schema::ShapeId::from_static(
|
28 28 | "com.amazonaws.cloudwatchlogs#InvalidSequenceTokenException$expectedSequenceToken",
|
29 29 | "com.amazonaws.cloudwatchlogs",
|
30 30 | "InvalidSequenceTokenException",
|
31 31 | ),
|
32 32 | ::aws_smithy_schema::ShapeType::String,
|
33 - | "expected_sequence_token",
|
33 + | "expectedSequenceToken",
|
34 34 | 0,
|
35 35 | );
|
36 36 | static INVALIDSEQUENCETOKENEXCEPTION_MEMBER_MESSAGE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
37 37 | ::aws_smithy_schema::ShapeId::from_static(
|
38 38 | "com.amazonaws.cloudwatchlogs#InvalidSequenceTokenException$message",
|
39 39 | "com.amazonaws.cloudwatchlogs",
|
40 40 | "InvalidSequenceTokenException",
|
41 41 | ),
|
42 42 | ::aws_smithy_schema::ShapeType::String,
|
43 43 | "message",
|
44 44 | 1,
|
45 45 | );
|
46 46 | static INVALIDSEQUENCETOKENEXCEPTION_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
47 47 | INVALIDSEQUENCETOKENEXCEPTION_SCHEMA_ID,
|
48 48 | ::aws_smithy_schema::ShapeType::Structure,
|
49 49 | &[
|
50 50 | &INVALIDSEQUENCETOKENEXCEPTION_MEMBER_EXPECTED_SEQUENCE_TOKEN,
|
51 51 | &INVALIDSEQUENCETOKENEXCEPTION_MEMBER_MESSAGE,
|
52 52 | ],
|
53 53 | );
|
54 54 | impl InvalidSequenceTokenException {
|
55 55 | /// The schema for this shape.
|
56 56 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &INVALIDSEQUENCETOKENEXCEPTION_SCHEMA;
|
57 57 | }
|
58 58 | impl ::aws_smithy_schema::serde::SerializableStruct for InvalidSequenceTokenException {
|
59 59 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
60 60 | fn serialize_members(
|
61 61 | &self,
|
62 62 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
63 63 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
64 64 | if let Some(ref val) = self.expected_sequence_token {
|
65 65 | ser.write_string(&INVALIDSEQUENCETOKENEXCEPTION_MEMBER_EXPECTED_SEQUENCE_TOKEN, val)?;
|
66 66 | }
|
67 67 | if let Some(ref val) = self.message {
|
68 68 | ser.write_string(&INVALIDSEQUENCETOKENEXCEPTION_MEMBER_MESSAGE, val)?;
|
69 69 | }
|
70 70 | Ok(())
|
71 71 | }
|
72 72 | }
|
73 73 | impl InvalidSequenceTokenException {
|
74 74 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
75 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
76 - | deserializer: &mut D,
|
75 + | pub fn deserialize(
|
76 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
77 77 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
78 78 | #[allow(unused_variables, unused_mut)]
|
79 79 | let mut builder = Self::builder();
|
80 80 | #[allow(
|
81 81 | unused_variables,
|
82 82 | unreachable_code,
|
83 83 | clippy::single_match,
|
84 84 | clippy::match_single_binding,
|
85 85 | clippy::diverging_sub_expression
|
86 86 | )]
|
87 - | deserializer.read_struct(&INVALIDSEQUENCETOKENEXCEPTION_SCHEMA, (), |_, member, deser| {
|
87 + | deserializer.read_struct(&INVALIDSEQUENCETOKENEXCEPTION_SCHEMA, &mut |member, deser| {
|
88 88 | match member.member_index() {
|
89 89 | Some(0) => {
|
90 90 | builder.expected_sequence_token = Some(deser.read_string(member)?);
|
91 91 | }
|
92 92 | Some(1) => {
|
93 93 | builder.message = Some(deser.read_string(member)?);
|
94 94 | }
|
95 95 | _ => {}
|
96 96 | }
|
97 97 | Ok(())
|
98 98 | })?;
|
99 99 | Ok(builder.build())
|
100 100 | }
|
101 101 | }
|
102 + | impl InvalidSequenceTokenException {
|
103 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
104 + | pub fn deserialize_with_response(
|
105 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
106 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
107 + | _status: u16,
|
108 + | _body: &[u8],
|
109 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
110 + | Self::deserialize(deserializer)
|
111 + | }
|
112 + | }
|
102 113 | impl InvalidSequenceTokenException {
|
103 114 | /// Returns the error message.
|
104 115 | pub fn message(&self) -> ::std::option::Option<&str> {
|
105 116 | self.message.as_deref()
|
106 117 | }
|
107 118 | }
|
108 119 | impl ::std::fmt::Display for InvalidSequenceTokenException {
|
109 120 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
110 121 | ::std::write!(f, "InvalidSequenceTokenException")?;
|
111 122 | if let ::std::option::Option::Some(inner_1) = &self.message {
|