pub struct Client { /* private fields */ }Expand description
Client for Amazon OpenSearch Memory
Client for invoking operations on Amazon OpenSearch Memory. Each operation on Amazon OpenSearch Memory is a method on this
this struct. .send() MUST be invoked on the generated operations to dispatch the request to the service.
§Constructing a Client
A Config is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env(), since this will resolve an SdkConfig which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env() instead, which returns a ConfigLoader that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_opensearchmemory::Client::new(&config);Occasionally, SDKs may have additional service-specific values that can be set on the Config that
is absent from SdkConfig, or slightly different settings for a specific client may be desired.
The Builder struct implements From<&SdkConfig>, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_opensearchmemory::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();See the aws-config docs and Config for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the BatchGetEvent operation has
a Client::batch_get_event, function which returns a builder for that operation.
The fluent builder ultimately has a send() function that returns an async future that
returns a result, as illustrated below:
let result = client.batch_get_event()
.space_id("example")
.send()
.await;The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize module for more
information.
§Waiters
This client provides wait_until methods behind the Waiters trait.
To use them, simply import the trait, and then call one of the wait_until methods. This will
return a waiter fluent builder that takes various parameters, which are documented on the builder
type. Once parameters have been provided, the wait method can be called to initiate waiting.
For example, if there was a wait_until_thing method, it could look like:
let result = client.wait_until_thing()
.thing_id("someId")
.wait(Duration::from_secs(120))
.await;Implementations§
Source§impl Client
impl Client
Sourcepub fn batch_get_event(&self) -> BatchGetEventFluentBuilder
pub fn batch_get_event(&self) -> BatchGetEventFluentBuilder
Constructs a fluent builder for the BatchGetEvent operation.
- The fluent builder is configurable:
space_id(impl Into<String>)/set_space_id(Option<String>):
required: trueThe ID of the space.
actor_id(impl Into<String>)/set_actor_id(Option<String>):
required: falseThe actor that every requested event must belong to. Omit it to skip this check. The operation reports an event that doesn’t match in
errorsasRESOURCE_NOT_FOUND.session_id(impl Into<String>)/set_session_id(Option<String>):
required: falseThe session that every requested event must belong to. Omit it to skip this check. The operation reports an event that doesn’t match in
errorsasRESOURCE_NOT_FOUND.event_ids(impl Into<String>)/set_event_ids(Option<Vec::<String>>):
required: trueThe IDs of the events to get: 1 to 10, without duplicates.
- On success, responds with
BatchGetEventOutputwith field(s):events(Vec::<Event>):The events found, in the order that you requested their IDs.
errors(Vec::<BatchGetEventError>):An entry for each requested event that the call didn’t return. Empty when the call returned every event.
- On failure, responds with
SdkError<BatchGetEventError>
Source§impl Client
impl Client
Sourcepub fn create_event(&self) -> CreateEventFluentBuilder
pub fn create_event(&self) -> CreateEventFluentBuilder
Constructs a fluent builder for the CreateEvent operation.
- The fluent builder is configurable:
space_id(impl Into<String>)/set_space_id(Option<String>):
required: trueThe ID of the space that owns the event, for example
sp-02864597b164.actor_id(impl Into<String>)/set_actor_id(Option<String>):
required: trueThe ID of the actor (end user or agent) that the event belongs to.
session_id(impl Into<String>)/set_session_id(Option<String>):
required: falseThe session the event belongs to. Send every event of one conversation with the same session ID, so that
SUMMARYstrategies summarize the conversation as one session. If you omit it, the service generates a session ID and returns it.event_timestamp(DateTime)/set_event_timestamp(Option<DateTime>):
required: falseWhen the event occurred. The default is the time that the service receives the request.
payload(EventPayload)/set_payload(Option<EventPayload>):
required: trueThe event content. Set exactly one union member.
metadata(impl Into<String>, impl Into<String>)/set_metadata(Option<HashMap::<String, String>>):
required: falseMetadata tags to store with the event. Memories derived from the event carry the same tags. Keys that begin with
x-amz-, the keysdocumentS3SourceanddocumentS3Url, and other keys that the service uses internally are reserved: a request that sets one fails withValidationException, and the message names the key.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
ValidationException. Reuse an existing key instead.client_token(impl Into<String>)/set_client_token(Option<String>):
required: falseA 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
sessionId, returns the same event. If you omitsessionId, the service generates a new one on each attempt, so a retry fails withConflictException. Reusing the token with different request content also fails withConflictException.eventTimestampisn’t compared. After 2 hours, the token starts a new event.infer(bool)/set_infer(Option<bool>):
required: falseSpecifies whether to extract memories from this event. The default is
true. Set it tofalseto store the event without extraction: the service skips strategies that infer memories, and still indexes the event’s turns forSearchEvents. A document submitted as ablobis still extracted.
- On success, responds with
CreateEventOutputwith field(s):event(Option<EventDetail>):The stored event’s identifiers: its ID, session, and timestamp.
- On failure, responds with
SdkError<CreateEventError>
Source§impl Client
impl Client
Sourcepub fn create_memory(&self) -> CreateMemoryFluentBuilder
pub fn create_memory(&self) -> CreateMemoryFluentBuilder
Constructs a fluent builder for the CreateMemory operation.
- The fluent builder is configurable:
space_id(impl Into<String>)/set_space_id(Option<String>):
required: trueThe ID of the space that owns the memory, for example
sp-02864597b164.name(impl Into<String>)/set_name(Option<String>):
required: trueThe name of the strategy that the memory belongs to. The space must already declare the strategy, and the memory’s type comes from that strategy. The name must be 1 to 64 characters: letters, digits, periods, hyphens, and underscores, starting with a letter or digit.
content(impl Into<String>)/set_content(Option<String>):
required: trueThe memory text, stored and embedded as provided.
actor_id(impl Into<String>)/set_actor_id(Option<String>):
required: trueThe actor (end user or agent) that owns the memory.
session_id(impl Into<String>)/set_session_id(Option<String>):
required: falseThe session that the memory belongs to. If you omit it, the service generates a session ID and returns it.
metadata(impl Into<String>, impl Into<String>)/set_metadata(Option<HashMap::<String, String>>):
required: falseMetadata tags to store with the memory. Keys that begin with
x-amz-, the keydocumentS3Source, and other keys that the service uses internally are reserved: a request that sets one fails withValidationException, and the message names the key.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
ValidationException. Reuse an existing key instead.client_token(impl Into<String>)/set_client_token(Option<String>):
required: falseA unique, case-sensitive identifier that makes the request idempotent. Within 2 hours of the first request, a retry with the same token returns the same
memoryIdinstead of creating a second memory. Reusing the token with a differentname,content,metadata,actorId, orsessionIdfails withConflictException. If you omitsessionId, a retry with the same token gets the same session. If you omit the token, each call creates a new memory.
- On success, responds with
CreateMemoryOutputwith field(s):memory(Option<CreateMemoryDetail>):The memory, identified but not yet indexed.
- On failure, responds with
SdkError<CreateMemoryError>
Source§impl Client
impl Client
Sourcepub fn create_space(&self) -> CreateSpaceFluentBuilder
pub fn create_space(&self) -> CreateSpaceFluentBuilder
Constructs a fluent builder for the CreateSpace operation.
- The fluent builder is configurable:
name(impl Into<String>)/set_name(Option<String>):
required: trueA name for the space, unique within your account in the Region. If another space already has the name, the request fails with
ConflictException.memory_strategies(MemoryStrategy)/set_memory_strategies(Option<Vec::<MemoryStrategy>>):
required: falseThe memory strategies that extract memories from the space’s events: up to 10 strategies, each with a name that is unique within the space.
Optional. Omit it, or send an empty list, to create a space with no memory strategies. Such a space stores the conversation events you send it and returns them through
SearchEventsandListEvents, but extracts no memories and has none to search. You can add strategies later withUpdateSpace.The serialized list can be at most 384 KiB.
event_expiry_days(i32)/set_event_expiry_days(Option<i32>):
required: falseHow many days the space keeps each event, from 1 to 365. The default is 90.
memory_expiry_days(i32)/set_memory_expiry_days(Option<i32>):
required: falseHow many days the space keeps each memory, from 0 to 3650, counted from when the service writes the memory. Updating a memory with
UpdateMemorydoesn’t restart the count. 0 means memories never expire. If you omit it, memories never expire.Searches and lists leave out a memory past its expiry, and reading, updating, or deleting it returns
ResourceNotFoundException.extraction_model_id(impl Into<String>)/set_extraction_model_id(Option<String>):
required: falseThe model that extracts and consolidates memories for every strategy in the space, as an Amazon Bedrock model ID without an inference-profile prefix:
anthropic.claude-opus-5-5oranthropic.claude-haiku-5-5. Another value fails withValidationException, and the message lists the supported IDs. Omit it to use the service default, which can change over time and isn’t returned byGetSpace. Setting a value pins the model.encryption_configuration(EncryptionConfiguration)/set_encryption_configuration(Option<EncryptionConfiguration>):
required: falseThe AWS KMS key that encrypts the space’s data. Omit it, or omit its
kmsKeyArn, to use an AWS owned key. You can’t change the key after you create the space.tags(Tag)/set_tags(Option<Vec::<Tag>>):
required: falseThe tags to add to the space.
client_token(impl Into<String>)/set_client_token(Option<String>):
required: falseA unique, case-sensitive identifier that makes the request idempotent. A retry with the same token and the same parameters within 2 hours returns the space that the first request created, instead of creating another. Reusing the token with different parameters, or while the first request is still in progress, fails with
ConflictException.
- On success, responds with
CreateSpaceOutputwith field(s):space_id(String):The ID of the space.
arn(String):The Amazon Resource Name (ARN) of the space.
name(String):The name of the space.
status(SpaceStatus):The status of the space:
CREATING.created_at(DateTime):When the space was created.
- On failure, responds with
SdkError<CreateSpaceError>
Source§impl Client
impl Client
Sourcepub fn delete_event(&self) -> DeleteEventFluentBuilder
pub fn delete_event(&self) -> DeleteEventFluentBuilder
Constructs a fluent builder for the DeleteEvent operation.
- The fluent builder is configurable:
space_id(impl Into<String>)/set_space_id(Option<String>):
required: trueThe ID of the space.
event_id(impl Into<String>)/set_event_id(Option<String>):
required: trueThe ID of the event to delete.
actor_id(impl Into<String>)/set_actor_id(Option<String>):
required: falseThe actor that the event must belong to. Omit it to skip this check. If it doesn’t match the stored event, the call fails with
ResourceNotFoundException, as if the event did not exist.session_id(impl Into<String>)/set_session_id(Option<String>):
required: falseThe session that the event must belong to. Omit it to skip this check. If it doesn’t match the stored event, the call fails with
ResourceNotFoundException, as if the event did not exist.
- On success, responds with
DeleteEventOutputwith field(s):event_id(String):The ID of the deleted event.
- On failure, responds with
SdkError<DeleteEventError>
Source§impl Client
impl Client
Sourcepub fn delete_memory(&self) -> DeleteMemoryFluentBuilder
pub fn delete_memory(&self) -> DeleteMemoryFluentBuilder
Constructs a fluent builder for the DeleteMemory operation.
- The fluent builder is configurable:
space_id(impl Into<String>)/set_space_id(Option<String>):
required: trueThe ID of the space that owns the memory.
memory_id(impl Into<String>)/set_memory_id(Option<String>):
required: trueThe ID of the memory to delete.
actor_id(impl Into<String>)/set_actor_id(Option<String>):
required: falseThe ID of the actor that the memory must belong to. Omit it to skip this check. If it doesn’t match the stored memory, the call fails with
ResourceNotFoundException, as if the memory did not exist.strategy_name(impl Into<String>)/set_strategy_name(Option<String>):
required: falseThe name of the strategy that the memory must belong to. Omit it to skip this check. If it doesn’t match the stored memory, the call fails with
ResourceNotFoundException, as if the memory did not exist.
- On success, responds with
DeleteMemoryOutputwith field(s):memory_id(String):The ID of the deleted memory.
- On failure, responds with
SdkError<DeleteMemoryError>
Source§impl Client
impl Client
Sourcepub fn delete_space(&self) -> DeleteSpaceFluentBuilder
pub fn delete_space(&self) -> DeleteSpaceFluentBuilder
Constructs a fluent builder for the DeleteSpace operation.
- The fluent builder is configurable:
space_id(impl Into<String>)/set_space_id(Option<String>):
required: trueThe ID of the space to delete.
- On success, responds with
DeleteSpaceOutputwith field(s):space_id(String):The ID of the space.
status(SpaceStatus):The status of the space:
DELETING.
- On failure, responds with
SdkError<DeleteSpaceError>
Source§impl Client
impl Client
Sourcepub fn get_event(&self) -> GetEventFluentBuilder
pub fn get_event(&self) -> GetEventFluentBuilder
Constructs a fluent builder for the GetEvent operation.
- The fluent builder is configurable:
space_id(impl Into<String>)/set_space_id(Option<String>):
required: trueThe ID of the space.
event_id(impl Into<String>)/set_event_id(Option<String>):
required: trueThe event’s ID, as returned by
CreateEvent,ListEvents, orSearchEvents.actor_id(impl Into<String>)/set_actor_id(Option<String>):
required: falseThe actor the event must belong to. Omit it to skip this check. If it doesn’t match the stored event, the call fails with
ResourceNotFoundException, as if the event did not exist.session_id(impl Into<String>)/set_session_id(Option<String>):
required: falseThe session the event must belong to. Omit it to skip this check. If it doesn’t match the stored event, the call fails with
ResourceNotFoundException, as if the event did not exist.
- On success, responds with
GetEventOutputwith field(s):event(Option<Event>):The event, including its payload.
- On failure, responds with
SdkError<GetEventError>
Source§impl Client
impl Client
Sourcepub fn get_memory(&self) -> GetMemoryFluentBuilder
pub fn get_memory(&self) -> GetMemoryFluentBuilder
Constructs a fluent builder for the GetMemory operation.
- The fluent builder is configurable:
space_id(impl Into<String>)/set_space_id(Option<String>):
required: trueThe ID of the space that holds the memory.
memory_id(impl Into<String>)/set_memory_id(Option<String>):
required: trueThe memory’s ID, as returned by
SearchMemoriesorListMemories.actor_id(impl Into<String>)/set_actor_id(Option<String>):
required: falseThe ID of the actor the memory must belong to. Omit it to skip this check. If it doesn’t match the stored memory, the call fails with
ResourceNotFoundException, as if the memory did not exist.strategy_name(impl Into<String>)/set_strategy_name(Option<String>):
required: falseThe name of the strategy the memory must belong to. Omit it to skip this check. If it doesn’t match the stored memory, the call fails with
ResourceNotFoundException, as if the memory did not exist.
- On success, responds with
GetMemoryOutputwith field(s):memory(Option<Memory>):The memory. Always present: a memory that doesn’t exist returns
ResourceNotFoundException.
- On failure, responds with
SdkError<GetMemoryError>
Source§impl Client
impl Client
Sourcepub fn get_space(&self) -> GetSpaceFluentBuilder
pub fn get_space(&self) -> GetSpaceFluentBuilder
Constructs a fluent builder for the GetSpace operation.
- The fluent builder is configurable:
space_id(impl Into<String>)/set_space_id(Option<String>):
required: trueThe ID of the space.
- On success, responds with
GetSpaceOutputwith field(s):space_id(String):The ID of the space.
arn(String):The Amazon Resource Name (ARN) of the space.
name(String):The name of the space.
status(SpaceStatus):The status of the space.
status_reason(Option<String>):Details about why the space is
FAILED. Read it only whenstatusisFAILED: it can still hold the reason for an earlier failure.created_at(DateTime):When the space was created.
memory_strategies(Option<Vec::<MemoryStrategy>>):The space’s memory strategies, including the names the service generated for strategies created without one. Empty for a space that has no memory strategies.
event_expiry_days(Option<i32>):How many days the space keeps each event. Absent when it was never set, in which case the default of 90 days applies.
memory_expiry_days(Option<i32>):How many days the space keeps each memory. 0 means memories never expire. Absent when it was never set, in which case memories never expire.
extraction_model_id(Option<String>):The model that extracts and consolidates memories for the space. Absent when it was never set, in which case the service default applies.
encryption_configuration(Option<EncryptionConfiguration>):The AWS KMS key the space was created with. Absent when the space uses an AWS owned key.
- On failure, responds with
SdkError<GetSpaceError>
Source§impl Client
impl Client
Sourcepub fn list_events(&self) -> ListEventsFluentBuilder
pub fn list_events(&self) -> ListEventsFluentBuilder
Constructs a fluent builder for the ListEvents operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
space_id(impl Into<String>)/set_space_id(Option<String>):
required: trueThe ID of the space.
actor_id(impl Into<String>)/set_actor_id(Option<String>):
required: trueThe actor whose events to list.
session_id(impl Into<String>)/set_session_id(Option<String>):
required: trueThe session whose events to list. To find events across sessions, use
SearchEvents.event_timestamp_before(DateTime)/set_event_timestamp_before(Option<DateTime>):
required: falseInclusive upper bound on
eventTimestamp: only events at or before this time are returned. Omit for no upper bound.event_timestamp_after(DateTime)/set_event_timestamp_after(Option<DateTime>):
required: falseInclusive lower bound on
eventTimestamp: only events at or after this time are returned. Omit for no lower bound.If it’s later than
eventTimestampBefore, the request fails withValidationException.sort_order(SortOrder)/set_sort_order(Option<SortOrder>):
required: falseThe order of the results by
eventTimestamp:ASCorDESC. The default isDESC, most recent first.metadata_filters(impl Into<String>, impl Into<String>)/set_metadata_filters(Option<HashMap::<String, String>>):
required: falseReturns only events whose metadata contains every one of these key-value pairs. Omit, or leave empty, for no metadata filter. The service applies the filter after it reads events, so a page can hold fewer than
maxResultsevents, or none, and still return anextToken. Keep paging untilnextTokenis absent.max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of events to return, from 1 to 100. The default is 20.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseThe token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
- On success, responds with
ListEventsOutputwith field(s):events(Vec::<EventSummary>):The events, without their payloads. Call
GetEventfor an event’s payload.next_token(Option<String>):The token for the next set of results. Absent when there are no more results.
- On failure, responds with
SdkError<ListEventsError>
Source§impl Client
impl Client
Sourcepub fn list_memories(&self) -> ListMemoriesFluentBuilder
pub fn list_memories(&self) -> ListMemoriesFluentBuilder
Constructs a fluent builder for the ListMemories operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
space_id(impl Into<String>)/set_space_id(Option<String>):
required: trueThe space whose memories to list.
memory_strategies(StrategySelector)/set_memory_strategies(Option<Vec::<StrategySelector>>):
required: falseThe strategies to list, as selectors. A selector without
memoryStrategyNameslists every strategy of its type, and omittingmemoryStrategieslists every strategy in the space. A name that is not a declared strategy of that type fails withValidationException.actor_ids(impl Into<String>)/set_actor_ids(Option<Vec::<String>>):
required: falseLists only memories owned by one of these actors. Combined with
sessionIdsby AND: a memory must match both filters when both are given. Omit for no actor filter. An empty list fails validation. A memory stored without an actor never matches an actor filter.session_ids(impl Into<String>)/set_session_ids(Option<Vec::<String>>):
required: falseLists only memories from one of these sessions. Combined with
actorIdsby AND. Omit for no session filter. An empty list fails validation. A memory stored without a session never matches a session filter.sort_by(MemorySortField)/set_sort_by(Option<MemorySortField>):
required: falseThe timestamp to sort by, as returned in
systemMetadata:CREATED_AT(the default) orUPDATED_AT.sort_order(SortOrder)/set_sort_order(Option<SortOrder>):
required: falseThe sort order:
ASCorDESC. The default isDESC, most recent first.max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of memories to return, from 1 to 100. The default is 20.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseThe token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
- On success, responds with
ListMemoriesOutputwith field(s):memories(Vec::<MemoryListSummary>):The memories, in the requested order. Empty when there are none.
next_token(Option<String>):The token for the next set of results. Absent when there are no more results.
- On failure, responds with
SdkError<ListMemoriesError>
Source§impl Client
impl Client
Sourcepub fn list_spaces(&self) -> ListSpacesFluentBuilder
pub fn list_spaces(&self) -> ListSpacesFluentBuilder
Constructs a fluent builder for the ListSpaces operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of spaces to return, from 1 to 100. The default is 100.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseThe token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
- On success, responds with
ListSpacesOutputwith field(s):spaces(Vec::<SpaceSummary>):The spaces.
next_token(Option<String>):The token for the next set of results. Absent when there are no more results.
- On failure, responds with
SdkError<ListSpacesError>
Source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)/set_resource_arn(Option<String>):
required: trueThe Amazon Resource Name (ARN) of the space.
- On success, responds with
ListTagsForResourceOutputwith field(s):tags(Option<Vec::<Tag>>):The tags for the space.
- On failure, responds with
SdkError<ListTagsForResourceError>
Source§impl Client
impl Client
Sourcepub fn search_events(&self) -> SearchEventsFluentBuilder
pub fn search_events(&self) -> SearchEventsFluentBuilder
Constructs a fluent builder for the SearchEvents operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
space_id(impl Into<String>)/set_space_id(Option<String>):
required: trueThe space whose events to search. Use
actorIdandsessionIdsto narrow the search within it.actor_id(impl Into<String>)/set_actor_id(Option<String>):
required: trueThe actor whose events to search (exact match). Required: every search covers exactly one actor, and an event stored without an actor is never returned. Narrow the search further with
sessionIds, combined by AND. This is the only way to filter by actor: a query that referencessystem_metadata.actor_idfails withValidationException(reasonnonFilterableField).session_ids(impl Into<String>)/set_session_ids(Option<Vec::<String>>):
required: falseReturns only events from one of these sessions (exact match). Combined with
actorIdby AND. Omit for no session filter. An empty list fails validation. An event stored without a session never matches a session filter. This is the only way to filter by session: a query that referencessystem_metadata.session_idfails withValidationException(reasonnonFilterableField).query(Document)/set_query(Option<Document>):
required: trueThe query: a subset of the OpenSearch Query DSL (see
SearchQuery), validated by the same rules as onSearchMemories. Query event text astextand embeddings asvector. A search covers both conversation turns and chunks of documents submitted as ablob. You can’t use actor and session fields here. Use the top-levelactorIdandsessionIds.To search only the content of particular events, filter on
event_idswithtermorterms, for example with thesourceEventIdsthat aSearchMemoriesresult returns. Atermsclause onevent_idscan list up to 10 event IDs. More IDs fail withValidationException(reasonqueryBodyTooLarge). You can useevent_idsonly interm,terms, andexistsqueries.sort(Document)/set_sort(Option<Document>):
required: falseThe sort order (see
SearchSort). Omit to return the most relevant events first.max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of events to return, from 1 to 100. The default is 20.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseThe token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
- On success, responds with
SearchEventsOutputwith field(s):events(Vec::<EventSearchSummary>):The matching event chunks, in the order
sortrequests, or most relevant first when it has none. Empty when nothing matches. Each result is the matching chunk of an event. CallGetEventfor the whole event.next_token(Option<String>):The token for the next set of results. Absent when there are no more results.
- On failure, responds with
SdkError<SearchEventsError>
Source§impl Client
impl Client
Sourcepub fn search_memories(&self) -> SearchMemoriesFluentBuilder
pub fn search_memories(&self) -> SearchMemoriesFluentBuilder
Constructs a fluent builder for the SearchMemories operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
space_id(impl Into<String>)/set_space_id(Option<String>):
required: trueThe space to search. Use
actorIdto narrow the search within it.memory_strategies(StrategySelector)/set_memory_strategies(Option<Vec::<StrategySelector>>):
required: falseThe strategies to search, as a list of selectors. Each selector names a memory type and, optionally, specific strategy names of that type. A space can hold several strategies of the same type. A selector without
memoryStrategyNamessearches every strategy of its type, and omittingmemoryStrategiessearches every strategy in the space. A name that is not a declared strategy of that type fails withValidationException.actor_id(impl Into<String>)/set_actor_id(Option<String>):
required: trueThe actor whose memories to search (exact match). Required: every search covers exactly one actor, and a memory stored without an actor is never returned. This is the only way to filter by actor: a query that references
system_metadata.actor_idfails withValidationException(reasonnonFilterableField).query(Document)/set_query(Option<Document>):
required: trueThe query: a subset of the OpenSearch Query DSL (see
SearchQuery). You can’t use the actor and session fieldssystem_metadata.actor_idandsystem_metadata.session_idhere. Use the top-levelactorIdto filter by actor. Searching memories doesn’t filter by session.sort(Document)/set_sort(Option<Document>):
required: falseThe sort order (see
SearchSort). Omit to return the most relevant memories first.max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of memories to return, from 1 to 100. The default is 20.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseThe token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
- On success, responds with
SearchMemoriesOutputwith field(s):memories(Vec::<MemorySearchSummary>):The matching memories, in the order
sortrequests, or most relevant first when it has none. Empty when nothing matches.next_token(Option<String>):The token for the next set of results. Absent when there are no more results.
- On failure, responds with
SdkError<SearchMemoriesError>
Source§impl Client
impl Client
Sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)/set_resource_arn(Option<String>):
required: trueThe Amazon Resource Name (ARN) of the space.
tags(Tag)/set_tags(Option<Vec::<Tag>>):
required: trueThe tags to add to the space.
- On success, responds with
TagResourceOutput - On failure, responds with
SdkError<TagResourceError>
Source§impl Client
impl Client
Sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)/set_resource_arn(Option<String>):
required: trueThe Amazon Resource Name (ARN) of the space.
tag_keys(impl Into<String>)/set_tag_keys(Option<Vec::<String>>):
required: trueThe keys of the tags to remove from the space.
- On success, responds with
UntagResourceOutput - On failure, responds with
SdkError<UntagResourceError>
Source§impl Client
impl Client
Sourcepub fn update_memory(&self) -> UpdateMemoryFluentBuilder
pub fn update_memory(&self) -> UpdateMemoryFluentBuilder
Constructs a fluent builder for the UpdateMemory operation.
- The fluent builder is configurable:
space_id(impl Into<String>)/set_space_id(Option<String>):
required: trueThe ID of the space that owns the memory, for example
sp-02864597b164.memory_id(impl Into<String>)/set_memory_id(Option<String>):
required: trueThe ID of the memory to update.
content(impl Into<String>)/set_content(Option<String>):
required: falseReplacement memory text. Supplying it re-embeds the memory. Omit to leave the text unchanged.
metadata(impl Into<String>, impl Into<String>)/set_metadata(Option<HashMap::<String, String>>):
required: falseThe metadata tags to apply. By default this map replaces the stored metadata, and any key not present is removed. Set
metadataModetoMERGEto keep the keys you don’t supply. Limits apply to the resulting metadata, not to the request. Keys that begin withx-amz-and the keydocumentS3Sourceare reserved: a request that sets one fails withValidationException.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
ValidationException. Reuse an existing key instead.metadata_mode(MetadataMode)/set_metadata_mode(Option<MetadataMode>):
required: falseHow
metadatacombines with what is stored. The default isREPLACE.actor_id(impl Into<String>)/set_actor_id(Option<String>):
required: falseThe ID of the actor that the memory must belong to. Omit it to skip this check. If it doesn’t match the stored memory, the call fails with
ResourceNotFoundException, as if the memory did not exist.strategy_name(impl Into<String>)/set_strategy_name(Option<String>):
required: falseThe name of the strategy that the memory must belong to. Omit it to skip this check. If it doesn’t match the stored memory, the call fails with
ResourceNotFoundException, as if the memory did not exist.
- On success, responds with
UpdateMemoryOutputwith field(s):memory(Option<Memory>):The updated memory, in the same shape that
GetMemoryreturns.
- On failure, responds with
SdkError<UpdateMemoryError>
Source§impl Client
impl Client
Sourcepub fn update_space(&self) -> UpdateSpaceFluentBuilder
pub fn update_space(&self) -> UpdateSpaceFluentBuilder
Constructs a fluent builder for the UpdateSpace operation.
- The fluent builder is configurable:
space_id(impl Into<String>)/set_space_id(Option<String>):
required: trueThe ID of the space to update.
memory_strategies(MemoryStrategy)/set_memory_strategies(Option<Vec::<MemoryStrategy>>):
required: falseThe complete new list of memory strategies. The service removes strategies that aren’t in the list from the space. Removing a strategy stops extraction for it but doesn’t delete its memories: they’re kept, until they expire if the space sets
memoryExpiryDays, and they’re available again if you later add a strategy with the sametypeandname. To delete them, useDeleteMemorybefore you remove the strategy, or delete the space.To keep a strategy, include it with the same
typeandnamethatGetSpacereturns. For a kept strategy, anyconfigurationmember you omit keeps its current value. It doesn’t return to the default, and you can’t clear a member once it’s set. Omit this field to leave the strategies unchanged. The list must name at least one strategy. You can’t remove every strategy from a space withUpdateSpace.The serialized list can be at most 384 KiB.
event_expiry_days(i32)/set_event_expiry_days(Option<i32>):
required: falseHow many days the space keeps each event, from 1 to 365. Omit it to leave the current value unchanged. Events already stored keep the expiry they were written with.
memory_expiry_days(i32)/set_memory_expiry_days(Option<i32>):
required: falseHow many days the space keeps each memory, from 0 to 3650. 0 means memories never expire. Omit it to leave the current value unchanged. You can’t clear the setting. To make memories written from then on never expire, send 0.
GetSpacethen returns 0.A change applies to memories written after it. Memories already stored keep the expiry they were written with. A memory the service rewrites later, such as a summary it keeps up to date, takes the setting in force at that rewrite. A change moves the space to
UPDATING. Sending the value that the space has stored doesn’t.extraction_model_id(impl Into<String>)/set_extraction_model_id(Option<String>):
required: falseThe model that extracts and consolidates memories for every strategy in the space:
anthropic.claude-opus-5-5oranthropic.claude-haiku-5-5. Omit it to leave the current value unchanged. Once set, it can’t be cleared back to the service default.
- On success, responds with
UpdateSpaceOutputwith field(s):space_id(String):The ID of the space.
status(SpaceStatus):The status of the space:
UPDATINGwhen the change has to be applied to the space’s strategies, retention, or extraction model. Otherwise, the space’s current status.
- On failure, responds with
SdkError<UpdateSpaceError>
Source§impl Client
impl Client
Sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_implconfigured. - Identity caching is enabled without a
sleep_implandtime_sourceconfigured. - No
behavior_versionis provided.
The panic message for each of these will have instructions on how to resolve them.
Source§impl Client
impl Client
Sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_configis missing an async sleep implementation. If you experience this panic, set thesleep_implon the Config passed into this function to fix it. - This method will panic if the
sdk_configis missing an HTTP connector. If you experience this panic, set thehttp_connectoron the Config passed into this function to fix it. - This method will panic if no
BehaviorVersionis provided. If you experience this panic, setbehavior_versionon the Config or enable thebehavior-version-latestCargo feature.
Trait Implementations§
Source§impl Waiters for Client
impl Waiters for Client
Source§fn wait_until_space_active(&self) -> SpaceActiveFluentBuilder
fn wait_until_space_active(&self) -> SpaceActiveFluentBuilder
ACTIVE.Source§fn wait_until_space_deleted(&self) -> SpaceDeletedFluentBuilder
fn wait_until_space_deleted(&self) -> SpaceDeletedFluentBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Forget for Client
impl Freeze for Client
impl Move for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);