aws_sdk_glue/operation/run_statement/
_run_statement_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 RunStatementInput {
6    /// <p>The Session Id of the statement to be run.</p>
7    pub session_id: ::std::option::Option<::std::string::String>,
8    /// <p>The statement code to be run.</p>
9    pub code: ::std::option::Option<::std::string::String>,
10    /// <p>The origin of the request.</p>
11    pub request_origin: ::std::option::Option<::std::string::String>,
12}
13impl RunStatementInput {
14    /// <p>The Session Id of the statement to be run.</p>
15    pub fn session_id(&self) -> ::std::option::Option<&str> {
16        self.session_id.as_deref()
17    }
18    /// <p>The statement code to be run.</p>
19    pub fn code(&self) -> ::std::option::Option<&str> {
20        self.code.as_deref()
21    }
22    /// <p>The origin of the request.</p>
23    pub fn request_origin(&self) -> ::std::option::Option<&str> {
24        self.request_origin.as_deref()
25    }
26}
27impl RunStatementInput {
28    /// Creates a new builder-style object to manufacture [`RunStatementInput`](crate::operation::run_statement::RunStatementInput).
29    pub fn builder() -> crate::operation::run_statement::builders::RunStatementInputBuilder {
30        crate::operation::run_statement::builders::RunStatementInputBuilder::default()
31    }
32}
33
34/// A builder for [`RunStatementInput`](crate::operation::run_statement::RunStatementInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct RunStatementInputBuilder {
38    pub(crate) session_id: ::std::option::Option<::std::string::String>,
39    pub(crate) code: ::std::option::Option<::std::string::String>,
40    pub(crate) request_origin: ::std::option::Option<::std::string::String>,
41}
42impl RunStatementInputBuilder {
43    /// <p>The Session Id of the statement to be run.</p>
44    /// This field is required.
45    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.session_id = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>The Session Id of the statement to be run.</p>
50    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.session_id = input;
52        self
53    }
54    /// <p>The Session Id of the statement to be run.</p>
55    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
56        &self.session_id
57    }
58    /// <p>The statement code to be run.</p>
59    /// This field is required.
60    pub fn code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.code = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The statement code to be run.</p>
65    pub fn set_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.code = input;
67        self
68    }
69    /// <p>The statement code to be run.</p>
70    pub fn get_code(&self) -> &::std::option::Option<::std::string::String> {
71        &self.code
72    }
73    /// <p>The origin of the request.</p>
74    pub fn request_origin(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.request_origin = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>The origin of the request.</p>
79    pub fn set_request_origin(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.request_origin = input;
81        self
82    }
83    /// <p>The origin of the request.</p>
84    pub fn get_request_origin(&self) -> &::std::option::Option<::std::string::String> {
85        &self.request_origin
86    }
87    /// Consumes the builder and constructs a [`RunStatementInput`](crate::operation::run_statement::RunStatementInput).
88    pub fn build(
89        self,
90    ) -> ::std::result::Result<crate::operation::run_statement::RunStatementInput, ::aws_smithy_types::error::operation::BuildError> {
91        ::std::result::Result::Ok(crate::operation::run_statement::RunStatementInput {
92            session_id: self.session_id,
93            code: self.code,
94            request_origin: self.request_origin,
95        })
96    }
97}