aws_sdk_kinesisanalyticsv2/operation/discover_input_schema/
_discover_input_schema_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DiscoverInputSchemaOutput {
6    /// <p>The schema inferred from the streaming source. It identifies the format of the data in the streaming source and how each data element maps to corresponding columns in the in-application stream that you can create.</p>
7    pub input_schema: ::std::option::Option<crate::types::SourceSchema>,
8    /// <p>An array of elements, where each element corresponds to a row in a stream record (a stream record can have more than one row).</p>
9    pub parsed_input_records: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
10    /// <p>The stream data that was modified by the processor specified in the <code>InputProcessingConfiguration</code> parameter.</p>
11    pub processed_input_records: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12    /// <p>The raw stream data that was sampled to infer the schema.</p>
13    pub raw_input_records: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
14    _request_id: Option<String>,
15}
16impl DiscoverInputSchemaOutput {
17    /// <p>The schema inferred from the streaming source. It identifies the format of the data in the streaming source and how each data element maps to corresponding columns in the in-application stream that you can create.</p>
18    pub fn input_schema(&self) -> ::std::option::Option<&crate::types::SourceSchema> {
19        self.input_schema.as_ref()
20    }
21    /// <p>An array of elements, where each element corresponds to a row in a stream record (a stream record can have more than one row).</p>
22    ///
23    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.parsed_input_records.is_none()`.
24    pub fn parsed_input_records(&self) -> &[::std::vec::Vec<::std::string::String>] {
25        self.parsed_input_records.as_deref().unwrap_or_default()
26    }
27    /// <p>The stream data that was modified by the processor specified in the <code>InputProcessingConfiguration</code> parameter.</p>
28    ///
29    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.processed_input_records.is_none()`.
30    pub fn processed_input_records(&self) -> &[::std::string::String] {
31        self.processed_input_records.as_deref().unwrap_or_default()
32    }
33    /// <p>The raw stream data that was sampled to infer the schema.</p>
34    ///
35    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.raw_input_records.is_none()`.
36    pub fn raw_input_records(&self) -> &[::std::string::String] {
37        self.raw_input_records.as_deref().unwrap_or_default()
38    }
39}
40impl ::aws_types::request_id::RequestId for DiscoverInputSchemaOutput {
41    fn request_id(&self) -> Option<&str> {
42        self._request_id.as_deref()
43    }
44}
45impl DiscoverInputSchemaOutput {
46    /// Creates a new builder-style object to manufacture [`DiscoverInputSchemaOutput`](crate::operation::discover_input_schema::DiscoverInputSchemaOutput).
47    pub fn builder() -> crate::operation::discover_input_schema::builders::DiscoverInputSchemaOutputBuilder {
48        crate::operation::discover_input_schema::builders::DiscoverInputSchemaOutputBuilder::default()
49    }
50}
51
52/// A builder for [`DiscoverInputSchemaOutput`](crate::operation::discover_input_schema::DiscoverInputSchemaOutput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct DiscoverInputSchemaOutputBuilder {
56    pub(crate) input_schema: ::std::option::Option<crate::types::SourceSchema>,
57    pub(crate) parsed_input_records: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
58    pub(crate) processed_input_records: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
59    pub(crate) raw_input_records: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
60    _request_id: Option<String>,
61}
62impl DiscoverInputSchemaOutputBuilder {
63    /// <p>The schema inferred from the streaming source. It identifies the format of the data in the streaming source and how each data element maps to corresponding columns in the in-application stream that you can create.</p>
64    pub fn input_schema(mut self, input: crate::types::SourceSchema) -> Self {
65        self.input_schema = ::std::option::Option::Some(input);
66        self
67    }
68    /// <p>The schema inferred from the streaming source. It identifies the format of the data in the streaming source and how each data element maps to corresponding columns in the in-application stream that you can create.</p>
69    pub fn set_input_schema(mut self, input: ::std::option::Option<crate::types::SourceSchema>) -> Self {
70        self.input_schema = input;
71        self
72    }
73    /// <p>The schema inferred from the streaming source. It identifies the format of the data in the streaming source and how each data element maps to corresponding columns in the in-application stream that you can create.</p>
74    pub fn get_input_schema(&self) -> &::std::option::Option<crate::types::SourceSchema> {
75        &self.input_schema
76    }
77    /// Appends an item to `parsed_input_records`.
78    ///
79    /// To override the contents of this collection use [`set_parsed_input_records`](Self::set_parsed_input_records).
80    ///
81    /// <p>An array of elements, where each element corresponds to a row in a stream record (a stream record can have more than one row).</p>
82    pub fn parsed_input_records(mut self, input: ::std::vec::Vec<::std::string::String>) -> Self {
83        let mut v = self.parsed_input_records.unwrap_or_default();
84        v.push(input);
85        self.parsed_input_records = ::std::option::Option::Some(v);
86        self
87    }
88    /// <p>An array of elements, where each element corresponds to a row in a stream record (a stream record can have more than one row).</p>
89    pub fn set_parsed_input_records(mut self, input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>) -> Self {
90        self.parsed_input_records = input;
91        self
92    }
93    /// <p>An array of elements, where each element corresponds to a row in a stream record (a stream record can have more than one row).</p>
94    pub fn get_parsed_input_records(&self) -> &::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>> {
95        &self.parsed_input_records
96    }
97    /// Appends an item to `processed_input_records`.
98    ///
99    /// To override the contents of this collection use [`set_processed_input_records`](Self::set_processed_input_records).
100    ///
101    /// <p>The stream data that was modified by the processor specified in the <code>InputProcessingConfiguration</code> parameter.</p>
102    pub fn processed_input_records(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        let mut v = self.processed_input_records.unwrap_or_default();
104        v.push(input.into());
105        self.processed_input_records = ::std::option::Option::Some(v);
106        self
107    }
108    /// <p>The stream data that was modified by the processor specified in the <code>InputProcessingConfiguration</code> parameter.</p>
109    pub fn set_processed_input_records(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
110        self.processed_input_records = input;
111        self
112    }
113    /// <p>The stream data that was modified by the processor specified in the <code>InputProcessingConfiguration</code> parameter.</p>
114    pub fn get_processed_input_records(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
115        &self.processed_input_records
116    }
117    /// Appends an item to `raw_input_records`.
118    ///
119    /// To override the contents of this collection use [`set_raw_input_records`](Self::set_raw_input_records).
120    ///
121    /// <p>The raw stream data that was sampled to infer the schema.</p>
122    pub fn raw_input_records(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        let mut v = self.raw_input_records.unwrap_or_default();
124        v.push(input.into());
125        self.raw_input_records = ::std::option::Option::Some(v);
126        self
127    }
128    /// <p>The raw stream data that was sampled to infer the schema.</p>
129    pub fn set_raw_input_records(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
130        self.raw_input_records = input;
131        self
132    }
133    /// <p>The raw stream data that was sampled to infer the schema.</p>
134    pub fn get_raw_input_records(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
135        &self.raw_input_records
136    }
137    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
138        self._request_id = Some(request_id.into());
139        self
140    }
141
142    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
143        self._request_id = request_id;
144        self
145    }
146    /// Consumes the builder and constructs a [`DiscoverInputSchemaOutput`](crate::operation::discover_input_schema::DiscoverInputSchemaOutput).
147    pub fn build(self) -> crate::operation::discover_input_schema::DiscoverInputSchemaOutput {
148        crate::operation::discover_input_schema::DiscoverInputSchemaOutput {
149            input_schema: self.input_schema,
150            parsed_input_records: self.parsed_input_records,
151            processed_input_records: self.processed_input_records,
152            raw_input_records: self.raw_input_records,
153            _request_id: self._request_id,
154        }
155    }
156}