Skip to main content

aws_sdk_glue/schema_serde/
shape_search_assets_input_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2static SEARCHASSETSINPUT_MEMBER_SEARCH_TEXT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3    ::aws_smithy_schema::ShapeId::from_parts(
4        "com.amazonaws.glue.synthetic#SearchAssetsInput$SearchText",
5        "com.amazonaws.glue.synthetic",
6        "SearchAssetsInput",
7    ),
8    ::aws_smithy_schema::ShapeType::String,
9    "SearchText",
10    0,
11);
12static SEARCHASSETSINPUT_MEMBER_MAX_RESULTS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
13    ::aws_smithy_schema::ShapeId::from_parts(
14        "com.amazonaws.glue.synthetic#SearchAssetsInput$MaxResults",
15        "com.amazonaws.glue.synthetic",
16        "SearchAssetsInput",
17    ),
18    ::aws_smithy_schema::ShapeType::Integer,
19    "MaxResults",
20    1,
21);
22static SEARCHASSETSINPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
23    ::aws_smithy_schema::ShapeId::from_parts(
24        "com.amazonaws.glue.synthetic#SearchAssetsInput$NextToken",
25        "com.amazonaws.glue.synthetic",
26        "SearchAssetsInput",
27    ),
28    ::aws_smithy_schema::ShapeType::String,
29    "NextToken",
30    2,
31);
32static SEARCHASSETSINPUT_MEMBER_SORT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
33    ::aws_smithy_schema::ShapeId::from_parts(
34        "com.amazonaws.glue.synthetic#SearchAssetsInput$Sort",
35        "com.amazonaws.glue.synthetic",
36        "SearchAssetsInput",
37    ),
38    ::aws_smithy_schema::ShapeType::Structure,
39    "Sort",
40    3,
41);
42static SEARCHASSETSINPUT_MEMBER_FILTER_CLAUSE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
43    ::aws_smithy_schema::ShapeId::from_parts(
44        "com.amazonaws.glue.synthetic#SearchAssetsInput$FilterClause",
45        "com.amazonaws.glue.synthetic",
46        "SearchAssetsInput",
47    ),
48    ::aws_smithy_schema::ShapeType::Union,
49    "FilterClause",
50    4,
51);
52static SEARCHASSETSINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
53    ::aws_smithy_schema::ShapeId::from_parts(
54        "com.amazonaws.glue.synthetic#SearchAssetsInput",
55        "com.amazonaws.glue.synthetic",
56        "SearchAssetsInput",
57    ),
58    ::aws_smithy_schema::ShapeType::Structure,
59    &[
60        &SEARCHASSETSINPUT_MEMBER_SEARCH_TEXT,
61        &SEARCHASSETSINPUT_MEMBER_MAX_RESULTS,
62        &SEARCHASSETSINPUT_MEMBER_NEXT_TOKEN,
63        &SEARCHASSETSINPUT_MEMBER_SORT,
64        &SEARCHASSETSINPUT_MEMBER_FILTER_CLAUSE,
65    ],
66)
67.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/search-assets", None))
68.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
69.with_original_name("SearchAssetsInput");
70impl crate::operation::search_assets::SearchAssetsInput {
71    /// The schema for this shape.
72    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &SEARCHASSETSINPUT_SCHEMA;
73}
74impl ::aws_smithy_schema::serde::SerializableStruct for crate::operation::search_assets::SearchAssetsInput {
75    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
76        Self::SCHEMA
77    }
78
79    #[allow(unused_variables, clippy::diverging_sub_expression)]
80    fn serialize_members(
81        &self,
82        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
83    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
84        if let Some(ref val) = self.search_text {
85            ser.write_string(&SEARCHASSETSINPUT_MEMBER_SEARCH_TEXT, val)?;
86        }
87        if let Some(ref val) = self.max_results {
88            ser.write_integer(&SEARCHASSETSINPUT_MEMBER_MAX_RESULTS, *val)?;
89        }
90        if let Some(ref val) = self.next_token {
91            ser.write_string(&SEARCHASSETSINPUT_MEMBER_NEXT_TOKEN, val)?;
92        }
93        if let Some(ref val) = self.sort {
94            ser.write_struct(&SEARCHASSETSINPUT_MEMBER_SORT, val)?;
95        }
96        if let Some(ref val) = self.filter_clause {
97            ser.write_struct(&SEARCHASSETSINPUT_MEMBER_FILTER_CLAUSE, val)?;
98        }
99        Ok(())
100    }
101}
102impl crate::operation::search_assets::builders::SearchAssetsInputBuilder {
103    #[allow(
104        unused_variables,
105        unreachable_code,
106        clippy::single_match,
107        clippy::match_single_binding,
108        clippy::diverging_sub_expression
109    )]
110    pub(crate) fn deserialize_members(
111        &mut self,
112        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
113    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
114        deserializer.read_struct(&SEARCHASSETSINPUT_SCHEMA, &mut |member, deser| {
115            match member.member_index() {
116                Some(0) => {
117                    if deser.is_null() {
118                        deser.read_null()?;
119                    } else {
120                        self.search_text = Some(deser.read_string(member)?);
121                    }
122                }
123                Some(1) => {
124                    if deser.is_null() {
125                        deser.read_null()?;
126                    } else {
127                        self.max_results = Some(deser.read_integer(member)?);
128                    }
129                }
130                Some(2) => {
131                    if deser.is_null() {
132                        deser.read_null()?;
133                    } else {
134                        self.next_token = Some(deser.read_string(member)?);
135                    }
136                }
137                Some(3) => {
138                    if deser.is_null() {
139                        deser.read_null()?;
140                    } else {
141                        self.sort = Some(crate::types::SearchSort::deserialize(deser)?);
142                    }
143                }
144                Some(4) => {
145                    if deser.is_null() {
146                        deser.read_null()?;
147                    } else {
148                        self.filter_clause = Some(crate::types::SearchFilterClause::deserialize(deser)?);
149                    }
150                }
151                _ => {}
152            }
153            Ok(())
154        })
155    }
156}
157
158impl crate::operation::search_assets::SearchAssetsInput {
159    /// Deserializes this structure from a [`ShapeDeserializer`].
160    pub fn deserialize(
161        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
162    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
163        let mut builder = Self::builder();
164        builder.deserialize_members(deserializer)?;
165        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
166    }
167}