aws_sdk_datapipeline/operation/set_status/_set_status_input.rs
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 104
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Contains the parameters for SetStatus.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SetStatusInput {
/// <p>The ID of the pipeline that contains the objects.</p>
pub pipeline_id: ::std::option::Option<::std::string::String>,
/// <p>The IDs of the objects. The corresponding objects can be either physical or components, but not a mix of both types.</p>
pub object_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <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>
pub status: ::std::option::Option<::std::string::String>,
}
impl SetStatusInput {
/// <p>The ID of the pipeline that contains the objects.</p>
pub fn pipeline_id(&self) -> ::std::option::Option<&str> {
self.pipeline_id.as_deref()
}
/// <p>The IDs of the objects. The corresponding objects can be either physical or components, but not a mix of both types.</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 `.object_ids.is_none()`.
pub fn object_ids(&self) -> &[::std::string::String] {
self.object_ids.as_deref().unwrap_or_default()
}
/// <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>
pub fn status(&self) -> ::std::option::Option<&str> {
self.status.as_deref()
}
}
impl SetStatusInput {
/// Creates a new builder-style object to manufacture [`SetStatusInput`](crate::operation::set_status::SetStatusInput).
pub fn builder() -> crate::operation::set_status::builders::SetStatusInputBuilder {
crate::operation::set_status::builders::SetStatusInputBuilder::default()
}
}
/// A builder for [`SetStatusInput`](crate::operation::set_status::SetStatusInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SetStatusInputBuilder {
pub(crate) pipeline_id: ::std::option::Option<::std::string::String>,
pub(crate) object_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) status: ::std::option::Option<::std::string::String>,
}
impl SetStatusInputBuilder {
/// <p>The ID of the pipeline that contains the objects.</p>
/// This field is required.
pub fn pipeline_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.pipeline_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the pipeline that contains the objects.</p>
pub fn set_pipeline_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.pipeline_id = input;
self
}
/// <p>The ID of the pipeline that contains the objects.</p>
pub fn get_pipeline_id(&self) -> &::std::option::Option<::std::string::String> {
&self.pipeline_id
}
/// Appends an item to `object_ids`.
///
/// To override the contents of this collection use [`set_object_ids`](Self::set_object_ids).
///
/// <p>The IDs of the objects. The corresponding objects can be either physical or components, but not a mix of both types.</p>
pub fn object_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.object_ids.unwrap_or_default();
v.push(input.into());
self.object_ids = ::std::option::Option::Some(v);
self
}
/// <p>The IDs of the objects. The corresponding objects can be either physical or components, but not a mix of both types.</p>
pub fn set_object_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.object_ids = input;
self
}
/// <p>The IDs of the objects. The corresponding objects can be either physical or components, but not a mix of both types.</p>
pub fn get_object_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.object_ids
}
/// <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>
/// This field is required.
pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.status = ::std::option::Option::Some(input.into());
self
}
/// <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>
pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.status = input;
self
}
/// <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>
pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
&self.status
}
/// Consumes the builder and constructs a [`SetStatusInput`](crate::operation::set_status::SetStatusInput).
pub fn build(self) -> ::std::result::Result<crate::operation::set_status::SetStatusInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::set_status::SetStatusInput {
pipeline_id: self.pipeline_id,
object_ids: self.object_ids,
status: self.status,
})
}
}