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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A request for the client to execute a specific tool with given parameters.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Call {
/// <p>A unique identifier for this tool call, used to match results back to requests.</p>
pub call_id: ::std::string::String,
/// <p>The input parameters for the tool call, formatted according to the tool's schema.</p>
pub input: ::aws_smithy_types::Document,
/// <p>The name of the tool to invoke, following the pattern 'tool.{toolName}' or 'browser.{browserAction}'.</p>
pub name: ::std::string::String,
}
impl Call {
/// <p>A unique identifier for this tool call, used to match results back to requests.</p>
pub fn call_id(&self) -> &str {
use std::ops::Deref;
self.call_id.deref()
}
/// <p>The input parameters for the tool call, formatted according to the tool's schema.</p>
pub fn input(&self) -> &::aws_smithy_types::Document {
&self.input
}
/// <p>The name of the tool to invoke, following the pattern 'tool.{toolName}' or 'browser.{browserAction}'.</p>
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
}
impl ::std::fmt::Debug for Call {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("Call");
formatter.field("call_id", &self.call_id);
formatter.field("input", &"*** Sensitive Data Redacted ***");
formatter.field("name", &self.name);
formatter.finish()
}
}
impl Call {
/// Creates a new builder-style object to manufacture [`Call`](crate::types::Call).
pub fn builder() -> crate::types::builders::CallBuilder {
crate::types::builders::CallBuilder::default()
}
}
/// A builder for [`Call`](crate::types::Call).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CallBuilder {
pub(crate) call_id: ::std::option::Option<::std::string::String>,
pub(crate) input: ::std::option::Option<::aws_smithy_types::Document>,
pub(crate) name: ::std::option::Option<::std::string::String>,
}
impl CallBuilder {
/// <p>A unique identifier for this tool call, used to match results back to requests.</p>
/// This field is required.
pub fn call_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.call_id = ::std::option::Option::Some(input.into());
self
}
/// <p>A unique identifier for this tool call, used to match results back to requests.</p>
pub fn set_call_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.call_id = input;
self
}
/// <p>A unique identifier for this tool call, used to match results back to requests.</p>
pub fn get_call_id(&self) -> &::std::option::Option<::std::string::String> {
&self.call_id
}
/// <p>The input parameters for the tool call, formatted according to the tool's schema.</p>
/// This field is required.
pub fn input(mut self, input: ::aws_smithy_types::Document) -> Self {
self.input = ::std::option::Option::Some(input);
self
}
/// <p>The input parameters for the tool call, formatted according to the tool's schema.</p>
pub fn set_input(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
self.input = input;
self
}
/// <p>The input parameters for the tool call, formatted according to the tool's schema.</p>
pub fn get_input(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
&self.input
}
/// <p>The name of the tool to invoke, following the pattern 'tool.{toolName}' or 'browser.{browserAction}'.</p>
/// This field is required.
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the tool to invoke, following the pattern 'tool.{toolName}' or 'browser.{browserAction}'.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the tool to invoke, following the pattern 'tool.{toolName}' or 'browser.{browserAction}'.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// Consumes the builder and constructs a [`Call`](crate::types::Call).
/// This method will fail if any of the following fields are not set:
/// - [`call_id`](crate::types::builders::CallBuilder::call_id)
/// - [`input`](crate::types::builders::CallBuilder::input)
/// - [`name`](crate::types::builders::CallBuilder::name)
pub fn build(self) -> ::std::result::Result<crate::types::Call, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Call {
call_id: self.call_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"call_id",
"call_id was not specified but it is required when building Call",
)
})?,
input: self.input.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"input",
"input was not specified but it is required when building Call",
)
})?,
name: self.name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"name",
"name was not specified but it is required when building Call",
)
})?,
})
}
}
impl ::std::fmt::Debug for CallBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("CallBuilder");
formatter.field("call_id", &self.call_id);
formatter.field("input", &"*** Sensitive Data Redacted ***");
formatter.field("name", &self.name);
formatter.finish()
}
}