aws_sdk_glue/types/
_view_representation.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A structure that contains the dialect of the view, and the query that defines the view.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ViewRepresentation {
7    /// <p>The dialect of the query engine.</p>
8    pub dialect: ::std::option::Option<crate::types::ViewDialect>,
9    /// <p>The version of the dialect of the query engine. For example, 3.0.0.</p>
10    pub dialect_version: ::std::option::Option<::std::string::String>,
11    /// <p>The <code>SELECT</code> query provided by the customer during <code>CREATE VIEW DDL</code>. This SQL is not used during a query on a view (<code>ViewExpandedText</code> is used instead). <code>ViewOriginalText</code> is used for cases like <code>SHOW CREATE VIEW</code> where users want to see the original DDL command that created the view.</p>
12    pub view_original_text: ::std::option::Option<::std::string::String>,
13    /// <p>The expanded SQL for the view. This SQL is used by engines while processing a query on a view. Engines may perform operations during view creation to transform <code>ViewOriginalText</code> to <code>ViewExpandedText</code>. For example:</p>
14    /// <ul>
15    /// <li>
16    /// <p>Fully qualified identifiers: <code>SELECT * from table1 -&gt; SELECT * from db1.table1</code></p></li>
17    /// </ul>
18    pub view_expanded_text: ::std::option::Option<::std::string::String>,
19    /// <p>The name of the connection to be used to validate the specific representation of the view.</p>
20    pub validation_connection: ::std::option::Option<::std::string::String>,
21    /// <p>Dialects marked as stale are no longer valid and must be updated before they can be queried in their respective query engines.</p>
22    pub is_stale: ::std::option::Option<bool>,
23}
24impl ViewRepresentation {
25    /// <p>The dialect of the query engine.</p>
26    pub fn dialect(&self) -> ::std::option::Option<&crate::types::ViewDialect> {
27        self.dialect.as_ref()
28    }
29    /// <p>The version of the dialect of the query engine. For example, 3.0.0.</p>
30    pub fn dialect_version(&self) -> ::std::option::Option<&str> {
31        self.dialect_version.as_deref()
32    }
33    /// <p>The <code>SELECT</code> query provided by the customer during <code>CREATE VIEW DDL</code>. This SQL is not used during a query on a view (<code>ViewExpandedText</code> is used instead). <code>ViewOriginalText</code> is used for cases like <code>SHOW CREATE VIEW</code> where users want to see the original DDL command that created the view.</p>
34    pub fn view_original_text(&self) -> ::std::option::Option<&str> {
35        self.view_original_text.as_deref()
36    }
37    /// <p>The expanded SQL for the view. This SQL is used by engines while processing a query on a view. Engines may perform operations during view creation to transform <code>ViewOriginalText</code> to <code>ViewExpandedText</code>. For example:</p>
38    /// <ul>
39    /// <li>
40    /// <p>Fully qualified identifiers: <code>SELECT * from table1 -&gt; SELECT * from db1.table1</code></p></li>
41    /// </ul>
42    pub fn view_expanded_text(&self) -> ::std::option::Option<&str> {
43        self.view_expanded_text.as_deref()
44    }
45    /// <p>The name of the connection to be used to validate the specific representation of the view.</p>
46    pub fn validation_connection(&self) -> ::std::option::Option<&str> {
47        self.validation_connection.as_deref()
48    }
49    /// <p>Dialects marked as stale are no longer valid and must be updated before they can be queried in their respective query engines.</p>
50    pub fn is_stale(&self) -> ::std::option::Option<bool> {
51        self.is_stale
52    }
53}
54impl ViewRepresentation {
55    /// Creates a new builder-style object to manufacture [`ViewRepresentation`](crate::types::ViewRepresentation).
56    pub fn builder() -> crate::types::builders::ViewRepresentationBuilder {
57        crate::types::builders::ViewRepresentationBuilder::default()
58    }
59}
60
61/// A builder for [`ViewRepresentation`](crate::types::ViewRepresentation).
62#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
63#[non_exhaustive]
64pub struct ViewRepresentationBuilder {
65    pub(crate) dialect: ::std::option::Option<crate::types::ViewDialect>,
66    pub(crate) dialect_version: ::std::option::Option<::std::string::String>,
67    pub(crate) view_original_text: ::std::option::Option<::std::string::String>,
68    pub(crate) view_expanded_text: ::std::option::Option<::std::string::String>,
69    pub(crate) validation_connection: ::std::option::Option<::std::string::String>,
70    pub(crate) is_stale: ::std::option::Option<bool>,
71}
72impl ViewRepresentationBuilder {
73    /// <p>The dialect of the query engine.</p>
74    pub fn dialect(mut self, input: crate::types::ViewDialect) -> Self {
75        self.dialect = ::std::option::Option::Some(input);
76        self
77    }
78    /// <p>The dialect of the query engine.</p>
79    pub fn set_dialect(mut self, input: ::std::option::Option<crate::types::ViewDialect>) -> Self {
80        self.dialect = input;
81        self
82    }
83    /// <p>The dialect of the query engine.</p>
84    pub fn get_dialect(&self) -> &::std::option::Option<crate::types::ViewDialect> {
85        &self.dialect
86    }
87    /// <p>The version of the dialect of the query engine. For example, 3.0.0.</p>
88    pub fn dialect_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.dialect_version = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The version of the dialect of the query engine. For example, 3.0.0.</p>
93    pub fn set_dialect_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.dialect_version = input;
95        self
96    }
97    /// <p>The version of the dialect of the query engine. For example, 3.0.0.</p>
98    pub fn get_dialect_version(&self) -> &::std::option::Option<::std::string::String> {
99        &self.dialect_version
100    }
101    /// <p>The <code>SELECT</code> query provided by the customer during <code>CREATE VIEW DDL</code>. This SQL is not used during a query on a view (<code>ViewExpandedText</code> is used instead). <code>ViewOriginalText</code> is used for cases like <code>SHOW CREATE VIEW</code> where users want to see the original DDL command that created the view.</p>
102    pub fn view_original_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.view_original_text = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>The <code>SELECT</code> query provided by the customer during <code>CREATE VIEW DDL</code>. This SQL is not used during a query on a view (<code>ViewExpandedText</code> is used instead). <code>ViewOriginalText</code> is used for cases like <code>SHOW CREATE VIEW</code> where users want to see the original DDL command that created the view.</p>
107    pub fn set_view_original_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.view_original_text = input;
109        self
110    }
111    /// <p>The <code>SELECT</code> query provided by the customer during <code>CREATE VIEW DDL</code>. This SQL is not used during a query on a view (<code>ViewExpandedText</code> is used instead). <code>ViewOriginalText</code> is used for cases like <code>SHOW CREATE VIEW</code> where users want to see the original DDL command that created the view.</p>
112    pub fn get_view_original_text(&self) -> &::std::option::Option<::std::string::String> {
113        &self.view_original_text
114    }
115    /// <p>The expanded SQL for the view. This SQL is used by engines while processing a query on a view. Engines may perform operations during view creation to transform <code>ViewOriginalText</code> to <code>ViewExpandedText</code>. For example:</p>
116    /// <ul>
117    /// <li>
118    /// <p>Fully qualified identifiers: <code>SELECT * from table1 -&gt; SELECT * from db1.table1</code></p></li>
119    /// </ul>
120    pub fn view_expanded_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.view_expanded_text = ::std::option::Option::Some(input.into());
122        self
123    }
124    /// <p>The expanded SQL for the view. This SQL is used by engines while processing a query on a view. Engines may perform operations during view creation to transform <code>ViewOriginalText</code> to <code>ViewExpandedText</code>. For example:</p>
125    /// <ul>
126    /// <li>
127    /// <p>Fully qualified identifiers: <code>SELECT * from table1 -&gt; SELECT * from db1.table1</code></p></li>
128    /// </ul>
129    pub fn set_view_expanded_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.view_expanded_text = input;
131        self
132    }
133    /// <p>The expanded SQL for the view. This SQL is used by engines while processing a query on a view. Engines may perform operations during view creation to transform <code>ViewOriginalText</code> to <code>ViewExpandedText</code>. For example:</p>
134    /// <ul>
135    /// <li>
136    /// <p>Fully qualified identifiers: <code>SELECT * from table1 -&gt; SELECT * from db1.table1</code></p></li>
137    /// </ul>
138    pub fn get_view_expanded_text(&self) -> &::std::option::Option<::std::string::String> {
139        &self.view_expanded_text
140    }
141    /// <p>The name of the connection to be used to validate the specific representation of the view.</p>
142    pub fn validation_connection(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.validation_connection = ::std::option::Option::Some(input.into());
144        self
145    }
146    /// <p>The name of the connection to be used to validate the specific representation of the view.</p>
147    pub fn set_validation_connection(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.validation_connection = input;
149        self
150    }
151    /// <p>The name of the connection to be used to validate the specific representation of the view.</p>
152    pub fn get_validation_connection(&self) -> &::std::option::Option<::std::string::String> {
153        &self.validation_connection
154    }
155    /// <p>Dialects marked as stale are no longer valid and must be updated before they can be queried in their respective query engines.</p>
156    pub fn is_stale(mut self, input: bool) -> Self {
157        self.is_stale = ::std::option::Option::Some(input);
158        self
159    }
160    /// <p>Dialects marked as stale are no longer valid and must be updated before they can be queried in their respective query engines.</p>
161    pub fn set_is_stale(mut self, input: ::std::option::Option<bool>) -> Self {
162        self.is_stale = input;
163        self
164    }
165    /// <p>Dialects marked as stale are no longer valid and must be updated before they can be queried in their respective query engines.</p>
166    pub fn get_is_stale(&self) -> &::std::option::Option<bool> {
167        &self.is_stale
168    }
169    /// Consumes the builder and constructs a [`ViewRepresentation`](crate::types::ViewRepresentation).
170    pub fn build(self) -> crate::types::ViewRepresentation {
171        crate::types::ViewRepresentation {
172            dialect: self.dialect,
173            dialect_version: self.dialect_version,
174            view_original_text: self.view_original_text,
175            view_expanded_text: self.view_expanded_text,
176            validation_connection: self.validation_connection,
177            is_stale: self.is_stale,
178        }
179    }
180}