1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct CreatePromptRouterInput {
/// <p>A unique, case-sensitive identifier that you provide to ensure idempotency of your requests. If not specified, the Amazon Web Services SDK automatically generates one for you.</p>
pub client_request_token: ::std::option::Option<::std::string::String>,
/// <p>The name of the prompt router. The name must be unique within your Amazon Web Services account in the current region.</p>
pub prompt_router_name: ::std::option::Option<::std::string::String>,
/// <p>A list of foundation models that the prompt router can route requests to. At least one model must be specified.</p>
pub models: ::std::option::Option<::std::vec::Vec<crate::types::PromptRouterTargetModel>>,
/// <p>An optional description of the prompt router to help identify its purpose.</p>
pub description: ::std::option::Option<::std::string::String>,
/// <p>The criteria, which is the response quality difference, used to determine how incoming requests are routed to different models.</p>
pub routing_criteria: ::std::option::Option<crate::types::RoutingCriteria>,
/// <p>The default model to use when the routing criteria is not met.</p>
pub fallback_model: ::std::option::Option<crate::types::PromptRouterTargetModel>,
/// <p>An array of key-value pairs to apply to this resource as tags. You can use tags to categorize and manage your Amazon Web Services resources.</p>
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreatePromptRouterInput {
/// <p>A unique, case-sensitive identifier that you provide to ensure idempotency of your requests. If not specified, the Amazon Web Services SDK automatically generates one for you.</p>
pub fn client_request_token(&self) -> ::std::option::Option<&str> {
self.client_request_token.as_deref()
}
/// <p>The name of the prompt router. The name must be unique within your Amazon Web Services account in the current region.</p>
pub fn prompt_router_name(&self) -> ::std::option::Option<&str> {
self.prompt_router_name.as_deref()
}
/// <p>A list of foundation models that the prompt router can route requests to. At least one model must be specified.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.models.is_none()`.
pub fn models(&self) -> &[crate::types::PromptRouterTargetModel] {
self.models.as_deref().unwrap_or_default()
}
/// <p>An optional description of the prompt router to help identify its purpose.</p>
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The criteria, which is the response quality difference, used to determine how incoming requests are routed to different models.</p>
pub fn routing_criteria(&self) -> ::std::option::Option<&crate::types::RoutingCriteria> {
self.routing_criteria.as_ref()
}
/// <p>The default model to use when the routing criteria is not met.</p>
pub fn fallback_model(&self) -> ::std::option::Option<&crate::types::PromptRouterTargetModel> {
self.fallback_model.as_ref()
}
/// <p>An array of key-value pairs to apply to this resource as tags. You can use tags to categorize and manage your Amazon Web Services resources.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
pub fn tags(&self) -> &[crate::types::Tag] {
self.tags.as_deref().unwrap_or_default()
}
}
impl ::std::fmt::Debug for CreatePromptRouterInput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("CreatePromptRouterInput");
formatter.field("client_request_token", &self.client_request_token);
formatter.field("prompt_router_name", &self.prompt_router_name);
formatter.field("models", &self.models);
formatter.field("description", &"*** Sensitive Data Redacted ***");
formatter.field("routing_criteria", &self.routing_criteria);
formatter.field("fallback_model", &self.fallback_model);
formatter.field("tags", &self.tags);
formatter.finish()
}
}
impl CreatePromptRouterInput {
/// Creates a new builder-style object to manufacture [`CreatePromptRouterInput`](crate::operation::create_prompt_router::CreatePromptRouterInput).
pub fn builder() -> crate::operation::create_prompt_router::builders::CreatePromptRouterInputBuilder {
crate::operation::create_prompt_router::builders::CreatePromptRouterInputBuilder::default()
}
}
/// A builder for [`CreatePromptRouterInput`](crate::operation::create_prompt_router::CreatePromptRouterInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreatePromptRouterInputBuilder {
pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
pub(crate) prompt_router_name: ::std::option::Option<::std::string::String>,
pub(crate) models: ::std::option::Option<::std::vec::Vec<crate::types::PromptRouterTargetModel>>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) routing_criteria: ::std::option::Option<crate::types::RoutingCriteria>,
pub(crate) fallback_model: ::std::option::Option<crate::types::PromptRouterTargetModel>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreatePromptRouterInputBuilder {
/// <p>A unique, case-sensitive identifier that you provide to ensure idempotency of your requests. If not specified, the Amazon Web Services SDK automatically generates one for you.</p>
pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.client_request_token = ::std::option::Option::Some(input.into());
self
}
/// <p>A unique, case-sensitive identifier that you provide to ensure idempotency of your requests. If not specified, the Amazon Web Services SDK automatically generates one for you.</p>
pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_request_token = input;
self
}
/// <p>A unique, case-sensitive identifier that you provide to ensure idempotency of your requests. If not specified, the Amazon Web Services SDK automatically generates one for you.</p>
pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
&self.client_request_token
}
/// <p>The name of the prompt router. The name must be unique within your Amazon Web Services account in the current region.</p>
/// This field is required.
pub fn prompt_router_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.prompt_router_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the prompt router. The name must be unique within your Amazon Web Services account in the current region.</p>
pub fn set_prompt_router_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.prompt_router_name = input;
self
}
/// <p>The name of the prompt router. The name must be unique within your Amazon Web Services account in the current region.</p>
pub fn get_prompt_router_name(&self) -> &::std::option::Option<::std::string::String> {
&self.prompt_router_name
}
/// Appends an item to `models`.
///
/// To override the contents of this collection use [`set_models`](Self::set_models).
///
/// <p>A list of foundation models that the prompt router can route requests to. At least one model must be specified.</p>
pub fn models(mut self, input: crate::types::PromptRouterTargetModel) -> Self {
let mut v = self.models.unwrap_or_default();
v.push(input);
self.models = ::std::option::Option::Some(v);
self
}
/// <p>A list of foundation models that the prompt router can route requests to. At least one model must be specified.</p>
pub fn set_models(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PromptRouterTargetModel>>) -> Self {
self.models = input;
self
}
/// <p>A list of foundation models that the prompt router can route requests to. At least one model must be specified.</p>
pub fn get_models(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PromptRouterTargetModel>> {
&self.models
}
/// <p>An optional description of the prompt router to help identify its purpose.</p>
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
/// <p>An optional description of the prompt router to help identify its purpose.</p>
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
/// <p>An optional description of the prompt router to help identify its purpose.</p>
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
/// <p>The criteria, which is the response quality difference, used to determine how incoming requests are routed to different models.</p>
/// This field is required.
pub fn routing_criteria(mut self, input: crate::types::RoutingCriteria) -> Self {
self.routing_criteria = ::std::option::Option::Some(input);
self
}
/// <p>The criteria, which is the response quality difference, used to determine how incoming requests are routed to different models.</p>
pub fn set_routing_criteria(mut self, input: ::std::option::Option<crate::types::RoutingCriteria>) -> Self {
self.routing_criteria = input;
self
}
/// <p>The criteria, which is the response quality difference, used to determine how incoming requests are routed to different models.</p>
pub fn get_routing_criteria(&self) -> &::std::option::Option<crate::types::RoutingCriteria> {
&self.routing_criteria
}
/// <p>The default model to use when the routing criteria is not met.</p>
/// This field is required.
pub fn fallback_model(mut self, input: crate::types::PromptRouterTargetModel) -> Self {
self.fallback_model = ::std::option::Option::Some(input);
self
}
/// <p>The default model to use when the routing criteria is not met.</p>
pub fn set_fallback_model(mut self, input: ::std::option::Option<crate::types::PromptRouterTargetModel>) -> Self {
self.fallback_model = input;
self
}
/// <p>The default model to use when the routing criteria is not met.</p>
pub fn get_fallback_model(&self) -> &::std::option::Option<crate::types::PromptRouterTargetModel> {
&self.fallback_model
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>An array of key-value pairs to apply to this resource as tags. You can use tags to categorize and manage your Amazon Web Services resources.</p>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
/// <p>An array of key-value pairs to apply to this resource as tags. You can use tags to categorize and manage your Amazon Web Services resources.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags = input;
self
}
/// <p>An array of key-value pairs to apply to this resource as tags. You can use tags to categorize and manage your Amazon Web Services resources.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags
}
/// Consumes the builder and constructs a [`CreatePromptRouterInput`](crate::operation::create_prompt_router::CreatePromptRouterInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_prompt_router::CreatePromptRouterInput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::create_prompt_router::CreatePromptRouterInput {
client_request_token: self.client_request_token,
prompt_router_name: self.prompt_router_name,
models: self.models,
description: self.description,
routing_criteria: self.routing_criteria,
fallback_model: self.fallback_model,
tags: self.tags,
})
}
}
impl ::std::fmt::Debug for CreatePromptRouterInputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("CreatePromptRouterInputBuilder");
formatter.field("client_request_token", &self.client_request_token);
formatter.field("prompt_router_name", &self.prompt_router_name);
formatter.field("models", &self.models);
formatter.field("description", &"*** Sensitive Data Redacted ***");
formatter.field("routing_criteria", &self.routing_criteria);
formatter.field("fallback_model", &self.fallback_model);
formatter.field("tags", &self.tags);
formatter.finish()
}
}