Skip to main content

aws_sdk_datazone/operation/create_notebook/
_create_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)]
5pub struct CreateNotebookInput {
6    /// <p>The identifier of the Amazon SageMaker Unified Studio domain in which to create the notebook.</p>
7    pub domain_identifier: ::std::option::Option<::std::string::String>,
8    /// <p>The identifier of the project that owns the notebook.</p>
9    pub owning_project_identifier: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the notebook. The name must be between 1 and 256 characters.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>The description of the notebook.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    /// <p>The metadata for the notebook, specified as key-value pairs. You can specify up to 50 entries, with keys up to 128 characters and values up to 1024 characters.</p>
15    pub metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16    /// <p>The sensitive parameters for the notebook, specified as key-value pairs. You can specify up to 50 entries, with keys up to 128 characters and values up to 1024 characters.</p>
17    pub parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
18    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request. This field is automatically populated if not provided.</p>
19    pub client_token: ::std::option::Option<::std::string::String>,
20}
21impl CreateNotebookInput {
22    /// <p>The identifier of the Amazon SageMaker Unified Studio domain in which to create the notebook.</p>
23    pub fn domain_identifier(&self) -> ::std::option::Option<&str> {
24        self.domain_identifier.as_deref()
25    }
26    /// <p>The identifier of the project that owns the notebook.</p>
27    pub fn owning_project_identifier(&self) -> ::std::option::Option<&str> {
28        self.owning_project_identifier.as_deref()
29    }
30    /// <p>The name of the notebook. The name must be between 1 and 256 characters.</p>
31    pub fn name(&self) -> ::std::option::Option<&str> {
32        self.name.as_deref()
33    }
34    /// <p>The description of the notebook.</p>
35    pub fn description(&self) -> ::std::option::Option<&str> {
36        self.description.as_deref()
37    }
38    /// <p>The metadata for the notebook, specified as key-value pairs. You can specify up to 50 entries, with keys up to 128 characters and values up to 1024 characters.</p>
39    pub fn metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
40        self.metadata.as_ref()
41    }
42    /// <p>The sensitive parameters for the notebook, specified as key-value pairs. You can specify up to 50 entries, with keys up to 128 characters and values up to 1024 characters.</p>
43    pub fn parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
44        self.parameters.as_ref()
45    }
46    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request. This field is automatically populated if not provided.</p>
47    pub fn client_token(&self) -> ::std::option::Option<&str> {
48        self.client_token.as_deref()
49    }
50}
51impl ::std::fmt::Debug for CreateNotebookInput {
52    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
53        let mut formatter = f.debug_struct("CreateNotebookInput");
54        formatter.field("domain_identifier", &self.domain_identifier);
55        formatter.field("owning_project_identifier", &self.owning_project_identifier);
56        formatter.field("name", &"*** Sensitive Data Redacted ***");
57        formatter.field("description", &"*** Sensitive Data Redacted ***");
58        formatter.field("metadata", &"*** Sensitive Data Redacted ***");
59        formatter.field("parameters", &"*** Sensitive Data Redacted ***");
60        formatter.field("client_token", &self.client_token);
61        formatter.finish()
62    }
63}
64impl CreateNotebookInput {
65    /// Creates a new builder-style object to manufacture [`CreateNotebookInput`](crate::operation::create_notebook::CreateNotebookInput).
66    pub fn builder() -> crate::operation::create_notebook::builders::CreateNotebookInputBuilder {
67        crate::operation::create_notebook::builders::CreateNotebookInputBuilder::default()
68    }
69}
70
71/// A builder for [`CreateNotebookInput`](crate::operation::create_notebook::CreateNotebookInput).
72#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
73#[non_exhaustive]
74pub struct CreateNotebookInputBuilder {
75    pub(crate) domain_identifier: ::std::option::Option<::std::string::String>,
76    pub(crate) owning_project_identifier: ::std::option::Option<::std::string::String>,
77    pub(crate) name: ::std::option::Option<::std::string::String>,
78    pub(crate) description: ::std::option::Option<::std::string::String>,
79    pub(crate) metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
80    pub(crate) parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
81    pub(crate) client_token: ::std::option::Option<::std::string::String>,
82}
83impl CreateNotebookInputBuilder {
84    /// <p>The identifier of the Amazon SageMaker Unified Studio domain in which to create the notebook.</p>
85    /// This field is required.
86    pub fn domain_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87        self.domain_identifier = ::std::option::Option::Some(input.into());
88        self
89    }
90    /// <p>The identifier of the Amazon SageMaker Unified Studio domain in which to create the notebook.</p>
91    pub fn set_domain_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92        self.domain_identifier = input;
93        self
94    }
95    /// <p>The identifier of the Amazon SageMaker Unified Studio domain in which to create the notebook.</p>
96    pub fn get_domain_identifier(&self) -> &::std::option::Option<::std::string::String> {
97        &self.domain_identifier
98    }
99    /// <p>The identifier of the project that owns the notebook.</p>
100    /// This field is required.
101    pub fn owning_project_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        self.owning_project_identifier = ::std::option::Option::Some(input.into());
103        self
104    }
105    /// <p>The identifier of the project that owns the notebook.</p>
106    pub fn set_owning_project_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107        self.owning_project_identifier = input;
108        self
109    }
110    /// <p>The identifier of the project that owns the notebook.</p>
111    pub fn get_owning_project_identifier(&self) -> &::std::option::Option<::std::string::String> {
112        &self.owning_project_identifier
113    }
114    /// <p>The name of the notebook. The name must be between 1 and 256 characters.</p>
115    /// This field is required.
116    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.name = ::std::option::Option::Some(input.into());
118        self
119    }
120    /// <p>The name of the notebook. The name must be between 1 and 256 characters.</p>
121    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.name = input;
123        self
124    }
125    /// <p>The name of the notebook. The name must be between 1 and 256 characters.</p>
126    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
127        &self.name
128    }
129    /// <p>The description of the notebook.</p>
130    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.description = ::std::option::Option::Some(input.into());
132        self
133    }
134    /// <p>The description of the notebook.</p>
135    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.description = input;
137        self
138    }
139    /// <p>The description of the notebook.</p>
140    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
141        &self.description
142    }
143    /// Adds a key-value pair to `metadata`.
144    ///
145    /// To override the contents of this collection use [`set_metadata`](Self::set_metadata).
146    ///
147    /// <p>The metadata for the notebook, specified as key-value pairs. You can specify up to 50 entries, with keys up to 128 characters and values up to 1024 characters.</p>
148    pub fn metadata(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
149        let mut hash_map = self.metadata.unwrap_or_default();
150        hash_map.insert(k.into(), v.into());
151        self.metadata = ::std::option::Option::Some(hash_map);
152        self
153    }
154    /// <p>The metadata for the notebook, specified as key-value pairs. You can specify up to 50 entries, with keys up to 128 characters and values up to 1024 characters.</p>
155    pub fn set_metadata(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
156        self.metadata = input;
157        self
158    }
159    /// <p>The metadata for the notebook, specified as key-value pairs. You can specify up to 50 entries, with keys up to 128 characters and values up to 1024 characters.</p>
160    pub fn get_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
161        &self.metadata
162    }
163    /// Adds a key-value pair to `parameters`.
164    ///
165    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
166    ///
167    /// <p>The sensitive parameters for the notebook, specified as key-value pairs. You can specify up to 50 entries, with keys up to 128 characters and values up to 1024 characters.</p>
168    pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
169        let mut hash_map = self.parameters.unwrap_or_default();
170        hash_map.insert(k.into(), v.into());
171        self.parameters = ::std::option::Option::Some(hash_map);
172        self
173    }
174    /// <p>The sensitive parameters for the notebook, specified as key-value pairs. You can specify up to 50 entries, with keys up to 128 characters and values up to 1024 characters.</p>
175    pub fn set_parameters(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
176        self.parameters = input;
177        self
178    }
179    /// <p>The sensitive parameters for the notebook, specified as key-value pairs. You can specify up to 50 entries, with keys up to 128 characters and values up to 1024 characters.</p>
180    pub fn get_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
181        &self.parameters
182    }
183    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request. This field is automatically populated if not provided.</p>
184    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185        self.client_token = ::std::option::Option::Some(input.into());
186        self
187    }
188    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request. This field is automatically populated if not provided.</p>
189    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190        self.client_token = input;
191        self
192    }
193    /// <p>A unique, case-sensitive identifier to ensure idempotency of the request. This field is automatically populated if not provided.</p>
194    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
195        &self.client_token
196    }
197    /// Consumes the builder and constructs a [`CreateNotebookInput`](crate::operation::create_notebook::CreateNotebookInput).
198    pub fn build(
199        self,
200    ) -> ::std::result::Result<crate::operation::create_notebook::CreateNotebookInput, ::aws_smithy_types::error::operation::BuildError> {
201        ::std::result::Result::Ok(crate::operation::create_notebook::CreateNotebookInput {
202            domain_identifier: self.domain_identifier,
203            owning_project_identifier: self.owning_project_identifier,
204            name: self.name,
205            description: self.description,
206            metadata: self.metadata,
207            parameters: self.parameters,
208            client_token: self.client_token,
209        })
210    }
211}
212impl ::std::fmt::Debug for CreateNotebookInputBuilder {
213    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
214        let mut formatter = f.debug_struct("CreateNotebookInputBuilder");
215        formatter.field("domain_identifier", &self.domain_identifier);
216        formatter.field("owning_project_identifier", &self.owning_project_identifier);
217        formatter.field("name", &"*** Sensitive Data Redacted ***");
218        formatter.field("description", &"*** Sensitive Data Redacted ***");
219        formatter.field("metadata", &"*** Sensitive Data Redacted ***");
220        formatter.field("parameters", &"*** Sensitive Data Redacted ***");
221        formatter.field("client_token", &self.client_token);
222        formatter.finish()
223    }
224}