aws_sdk_bedrockagent/operation/prepare_agent/
_prepare_agent_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 PrepareAgentOutput {
6    /// <p>The unique identifier of the agent for which the <code>DRAFT</code> version was created.</p>
7    pub agent_id: ::std::string::String,
8    /// <p>The status of the <code>DRAFT</code> version and whether it is ready for use.</p>
9    pub agent_status: crate::types::AgentStatus,
10    /// <p>The version of the agent.</p>
11    pub agent_version: ::std::string::String,
12    /// <p>The time at which the <code>DRAFT</code> version of the agent was last prepared.</p>
13    pub prepared_at: ::aws_smithy_types::DateTime,
14    _request_id: Option<String>,
15}
16impl PrepareAgentOutput {
17    /// <p>The unique identifier of the agent for which the <code>DRAFT</code> version was created.</p>
18    pub fn agent_id(&self) -> &str {
19        use std::ops::Deref;
20        self.agent_id.deref()
21    }
22    /// <p>The status of the <code>DRAFT</code> version and whether it is ready for use.</p>
23    pub fn agent_status(&self) -> &crate::types::AgentStatus {
24        &self.agent_status
25    }
26    /// <p>The version of the agent.</p>
27    pub fn agent_version(&self) -> &str {
28        use std::ops::Deref;
29        self.agent_version.deref()
30    }
31    /// <p>The time at which the <code>DRAFT</code> version of the agent was last prepared.</p>
32    pub fn prepared_at(&self) -> &::aws_smithy_types::DateTime {
33        &self.prepared_at
34    }
35}
36impl ::aws_types::request_id::RequestId for PrepareAgentOutput {
37    fn request_id(&self) -> Option<&str> {
38        self._request_id.as_deref()
39    }
40}
41impl PrepareAgentOutput {
42    /// Creates a new builder-style object to manufacture [`PrepareAgentOutput`](crate::operation::prepare_agent::PrepareAgentOutput).
43    pub fn builder() -> crate::operation::prepare_agent::builders::PrepareAgentOutputBuilder {
44        crate::operation::prepare_agent::builders::PrepareAgentOutputBuilder::default()
45    }
46}
47
48/// A builder for [`PrepareAgentOutput`](crate::operation::prepare_agent::PrepareAgentOutput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct PrepareAgentOutputBuilder {
52    pub(crate) agent_id: ::std::option::Option<::std::string::String>,
53    pub(crate) agent_status: ::std::option::Option<crate::types::AgentStatus>,
54    pub(crate) agent_version: ::std::option::Option<::std::string::String>,
55    pub(crate) prepared_at: ::std::option::Option<::aws_smithy_types::DateTime>,
56    _request_id: Option<String>,
57}
58impl PrepareAgentOutputBuilder {
59    /// <p>The unique identifier of the agent for which the <code>DRAFT</code> version was created.</p>
60    /// This field is required.
61    pub fn agent_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.agent_id = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The unique identifier of the agent for which the <code>DRAFT</code> version was created.</p>
66    pub fn set_agent_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.agent_id = input;
68        self
69    }
70    /// <p>The unique identifier of the agent for which the <code>DRAFT</code> version was created.</p>
71    pub fn get_agent_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.agent_id
73    }
74    /// <p>The status of the <code>DRAFT</code> version and whether it is ready for use.</p>
75    /// This field is required.
76    pub fn agent_status(mut self, input: crate::types::AgentStatus) -> Self {
77        self.agent_status = ::std::option::Option::Some(input);
78        self
79    }
80    /// <p>The status of the <code>DRAFT</code> version and whether it is ready for use.</p>
81    pub fn set_agent_status(mut self, input: ::std::option::Option<crate::types::AgentStatus>) -> Self {
82        self.agent_status = input;
83        self
84    }
85    /// <p>The status of the <code>DRAFT</code> version and whether it is ready for use.</p>
86    pub fn get_agent_status(&self) -> &::std::option::Option<crate::types::AgentStatus> {
87        &self.agent_status
88    }
89    /// <p>The version of the agent.</p>
90    /// This field is required.
91    pub fn agent_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.agent_version = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// <p>The version of the agent.</p>
96    pub fn set_agent_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.agent_version = input;
98        self
99    }
100    /// <p>The version of the agent.</p>
101    pub fn get_agent_version(&self) -> &::std::option::Option<::std::string::String> {
102        &self.agent_version
103    }
104    /// <p>The time at which the <code>DRAFT</code> version of the agent was last prepared.</p>
105    /// This field is required.
106    pub fn prepared_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
107        self.prepared_at = ::std::option::Option::Some(input);
108        self
109    }
110    /// <p>The time at which the <code>DRAFT</code> version of the agent was last prepared.</p>
111    pub fn set_prepared_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
112        self.prepared_at = input;
113        self
114    }
115    /// <p>The time at which the <code>DRAFT</code> version of the agent was last prepared.</p>
116    pub fn get_prepared_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
117        &self.prepared_at
118    }
119    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
120        self._request_id = Some(request_id.into());
121        self
122    }
123
124    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
125        self._request_id = request_id;
126        self
127    }
128    /// Consumes the builder and constructs a [`PrepareAgentOutput`](crate::operation::prepare_agent::PrepareAgentOutput).
129    /// This method will fail if any of the following fields are not set:
130    /// - [`agent_id`](crate::operation::prepare_agent::builders::PrepareAgentOutputBuilder::agent_id)
131    /// - [`agent_status`](crate::operation::prepare_agent::builders::PrepareAgentOutputBuilder::agent_status)
132    /// - [`agent_version`](crate::operation::prepare_agent::builders::PrepareAgentOutputBuilder::agent_version)
133    /// - [`prepared_at`](crate::operation::prepare_agent::builders::PrepareAgentOutputBuilder::prepared_at)
134    pub fn build(
135        self,
136    ) -> ::std::result::Result<crate::operation::prepare_agent::PrepareAgentOutput, ::aws_smithy_types::error::operation::BuildError> {
137        ::std::result::Result::Ok(crate::operation::prepare_agent::PrepareAgentOutput {
138            agent_id: self.agent_id.ok_or_else(|| {
139                ::aws_smithy_types::error::operation::BuildError::missing_field(
140                    "agent_id",
141                    "agent_id was not specified but it is required when building PrepareAgentOutput",
142                )
143            })?,
144            agent_status: self.agent_status.ok_or_else(|| {
145                ::aws_smithy_types::error::operation::BuildError::missing_field(
146                    "agent_status",
147                    "agent_status was not specified but it is required when building PrepareAgentOutput",
148                )
149            })?,
150            agent_version: self.agent_version.ok_or_else(|| {
151                ::aws_smithy_types::error::operation::BuildError::missing_field(
152                    "agent_version",
153                    "agent_version was not specified but it is required when building PrepareAgentOutput",
154                )
155            })?,
156            prepared_at: self.prepared_at.ok_or_else(|| {
157                ::aws_smithy_types::error::operation::BuildError::missing_field(
158                    "prepared_at",
159                    "prepared_at was not specified but it is required when building PrepareAgentOutput",
160                )
161            })?,
162            _request_id: self._request_id,
163        })
164    }
165}