Skip to main content

aws_sdk_m2/types/
_restart_batch_job_identifier.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An identifier for the <code>StartBatchJob</code> API to show that it is a restart operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct RestartBatchJobIdentifier {
7    /// <p>The <code>executionId</code> from the <code>StartBatchJob</code> response when the job ran for the first time.</p>
8    pub execution_id: ::std::string::String,
9    /// <p>The step/procedure step information for a restart batch job operation.</p>
10    pub job_step_restart_marker: ::std::option::Option<crate::types::JobStepRestartMarker>,
11}
12impl RestartBatchJobIdentifier {
13    /// <p>The <code>executionId</code> from the <code>StartBatchJob</code> response when the job ran for the first time.</p>
14    pub fn execution_id(&self) -> &str {
15        use std::ops::Deref;
16        self.execution_id.deref()
17    }
18    /// <p>The step/procedure step information for a restart batch job operation.</p>
19    pub fn job_step_restart_marker(&self) -> ::std::option::Option<&crate::types::JobStepRestartMarker> {
20        self.job_step_restart_marker.as_ref()
21    }
22}
23impl RestartBatchJobIdentifier {
24    /// Creates a new builder-style object to manufacture [`RestartBatchJobIdentifier`](crate::types::RestartBatchJobIdentifier).
25    pub fn builder() -> crate::types::builders::RestartBatchJobIdentifierBuilder {
26        crate::types::builders::RestartBatchJobIdentifierBuilder::default()
27    }
28}
29
30/// A builder for [`RestartBatchJobIdentifier`](crate::types::RestartBatchJobIdentifier).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct RestartBatchJobIdentifierBuilder {
34    pub(crate) execution_id: ::std::option::Option<::std::string::String>,
35    pub(crate) job_step_restart_marker: ::std::option::Option<crate::types::JobStepRestartMarker>,
36}
37impl RestartBatchJobIdentifierBuilder {
38    /// <p>The <code>executionId</code> from the <code>StartBatchJob</code> response when the job ran for the first time.</p>
39    /// This field is required.
40    pub fn execution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.execution_id = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>The <code>executionId</code> from the <code>StartBatchJob</code> response when the job ran for the first time.</p>
45    pub fn set_execution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.execution_id = input;
47        self
48    }
49    /// <p>The <code>executionId</code> from the <code>StartBatchJob</code> response when the job ran for the first time.</p>
50    pub fn get_execution_id(&self) -> &::std::option::Option<::std::string::String> {
51        &self.execution_id
52    }
53    /// <p>The step/procedure step information for a restart batch job operation.</p>
54    /// This field is required.
55    pub fn job_step_restart_marker(mut self, input: crate::types::JobStepRestartMarker) -> Self {
56        self.job_step_restart_marker = ::std::option::Option::Some(input);
57        self
58    }
59    /// <p>The step/procedure step information for a restart batch job operation.</p>
60    pub fn set_job_step_restart_marker(mut self, input: ::std::option::Option<crate::types::JobStepRestartMarker>) -> Self {
61        self.job_step_restart_marker = input;
62        self
63    }
64    /// <p>The step/procedure step information for a restart batch job operation.</p>
65    pub fn get_job_step_restart_marker(&self) -> &::std::option::Option<crate::types::JobStepRestartMarker> {
66        &self.job_step_restart_marker
67    }
68    /// Consumes the builder and constructs a [`RestartBatchJobIdentifier`](crate::types::RestartBatchJobIdentifier).
69    /// This method will fail if any of the following fields are not set:
70    /// - [`execution_id`](crate::types::builders::RestartBatchJobIdentifierBuilder::execution_id)
71    pub fn build(self) -> ::std::result::Result<crate::types::RestartBatchJobIdentifier, ::aws_smithy_types::error::operation::BuildError> {
72        ::std::result::Result::Ok(crate::types::RestartBatchJobIdentifier {
73            execution_id: self.execution_id.ok_or_else(|| {
74                ::aws_smithy_types::error::operation::BuildError::missing_field(
75                    "execution_id",
76                    "execution_id was not specified but it is required when building RestartBatchJobIdentifier",
77                )
78            })?,
79            job_step_restart_marker: self.job_step_restart_marker,
80        })
81    }
82}