1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | pub(crate) fn de_scheduled_query_description<'a, I>(
|
3 - | tokens: &mut ::std::iter::Peekable<I>,
|
4 - | _value: &'a [u8],
|
5 - | ) -> ::std::result::Result<Option<crate::types::ScheduledQueryDescription>, ::aws_smithy_json::deserialize::error::DeserializeError>
|
6 - | where
|
7 - | I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
|
8 - | {
|
9 - | match tokens.next().transpose()? {
|
10 - | Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
|
11 - | Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
|
12 - | #[allow(unused_mut)]
|
13 - | let mut builder = crate::types::builders::ScheduledQueryDescriptionBuilder::default();
|
14 - | loop {
|
15 - | match tokens.next().transpose()? {
|
16 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
17 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
18 - | "Arn" => {
|
19 - | builder = builder.set_arn(
|
20 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
21 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
22 - | .transpose()?,
|
23 - | );
|
24 - | }
|
25 - | "Name" => {
|
26 - | builder = builder.set_name(
|
27 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
28 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
29 - | .transpose()?,
|
30 - | );
|
31 - | }
|
32 - | "QueryString" => {
|
33 - | builder = builder.set_query_string(
|
34 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
35 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
36 - | .transpose()?,
|
37 - | );
|
38 - | }
|
39 - | "CreationTime" => {
|
40 - | builder = builder.set_creation_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
41 - | tokens.next(),
|
42 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
43 - | )?);
|
44 - | }
|
45 - | "State" => {
|
46 - | builder = builder.set_state(
|
47 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
48 - | .map(|s| s.to_unescaped().map(|u| crate::types::ScheduledQueryState::from(u.as_ref())))
|
49 - | .transpose()?,
|
50 - | );
|
51 - | }
|
52 - | "PreviousInvocationTime" => {
|
53 - | builder = builder.set_previous_invocation_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
54 - | tokens.next(),
|
55 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
56 - | )?);
|
57 - | }
|
58 - | "NextInvocationTime" => {
|
59 - | builder = builder.set_next_invocation_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
60 - | tokens.next(),
|
61 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
62 - | )?);
|
63 - | }
|
64 - | "ScheduleConfiguration" => {
|
65 - | builder = builder.set_schedule_configuration(
|
66 - | crate::protocol_serde::shape_schedule_configuration::de_schedule_configuration(tokens, _value)?,
|
67 - | );
|
68 - | }
|
69 - | "NotificationConfiguration" => {
|
70 - | builder = builder.set_notification_configuration(
|
71 - | crate::protocol_serde::shape_notification_configuration::de_notification_configuration(tokens, _value)?,
|
72 - | );
|
73 - | }
|
74 - | "TargetConfiguration" => {
|
75 - | builder = builder.set_target_configuration(crate::protocol_serde::shape_target_configuration::de_target_configuration(
|
76 - | tokens, _value,
|
77 - | )?);
|
78 - | }
|
79 - | "ScheduledQueryExecutionRoleArn" => {
|
80 - | builder = builder.set_scheduled_query_execution_role_arn(
|
81 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
82 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
83 - | .transpose()?,
|
84 - | );
|
85 - | }
|
86 - | "KmsKeyId" => {
|
87 - | builder = builder.set_kms_key_id(
|
88 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
89 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
90 - | .transpose()?,
|
91 - | );
|
92 - | }
|
93 - | "ErrorReportConfiguration" => {
|
94 - | builder = builder.set_error_report_configuration(
|
95 - | crate::protocol_serde::shape_error_report_configuration::de_error_report_configuration(tokens, _value)?,
|
96 - | );
|
97 - | }
|
98 - | "LastRunSummary" => {
|
99 - | builder = builder.set_last_run_summary(
|
100 - | crate::protocol_serde::shape_scheduled_query_run_summary::de_scheduled_query_run_summary(tokens, _value)?,
|
101 - | );
|
102 - | }
|
103 - | "RecentlyFailedRuns" => {
|
104 - | builder = builder.set_recently_failed_runs(
|
105 - | crate::protocol_serde::shape_scheduled_query_run_summary_list::de_scheduled_query_run_summary_list(tokens, _value)?,
|
106 - | );
|
107 - | }
|
108 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
109 - | },
|
110 - | other => {
|
111 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
112 - | "expected object key or end object, found: {other:?}"
|
113 - | )))
|
114 - | }
|
115 - | }
|
116 - | }
|
117 - | Ok(Some(
|
118 - | crate::serde_util::scheduled_query_description_correct_errors(builder)
|
119 - | .build()
|
120 - | .map_err(|err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?,
|
121 - | ))
|
122 - | }
|
123 - | _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
124 - | "expected start object or null",
|
125 - | )),
|
126 - | }
|
127 - | }
|