aws_sdk_bedrockagent/operation/update_prompt/
_update_prompt_input.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)]
5pub struct UpdatePromptInput {
6    /// <p>A name for the prompt.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>A description for the prompt.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt.</p>
11    pub customer_encryption_key_arn: ::std::option::Option<::std::string::String>,
12    /// <p>The name of the default variant for the prompt. This value must match the <code>name</code> field in the relevant <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html">PromptVariant</a> object.</p>
13    pub default_variant: ::std::option::Option<::std::string::String>,
14    /// <p>A list of objects, each containing details about a variant of the prompt.</p>
15    pub variants: ::std::option::Option<::std::vec::Vec<crate::types::PromptVariant>>,
16    /// <p>The unique identifier of the prompt.</p>
17    pub prompt_identifier: ::std::option::Option<::std::string::String>,
18}
19impl UpdatePromptInput {
20    /// <p>A name for the prompt.</p>
21    pub fn name(&self) -> ::std::option::Option<&str> {
22        self.name.as_deref()
23    }
24    /// <p>A description for the prompt.</p>
25    pub fn description(&self) -> ::std::option::Option<&str> {
26        self.description.as_deref()
27    }
28    /// <p>The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt.</p>
29    pub fn customer_encryption_key_arn(&self) -> ::std::option::Option<&str> {
30        self.customer_encryption_key_arn.as_deref()
31    }
32    /// <p>The name of the default variant for the prompt. This value must match the <code>name</code> field in the relevant <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html">PromptVariant</a> object.</p>
33    pub fn default_variant(&self) -> ::std::option::Option<&str> {
34        self.default_variant.as_deref()
35    }
36    /// <p>A list of objects, each containing details about a variant of the prompt.</p>
37    ///
38    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.variants.is_none()`.
39    pub fn variants(&self) -> &[crate::types::PromptVariant] {
40        self.variants.as_deref().unwrap_or_default()
41    }
42    /// <p>The unique identifier of the prompt.</p>
43    pub fn prompt_identifier(&self) -> ::std::option::Option<&str> {
44        self.prompt_identifier.as_deref()
45    }
46}
47impl ::std::fmt::Debug for UpdatePromptInput {
48    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
49        let mut formatter = f.debug_struct("UpdatePromptInput");
50        formatter.field("name", &self.name);
51        formatter.field("description", &self.description);
52        formatter.field("customer_encryption_key_arn", &self.customer_encryption_key_arn);
53        formatter.field("default_variant", &self.default_variant);
54        formatter.field("variants", &"*** Sensitive Data Redacted ***");
55        formatter.field("prompt_identifier", &self.prompt_identifier);
56        formatter.finish()
57    }
58}
59impl UpdatePromptInput {
60    /// Creates a new builder-style object to manufacture [`UpdatePromptInput`](crate::operation::update_prompt::UpdatePromptInput).
61    pub fn builder() -> crate::operation::update_prompt::builders::UpdatePromptInputBuilder {
62        crate::operation::update_prompt::builders::UpdatePromptInputBuilder::default()
63    }
64}
65
66/// A builder for [`UpdatePromptInput`](crate::operation::update_prompt::UpdatePromptInput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
68#[non_exhaustive]
69pub struct UpdatePromptInputBuilder {
70    pub(crate) name: ::std::option::Option<::std::string::String>,
71    pub(crate) description: ::std::option::Option<::std::string::String>,
72    pub(crate) customer_encryption_key_arn: ::std::option::Option<::std::string::String>,
73    pub(crate) default_variant: ::std::option::Option<::std::string::String>,
74    pub(crate) variants: ::std::option::Option<::std::vec::Vec<crate::types::PromptVariant>>,
75    pub(crate) prompt_identifier: ::std::option::Option<::std::string::String>,
76}
77impl UpdatePromptInputBuilder {
78    /// <p>A name for the prompt.</p>
79    /// This field is required.
80    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.name = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>A name for the prompt.</p>
85    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.name = input;
87        self
88    }
89    /// <p>A name for the prompt.</p>
90    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
91        &self.name
92    }
93    /// <p>A description for the prompt.</p>
94    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.description = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>A description for the prompt.</p>
99    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.description = input;
101        self
102    }
103    /// <p>A description for the prompt.</p>
104    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
105        &self.description
106    }
107    /// <p>The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt.</p>
108    pub fn customer_encryption_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.customer_encryption_key_arn = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt.</p>
113    pub fn set_customer_encryption_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.customer_encryption_key_arn = input;
115        self
116    }
117    /// <p>The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt.</p>
118    pub fn get_customer_encryption_key_arn(&self) -> &::std::option::Option<::std::string::String> {
119        &self.customer_encryption_key_arn
120    }
121    /// <p>The name of the default variant for the prompt. This value must match the <code>name</code> field in the relevant <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html">PromptVariant</a> object.</p>
122    pub fn default_variant(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.default_variant = ::std::option::Option::Some(input.into());
124        self
125    }
126    /// <p>The name of the default variant for the prompt. This value must match the <code>name</code> field in the relevant <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html">PromptVariant</a> object.</p>
127    pub fn set_default_variant(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.default_variant = input;
129        self
130    }
131    /// <p>The name of the default variant for the prompt. This value must match the <code>name</code> field in the relevant <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html">PromptVariant</a> object.</p>
132    pub fn get_default_variant(&self) -> &::std::option::Option<::std::string::String> {
133        &self.default_variant
134    }
135    /// Appends an item to `variants`.
136    ///
137    /// To override the contents of this collection use [`set_variants`](Self::set_variants).
138    ///
139    /// <p>A list of objects, each containing details about a variant of the prompt.</p>
140    pub fn variants(mut self, input: crate::types::PromptVariant) -> Self {
141        let mut v = self.variants.unwrap_or_default();
142        v.push(input);
143        self.variants = ::std::option::Option::Some(v);
144        self
145    }
146    /// <p>A list of objects, each containing details about a variant of the prompt.</p>
147    pub fn set_variants(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PromptVariant>>) -> Self {
148        self.variants = input;
149        self
150    }
151    /// <p>A list of objects, each containing details about a variant of the prompt.</p>
152    pub fn get_variants(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PromptVariant>> {
153        &self.variants
154    }
155    /// <p>The unique identifier of the prompt.</p>
156    /// This field is required.
157    pub fn prompt_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.prompt_identifier = ::std::option::Option::Some(input.into());
159        self
160    }
161    /// <p>The unique identifier of the prompt.</p>
162    pub fn set_prompt_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.prompt_identifier = input;
164        self
165    }
166    /// <p>The unique identifier of the prompt.</p>
167    pub fn get_prompt_identifier(&self) -> &::std::option::Option<::std::string::String> {
168        &self.prompt_identifier
169    }
170    /// Consumes the builder and constructs a [`UpdatePromptInput`](crate::operation::update_prompt::UpdatePromptInput).
171    pub fn build(
172        self,
173    ) -> ::std::result::Result<crate::operation::update_prompt::UpdatePromptInput, ::aws_smithy_types::error::operation::BuildError> {
174        ::std::result::Result::Ok(crate::operation::update_prompt::UpdatePromptInput {
175            name: self.name,
176            description: self.description,
177            customer_encryption_key_arn: self.customer_encryption_key_arn,
178            default_variant: self.default_variant,
179            variants: self.variants,
180            prompt_identifier: self.prompt_identifier,
181        })
182    }
183}
184impl ::std::fmt::Debug for UpdatePromptInputBuilder {
185    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
186        let mut formatter = f.debug_struct("UpdatePromptInputBuilder");
187        formatter.field("name", &self.name);
188        formatter.field("description", &self.description);
189        formatter.field("customer_encryption_key_arn", &self.customer_encryption_key_arn);
190        formatter.field("default_variant", &self.default_variant);
191        formatter.field("variants", &"*** Sensitive Data Redacted ***");
192        formatter.field("prompt_identifier", &self.prompt_identifier);
193        formatter.finish()
194    }
195}