aws_sdk_connect/operation/delete_vocabulary/
_delete_vocabulary_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 DeleteVocabularyOutput {
6    /// <p>The Amazon Resource Name (ARN) of the custom vocabulary.</p>
7    pub vocabulary_arn: ::std::string::String,
8    /// <p>The identifier of the custom vocabulary.</p>
9    pub vocabulary_id: ::std::string::String,
10    /// <p>The current state of the custom vocabulary.</p>
11    pub state: crate::types::VocabularyState,
12    _request_id: Option<String>,
13}
14impl DeleteVocabularyOutput {
15    /// <p>The Amazon Resource Name (ARN) of the custom vocabulary.</p>
16    pub fn vocabulary_arn(&self) -> &str {
17        use std::ops::Deref;
18        self.vocabulary_arn.deref()
19    }
20    /// <p>The identifier of the custom vocabulary.</p>
21    pub fn vocabulary_id(&self) -> &str {
22        use std::ops::Deref;
23        self.vocabulary_id.deref()
24    }
25    /// <p>The current state of the custom vocabulary.</p>
26    pub fn state(&self) -> &crate::types::VocabularyState {
27        &self.state
28    }
29}
30impl ::aws_types::request_id::RequestId for DeleteVocabularyOutput {
31    fn request_id(&self) -> Option<&str> {
32        self._request_id.as_deref()
33    }
34}
35impl DeleteVocabularyOutput {
36    /// Creates a new builder-style object to manufacture [`DeleteVocabularyOutput`](crate::operation::delete_vocabulary::DeleteVocabularyOutput).
37    pub fn builder() -> crate::operation::delete_vocabulary::builders::DeleteVocabularyOutputBuilder {
38        crate::operation::delete_vocabulary::builders::DeleteVocabularyOutputBuilder::default()
39    }
40}
41
42/// A builder for [`DeleteVocabularyOutput`](crate::operation::delete_vocabulary::DeleteVocabularyOutput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct DeleteVocabularyOutputBuilder {
46    pub(crate) vocabulary_arn: ::std::option::Option<::std::string::String>,
47    pub(crate) vocabulary_id: ::std::option::Option<::std::string::String>,
48    pub(crate) state: ::std::option::Option<crate::types::VocabularyState>,
49    _request_id: Option<String>,
50}
51impl DeleteVocabularyOutputBuilder {
52    /// <p>The Amazon Resource Name (ARN) of the custom vocabulary.</p>
53    /// This field is required.
54    pub fn vocabulary_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.vocabulary_arn = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The Amazon Resource Name (ARN) of the custom vocabulary.</p>
59    pub fn set_vocabulary_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.vocabulary_arn = input;
61        self
62    }
63    /// <p>The Amazon Resource Name (ARN) of the custom vocabulary.</p>
64    pub fn get_vocabulary_arn(&self) -> &::std::option::Option<::std::string::String> {
65        &self.vocabulary_arn
66    }
67    /// <p>The identifier of the custom vocabulary.</p>
68    /// This field is required.
69    pub fn vocabulary_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.vocabulary_id = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>The identifier of the custom vocabulary.</p>
74    pub fn set_vocabulary_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.vocabulary_id = input;
76        self
77    }
78    /// <p>The identifier of the custom vocabulary.</p>
79    pub fn get_vocabulary_id(&self) -> &::std::option::Option<::std::string::String> {
80        &self.vocabulary_id
81    }
82    /// <p>The current state of the custom vocabulary.</p>
83    /// This field is required.
84    pub fn state(mut self, input: crate::types::VocabularyState) -> Self {
85        self.state = ::std::option::Option::Some(input);
86        self
87    }
88    /// <p>The current state of the custom vocabulary.</p>
89    pub fn set_state(mut self, input: ::std::option::Option<crate::types::VocabularyState>) -> Self {
90        self.state = input;
91        self
92    }
93    /// <p>The current state of the custom vocabulary.</p>
94    pub fn get_state(&self) -> &::std::option::Option<crate::types::VocabularyState> {
95        &self.state
96    }
97    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
98        self._request_id = Some(request_id.into());
99        self
100    }
101
102    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
103        self._request_id = request_id;
104        self
105    }
106    /// Consumes the builder and constructs a [`DeleteVocabularyOutput`](crate::operation::delete_vocabulary::DeleteVocabularyOutput).
107    /// This method will fail if any of the following fields are not set:
108    /// - [`vocabulary_arn`](crate::operation::delete_vocabulary::builders::DeleteVocabularyOutputBuilder::vocabulary_arn)
109    /// - [`vocabulary_id`](crate::operation::delete_vocabulary::builders::DeleteVocabularyOutputBuilder::vocabulary_id)
110    /// - [`state`](crate::operation::delete_vocabulary::builders::DeleteVocabularyOutputBuilder::state)
111    pub fn build(
112        self,
113    ) -> ::std::result::Result<crate::operation::delete_vocabulary::DeleteVocabularyOutput, ::aws_smithy_types::error::operation::BuildError> {
114        ::std::result::Result::Ok(crate::operation::delete_vocabulary::DeleteVocabularyOutput {
115            vocabulary_arn: self.vocabulary_arn.ok_or_else(|| {
116                ::aws_smithy_types::error::operation::BuildError::missing_field(
117                    "vocabulary_arn",
118                    "vocabulary_arn was not specified but it is required when building DeleteVocabularyOutput",
119                )
120            })?,
121            vocabulary_id: self.vocabulary_id.ok_or_else(|| {
122                ::aws_smithy_types::error::operation::BuildError::missing_field(
123                    "vocabulary_id",
124                    "vocabulary_id was not specified but it is required when building DeleteVocabularyOutput",
125                )
126            })?,
127            state: self.state.ok_or_else(|| {
128                ::aws_smithy_types::error::operation::BuildError::missing_field(
129                    "state",
130                    "state was not specified but it is required when building DeleteVocabularyOutput",
131                )
132            })?,
133            _request_id: self._request_id,
134        })
135    }
136}