// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
/// Constructs a fluent builder for the [`PutTrace`](crate::operation::put_trace::builders::PutTraceFluentBuilder) operation.
///
/// - The fluent builder is configurable:
/// - [`session_id(impl Into<String>)`](crate::operation::put_trace::builders::PutTraceFluentBuilder::session_id) / [`set_session_id(Option<String>)`](crate::operation::put_trace::builders::PutTraceFluentBuilder::set_session_id):<br>required: **false**<br><p>The agent session this trace belongs to and the grouping key: multiple PutTrace calls with the same <code>sessionId</code> are one session. Optional. If you omit it, the service generates one and returns it in the response. It is not the <code>traceId</code>: an OTLP batch carries many trace_ids under one session.</p><br>
/// - [`client_token(impl Into<String>)`](crate::operation::put_trace::builders::PutTraceFluentBuilder::client_token) / [`set_client_token(Option<String>)`](crate::operation::put_trace::builders::PutTraceFluentBuilder::set_client_token):<br>required: **false**<br><p>Makes the call idempotent. A retry with the same token and the same request returns the same <code>sessionId</code> and does not write the traces again. Reusing the token fails with <code>ValidationException</code> if the request is different, or if another caller reuses it when <code>accessControlConfig</code> names no entries. A token is honored for 8 hours after its first use. When <code>accessControlConfig</code> names no entries and the caller's end user cannot be resolved at the time of the retry, the retry fails with <code>ValidationException</code> even if the first attempt stored traces. To complete them, resend with explicit entries under a new token.</p><br>
/// - [`format(TraceFormat)`](crate::operation::put_trace::builders::PutTraceFluentBuilder::format) / [`set_format(Option<TraceFormat>)`](crate::operation::put_trace::builders::PutTraceFluentBuilder::set_format):<br>required: **true**<br><p>The format of the documents in <code>traceDocuments</code>. Valid values:</p> <ul> <li> <p><code>OTEL</code> - OpenTelemetry traces in OTLP/JSON.</p></li> <li> <p><code>ANTHROPIC</code> - Claude Code session logs, one log line per document.</p></li> <li> <p><code>BEDROCK_CONVERSE</code> - Amazon Bedrock Converse messages, one message (<code>role</code> and <code>content</code>) per document, in conversation order.</p></li> <li> <p><code>KIRO</code> - Kiro IDE or Kiro CLI session logs.</p></li> </ul><br>
/// - [`trace_documents(Blob)`](crate::operation::put_trace::builders::PutTraceFluentBuilder::trace_documents) / [`set_trace_documents(Option<Vec::<Blob>>)`](crate::operation::put_trace::builders::PutTraceFluentBuilder::set_trace_documents):<br>required: **true**<br><p>The raw trace documents, in the trace schema that <code>format</code> selects. You can send 1–100 documents per call, and each document can be up to 5 MiB (5,242,880 bytes) before encoding. If you use an AWS SDK, pass each document's raw bytes. If you call PutTrace through the agent context's MCP server or another JSON client, send each document as a base64-encoded string.</p><br>
/// - [`agent_context_arns(impl Into<String>)`](crate::operation::put_trace::builders::PutTraceFluentBuilder::agent_context_arns) / [`set_agent_context_arns(Option<Vec::<String>>)`](crate::operation::put_trace::builders::PutTraceFluentBuilder::set_agent_context_arns):<br>required: **true**<br><p>The ARNs of the agent contexts that the traces are about: 1–10 <code>agent-context/</code> ARNs that name at most 5 distinct agent contexts, in this Region and partition, all in your account. If you name more, the request fails with <code>ValidationException</code>. AWS Context authorizes <code>context:PutTrace</code> once for each agent context. If any authorization is denied, the whole call fails with <code>AccessDeniedException</code>, and nothing is stored. After authorization, if trace analysis is disabled for an agent context, the call fails with <code>ValidationException</code>, and nothing is stored.</p><br>
/// - [`trace_metadata(impl Into<String>, impl Into<String>)`](crate::operation::put_trace::builders::PutTraceFluentBuilder::trace_metadata) / [`set_trace_metadata(Option<HashMap::<String, String>>)`](crate::operation::put_trace::builders::PutTraceFluentBuilder::set_trace_metadata):<br>required: **false**<br><p>Client-supplied key-value pairs, stored with the traces as-is. The key <code>analysisMode</code> is reserved. A request that sets it fails with <code>AccessDeniedException</code>.</p><br>
/// - [`access_control_config(AccessControlConfig)`](crate::operation::put_trace::builders::PutTraceFluentBuilder::access_control_config) / [`set_access_control_config(Option<AccessControlConfig>)`](crate::operation::put_trace::builders::PutTraceFluentBuilder::set_access_control_config):<br>required: **false**<br><p>The principals who can see the insights that AWS Context generates from the traces. If you provide entries, the caller is not included unless an entry names it.</p> <p>If you provide no entries (<code>accessControlConfig</code> absent, or <code>accessControlList</code> absent or empty), only the end user that the caller's trusted identity propagation session names can see the insights. If the session names no end user, or there is no session, the call fails with <code>ValidationException</code> and stores nothing. In that case, name the principals, or send <code>ALLOW</code> for <code>*</code> so that every reader of the agent contexts can see the insights.</p> <p>An entry other than <code>*</code> without <code>principalType</code>, a <code>principalId</code> that is not valid Unicode, or entries that total more than 65,536 bytes of UTF-8 are rejected with <code>ValidationException</code>. AWS Context stores principal IDs as given and does not verify them against a directory. A session's access control is the union of its traces' entries. A call that would take that union over 100 entries, or over 65,536 bytes of UTF-8, fails with <code>ValidationException</code> and stores nothing.</p><br>
/// - On success, responds with [`PutTraceOutput`](crate::operation::put_trace::PutTraceOutput) with field(s):
/// - [`session_id(String)`](crate::operation::put_trace::PutTraceOutput::session_id): <p>The session ID for the traces: the <code>sessionId</code> that you specified, or one that AWS Context generated if you omitted it. A successful response means that AWS Context stored every document. A failed call might leave some documents stored. To store the rest without duplicates, retry with the same <code>clientToken</code>.</p>
/// - On failure, responds with [`SdkError<PutTraceError>`](crate::operation::put_trace::PutTraceError)
pub fn put_trace(&self) -> crate::operation::put_trace::builders::PutTraceFluentBuilder {
crate::operation::put_trace::builders::PutTraceFluentBuilder::new(self.handle.clone())
}
}