1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The input argument to the <code>CancelSteps</code> operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CancelStepsInput {
    /// <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>
    pub cluster_id: ::std::option::Option<::std::string::String>,
    /// <p>The list of <code>StepIDs</code> to cancel. Use <code>ListSteps</code> to get steps and their states for the specified cluster.</p>
    pub step_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The option to choose to cancel <code>RUNNING</code> steps. By default, the value is <code>SEND_INTERRUPT</code>.</p>
    pub step_cancellation_option: ::std::option::Option<crate::types::StepCancellationOption>,
}
impl CancelStepsInput {
    /// <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>
    pub fn cluster_id(&self) -> ::std::option::Option<&str> {
        self.cluster_id.as_deref()
    }
    /// <p>The list of <code>StepIDs</code> to cancel. Use <code>ListSteps</code> to get steps and their states for the specified cluster.</p>
    ///
    /// 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()`.
    pub fn step_ids(&self) -> &[::std::string::String] {
        self.step_ids.as_deref().unwrap_or_default()
    }
    /// <p>The option to choose to cancel <code>RUNNING</code> steps. By default, the value is <code>SEND_INTERRUPT</code>.</p>
    pub fn step_cancellation_option(&self) -> ::std::option::Option<&crate::types::StepCancellationOption> {
        self.step_cancellation_option.as_ref()
    }
}
impl CancelStepsInput {
    /// Creates a new builder-style object to manufacture [`CancelStepsInput`](crate::operation::cancel_steps::CancelStepsInput).
    pub fn builder() -> crate::operation::cancel_steps::builders::CancelStepsInputBuilder {
        crate::operation::cancel_steps::builders::CancelStepsInputBuilder::default()
    }
}

/// A builder for [`CancelStepsInput`](crate::operation::cancel_steps::CancelStepsInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CancelStepsInputBuilder {
    pub(crate) cluster_id: ::std::option::Option<::std::string::String>,
    pub(crate) step_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) step_cancellation_option: ::std::option::Option<crate::types::StepCancellationOption>,
}
impl CancelStepsInputBuilder {
    /// <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>
    /// This field is required.
    pub fn cluster_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.cluster_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <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>
    pub fn set_cluster_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.cluster_id = input;
        self
    }
    /// <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>
    pub fn get_cluster_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.cluster_id
    }
    /// Appends an item to `step_ids`.
    ///
    /// To override the contents of this collection use [`set_step_ids`](Self::set_step_ids).
    ///
    /// <p>The list of <code>StepIDs</code> to cancel. Use <code>ListSteps</code> to get steps and their states for the specified cluster.</p>
    pub fn step_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.step_ids.unwrap_or_default();
        v.push(input.into());
        self.step_ids = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of <code>StepIDs</code> to cancel. Use <code>ListSteps</code> to get steps and their states for the specified cluster.</p>
    pub fn set_step_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.step_ids = input;
        self
    }
    /// <p>The list of <code>StepIDs</code> to cancel. Use <code>ListSteps</code> to get steps and their states for the specified cluster.</p>
    pub fn get_step_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.step_ids
    }
    /// <p>The option to choose to cancel <code>RUNNING</code> steps. By default, the value is <code>SEND_INTERRUPT</code>.</p>
    pub fn step_cancellation_option(mut self, input: crate::types::StepCancellationOption) -> Self {
        self.step_cancellation_option = ::std::option::Option::Some(input);
        self
    }
    /// <p>The option to choose to cancel <code>RUNNING</code> steps. By default, the value is <code>SEND_INTERRUPT</code>.</p>
    pub fn set_step_cancellation_option(mut self, input: ::std::option::Option<crate::types::StepCancellationOption>) -> Self {
        self.step_cancellation_option = input;
        self
    }
    /// <p>The option to choose to cancel <code>RUNNING</code> steps. By default, the value is <code>SEND_INTERRUPT</code>.</p>
    pub fn get_step_cancellation_option(&self) -> &::std::option::Option<crate::types::StepCancellationOption> {
        &self.step_cancellation_option
    }
    /// Consumes the builder and constructs a [`CancelStepsInput`](crate::operation::cancel_steps::CancelStepsInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::cancel_steps::CancelStepsInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::cancel_steps::CancelStepsInput {
            cluster_id: self.cluster_id,
            step_ids: self.step_ids,
            step_cancellation_option: self.step_cancellation_option,
        })
    }
}