aws_sdk_emr/operation/start_notebook_execution/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_notebook_execution::_start_notebook_execution_output::StartNotebookExecutionOutputBuilder;
3
4pub use crate::operation::start_notebook_execution::_start_notebook_execution_input::StartNotebookExecutionInputBuilder;
5
6impl crate::operation::start_notebook_execution::builders::StartNotebookExecutionInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::start_notebook_execution::StartNotebookExecutionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::start_notebook_execution::StartNotebookExecutionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.start_notebook_execution();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StartNotebookExecution`.
24///
25/// <p>Starts a notebook execution.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct StartNotebookExecutionFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::start_notebook_execution::builders::StartNotebookExecutionInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::start_notebook_execution::StartNotebookExecutionOutput,
35        crate::operation::start_notebook_execution::StartNotebookExecutionError,
36    > for StartNotebookExecutionFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::start_notebook_execution::StartNotebookExecutionOutput,
44            crate::operation::start_notebook_execution::StartNotebookExecutionError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl StartNotebookExecutionFluentBuilder {
51    /// Creates a new `StartNotebookExecutionFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the StartNotebookExecution as a reference.
60    pub fn as_input(&self) -> &crate::operation::start_notebook_execution::builders::StartNotebookExecutionInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::start_notebook_execution::StartNotebookExecutionOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::start_notebook_execution::StartNotebookExecutionError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::start_notebook_execution::StartNotebookExecution::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::start_notebook_execution::StartNotebookExecution::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::start_notebook_execution::StartNotebookExecutionOutput,
97        crate::operation::start_notebook_execution::StartNotebookExecutionError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The unique identifier of the Amazon EMR Notebook to use for notebook execution.</p>
112    pub fn editor_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.editor_id(input.into());
114        self
115    }
116    /// <p>The unique identifier of the Amazon EMR Notebook to use for notebook execution.</p>
117    pub fn set_editor_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_editor_id(input);
119        self
120    }
121    /// <p>The unique identifier of the Amazon EMR Notebook to use for notebook execution.</p>
122    pub fn get_editor_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_editor_id()
124    }
125    /// <p>The path and file name of the notebook file for this execution, relative to the path specified for the Amazon EMR Notebook. For example, if you specify a path of <code>s3://MyBucket/MyNotebooks</code> when you create an Amazon EMR Notebook for a notebook with an ID of <code>e-ABCDEFGHIJK1234567890ABCD</code> (the <code>EditorID</code> of this request), and you specify a <code>RelativePath</code> of <code>my_notebook_executions/notebook_execution.ipynb</code>, the location of the file for the notebook execution is <code>s3://MyBucket/MyNotebooks/e-ABCDEFGHIJK1234567890ABCD/my_notebook_executions/notebook_execution.ipynb</code>.</p>
126    pub fn relative_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.relative_path(input.into());
128        self
129    }
130    /// <p>The path and file name of the notebook file for this execution, relative to the path specified for the Amazon EMR Notebook. For example, if you specify a path of <code>s3://MyBucket/MyNotebooks</code> when you create an Amazon EMR Notebook for a notebook with an ID of <code>e-ABCDEFGHIJK1234567890ABCD</code> (the <code>EditorID</code> of this request), and you specify a <code>RelativePath</code> of <code>my_notebook_executions/notebook_execution.ipynb</code>, the location of the file for the notebook execution is <code>s3://MyBucket/MyNotebooks/e-ABCDEFGHIJK1234567890ABCD/my_notebook_executions/notebook_execution.ipynb</code>.</p>
131    pub fn set_relative_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_relative_path(input);
133        self
134    }
135    /// <p>The path and file name of the notebook file for this execution, relative to the path specified for the Amazon EMR Notebook. For example, if you specify a path of <code>s3://MyBucket/MyNotebooks</code> when you create an Amazon EMR Notebook for a notebook with an ID of <code>e-ABCDEFGHIJK1234567890ABCD</code> (the <code>EditorID</code> of this request), and you specify a <code>RelativePath</code> of <code>my_notebook_executions/notebook_execution.ipynb</code>, the location of the file for the notebook execution is <code>s3://MyBucket/MyNotebooks/e-ABCDEFGHIJK1234567890ABCD/my_notebook_executions/notebook_execution.ipynb</code>.</p>
136    pub fn get_relative_path(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_relative_path()
138    }
139    /// <p>An optional name for the notebook execution.</p>
140    pub fn notebook_execution_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.notebook_execution_name(input.into());
142        self
143    }
144    /// <p>An optional name for the notebook execution.</p>
145    pub fn set_notebook_execution_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_notebook_execution_name(input);
147        self
148    }
149    /// <p>An optional name for the notebook execution.</p>
150    pub fn get_notebook_execution_name(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_notebook_execution_name()
152    }
153    /// <p>Input parameters in JSON format passed to the Amazon EMR Notebook at runtime for execution.</p>
154    pub fn notebook_params(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.notebook_params(input.into());
156        self
157    }
158    /// <p>Input parameters in JSON format passed to the Amazon EMR Notebook at runtime for execution.</p>
159    pub fn set_notebook_params(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_notebook_params(input);
161        self
162    }
163    /// <p>Input parameters in JSON format passed to the Amazon EMR Notebook at runtime for execution.</p>
164    pub fn get_notebook_params(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_notebook_params()
166    }
167    /// <p>Specifies the execution engine (cluster) that runs the notebook execution.</p>
168    pub fn execution_engine(mut self, input: crate::types::ExecutionEngineConfig) -> Self {
169        self.inner = self.inner.execution_engine(input);
170        self
171    }
172    /// <p>Specifies the execution engine (cluster) that runs the notebook execution.</p>
173    pub fn set_execution_engine(mut self, input: ::std::option::Option<crate::types::ExecutionEngineConfig>) -> Self {
174        self.inner = self.inner.set_execution_engine(input);
175        self
176    }
177    /// <p>Specifies the execution engine (cluster) that runs the notebook execution.</p>
178    pub fn get_execution_engine(&self) -> &::std::option::Option<crate::types::ExecutionEngineConfig> {
179        self.inner.get_execution_engine()
180    }
181    /// <p>The name or ARN of the IAM role that is used as the service role for Amazon EMR (the Amazon EMR role) for the notebook execution.</p>
182    pub fn service_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.service_role(input.into());
184        self
185    }
186    /// <p>The name or ARN of the IAM role that is used as the service role for Amazon EMR (the Amazon EMR role) for the notebook execution.</p>
187    pub fn set_service_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.inner = self.inner.set_service_role(input);
189        self
190    }
191    /// <p>The name or ARN of the IAM role that is used as the service role for Amazon EMR (the Amazon EMR role) for the notebook execution.</p>
192    pub fn get_service_role(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_service_role()
194    }
195    /// <p>The unique identifier of the Amazon EC2 security group to associate with the Amazon EMR Notebook for this notebook execution.</p>
196    pub fn notebook_instance_security_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197        self.inner = self.inner.notebook_instance_security_group_id(input.into());
198        self
199    }
200    /// <p>The unique identifier of the Amazon EC2 security group to associate with the Amazon EMR Notebook for this notebook execution.</p>
201    pub fn set_notebook_instance_security_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202        self.inner = self.inner.set_notebook_instance_security_group_id(input);
203        self
204    }
205    /// <p>The unique identifier of the Amazon EC2 security group to associate with the Amazon EMR Notebook for this notebook execution.</p>
206    pub fn get_notebook_instance_security_group_id(&self) -> &::std::option::Option<::std::string::String> {
207        self.inner.get_notebook_instance_security_group_id()
208    }
209    ///
210    /// Appends an item to `Tags`.
211    ///
212    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
213    ///
214    /// <p>A list of tags associated with a notebook execution. Tags are user-defined key-value pairs that consist of a required key string with a maximum of 128 characters and an optional value string with a maximum of 256 characters.</p>
215    pub fn tags(mut self, input: crate::types::Tag) -> Self {
216        self.inner = self.inner.tags(input);
217        self
218    }
219    /// <p>A list of tags associated with a notebook execution. Tags are user-defined key-value pairs that consist of a required key string with a maximum of 128 characters and an optional value string with a maximum of 256 characters.</p>
220    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
221        self.inner = self.inner.set_tags(input);
222        self
223    }
224    /// <p>A list of tags associated with a notebook execution. Tags are user-defined key-value pairs that consist of a required key string with a maximum of 128 characters and an optional value string with a maximum of 256 characters.</p>
225    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
226        self.inner.get_tags()
227    }
228    /// <p>The Amazon S3 location for the notebook execution input.</p>
229    pub fn notebook_s3_location(mut self, input: crate::types::NotebookS3LocationFromInput) -> Self {
230        self.inner = self.inner.notebook_s3_location(input);
231        self
232    }
233    /// <p>The Amazon S3 location for the notebook execution input.</p>
234    pub fn set_notebook_s3_location(mut self, input: ::std::option::Option<crate::types::NotebookS3LocationFromInput>) -> Self {
235        self.inner = self.inner.set_notebook_s3_location(input);
236        self
237    }
238    /// <p>The Amazon S3 location for the notebook execution input.</p>
239    pub fn get_notebook_s3_location(&self) -> &::std::option::Option<crate::types::NotebookS3LocationFromInput> {
240        self.inner.get_notebook_s3_location()
241    }
242    /// <p>The Amazon S3 location for the notebook execution output.</p>
243    pub fn output_notebook_s3_location(mut self, input: crate::types::OutputNotebookS3LocationFromInput) -> Self {
244        self.inner = self.inner.output_notebook_s3_location(input);
245        self
246    }
247    /// <p>The Amazon S3 location for the notebook execution output.</p>
248    pub fn set_output_notebook_s3_location(mut self, input: ::std::option::Option<crate::types::OutputNotebookS3LocationFromInput>) -> Self {
249        self.inner = self.inner.set_output_notebook_s3_location(input);
250        self
251    }
252    /// <p>The Amazon S3 location for the notebook execution output.</p>
253    pub fn get_output_notebook_s3_location(&self) -> &::std::option::Option<crate::types::OutputNotebookS3LocationFromInput> {
254        self.inner.get_output_notebook_s3_location()
255    }
256    /// <p>The output format for the notebook execution.</p>
257    pub fn output_notebook_format(mut self, input: crate::types::OutputNotebookFormat) -> Self {
258        self.inner = self.inner.output_notebook_format(input);
259        self
260    }
261    /// <p>The output format for the notebook execution.</p>
262    pub fn set_output_notebook_format(mut self, input: ::std::option::Option<crate::types::OutputNotebookFormat>) -> Self {
263        self.inner = self.inner.set_output_notebook_format(input);
264        self
265    }
266    /// <p>The output format for the notebook execution.</p>
267    pub fn get_output_notebook_format(&self) -> &::std::option::Option<crate::types::OutputNotebookFormat> {
268        self.inner.get_output_notebook_format()
269    }
270    ///
271    /// Adds a key-value pair to `EnvironmentVariables`.
272    ///
273    /// To override the contents of this collection use [`set_environment_variables`](Self::set_environment_variables).
274    ///
275    /// <p>The environment variables associated with the notebook execution.</p>
276    pub fn environment_variables(
277        mut self,
278        k: impl ::std::convert::Into<::std::string::String>,
279        v: impl ::std::convert::Into<::std::string::String>,
280    ) -> Self {
281        self.inner = self.inner.environment_variables(k.into(), v.into());
282        self
283    }
284    /// <p>The environment variables associated with the notebook execution.</p>
285    pub fn set_environment_variables(
286        mut self,
287        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
288    ) -> Self {
289        self.inner = self.inner.set_environment_variables(input);
290        self
291    }
292    /// <p>The environment variables associated with the notebook execution.</p>
293    pub fn get_environment_variables(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
294        self.inner.get_environment_variables()
295    }
296}