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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Provides information about the execution process for different types of invocations, such as model invocation, knowledge base invocation, agent collaborator invocation, guardrail invocation, and code interpreter Invocation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Metadata {
/// <p>In the final response, <code>startTime</code> is the start time of the agent invocation operation.</p>
pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>In the final response, <code>endTime</code> is the end time of the agent invocation operation.</p>
pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The total execution time for the specific invocation being processed (model, knowledge base, guardrail, agent collaborator, or code interpreter). It represents how long the individual invocation took.</p>
pub total_time_ms: ::std::option::Option<i64>,
/// <p>The total time it took for the agent to complete execution. This field is only set for the final response.</p>
pub operation_total_time_ms: ::std::option::Option<i64>,
/// <p>A unique identifier associated with the downstream invocation. This ID can be used for tracing, debugging, and identifying specific invocations in customer logs or systems.</p>
pub client_request_id: ::std::option::Option<::std::string::String>,
/// <p>Specific to model invocation and contains details about the usage of a foundation model.</p>
pub usage: ::std::option::Option<crate::types::Usage>,
}
impl Metadata {
/// <p>In the final response, <code>startTime</code> is the start time of the agent invocation operation.</p>
pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.start_time.as_ref()
}
/// <p>In the final response, <code>endTime</code> is the end time of the agent invocation operation.</p>
pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.end_time.as_ref()
}
/// <p>The total execution time for the specific invocation being processed (model, knowledge base, guardrail, agent collaborator, or code interpreter). It represents how long the individual invocation took.</p>
pub fn total_time_ms(&self) -> ::std::option::Option<i64> {
self.total_time_ms
}
/// <p>The total time it took for the agent to complete execution. This field is only set for the final response.</p>
pub fn operation_total_time_ms(&self) -> ::std::option::Option<i64> {
self.operation_total_time_ms
}
/// <p>A unique identifier associated with the downstream invocation. This ID can be used for tracing, debugging, and identifying specific invocations in customer logs or systems.</p>
pub fn client_request_id(&self) -> ::std::option::Option<&str> {
self.client_request_id.as_deref()
}
/// <p>Specific to model invocation and contains details about the usage of a foundation model.</p>
pub fn usage(&self) -> ::std::option::Option<&crate::types::Usage> {
self.usage.as_ref()
}
}
impl ::std::fmt::Debug for Metadata {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("Metadata");
formatter.field("start_time", &"*** Sensitive Data Redacted ***");
formatter.field("end_time", &"*** Sensitive Data Redacted ***");
formatter.field("total_time_ms", &"*** Sensitive Data Redacted ***");
formatter.field("operation_total_time_ms", &"*** Sensitive Data Redacted ***");
formatter.field("client_request_id", &"*** Sensitive Data Redacted ***");
formatter.field("usage", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
impl Metadata {
/// Creates a new builder-style object to manufacture [`Metadata`](crate::types::Metadata).
pub fn builder() -> crate::types::builders::MetadataBuilder {
crate::types::builders::MetadataBuilder::default()
}
}
/// A builder for [`Metadata`](crate::types::Metadata).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct MetadataBuilder {
pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) total_time_ms: ::std::option::Option<i64>,
pub(crate) operation_total_time_ms: ::std::option::Option<i64>,
pub(crate) client_request_id: ::std::option::Option<::std::string::String>,
pub(crate) usage: ::std::option::Option<crate::types::Usage>,
}
impl MetadataBuilder {
/// <p>In the final response, <code>startTime</code> is the start time of the agent invocation operation.</p>
pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.start_time = ::std::option::Option::Some(input);
self
}
/// <p>In the final response, <code>startTime</code> is the start time of the agent invocation operation.</p>
pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.start_time = input;
self
}
/// <p>In the final response, <code>startTime</code> is the start time of the agent invocation operation.</p>
pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.start_time
}
/// <p>In the final response, <code>endTime</code> is the end time of the agent invocation operation.</p>
pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.end_time = ::std::option::Option::Some(input);
self
}
/// <p>In the final response, <code>endTime</code> is the end time of the agent invocation operation.</p>
pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.end_time = input;
self
}
/// <p>In the final response, <code>endTime</code> is the end time of the agent invocation operation.</p>
pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.end_time
}
/// <p>The total execution time for the specific invocation being processed (model, knowledge base, guardrail, agent collaborator, or code interpreter). It represents how long the individual invocation took.</p>
pub fn total_time_ms(mut self, input: i64) -> Self {
self.total_time_ms = ::std::option::Option::Some(input);
self
}
/// <p>The total execution time for the specific invocation being processed (model, knowledge base, guardrail, agent collaborator, or code interpreter). It represents how long the individual invocation took.</p>
pub fn set_total_time_ms(mut self, input: ::std::option::Option<i64>) -> Self {
self.total_time_ms = input;
self
}
/// <p>The total execution time for the specific invocation being processed (model, knowledge base, guardrail, agent collaborator, or code interpreter). It represents how long the individual invocation took.</p>
pub fn get_total_time_ms(&self) -> &::std::option::Option<i64> {
&self.total_time_ms
}
/// <p>The total time it took for the agent to complete execution. This field is only set for the final response.</p>
pub fn operation_total_time_ms(mut self, input: i64) -> Self {
self.operation_total_time_ms = ::std::option::Option::Some(input);
self
}
/// <p>The total time it took for the agent to complete execution. This field is only set for the final response.</p>
pub fn set_operation_total_time_ms(mut self, input: ::std::option::Option<i64>) -> Self {
self.operation_total_time_ms = input;
self
}
/// <p>The total time it took for the agent to complete execution. This field is only set for the final response.</p>
pub fn get_operation_total_time_ms(&self) -> &::std::option::Option<i64> {
&self.operation_total_time_ms
}
/// <p>A unique identifier associated with the downstream invocation. This ID can be used for tracing, debugging, and identifying specific invocations in customer logs or systems.</p>
pub fn client_request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.client_request_id = ::std::option::Option::Some(input.into());
self
}
/// <p>A unique identifier associated with the downstream invocation. This ID can be used for tracing, debugging, and identifying specific invocations in customer logs or systems.</p>
pub fn set_client_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_request_id = input;
self
}
/// <p>A unique identifier associated with the downstream invocation. This ID can be used for tracing, debugging, and identifying specific invocations in customer logs or systems.</p>
pub fn get_client_request_id(&self) -> &::std::option::Option<::std::string::String> {
&self.client_request_id
}
/// <p>Specific to model invocation and contains details about the usage of a foundation model.</p>
pub fn usage(mut self, input: crate::types::Usage) -> Self {
self.usage = ::std::option::Option::Some(input);
self
}
/// <p>Specific to model invocation and contains details about the usage of a foundation model.</p>
pub fn set_usage(mut self, input: ::std::option::Option<crate::types::Usage>) -> Self {
self.usage = input;
self
}
/// <p>Specific to model invocation and contains details about the usage of a foundation model.</p>
pub fn get_usage(&self) -> &::std::option::Option<crate::types::Usage> {
&self.usage
}
/// Consumes the builder and constructs a [`Metadata`](crate::types::Metadata).
pub fn build(self) -> crate::types::Metadata {
crate::types::Metadata {
start_time: self.start_time,
end_time: self.end_time,
total_time_ms: self.total_time_ms,
operation_total_time_ms: self.operation_total_time_ms,
client_request_id: self.client_request_id,
usage: self.usage,
}
}
}
impl ::std::fmt::Debug for MetadataBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("MetadataBuilder");
formatter.field("start_time", &"*** Sensitive Data Redacted ***");
formatter.field("end_time", &"*** Sensitive Data Redacted ***");
formatter.field("total_time_ms", &"*** Sensitive Data Redacted ***");
formatter.field("operation_total_time_ms", &"*** Sensitive Data Redacted ***");
formatter.field("client_request_id", &"*** Sensitive Data Redacted ***");
formatter.field("usage", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}