aws_sdk_datapipeline/operation/set_status/_set_status_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the parameters for SetStatus.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SetStatusInput {
7 /// <p>The ID of the pipeline that contains the objects.</p>
8 pub pipeline_id: ::std::option::Option<::std::string::String>,
9 /// <p>The IDs of the objects. The corresponding objects can be either physical or components, but not a mix of both types.</p>
10 pub object_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11 /// <p>The status to be set on all the objects specified in <code>objectIds</code>. For components, use <code>PAUSE</code> or <code>RESUME</code>. For instances, use <code>TRY_CANCEL</code>, <code>RERUN</code>, or <code>MARK_FINISHED</code>.</p>
12 pub status: ::std::option::Option<::std::string::String>,
13}
14impl SetStatusInput {
15 /// <p>The ID of the pipeline that contains the objects.</p>
16 pub fn pipeline_id(&self) -> ::std::option::Option<&str> {
17 self.pipeline_id.as_deref()
18 }
19 /// <p>The IDs of the objects. The corresponding objects can be either physical or components, but not a mix of both types.</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 `.object_ids.is_none()`.
22 pub fn object_ids(&self) -> &[::std::string::String] {
23 self.object_ids.as_deref().unwrap_or_default()
24 }
25 /// <p>The status to be set on all the objects specified in <code>objectIds</code>. For components, use <code>PAUSE</code> or <code>RESUME</code>. For instances, use <code>TRY_CANCEL</code>, <code>RERUN</code>, or <code>MARK_FINISHED</code>.</p>
26 pub fn status(&self) -> ::std::option::Option<&str> {
27 self.status.as_deref()
28 }
29}
30impl SetStatusInput {
31 /// Creates a new builder-style object to manufacture [`SetStatusInput`](crate::operation::set_status::SetStatusInput).
32 pub fn builder() -> crate::operation::set_status::builders::SetStatusInputBuilder {
33 crate::operation::set_status::builders::SetStatusInputBuilder::default()
34 }
35}
36
37/// A builder for [`SetStatusInput`](crate::operation::set_status::SetStatusInput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct SetStatusInputBuilder {
41 pub(crate) pipeline_id: ::std::option::Option<::std::string::String>,
42 pub(crate) object_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
43 pub(crate) status: ::std::option::Option<::std::string::String>,
44}
45impl SetStatusInputBuilder {
46 /// <p>The ID of the pipeline that contains the objects.</p>
47 /// This field is required.
48 pub fn pipeline_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49 self.pipeline_id = ::std::option::Option::Some(input.into());
50 self
51 }
52 /// <p>The ID of the pipeline that contains the objects.</p>
53 pub fn set_pipeline_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54 self.pipeline_id = input;
55 self
56 }
57 /// <p>The ID of the pipeline that contains the objects.</p>
58 pub fn get_pipeline_id(&self) -> &::std::option::Option<::std::string::String> {
59 &self.pipeline_id
60 }
61 /// Appends an item to `object_ids`.
62 ///
63 /// To override the contents of this collection use [`set_object_ids`](Self::set_object_ids).
64 ///
65 /// <p>The IDs of the objects. The corresponding objects can be either physical or components, but not a mix of both types.</p>
66 pub fn object_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 let mut v = self.object_ids.unwrap_or_default();
68 v.push(input.into());
69 self.object_ids = ::std::option::Option::Some(v);
70 self
71 }
72 /// <p>The IDs of the objects. The corresponding objects can be either physical or components, but not a mix of both types.</p>
73 pub fn set_object_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
74 self.object_ids = input;
75 self
76 }
77 /// <p>The IDs of the objects. The corresponding objects can be either physical or components, but not a mix of both types.</p>
78 pub fn get_object_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
79 &self.object_ids
80 }
81 /// <p>The status to be set on all the objects specified in <code>objectIds</code>. For components, use <code>PAUSE</code> or <code>RESUME</code>. For instances, use <code>TRY_CANCEL</code>, <code>RERUN</code>, or <code>MARK_FINISHED</code>.</p>
82 /// This field is required.
83 pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84 self.status = ::std::option::Option::Some(input.into());
85 self
86 }
87 /// <p>The status to be set on all the objects specified in <code>objectIds</code>. For components, use <code>PAUSE</code> or <code>RESUME</code>. For instances, use <code>TRY_CANCEL</code>, <code>RERUN</code>, or <code>MARK_FINISHED</code>.</p>
88 pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89 self.status = input;
90 self
91 }
92 /// <p>The status to be set on all the objects specified in <code>objectIds</code>. For components, use <code>PAUSE</code> or <code>RESUME</code>. For instances, use <code>TRY_CANCEL</code>, <code>RERUN</code>, or <code>MARK_FINISHED</code>.</p>
93 pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
94 &self.status
95 }
96 /// Consumes the builder and constructs a [`SetStatusInput`](crate::operation::set_status::SetStatusInput).
97 pub fn build(self) -> ::std::result::Result<crate::operation::set_status::SetStatusInput, ::aws_smithy_types::error::operation::BuildError> {
98 ::std::result::Result::Ok(crate::operation::set_status::SetStatusInput {
99 pipeline_id: self.pipeline_id,
100 object_ids: self.object_ids,
101 status: self.status,
102 })
103 }
104}