aws_sdk_bedrockagent/operation/prepare_flow/
_prepare_flow_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 PrepareFlowOutput {
6    /// <p>The unique identifier of the flow.</p>
7    pub id: ::std::string::String,
8    /// <p>The status of the flow. When you submit this request, the status will be <code>NotPrepared</code>. If preparation succeeds, the status becomes <code>Prepared</code>. If it fails, the status becomes <code>FAILED</code>.</p>
9    pub status: crate::types::FlowStatus,
10    _request_id: Option<String>,
11}
12impl PrepareFlowOutput {
13    /// <p>The unique identifier of the flow.</p>
14    pub fn id(&self) -> &str {
15        use std::ops::Deref;
16        self.id.deref()
17    }
18    /// <p>The status of the flow. When you submit this request, the status will be <code>NotPrepared</code>. If preparation succeeds, the status becomes <code>Prepared</code>. If it fails, the status becomes <code>FAILED</code>.</p>
19    pub fn status(&self) -> &crate::types::FlowStatus {
20        &self.status
21    }
22}
23impl ::aws_types::request_id::RequestId for PrepareFlowOutput {
24    fn request_id(&self) -> Option<&str> {
25        self._request_id.as_deref()
26    }
27}
28impl PrepareFlowOutput {
29    /// Creates a new builder-style object to manufacture [`PrepareFlowOutput`](crate::operation::prepare_flow::PrepareFlowOutput).
30    pub fn builder() -> crate::operation::prepare_flow::builders::PrepareFlowOutputBuilder {
31        crate::operation::prepare_flow::builders::PrepareFlowOutputBuilder::default()
32    }
33}
34
35/// A builder for [`PrepareFlowOutput`](crate::operation::prepare_flow::PrepareFlowOutput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct PrepareFlowOutputBuilder {
39    pub(crate) id: ::std::option::Option<::std::string::String>,
40    pub(crate) status: ::std::option::Option<crate::types::FlowStatus>,
41    _request_id: Option<String>,
42}
43impl PrepareFlowOutputBuilder {
44    /// <p>The unique identifier of the flow.</p>
45    /// This field is required.
46    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.id = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>The unique identifier of the flow.</p>
51    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.id = input;
53        self
54    }
55    /// <p>The unique identifier of the flow.</p>
56    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
57        &self.id
58    }
59    /// <p>The status of the flow. When you submit this request, the status will be <code>NotPrepared</code>. If preparation succeeds, the status becomes <code>Prepared</code>. If it fails, the status becomes <code>FAILED</code>.</p>
60    /// This field is required.
61    pub fn status(mut self, input: crate::types::FlowStatus) -> Self {
62        self.status = ::std::option::Option::Some(input);
63        self
64    }
65    /// <p>The status of the flow. When you submit this request, the status will be <code>NotPrepared</code>. If preparation succeeds, the status becomes <code>Prepared</code>. If it fails, the status becomes <code>FAILED</code>.</p>
66    pub fn set_status(mut self, input: ::std::option::Option<crate::types::FlowStatus>) -> Self {
67        self.status = input;
68        self
69    }
70    /// <p>The status of the flow. When you submit this request, the status will be <code>NotPrepared</code>. If preparation succeeds, the status becomes <code>Prepared</code>. If it fails, the status becomes <code>FAILED</code>.</p>
71    pub fn get_status(&self) -> &::std::option::Option<crate::types::FlowStatus> {
72        &self.status
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 [`PrepareFlowOutput`](crate::operation::prepare_flow::PrepareFlowOutput).
84    /// This method will fail if any of the following fields are not set:
85    /// - [`id`](crate::operation::prepare_flow::builders::PrepareFlowOutputBuilder::id)
86    /// - [`status`](crate::operation::prepare_flow::builders::PrepareFlowOutputBuilder::status)
87    pub fn build(self) -> ::std::result::Result<crate::operation::prepare_flow::PrepareFlowOutput, ::aws_smithy_types::error::operation::BuildError> {
88        ::std::result::Result::Ok(crate::operation::prepare_flow::PrepareFlowOutput {
89            id: self.id.ok_or_else(|| {
90                ::aws_smithy_types::error::operation::BuildError::missing_field(
91                    "id",
92                    "id was not specified but it is required when building PrepareFlowOutput",
93                )
94            })?,
95            status: self.status.ok_or_else(|| {
96                ::aws_smithy_types::error::operation::BuildError::missing_field(
97                    "status",
98                    "status was not specified but it is required when building PrepareFlowOutput",
99                )
100            })?,
101            _request_id: self._request_id,
102        })
103    }
104}