aws_sdk_emr/operation/cancel_steps/_cancel_steps_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The input argument to the <code>CancelSteps</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CancelStepsInput {
7 /// <p>The <code>ClusterID</code> for the specified steps that will be canceled. Use <code>RunJobFlow</code> and <code>ListClusters</code> to get ClusterIDs.</p>
8 pub cluster_id: ::std::option::Option<::std::string::String>,
9 /// <p>The list of <code>StepIDs</code> to cancel. Use <code>ListSteps</code> to get steps and their states for the specified cluster.</p>
10 pub step_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11 /// <p>The option to choose to cancel <code>RUNNING</code> steps. By default, the value is <code>SEND_INTERRUPT</code>.</p>
12 pub step_cancellation_option: ::std::option::Option<crate::types::StepCancellationOption>,
13}
14impl CancelStepsInput {
15 /// <p>The <code>ClusterID</code> for the specified steps that will be canceled. Use <code>RunJobFlow</code> and <code>ListClusters</code> to get ClusterIDs.</p>
16 pub fn cluster_id(&self) -> ::std::option::Option<&str> {
17 self.cluster_id.as_deref()
18 }
19 /// <p>The list of <code>StepIDs</code> to cancel. Use <code>ListSteps</code> to get steps and their states for the specified cluster.</p>
20 ///
21 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.step_ids.is_none()`.
22 pub fn step_ids(&self) -> &[::std::string::String] {
23 self.step_ids.as_deref().unwrap_or_default()
24 }
25 /// <p>The option to choose to cancel <code>RUNNING</code> steps. By default, the value is <code>SEND_INTERRUPT</code>.</p>
26 pub fn step_cancellation_option(&self) -> ::std::option::Option<&crate::types::StepCancellationOption> {
27 self.step_cancellation_option.as_ref()
28 }
29}
30impl CancelStepsInput {
31 /// Creates a new builder-style object to manufacture [`CancelStepsInput`](crate::operation::cancel_steps::CancelStepsInput).
32 pub fn builder() -> crate::operation::cancel_steps::builders::CancelStepsInputBuilder {
33 crate::operation::cancel_steps::builders::CancelStepsInputBuilder::default()
34 }
35}
36
37/// A builder for [`CancelStepsInput`](crate::operation::cancel_steps::CancelStepsInput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct CancelStepsInputBuilder {
41 pub(crate) cluster_id: ::std::option::Option<::std::string::String>,
42 pub(crate) step_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
43 pub(crate) step_cancellation_option: ::std::option::Option<crate::types::StepCancellationOption>,
44}
45impl CancelStepsInputBuilder {
46 /// <p>The <code>ClusterID</code> for the specified steps that will be canceled. Use <code>RunJobFlow</code> and <code>ListClusters</code> to get ClusterIDs.</p>
47 /// This field is required.
48 pub fn cluster_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49 self.cluster_id = ::std::option::Option::Some(input.into());
50 self
51 }
52 /// <p>The <code>ClusterID</code> for the specified steps that will be canceled. Use <code>RunJobFlow</code> and <code>ListClusters</code> to get ClusterIDs.</p>
53 pub fn set_cluster_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54 self.cluster_id = input;
55 self
56 }
57 /// <p>The <code>ClusterID</code> for the specified steps that will be canceled. Use <code>RunJobFlow</code> and <code>ListClusters</code> to get ClusterIDs.</p>
58 pub fn get_cluster_id(&self) -> &::std::option::Option<::std::string::String> {
59 &self.cluster_id
60 }
61 /// Appends an item to `step_ids`.
62 ///
63 /// To override the contents of this collection use [`set_step_ids`](Self::set_step_ids).
64 ///
65 /// <p>The list of <code>StepIDs</code> to cancel. Use <code>ListSteps</code> to get steps and their states for the specified cluster.</p>
66 pub fn step_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 let mut v = self.step_ids.unwrap_or_default();
68 v.push(input.into());
69 self.step_ids = ::std::option::Option::Some(v);
70 self
71 }
72 /// <p>The list of <code>StepIDs</code> to cancel. Use <code>ListSteps</code> to get steps and their states for the specified cluster.</p>
73 pub fn set_step_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
74 self.step_ids = input;
75 self
76 }
77 /// <p>The list of <code>StepIDs</code> to cancel. Use <code>ListSteps</code> to get steps and their states for the specified cluster.</p>
78 pub fn get_step_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
79 &self.step_ids
80 }
81 /// <p>The option to choose to cancel <code>RUNNING</code> steps. By default, the value is <code>SEND_INTERRUPT</code>.</p>
82 pub fn step_cancellation_option(mut self, input: crate::types::StepCancellationOption) -> Self {
83 self.step_cancellation_option = ::std::option::Option::Some(input);
84 self
85 }
86 /// <p>The option to choose to cancel <code>RUNNING</code> steps. By default, the value is <code>SEND_INTERRUPT</code>.</p>
87 pub fn set_step_cancellation_option(mut self, input: ::std::option::Option<crate::types::StepCancellationOption>) -> Self {
88 self.step_cancellation_option = input;
89 self
90 }
91 /// <p>The option to choose to cancel <code>RUNNING</code> steps. By default, the value is <code>SEND_INTERRUPT</code>.</p>
92 pub fn get_step_cancellation_option(&self) -> &::std::option::Option<crate::types::StepCancellationOption> {
93 &self.step_cancellation_option
94 }
95 /// Consumes the builder and constructs a [`CancelStepsInput`](crate::operation::cancel_steps::CancelStepsInput).
96 pub fn build(self) -> ::std::result::Result<crate::operation::cancel_steps::CancelStepsInput, ::aws_smithy_types::error::operation::BuildError> {
97 ::std::result::Result::Ok(crate::operation::cancel_steps::CancelStepsInput {
98 cluster_id: self.cluster_id,
99 step_ids: self.step_ids,
100 step_cancellation_option: self.step_cancellation_option,
101 })
102 }
103}