aws_sdk_datapipeline/operation/activate_pipeline/
_activate_pipeline_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the parameters for ActivatePipeline.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ActivatePipelineInput {
7    /// <p>The ID of the pipeline.</p>
8    pub pipeline_id: ::std::option::Option<::std::string::String>,
9    /// <p>A list of parameter values to pass to the pipeline at activation.</p>
10    pub parameter_values: ::std::option::Option<::std::vec::Vec<crate::types::ParameterValue>>,
11    /// <p>The date and time to resume the pipeline. By default, the pipeline resumes from the last completed execution.</p>
12    pub start_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
13}
14impl ActivatePipelineInput {
15    /// <p>The ID of the pipeline.</p>
16    pub fn pipeline_id(&self) -> ::std::option::Option<&str> {
17        self.pipeline_id.as_deref()
18    }
19    /// <p>A list of parameter values to pass to the pipeline at activation.</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 `.parameter_values.is_none()`.
22    pub fn parameter_values(&self) -> &[crate::types::ParameterValue] {
23        self.parameter_values.as_deref().unwrap_or_default()
24    }
25    /// <p>The date and time to resume the pipeline. By default, the pipeline resumes from the last completed execution.</p>
26    pub fn start_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
27        self.start_timestamp.as_ref()
28    }
29}
30impl ActivatePipelineInput {
31    /// Creates a new builder-style object to manufacture [`ActivatePipelineInput`](crate::operation::activate_pipeline::ActivatePipelineInput).
32    pub fn builder() -> crate::operation::activate_pipeline::builders::ActivatePipelineInputBuilder {
33        crate::operation::activate_pipeline::builders::ActivatePipelineInputBuilder::default()
34    }
35}
36
37/// A builder for [`ActivatePipelineInput`](crate::operation::activate_pipeline::ActivatePipelineInput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct ActivatePipelineInputBuilder {
41    pub(crate) pipeline_id: ::std::option::Option<::std::string::String>,
42    pub(crate) parameter_values: ::std::option::Option<::std::vec::Vec<crate::types::ParameterValue>>,
43    pub(crate) start_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
44}
45impl ActivatePipelineInputBuilder {
46    /// <p>The ID of the pipeline.</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.</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.</p>
58    pub fn get_pipeline_id(&self) -> &::std::option::Option<::std::string::String> {
59        &self.pipeline_id
60    }
61    /// Appends an item to `parameter_values`.
62    ///
63    /// To override the contents of this collection use [`set_parameter_values`](Self::set_parameter_values).
64    ///
65    /// <p>A list of parameter values to pass to the pipeline at activation.</p>
66    pub fn parameter_values(mut self, input: crate::types::ParameterValue) -> Self {
67        let mut v = self.parameter_values.unwrap_or_default();
68        v.push(input);
69        self.parameter_values = ::std::option::Option::Some(v);
70        self
71    }
72    /// <p>A list of parameter values to pass to the pipeline at activation.</p>
73    pub fn set_parameter_values(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ParameterValue>>) -> Self {
74        self.parameter_values = input;
75        self
76    }
77    /// <p>A list of parameter values to pass to the pipeline at activation.</p>
78    pub fn get_parameter_values(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ParameterValue>> {
79        &self.parameter_values
80    }
81    /// <p>The date and time to resume the pipeline. By default, the pipeline resumes from the last completed execution.</p>
82    pub fn start_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
83        self.start_timestamp = ::std::option::Option::Some(input);
84        self
85    }
86    /// <p>The date and time to resume the pipeline. By default, the pipeline resumes from the last completed execution.</p>
87    pub fn set_start_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
88        self.start_timestamp = input;
89        self
90    }
91    /// <p>The date and time to resume the pipeline. By default, the pipeline resumes from the last completed execution.</p>
92    pub fn get_start_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
93        &self.start_timestamp
94    }
95    /// Consumes the builder and constructs a [`ActivatePipelineInput`](crate::operation::activate_pipeline::ActivatePipelineInput).
96    pub fn build(
97        self,
98    ) -> ::std::result::Result<crate::operation::activate_pipeline::ActivatePipelineInput, ::aws_smithy_types::error::operation::BuildError> {
99        ::std::result::Result::Ok(crate::operation::activate_pipeline::ActivatePipelineInput {
100            pipeline_id: self.pipeline_id,
101            parameter_values: self.parameter_values,
102            start_timestamp: self.start_timestamp,
103        })
104    }
105}