aws_sdk_sfn/operation/create_activity/
_create_activity_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateActivityOutput {
6    /// <p>The Amazon Resource Name (ARN) that identifies the created activity.</p>
7    pub activity_arn: ::std::string::String,
8    /// <p>The date the activity is created.</p>
9    pub creation_date: ::aws_smithy_types::DateTime,
10    _request_id: Option<String>,
11}
12impl CreateActivityOutput {
13    /// <p>The Amazon Resource Name (ARN) that identifies the created activity.</p>
14    pub fn activity_arn(&self) -> &str {
15        use std::ops::Deref;
16        self.activity_arn.deref()
17    }
18    /// <p>The date the activity is created.</p>
19    pub fn creation_date(&self) -> &::aws_smithy_types::DateTime {
20        &self.creation_date
21    }
22}
23impl ::aws_types::request_id::RequestId for CreateActivityOutput {
24    fn request_id(&self) -> Option<&str> {
25        self._request_id.as_deref()
26    }
27}
28impl CreateActivityOutput {
29    /// Creates a new builder-style object to manufacture [`CreateActivityOutput`](crate::operation::create_activity::CreateActivityOutput).
30    pub fn builder() -> crate::operation::create_activity::builders::CreateActivityOutputBuilder {
31        crate::operation::create_activity::builders::CreateActivityOutputBuilder::default()
32    }
33}
34
35/// A builder for [`CreateActivityOutput`](crate::operation::create_activity::CreateActivityOutput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct CreateActivityOutputBuilder {
39    pub(crate) activity_arn: ::std::option::Option<::std::string::String>,
40    pub(crate) creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
41    _request_id: Option<String>,
42}
43impl CreateActivityOutputBuilder {
44    /// <p>The Amazon Resource Name (ARN) that identifies the created activity.</p>
45    /// This field is required.
46    pub fn activity_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.activity_arn = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>The Amazon Resource Name (ARN) that identifies the created activity.</p>
51    pub fn set_activity_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.activity_arn = input;
53        self
54    }
55    /// <p>The Amazon Resource Name (ARN) that identifies the created activity.</p>
56    pub fn get_activity_arn(&self) -> &::std::option::Option<::std::string::String> {
57        &self.activity_arn
58    }
59    /// <p>The date the activity is created.</p>
60    /// This field is required.
61    pub fn creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
62        self.creation_date = ::std::option::Option::Some(input);
63        self
64    }
65    /// <p>The date the activity is created.</p>
66    pub fn set_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
67        self.creation_date = input;
68        self
69    }
70    /// <p>The date the activity is created.</p>
71    pub fn get_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
72        &self.creation_date
73    }
74    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
75        self._request_id = Some(request_id.into());
76        self
77    }
78
79    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
80        self._request_id = request_id;
81        self
82    }
83    /// Consumes the builder and constructs a [`CreateActivityOutput`](crate::operation::create_activity::CreateActivityOutput).
84    /// This method will fail if any of the following fields are not set:
85    /// - [`activity_arn`](crate::operation::create_activity::builders::CreateActivityOutputBuilder::activity_arn)
86    /// - [`creation_date`](crate::operation::create_activity::builders::CreateActivityOutputBuilder::creation_date)
87    pub fn build(
88        self,
89    ) -> ::std::result::Result<crate::operation::create_activity::CreateActivityOutput, ::aws_smithy_types::error::operation::BuildError> {
90        ::std::result::Result::Ok(crate::operation::create_activity::CreateActivityOutput {
91            activity_arn: self.activity_arn.ok_or_else(|| {
92                ::aws_smithy_types::error::operation::BuildError::missing_field(
93                    "activity_arn",
94                    "activity_arn was not specified but it is required when building CreateActivityOutput",
95                )
96            })?,
97            creation_date: self.creation_date.ok_or_else(|| {
98                ::aws_smithy_types::error::operation::BuildError::missing_field(
99                    "creation_date",
100                    "creation_date was not specified but it is required when building CreateActivityOutput",
101                )
102            })?,
103            _request_id: self._request_id,
104        })
105    }
106}