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