aws_sdk_applicationdiscovery/types/
_batch_delete_agent_error.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct BatchDeleteAgentError {
7 pub agent_id: ::std::string::String,
9 pub error_message: ::std::string::String,
11 pub error_code: crate::types::DeleteAgentErrorCode,
13}
14impl BatchDeleteAgentError {
15 pub fn agent_id(&self) -> &str {
17 use std::ops::Deref;
18 self.agent_id.deref()
19 }
20 pub fn error_message(&self) -> &str {
22 use std::ops::Deref;
23 self.error_message.deref()
24 }
25 pub fn error_code(&self) -> &crate::types::DeleteAgentErrorCode {
27 &self.error_code
28 }
29}
30impl BatchDeleteAgentError {
31 pub fn builder() -> crate::types::builders::BatchDeleteAgentErrorBuilder {
33 crate::types::builders::BatchDeleteAgentErrorBuilder::default()
34 }
35}
36
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct BatchDeleteAgentErrorBuilder {
41 pub(crate) agent_id: ::std::option::Option<::std::string::String>,
42 pub(crate) error_message: ::std::option::Option<::std::string::String>,
43 pub(crate) error_code: ::std::option::Option<crate::types::DeleteAgentErrorCode>,
44}
45impl BatchDeleteAgentErrorBuilder {
46 pub fn agent_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49 self.agent_id = ::std::option::Option::Some(input.into());
50 self
51 }
52 pub fn set_agent_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54 self.agent_id = input;
55 self
56 }
57 pub fn get_agent_id(&self) -> &::std::option::Option<::std::string::String> {
59 &self.agent_id
60 }
61 pub fn error_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64 self.error_message = ::std::option::Option::Some(input.into());
65 self
66 }
67 pub fn set_error_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69 self.error_message = input;
70 self
71 }
72 pub fn get_error_message(&self) -> &::std::option::Option<::std::string::String> {
74 &self.error_message
75 }
76 pub fn error_code(mut self, input: crate::types::DeleteAgentErrorCode) -> Self {
79 self.error_code = ::std::option::Option::Some(input);
80 self
81 }
82 pub fn set_error_code(mut self, input: ::std::option::Option<crate::types::DeleteAgentErrorCode>) -> Self {
84 self.error_code = input;
85 self
86 }
87 pub fn get_error_code(&self) -> &::std::option::Option<crate::types::DeleteAgentErrorCode> {
89 &self.error_code
90 }
91 pub fn build(self) -> ::std::result::Result<crate::types::BatchDeleteAgentError, ::aws_smithy_types::error::operation::BuildError> {
97 ::std::result::Result::Ok(crate::types::BatchDeleteAgentError {
98 agent_id: self.agent_id.ok_or_else(|| {
99 ::aws_smithy_types::error::operation::BuildError::missing_field(
100 "agent_id",
101 "agent_id was not specified but it is required when building BatchDeleteAgentError",
102 )
103 })?,
104 error_message: self.error_message.ok_or_else(|| {
105 ::aws_smithy_types::error::operation::BuildError::missing_field(
106 "error_message",
107 "error_message was not specified but it is required when building BatchDeleteAgentError",
108 )
109 })?,
110 error_code: self.error_code.ok_or_else(|| {
111 ::aws_smithy_types::error::operation::BuildError::missing_field(
112 "error_code",
113 "error_code was not specified but it is required when building BatchDeleteAgentError",
114 )
115 })?,
116 })
117 }
118}