aws_sdk_context/operation/execute_sql/_execute_sql_input.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 ExecuteSqlInput {
6 /// <p>The agent context that owns the connection, by ID or full ARN.</p>
7 pub agent_context_id: ::std::option::Option<::std::string::String>,
8 /// <p>The connection to run against. Must be a GLUE_DATA_CATALOG connection linked to the agent context. Its access configuration (<code>accessConfig</code>) determines how AWS Context reads the tables.</p>
9 pub connection_id: ::std::option::Option<::std::string::String>,
10 /// <p>The query to run: a SQL statement and the AWS Glue tables that it reads. For the SQL rules and limits, see <code>SqlQuery</code>.</p>
11 pub query: ::std::option::Option<crate::types::SqlDataQuery>,
12}
13impl ExecuteSqlInput {
14 /// <p>The agent context that owns the connection, by ID or full ARN.</p>
15 pub fn agent_context_id(&self) -> ::std::option::Option<&str> {
16 self.agent_context_id.as_deref()
17 }
18 /// <p>The connection to run against. Must be a GLUE_DATA_CATALOG connection linked to the agent context. Its access configuration (<code>accessConfig</code>) determines how AWS Context reads the tables.</p>
19 pub fn connection_id(&self) -> ::std::option::Option<&str> {
20 self.connection_id.as_deref()
21 }
22 /// <p>The query to run: a SQL statement and the AWS Glue tables that it reads. For the SQL rules and limits, see <code>SqlQuery</code>.</p>
23 pub fn query(&self) -> ::std::option::Option<&crate::types::SqlDataQuery> {
24 self.query.as_ref()
25 }
26}
27impl ExecuteSqlInput {
28 /// Creates a new builder-style object to manufacture [`ExecuteSqlInput`](crate::operation::execute_sql::ExecuteSqlInput).
29 pub fn builder() -> crate::operation::execute_sql::builders::ExecuteSqlInputBuilder {
30 crate::operation::execute_sql::builders::ExecuteSqlInputBuilder::default()
31 }
32}
33
34/// A builder for [`ExecuteSqlInput`](crate::operation::execute_sql::ExecuteSqlInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct ExecuteSqlInputBuilder {
38 pub(crate) agent_context_id: ::std::option::Option<::std::string::String>,
39 pub(crate) connection_id: ::std::option::Option<::std::string::String>,
40 pub(crate) query: ::std::option::Option<crate::types::SqlDataQuery>,
41}
42impl ExecuteSqlInputBuilder {
43 /// <p>The agent context that owns the connection, by ID or full ARN.</p>
44 /// This field is required.
45 pub fn agent_context_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46 self.agent_context_id = ::std::option::Option::Some(input.into());
47 self
48 }
49 /// <p>The agent context that owns the connection, by ID or full ARN.</p>
50 pub fn set_agent_context_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51 self.agent_context_id = input;
52 self
53 }
54 /// <p>The agent context that owns the connection, by ID or full ARN.</p>
55 pub fn get_agent_context_id(&self) -> &::std::option::Option<::std::string::String> {
56 &self.agent_context_id
57 }
58 /// <p>The connection to run against. Must be a GLUE_DATA_CATALOG connection linked to the agent context. Its access configuration (<code>accessConfig</code>) determines how AWS Context reads the tables.</p>
59 /// This field is required.
60 pub fn connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61 self.connection_id = ::std::option::Option::Some(input.into());
62 self
63 }
64 /// <p>The connection to run against. Must be a GLUE_DATA_CATALOG connection linked to the agent context. Its access configuration (<code>accessConfig</code>) determines how AWS Context reads the tables.</p>
65 pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66 self.connection_id = input;
67 self
68 }
69 /// <p>The connection to run against. Must be a GLUE_DATA_CATALOG connection linked to the agent context. Its access configuration (<code>accessConfig</code>) determines how AWS Context reads the tables.</p>
70 pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
71 &self.connection_id
72 }
73 /// <p>The query to run: a SQL statement and the AWS Glue tables that it reads. For the SQL rules and limits, see <code>SqlQuery</code>.</p>
74 /// This field is required.
75 pub fn query(mut self, input: crate::types::SqlDataQuery) -> Self {
76 self.query = ::std::option::Option::Some(input);
77 self
78 }
79 /// <p>The query to run: a SQL statement and the AWS Glue tables that it reads. For the SQL rules and limits, see <code>SqlQuery</code>.</p>
80 pub fn set_query(mut self, input: ::std::option::Option<crate::types::SqlDataQuery>) -> Self {
81 self.query = input;
82 self
83 }
84 /// <p>The query to run: a SQL statement and the AWS Glue tables that it reads. For the SQL rules and limits, see <code>SqlQuery</code>.</p>
85 pub fn get_query(&self) -> &::std::option::Option<crate::types::SqlDataQuery> {
86 &self.query
87 }
88 /// Consumes the builder and constructs a [`ExecuteSqlInput`](crate::operation::execute_sql::ExecuteSqlInput).
89 pub fn build(self) -> ::std::result::Result<crate::operation::execute_sql::ExecuteSqlInput, ::aws_smithy_types::error::operation::BuildError> {
90 ::std::result::Result::Ok(crate::operation::execute_sql::ExecuteSqlInput {
91 agent_context_id: self.agent_context_id,
92 connection_id: self.connection_id,
93 query: self.query,
94 })
95 }
96}