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