aws_sdk_opensearchmemory/client/create_memory.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3 /// Constructs a fluent builder for the [`CreateMemory`](crate::operation::create_memory::builders::CreateMemoryFluentBuilder) operation.
4 ///
5 /// - The fluent builder is configurable:
6 /// - [`space_id(impl Into<String>)`](crate::operation::create_memory::builders::CreateMemoryFluentBuilder::space_id) / [`set_space_id(Option<String>)`](crate::operation::create_memory::builders::CreateMemoryFluentBuilder::set_space_id):<br>required: **true**<br><p>The ID of the space that owns the memory, for example <code>sp-02864597b164</code>.</p><br>
7 /// - [`name(impl Into<String>)`](crate::operation::create_memory::builders::CreateMemoryFluentBuilder::name) / [`set_name(Option<String>)`](crate::operation::create_memory::builders::CreateMemoryFluentBuilder::set_name):<br>required: **true**<br><p>The 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.</p><br>
8 /// - [`content(impl Into<String>)`](crate::operation::create_memory::builders::CreateMemoryFluentBuilder::content) / [`set_content(Option<String>)`](crate::operation::create_memory::builders::CreateMemoryFluentBuilder::set_content):<br>required: **true**<br><p>The memory text, stored and embedded as provided.</p><br>
9 /// - [`actor_id(impl Into<String>)`](crate::operation::create_memory::builders::CreateMemoryFluentBuilder::actor_id) / [`set_actor_id(Option<String>)`](crate::operation::create_memory::builders::CreateMemoryFluentBuilder::set_actor_id):<br>required: **true**<br><p>The actor (end user or agent) that owns the memory.</p><br>
10 /// - [`session_id(impl Into<String>)`](crate::operation::create_memory::builders::CreateMemoryFluentBuilder::session_id) / [`set_session_id(Option<String>)`](crate::operation::create_memory::builders::CreateMemoryFluentBuilder::set_session_id):<br>required: **false**<br><p>The session that the memory belongs to. If you omit it, the service generates a session ID and returns it.</p><br>
11 /// - [`metadata(impl Into<String>, impl Into<String>)`](crate::operation::create_memory::builders::CreateMemoryFluentBuilder::metadata) / [`set_metadata(Option<HashMap::<String, String>>)`](crate::operation::create_memory::builders::CreateMemoryFluentBuilder::set_metadata):<br>required: **false**<br><p>Metadata tags to store with the memory. Keys that begin with <code>x-amz-</code>, the key <code>documentS3Source</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><br>
12 /// - [`client_token(impl Into<String>)`](crate::operation::create_memory::builders::CreateMemoryFluentBuilder::client_token) / [`set_client_token(Option<String>)`](crate::operation::create_memory::builders::CreateMemoryFluentBuilder::set_client_token):<br>required: **false**<br><p>A 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 <code>memoryId</code> instead of creating a second memory. Reusing the token with a different <code>name</code>, <code>content</code>, <code>metadata</code>, <code>actorId</code>, or <code>sessionId</code> fails with <code>ConflictException</code>. If you omit <code>sessionId</code>, a retry with the same token gets the same session. If you omit the token, each call creates a new memory.</p><br>
13 /// - On success, responds with [`CreateMemoryOutput`](crate::operation::create_memory::CreateMemoryOutput) with field(s):
14 /// - [`memory(Option<CreateMemoryDetail>)`](crate::operation::create_memory::CreateMemoryOutput::memory): <p>The memory, identified but not yet indexed.</p>
15 /// - On failure, responds with [`SdkError<CreateMemoryError>`](crate::operation::create_memory::CreateMemoryError)
16 pub fn create_memory(&self) -> crate::operation::create_memory::builders::CreateMemoryFluentBuilder {
17 crate::operation::create_memory::builders::CreateMemoryFluentBuilder::new(self.handle.clone())
18 }
19}