// 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, ::std::fmt::Debug)]
pub struct CreateEventInput {
/// <p>The ID of the space that owns the event, for example <code>sp-02864597b164</code>.</p>
pub space_id: ::std::option::Option<::std::string::String>,
/// <p>The ID of the actor (end user or agent) that the event belongs to.</p>
pub actor_id: ::std::option::Option<::std::string::String>,
/// <p>The session the event belongs to. Send every event of one conversation with the same session ID, so that <code>SUMMARY</code> strategies summarize the conversation as one session. If you omit it, the service generates a session ID and returns it.</p>
pub session_id: ::std::option::Option<::std::string::String>,
/// <p>When the event occurred. The default is the time that the service receives the request.</p>
pub event_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The event content. Set exactly one union member.</p>
pub payload: ::std::option::Option<crate::types::EventPayload>,
/// <p>Metadata tags to store with the event. Memories derived from the event carry the same tags. Keys that begin with <code>x-amz-</code>, the keys <code>documentS3Source</code> and <code>documentS3Url</code>, and other keys that the service uses internally are reserved: a request that sets one fails with <code>ValidationException</code>, and the message names the key.</p>
/// <p>A space can use at most 50 distinct metadata keys across all of its events and memories. A request that would add a key beyond that fails with <code>ValidationException</code>. Reuse an existing key instead.</p>
pub metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
/// <p>A unique, case-sensitive identifier that makes the request idempotent. Within 2 hours of the first request, a retry with the same token and the same request, including the same <code>sessionId</code>, returns the same event. If you omit <code>sessionId</code>, the service generates a new one on each attempt, so a retry fails with <code>ConflictException</code>. Reusing the token with different request content also fails with <code>ConflictException</code>. <code>eventTimestamp</code> isn't compared. After 2 hours, the token starts a new event.</p>
pub client_token: ::std::option::Option<::std::string::String>,
/// <p>Specifies whether to extract memories from this event. The default is <code>true</code>. Set it to <code>false</code> to store the event without extraction: the service skips strategies that infer memories, and still indexes the event's turns for <code>SearchEvents</code>. A document submitted as a <code>blob</code> is still extracted.</p>
pub infer: ::std::option::Option<bool>,
}
impl CreateEventInput {
/// <p>The ID of the space that owns the event, for example <code>sp-02864597b164</code>.</p>
pub fn space_id(&self) -> ::std::option::Option<&str> {
self.space_id.as_deref()
}
/// <p>The ID of the actor (end user or agent) that the event belongs to.</p>
pub fn actor_id(&self) -> ::std::option::Option<&str> {
self.actor_id.as_deref()
}
/// <p>The session the event belongs to. Send every event of one conversation with the same session ID, so that <code>SUMMARY</code> strategies summarize the conversation as one session. If you omit it, the service generates a session ID and returns it.</p>
pub fn session_id(&self) -> ::std::option::Option<&str> {
self.session_id.as_deref()
}
/// <p>When the event occurred. The default is the time that the service receives the request.</p>
pub fn event_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.event_timestamp.as_ref()
}
/// <p>The event content. Set exactly one union member.</p>
pub fn payload(&self) -> ::std::option::Option<&crate::types::EventPayload> {
self.payload.as_ref()
}
/// <p>Metadata tags to store with the event. Memories derived from the event carry the same tags. Keys that begin with <code>x-amz-</code>, the keys <code>documentS3Source</code> and <code>documentS3Url</code>, and other keys that the service uses internally are reserved: a request that sets one fails with <code>ValidationException</code>, and the message names the key.</p>
/// <p>A space can use at most 50 distinct metadata keys across all of its events and memories. A request that would add a key beyond that fails with <code>ValidationException</code>. Reuse an existing key instead.</p>
pub fn metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.metadata.as_ref()
}
/// <p>A unique, case-sensitive identifier that makes the request idempotent. Within 2 hours of the first request, a retry with the same token and the same request, including the same <code>sessionId</code>, returns the same event. If you omit <code>sessionId</code>, the service generates a new one on each attempt, so a retry fails with <code>ConflictException</code>. Reusing the token with different request content also fails with <code>ConflictException</code>. <code>eventTimestamp</code> isn't compared. After 2 hours, the token starts a new event.</p>
pub fn client_token(&self) -> ::std::option::Option<&str> {
self.client_token.as_deref()
}
/// <p>Specifies whether to extract memories from this event. The default is <code>true</code>. Set it to <code>false</code> to store the event without extraction: the service skips strategies that infer memories, and still indexes the event's turns for <code>SearchEvents</code>. A document submitted as a <code>blob</code> is still extracted.</p>
pub fn infer(&self) -> ::std::option::Option<bool> {
self.infer
}
}
impl CreateEventInput {
/// Creates a new builder-style object to manufacture [`CreateEventInput`](crate::operation::create_event::CreateEventInput).
pub fn builder() -> crate::operation::create_event::builders::CreateEventInputBuilder {
crate::operation::create_event::builders::CreateEventInputBuilder::default()
}
}
/// A builder for [`CreateEventInput`](crate::operation::create_event::CreateEventInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateEventInputBuilder {
pub(crate) space_id: ::std::option::Option<::std::string::String>,
pub(crate) actor_id: ::std::option::Option<::std::string::String>,
pub(crate) session_id: ::std::option::Option<::std::string::String>,
pub(crate) event_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) payload: ::std::option::Option<crate::types::EventPayload>,
pub(crate) metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) client_token: ::std::option::Option<::std::string::String>,
pub(crate) infer: ::std::option::Option<bool>,
}
impl CreateEventInputBuilder {
/// <p>The ID of the space that owns the event, for example <code>sp-02864597b164</code>.</p>
/// This field is required.
pub fn space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.space_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the space that owns the event, for example <code>sp-02864597b164</code>.</p>
pub fn set_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.space_id = input;
self
}
/// <p>The ID of the space that owns the event, for example <code>sp-02864597b164</code>.</p>
pub fn get_space_id(&self) -> &::std::option::Option<::std::string::String> {
&self.space_id
}
/// <p>The ID of the actor (end user or agent) that the event belongs to.</p>
/// This field is required.
pub fn actor_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.actor_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the actor (end user or agent) that the event belongs to.</p>
pub fn set_actor_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.actor_id = input;
self
}
/// <p>The ID of the actor (end user or agent) that the event belongs to.</p>
pub fn get_actor_id(&self) -> &::std::option::Option<::std::string::String> {
&self.actor_id
}
/// <p>The session the event belongs to. Send every event of one conversation with the same session ID, so that <code>SUMMARY</code> strategies summarize the conversation as one session. If you omit it, the service generates a session ID and returns it.</p>
pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.session_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The session the event belongs to. Send every event of one conversation with the same session ID, so that <code>SUMMARY</code> strategies summarize the conversation as one session. If you omit it, the service generates a session ID and returns it.</p>
pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.session_id = input;
self
}
/// <p>The session the event belongs to. Send every event of one conversation with the same session ID, so that <code>SUMMARY</code> strategies summarize the conversation as one session. If you omit it, the service generates a session ID and returns it.</p>
pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
&self.session_id
}
/// <p>When the event occurred. The default is the time that the service receives the request.</p>
pub fn event_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.event_timestamp = ::std::option::Option::Some(input);
self
}
/// <p>When the event occurred. The default is the time that the service receives the request.</p>
pub fn set_event_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.event_timestamp = input;
self
}
/// <p>When the event occurred. The default is the time that the service receives the request.</p>
pub fn get_event_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.event_timestamp
}
/// <p>The event content. Set exactly one union member.</p>
/// This field is required.
pub fn payload(mut self, input: crate::types::EventPayload) -> Self {
self.payload = ::std::option::Option::Some(input);
self
}
/// <p>The event content. Set exactly one union member.</p>
pub fn set_payload(mut self, input: ::std::option::Option<crate::types::EventPayload>) -> Self {
self.payload = input;
self
}
/// <p>The event content. Set exactly one union member.</p>
pub fn get_payload(&self) -> &::std::option::Option<crate::types::EventPayload> {
&self.payload
}
/// Adds a key-value pair to `metadata`.
///
/// To override the contents of this collection use [`set_metadata`](Self::set_metadata).
///
/// <p>Metadata tags to store with the event. Memories derived from the event carry the same tags. Keys that begin with <code>x-amz-</code>, the keys <code>documentS3Source</code> and <code>documentS3Url</code>, and other keys that the service uses internally are reserved: a request that sets one fails with <code>ValidationException</code>, and the message names the key.</p>
/// <p>A space can use at most 50 distinct metadata keys across all of its events and memories. A request that would add a key beyond that fails with <code>ValidationException</code>. Reuse an existing key instead.</p>
pub fn metadata(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.metadata.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.metadata = ::std::option::Option::Some(hash_map);
self
}
/// <p>Metadata tags to store with the event. Memories derived from the event carry the same tags. Keys that begin with <code>x-amz-</code>, the keys <code>documentS3Source</code> and <code>documentS3Url</code>, and other keys that the service uses internally are reserved: a request that sets one fails with <code>ValidationException</code>, and the message names the key.</p>
/// <p>A space can use at most 50 distinct metadata keys across all of its events and memories. A request that would add a key beyond that fails with <code>ValidationException</code>. Reuse an existing key instead.</p>
pub fn set_metadata(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.metadata = input;
self
}
/// <p>Metadata tags to store with the event. Memories derived from the event carry the same tags. Keys that begin with <code>x-amz-</code>, the keys <code>documentS3Source</code> and <code>documentS3Url</code>, and other keys that the service uses internally are reserved: a request that sets one fails with <code>ValidationException</code>, and the message names the key.</p>
/// <p>A space can use at most 50 distinct metadata keys across all of its events and memories. A request that would add a key beyond that fails with <code>ValidationException</code>. Reuse an existing key instead.</p>
pub fn get_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.metadata
}
/// <p>A unique, case-sensitive identifier that makes the request idempotent. Within 2 hours of the first request, a retry with the same token and the same request, including the same <code>sessionId</code>, returns the same event. If you omit <code>sessionId</code>, the service generates a new one on each attempt, so a retry fails with <code>ConflictException</code>. Reusing the token with different request content also fails with <code>ConflictException</code>. <code>eventTimestamp</code> isn't compared. After 2 hours, the token starts a new event.</p>
pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.client_token = ::std::option::Option::Some(input.into());
self
}
/// <p>A unique, case-sensitive identifier that makes the request idempotent. Within 2 hours of the first request, a retry with the same token and the same request, including the same <code>sessionId</code>, returns the same event. If you omit <code>sessionId</code>, the service generates a new one on each attempt, so a retry fails with <code>ConflictException</code>. Reusing the token with different request content also fails with <code>ConflictException</code>. <code>eventTimestamp</code> isn't compared. After 2 hours, the token starts a new event.</p>
pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_token = input;
self
}
/// <p>A unique, case-sensitive identifier that makes the request idempotent. Within 2 hours of the first request, a retry with the same token and the same request, including the same <code>sessionId</code>, returns the same event. If you omit <code>sessionId</code>, the service generates a new one on each attempt, so a retry fails with <code>ConflictException</code>. Reusing the token with different request content also fails with <code>ConflictException</code>. <code>eventTimestamp</code> isn't compared. After 2 hours, the token starts a new event.</p>
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
&self.client_token
}
/// <p>Specifies whether to extract memories from this event. The default is <code>true</code>. Set it to <code>false</code> to store the event without extraction: the service skips strategies that infer memories, and still indexes the event's turns for <code>SearchEvents</code>. A document submitted as a <code>blob</code> is still extracted.</p>
pub fn infer(mut self, input: bool) -> Self {
self.infer = ::std::option::Option::Some(input);
self
}
/// <p>Specifies whether to extract memories from this event. The default is <code>true</code>. Set it to <code>false</code> to store the event without extraction: the service skips strategies that infer memories, and still indexes the event's turns for <code>SearchEvents</code>. A document submitted as a <code>blob</code> is still extracted.</p>
pub fn set_infer(mut self, input: ::std::option::Option<bool>) -> Self {
self.infer = input;
self
}
/// <p>Specifies whether to extract memories from this event. The default is <code>true</code>. Set it to <code>false</code> to store the event without extraction: the service skips strategies that infer memories, and still indexes the event's turns for <code>SearchEvents</code>. A document submitted as a <code>blob</code> is still extracted.</p>
pub fn get_infer(&self) -> &::std::option::Option<bool> {
&self.infer
}
/// Consumes the builder and constructs a [`CreateEventInput`](crate::operation::create_event::CreateEventInput).
pub fn build(self) -> ::std::result::Result<crate::operation::create_event::CreateEventInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_event::CreateEventInput {
space_id: self.space_id,
actor_id: self.actor_id,
session_id: self.session_id,
event_timestamp: self.event_timestamp,
payload: self.payload,
metadata: self.metadata,
client_token: self.client_token,
infer: self.infer,
})
}
}