aws_sdk_athena/operation/update_notebook/
_update_notebook_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 UpdateNotebookInput {
6    /// <p>The ID of the notebook to update.</p>
7    pub notebook_id: ::std::option::Option<::std::string::String>,
8    /// <p>The updated content for the notebook.</p>
9    pub payload: ::std::option::Option<::std::string::String>,
10    /// <p>The notebook content type. Currently, the only valid type is <code>IPYNB</code>.</p>
11    pub r#type: ::std::option::Option<crate::types::NotebookType>,
12    /// <p>The active notebook session ID. Required if the notebook has an active session.</p>
13    pub session_id: ::std::option::Option<::std::string::String>,
14    /// <p>A unique case-sensitive string used to ensure the request to create the notebook is idempotent (executes only once).</p><important>
15    /// <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for you. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p>
16    /// </important>
17    pub client_request_token: ::std::option::Option<::std::string::String>,
18}
19impl UpdateNotebookInput {
20    /// <p>The ID of the notebook to update.</p>
21    pub fn notebook_id(&self) -> ::std::option::Option<&str> {
22        self.notebook_id.as_deref()
23    }
24    /// <p>The updated content for the notebook.</p>
25    pub fn payload(&self) -> ::std::option::Option<&str> {
26        self.payload.as_deref()
27    }
28    /// <p>The notebook content type. Currently, the only valid type is <code>IPYNB</code>.</p>
29    pub fn r#type(&self) -> ::std::option::Option<&crate::types::NotebookType> {
30        self.r#type.as_ref()
31    }
32    /// <p>The active notebook session ID. Required if the notebook has an active session.</p>
33    pub fn session_id(&self) -> ::std::option::Option<&str> {
34        self.session_id.as_deref()
35    }
36    /// <p>A unique case-sensitive string used to ensure the request to create the notebook is idempotent (executes only once).</p><important>
37    /// <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for you. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p>
38    /// </important>
39    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
40        self.client_request_token.as_deref()
41    }
42}
43impl UpdateNotebookInput {
44    /// Creates a new builder-style object to manufacture [`UpdateNotebookInput`](crate::operation::update_notebook::UpdateNotebookInput).
45    pub fn builder() -> crate::operation::update_notebook::builders::UpdateNotebookInputBuilder {
46        crate::operation::update_notebook::builders::UpdateNotebookInputBuilder::default()
47    }
48}
49
50/// A builder for [`UpdateNotebookInput`](crate::operation::update_notebook::UpdateNotebookInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct UpdateNotebookInputBuilder {
54    pub(crate) notebook_id: ::std::option::Option<::std::string::String>,
55    pub(crate) payload: ::std::option::Option<::std::string::String>,
56    pub(crate) r#type: ::std::option::Option<crate::types::NotebookType>,
57    pub(crate) session_id: ::std::option::Option<::std::string::String>,
58    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
59}
60impl UpdateNotebookInputBuilder {
61    /// <p>The ID of the notebook to update.</p>
62    /// This field is required.
63    pub fn notebook_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64        self.notebook_id = ::std::option::Option::Some(input.into());
65        self
66    }
67    /// <p>The ID of the notebook to update.</p>
68    pub fn set_notebook_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69        self.notebook_id = input;
70        self
71    }
72    /// <p>The ID of the notebook to update.</p>
73    pub fn get_notebook_id(&self) -> &::std::option::Option<::std::string::String> {
74        &self.notebook_id
75    }
76    /// <p>The updated content for the notebook.</p>
77    /// This field is required.
78    pub fn payload(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
79        self.payload = ::std::option::Option::Some(input.into());
80        self
81    }
82    /// <p>The updated content for the notebook.</p>
83    pub fn set_payload(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
84        self.payload = input;
85        self
86    }
87    /// <p>The updated content for the notebook.</p>
88    pub fn get_payload(&self) -> &::std::option::Option<::std::string::String> {
89        &self.payload
90    }
91    /// <p>The notebook content type. Currently, the only valid type is <code>IPYNB</code>.</p>
92    /// This field is required.
93    pub fn r#type(mut self, input: crate::types::NotebookType) -> Self {
94        self.r#type = ::std::option::Option::Some(input);
95        self
96    }
97    /// <p>The notebook content type. Currently, the only valid type is <code>IPYNB</code>.</p>
98    pub fn set_type(mut self, input: ::std::option::Option<crate::types::NotebookType>) -> Self {
99        self.r#type = input;
100        self
101    }
102    /// <p>The notebook content type. Currently, the only valid type is <code>IPYNB</code>.</p>
103    pub fn get_type(&self) -> &::std::option::Option<crate::types::NotebookType> {
104        &self.r#type
105    }
106    /// <p>The active notebook session ID. Required if the notebook has an active session.</p>
107    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108        self.session_id = ::std::option::Option::Some(input.into());
109        self
110    }
111    /// <p>The active notebook session ID. Required if the notebook has an active session.</p>
112    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113        self.session_id = input;
114        self
115    }
116    /// <p>The active notebook session ID. Required if the notebook has an active session.</p>
117    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
118        &self.session_id
119    }
120    /// <p>A unique case-sensitive string used to ensure the request to create the notebook is idempotent (executes only once).</p><important>
121    /// <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for you. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p>
122    /// </important>
123    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.client_request_token = ::std::option::Option::Some(input.into());
125        self
126    }
127    /// <p>A unique case-sensitive string used to ensure the request to create the notebook is idempotent (executes only once).</p><important>
128    /// <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for you. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p>
129    /// </important>
130    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.client_request_token = input;
132        self
133    }
134    /// <p>A unique case-sensitive string used to ensure the request to create the notebook is idempotent (executes only once).</p><important>
135    /// <p>This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for you. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.</p>
136    /// </important>
137    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
138        &self.client_request_token
139    }
140    /// Consumes the builder and constructs a [`UpdateNotebookInput`](crate::operation::update_notebook::UpdateNotebookInput).
141    pub fn build(
142        self,
143    ) -> ::std::result::Result<crate::operation::update_notebook::UpdateNotebookInput, ::aws_smithy_types::error::operation::BuildError> {
144        ::std::result::Result::Ok(crate::operation::update_notebook::UpdateNotebookInput {
145            notebook_id: self.notebook_id,
146            payload: self.payload,
147            r#type: self.r#type,
148            session_id: self.session_id,
149            client_request_token: self.client_request_token,
150        })
151    }
152}