aws_sdk_sagemaker/protocol_serde/
shape_processing_job.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub(crate) fn de_processing_job<'a, I>(
3    tokens: &mut ::std::iter::Peekable<I>,
4) -> ::std::result::Result<Option<crate::types::ProcessingJob>, ::aws_smithy_json::deserialize::error::DeserializeError>
5where
6    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
7{
8    match tokens.next().transpose()? {
9        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
10        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
11            #[allow(unused_mut)]
12            let mut builder = crate::types::builders::ProcessingJobBuilder::default();
13            loop {
14                match tokens.next().transpose()? {
15                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
16                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
17                        "ProcessingInputs" => {
18                            builder = builder.set_processing_inputs(crate::protocol_serde::shape_processing_inputs::de_processing_inputs(tokens)?);
19                        }
20                        "ProcessingOutputConfig" => {
21                            builder = builder.set_processing_output_config(
22                                crate::protocol_serde::shape_processing_output_config::de_processing_output_config(tokens)?,
23                            );
24                        }
25                        "ProcessingJobName" => {
26                            builder = builder.set_processing_job_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                        "ProcessingResources" => {
33                            builder =
34                                builder.set_processing_resources(crate::protocol_serde::shape_processing_resources::de_processing_resources(tokens)?);
35                        }
36                        "StoppingCondition" => {
37                            builder = builder.set_stopping_condition(
38                                crate::protocol_serde::shape_processing_stopping_condition::de_processing_stopping_condition(tokens)?,
39                            );
40                        }
41                        "AppSpecification" => {
42                            builder = builder.set_app_specification(crate::protocol_serde::shape_app_specification::de_app_specification(tokens)?);
43                        }
44                        "Environment" => {
45                            builder = builder.set_environment(
46                                crate::protocol_serde::shape_processing_environment_map::de_processing_environment_map(tokens)?,
47                            );
48                        }
49                        "NetworkConfig" => {
50                            builder = builder.set_network_config(crate::protocol_serde::shape_network_config::de_network_config(tokens)?);
51                        }
52                        "RoleArn" => {
53                            builder = builder.set_role_arn(
54                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
55                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
56                                    .transpose()?,
57                            );
58                        }
59                        "ExperimentConfig" => {
60                            builder = builder.set_experiment_config(crate::protocol_serde::shape_experiment_config::de_experiment_config(tokens)?);
61                        }
62                        "ProcessingJobArn" => {
63                            builder = builder.set_processing_job_arn(
64                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
65                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
66                                    .transpose()?,
67                            );
68                        }
69                        "ProcessingJobStatus" => {
70                            builder = builder.set_processing_job_status(
71                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
72                                    .map(|s| s.to_unescaped().map(|u| crate::types::ProcessingJobStatus::from(u.as_ref())))
73                                    .transpose()?,
74                            );
75                        }
76                        "ExitMessage" => {
77                            builder = builder.set_exit_message(
78                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
79                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
80                                    .transpose()?,
81                            );
82                        }
83                        "FailureReason" => {
84                            builder = builder.set_failure_reason(
85                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
86                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
87                                    .transpose()?,
88                            );
89                        }
90                        "ProcessingEndTime" => {
91                            builder = builder.set_processing_end_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
92                                tokens.next(),
93                                ::aws_smithy_types::date_time::Format::EpochSeconds,
94                            )?);
95                        }
96                        "ProcessingStartTime" => {
97                            builder = builder.set_processing_start_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
98                                tokens.next(),
99                                ::aws_smithy_types::date_time::Format::EpochSeconds,
100                            )?);
101                        }
102                        "LastModifiedTime" => {
103                            builder = builder.set_last_modified_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
104                                tokens.next(),
105                                ::aws_smithy_types::date_time::Format::EpochSeconds,
106                            )?);
107                        }
108                        "CreationTime" => {
109                            builder = builder.set_creation_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
110                                tokens.next(),
111                                ::aws_smithy_types::date_time::Format::EpochSeconds,
112                            )?);
113                        }
114                        "MonitoringScheduleArn" => {
115                            builder = builder.set_monitoring_schedule_arn(
116                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
117                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
118                                    .transpose()?,
119                            );
120                        }
121                        "AutoMLJobArn" => {
122                            builder = builder.set_auto_ml_job_arn(
123                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
124                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
125                                    .transpose()?,
126                            );
127                        }
128                        "TrainingJobArn" => {
129                            builder = builder.set_training_job_arn(
130                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
131                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
132                                    .transpose()?,
133                            );
134                        }
135                        "Tags" => {
136                            builder = builder.set_tags(crate::protocol_serde::shape_tag_list::de_tag_list(tokens)?);
137                        }
138                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
139                    },
140                    other => {
141                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
142                            "expected object key or end object, found: {:?}",
143                            other
144                        )))
145                    }
146                }
147            }
148            Ok(Some(builder.build()))
149        }
150        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
151            "expected start object or null",
152        )),
153    }
154}