aws_sdk_route53domains/types/error/
_invalid_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The requested item is not acceptable. For example, for APIs that accept a domain name, the request might specify a domain name that doesn't belong to the account that submitted the request. For <code>AcceptDomainTransferFromAnotherAwsAccount</code>, the password might be invalid.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct InvalidInput {
7    /// <p>The requested item is not acceptable. For example, for an OperationId it might refer to the ID of an operation that is already completed. For a domain name, it might not be a valid domain name or belong to the requester account.</p>
8    pub message: ::std::option::Option<::std::string::String>,
9    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
10}
11impl InvalidInput {
12    /// Returns the error message.
13    pub fn message(&self) -> ::std::option::Option<&str> {
14        self.message.as_deref()
15    }
16}
17impl ::std::fmt::Display for InvalidInput {
18    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19        ::std::write!(f, "InvalidInput")?;
20        if let ::std::option::Option::Some(inner_1) = &self.message {
21            {
22                ::std::write!(f, ": {}", inner_1)?;
23            }
24        }
25        Ok(())
26    }
27}
28impl ::std::error::Error for InvalidInput {}
29impl ::aws_types::request_id::RequestId for crate::types::error::InvalidInput {
30    fn request_id(&self) -> Option<&str> {
31        use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
32        self.meta().request_id()
33    }
34}
35impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvalidInput {
36    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
37        &self.meta
38    }
39}
40impl InvalidInput {
41    /// Creates a new builder-style object to manufacture [`InvalidInput`](crate::types::error::InvalidInput).
42    pub fn builder() -> crate::types::error::builders::InvalidInputBuilder {
43        crate::types::error::builders::InvalidInputBuilder::default()
44    }
45}
46
47/// A builder for [`InvalidInput`](crate::types::error::InvalidInput).
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
49#[non_exhaustive]
50pub struct InvalidInputBuilder {
51    pub(crate) message: ::std::option::Option<::std::string::String>,
52    meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
53}
54impl InvalidInputBuilder {
55    /// <p>The requested item is not acceptable. For example, for an OperationId it might refer to the ID of an operation that is already completed. For a domain name, it might not be a valid domain name or belong to the requester account.</p>
56    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
57        self.message = ::std::option::Option::Some(input.into());
58        self
59    }
60    /// <p>The requested item is not acceptable. For example, for an OperationId it might refer to the ID of an operation that is already completed. For a domain name, it might not be a valid domain name or belong to the requester account.</p>
61    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62        self.message = input;
63        self
64    }
65    /// <p>The requested item is not acceptable. For example, for an OperationId it might refer to the ID of an operation that is already completed. For a domain name, it might not be a valid domain name or belong to the requester account.</p>
66    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
67        &self.message
68    }
69    /// Sets error metadata
70    pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
71        self.meta = Some(meta);
72        self
73    }
74
75    /// Sets error metadata
76    pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
77        self.meta = meta;
78        self
79    }
80    /// Consumes the builder and constructs a [`InvalidInput`](crate::types::error::InvalidInput).
81    pub fn build(self) -> crate::types::error::InvalidInput {
82        crate::types::error::InvalidInput {
83            message: self.message,
84            meta: self.meta.unwrap_or_default(),
85        }
86    }
87}