aws_sdk_entityresolution/types/_delete_unique_id_error.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The error information provided when the delete unique ID operation doesn't complete.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DeleteUniqueIdError {
7    /// <p>The unique ID that couldn't be deleted.</p>
8    pub unique_id: ::std::string::String,
9    /// <p>The error type for the delete unique ID operation.</p>
10    /// <p>The <code>SERVICE_ERROR</code> value indicates that an internal service-side problem occurred during the deletion operation.</p>
11    /// <p>The <code>VALIDATION_ERROR</code> value indicates that the deletion operation couldn't complete because of invalid input parameters or data.</p>
12    pub error_type: crate::types::DeleteUniqueIdErrorType,
13}
14impl DeleteUniqueIdError {
15    /// <p>The unique ID that couldn't be deleted.</p>
16    pub fn unique_id(&self) -> &str {
17        use std::ops::Deref;
18        self.unique_id.deref()
19    }
20    /// <p>The error type for the delete unique ID operation.</p>
21    /// <p>The <code>SERVICE_ERROR</code> value indicates that an internal service-side problem occurred during the deletion operation.</p>
22    /// <p>The <code>VALIDATION_ERROR</code> value indicates that the deletion operation couldn't complete because of invalid input parameters or data.</p>
23    pub fn error_type(&self) -> &crate::types::DeleteUniqueIdErrorType {
24        &self.error_type
25    }
26}
27impl DeleteUniqueIdError {
28    /// Creates a new builder-style object to manufacture [`DeleteUniqueIdError`](crate::types::DeleteUniqueIdError).
29    pub fn builder() -> crate::types::builders::DeleteUniqueIdErrorBuilder {
30        crate::types::builders::DeleteUniqueIdErrorBuilder::default()
31    }
32}
33
34/// A builder for [`DeleteUniqueIdError`](crate::types::DeleteUniqueIdError).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct DeleteUniqueIdErrorBuilder {
38    pub(crate) unique_id: ::std::option::Option<::std::string::String>,
39    pub(crate) error_type: ::std::option::Option<crate::types::DeleteUniqueIdErrorType>,
40}
41impl DeleteUniqueIdErrorBuilder {
42    /// <p>The unique ID that couldn't be deleted.</p>
43    /// This field is required.
44    pub fn unique_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        self.unique_id = ::std::option::Option::Some(input.into());
46        self
47    }
48    /// <p>The unique ID that couldn't be deleted.</p>
49    pub fn set_unique_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50        self.unique_id = input;
51        self
52    }
53    /// <p>The unique ID that couldn't be deleted.</p>
54    pub fn get_unique_id(&self) -> &::std::option::Option<::std::string::String> {
55        &self.unique_id
56    }
57    /// <p>The error type for the delete unique ID operation.</p>
58    /// <p>The <code>SERVICE_ERROR</code> value indicates that an internal service-side problem occurred during the deletion operation.</p>
59    /// <p>The <code>VALIDATION_ERROR</code> value indicates that the deletion operation couldn't complete because of invalid input parameters or data.</p>
60    /// This field is required.
61    pub fn error_type(mut self, input: crate::types::DeleteUniqueIdErrorType) -> Self {
62        self.error_type = ::std::option::Option::Some(input);
63        self
64    }
65    /// <p>The error type for the delete unique ID operation.</p>
66    /// <p>The <code>SERVICE_ERROR</code> value indicates that an internal service-side problem occurred during the deletion operation.</p>
67    /// <p>The <code>VALIDATION_ERROR</code> value indicates that the deletion operation couldn't complete because of invalid input parameters or data.</p>
68    pub fn set_error_type(mut self, input: ::std::option::Option<crate::types::DeleteUniqueIdErrorType>) -> Self {
69        self.error_type = input;
70        self
71    }
72    /// <p>The error type for the delete unique ID operation.</p>
73    /// <p>The <code>SERVICE_ERROR</code> value indicates that an internal service-side problem occurred during the deletion operation.</p>
74    /// <p>The <code>VALIDATION_ERROR</code> value indicates that the deletion operation couldn't complete because of invalid input parameters or data.</p>
75    pub fn get_error_type(&self) -> &::std::option::Option<crate::types::DeleteUniqueIdErrorType> {
76        &self.error_type
77    }
78    /// Consumes the builder and constructs a [`DeleteUniqueIdError`](crate::types::DeleteUniqueIdError).
79    /// This method will fail if any of the following fields are not set:
80    /// - [`unique_id`](crate::types::builders::DeleteUniqueIdErrorBuilder::unique_id)
81    /// - [`error_type`](crate::types::builders::DeleteUniqueIdErrorBuilder::error_type)
82    pub fn build(self) -> ::std::result::Result<crate::types::DeleteUniqueIdError, ::aws_smithy_types::error::operation::BuildError> {
83        ::std::result::Result::Ok(crate::types::DeleteUniqueIdError {
84            unique_id: self.unique_id.ok_or_else(|| {
85                ::aws_smithy_types::error::operation::BuildError::missing_field(
86                    "unique_id",
87                    "unique_id was not specified but it is required when building DeleteUniqueIdError",
88                )
89            })?,
90            error_type: self.error_type.ok_or_else(|| {
91                ::aws_smithy_types::error::operation::BuildError::missing_field(
92                    "error_type",
93                    "error_type was not specified but it is required when building DeleteUniqueIdError",
94                )
95            })?,
96        })
97    }
98}