aws_sdk_codepipeline/types/
_job.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents information about a job.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Job {
7    /// <p>The unique system-generated ID of the job.</p>
8    pub id: ::std::option::Option<::std::string::String>,
9    /// <p>Other data about a job.</p>
10    pub data: ::std::option::Option<crate::types::JobData>,
11    /// <p>A system-generated random number that CodePipeline uses to ensure that the job is being worked on by only one job worker. Use this number in an <code>AcknowledgeJob</code> request.</p>
12    pub nonce: ::std::option::Option<::std::string::String>,
13    /// <p>The ID of the Amazon Web Services account to use when performing the job.</p>
14    pub account_id: ::std::option::Option<::std::string::String>,
15}
16impl Job {
17    /// <p>The unique system-generated ID of the job.</p>
18    pub fn id(&self) -> ::std::option::Option<&str> {
19        self.id.as_deref()
20    }
21    /// <p>Other data about a job.</p>
22    pub fn data(&self) -> ::std::option::Option<&crate::types::JobData> {
23        self.data.as_ref()
24    }
25    /// <p>A system-generated random number that CodePipeline uses to ensure that the job is being worked on by only one job worker. Use this number in an <code>AcknowledgeJob</code> request.</p>
26    pub fn nonce(&self) -> ::std::option::Option<&str> {
27        self.nonce.as_deref()
28    }
29    /// <p>The ID of the Amazon Web Services account to use when performing the job.</p>
30    pub fn account_id(&self) -> ::std::option::Option<&str> {
31        self.account_id.as_deref()
32    }
33}
34impl Job {
35    /// Creates a new builder-style object to manufacture [`Job`](crate::types::Job).
36    pub fn builder() -> crate::types::builders::JobBuilder {
37        crate::types::builders::JobBuilder::default()
38    }
39}
40
41/// A builder for [`Job`](crate::types::Job).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct JobBuilder {
45    pub(crate) id: ::std::option::Option<::std::string::String>,
46    pub(crate) data: ::std::option::Option<crate::types::JobData>,
47    pub(crate) nonce: ::std::option::Option<::std::string::String>,
48    pub(crate) account_id: ::std::option::Option<::std::string::String>,
49}
50impl JobBuilder {
51    /// <p>The unique system-generated ID of the job.</p>
52    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.id = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The unique system-generated ID of the job.</p>
57    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.id = input;
59        self
60    }
61    /// <p>The unique system-generated ID of the job.</p>
62    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
63        &self.id
64    }
65    /// <p>Other data about a job.</p>
66    pub fn data(mut self, input: crate::types::JobData) -> Self {
67        self.data = ::std::option::Option::Some(input);
68        self
69    }
70    /// <p>Other data about a job.</p>
71    pub fn set_data(mut self, input: ::std::option::Option<crate::types::JobData>) -> Self {
72        self.data = input;
73        self
74    }
75    /// <p>Other data about a job.</p>
76    pub fn get_data(&self) -> &::std::option::Option<crate::types::JobData> {
77        &self.data
78    }
79    /// <p>A system-generated random number that CodePipeline uses to ensure that the job is being worked on by only one job worker. Use this number in an <code>AcknowledgeJob</code> request.</p>
80    pub fn nonce(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.nonce = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>A system-generated random number that CodePipeline uses to ensure that the job is being worked on by only one job worker. Use this number in an <code>AcknowledgeJob</code> request.</p>
85    pub fn set_nonce(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.nonce = input;
87        self
88    }
89    /// <p>A system-generated random number that CodePipeline uses to ensure that the job is being worked on by only one job worker. Use this number in an <code>AcknowledgeJob</code> request.</p>
90    pub fn get_nonce(&self) -> &::std::option::Option<::std::string::String> {
91        &self.nonce
92    }
93    /// <p>The ID of the Amazon Web Services account to use when performing the job.</p>
94    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.account_id = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The ID of the Amazon Web Services account to use when performing the job.</p>
99    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.account_id = input;
101        self
102    }
103    /// <p>The ID of the Amazon Web Services account to use when performing the job.</p>
104    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
105        &self.account_id
106    }
107    /// Consumes the builder and constructs a [`Job`](crate::types::Job).
108    pub fn build(self) -> crate::types::Job {
109        crate::types::Job {
110            id: self.id,
111            data: self.data,
112            nonce: self.nonce,
113            account_id: self.account_id,
114        }
115    }
116}