aws_sdk_transfer/operation/describe_execution/
_describe_execution_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 DescribeExecutionOutput {
6    /// <p>A unique identifier for the workflow.</p>
7    pub workflow_id: ::std::string::String,
8    /// <p>The structure that contains the details of the workflow' execution.</p>
9    pub execution: ::std::option::Option<crate::types::DescribedExecution>,
10    _request_id: Option<String>,
11}
12impl DescribeExecutionOutput {
13    /// <p>A unique identifier for the workflow.</p>
14    pub fn workflow_id(&self) -> &str {
15        use std::ops::Deref;
16        self.workflow_id.deref()
17    }
18    /// <p>The structure that contains the details of the workflow' execution.</p>
19    pub fn execution(&self) -> ::std::option::Option<&crate::types::DescribedExecution> {
20        self.execution.as_ref()
21    }
22}
23impl ::aws_types::request_id::RequestId for DescribeExecutionOutput {
24    fn request_id(&self) -> Option<&str> {
25        self._request_id.as_deref()
26    }
27}
28impl DescribeExecutionOutput {
29    /// Creates a new builder-style object to manufacture [`DescribeExecutionOutput`](crate::operation::describe_execution::DescribeExecutionOutput).
30    pub fn builder() -> crate::operation::describe_execution::builders::DescribeExecutionOutputBuilder {
31        crate::operation::describe_execution::builders::DescribeExecutionOutputBuilder::default()
32    }
33}
34
35/// A builder for [`DescribeExecutionOutput`](crate::operation::describe_execution::DescribeExecutionOutput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct DescribeExecutionOutputBuilder {
39    pub(crate) workflow_id: ::std::option::Option<::std::string::String>,
40    pub(crate) execution: ::std::option::Option<crate::types::DescribedExecution>,
41    _request_id: Option<String>,
42}
43impl DescribeExecutionOutputBuilder {
44    /// <p>A unique identifier for the workflow.</p>
45    /// This field is required.
46    pub fn workflow_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.workflow_id = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>A unique identifier for the workflow.</p>
51    pub fn set_workflow_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.workflow_id = input;
53        self
54    }
55    /// <p>A unique identifier for the workflow.</p>
56    pub fn get_workflow_id(&self) -> &::std::option::Option<::std::string::String> {
57        &self.workflow_id
58    }
59    /// <p>The structure that contains the details of the workflow' execution.</p>
60    /// This field is required.
61    pub fn execution(mut self, input: crate::types::DescribedExecution) -> Self {
62        self.execution = ::std::option::Option::Some(input);
63        self
64    }
65    /// <p>The structure that contains the details of the workflow' execution.</p>
66    pub fn set_execution(mut self, input: ::std::option::Option<crate::types::DescribedExecution>) -> Self {
67        self.execution = input;
68        self
69    }
70    /// <p>The structure that contains the details of the workflow' execution.</p>
71    pub fn get_execution(&self) -> &::std::option::Option<crate::types::DescribedExecution> {
72        &self.execution
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 [`DescribeExecutionOutput`](crate::operation::describe_execution::DescribeExecutionOutput).
84    /// This method will fail if any of the following fields are not set:
85    /// - [`workflow_id`](crate::operation::describe_execution::builders::DescribeExecutionOutputBuilder::workflow_id)
86    pub fn build(
87        self,
88    ) -> ::std::result::Result<crate::operation::describe_execution::DescribeExecutionOutput, ::aws_smithy_types::error::operation::BuildError> {
89        ::std::result::Result::Ok(crate::operation::describe_execution::DescribeExecutionOutput {
90            workflow_id: self.workflow_id.ok_or_else(|| {
91                ::aws_smithy_types::error::operation::BuildError::missing_field(
92                    "workflow_id",
93                    "workflow_id was not specified but it is required when building DescribeExecutionOutput",
94                )
95            })?,
96            execution: self.execution,
97            _request_id: self._request_id,
98        })
99    }
100}