aws-sdk-opensearchmemory 1.0.0

AWS SDK for Amazon OpenSearch Memory
Documentation
// 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 UpdateSpaceInput {
    /// <p>The ID of the space to update.</p>
    pub space_id: ::std::option::Option<::std::string::String>,
    /// <p>The 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 <code>memoryExpiryDays</code>, and they're available again if you later add a strategy with the same <code>type</code> and <code>name</code>. To delete them, use <code>DeleteMemory</code> before you remove the strategy, or delete the space.</p>
    /// <p>To keep a strategy, include it with the same <code>type</code> and <code>name</code> that <code>GetSpace</code> returns. For a kept strategy, any <code>configuration</code> member 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 with <code>UpdateSpace</code>.</p>
    /// <p>The serialized list can be at most 384 KiB.</p>
    pub memory_strategies: ::std::option::Option<::std::vec::Vec<crate::types::MemoryStrategy>>,
    /// <p>How 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.</p>
    pub event_expiry_days: ::std::option::Option<i32>,
    /// <p>How 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. <code>GetSpace</code> then returns 0.</p>
    /// <p>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 <code>UPDATING</code>. Sending the value that the space has stored doesn't.</p>
    pub memory_expiry_days: ::std::option::Option<i32>,
    /// <p>The model that extracts and consolidates memories for every strategy in the space: <code>anthropic.claude-opus-5-5</code> or <code>anthropic.claude-haiku-5-5</code>. Omit it to leave the current value unchanged. Once set, it can't be cleared back to the service default.</p>
    pub extraction_model_id: ::std::option::Option<::std::string::String>,
}
impl UpdateSpaceInput {
    /// <p>The ID of the space to update.</p>
    pub fn space_id(&self) -> ::std::option::Option<&str> {
        self.space_id.as_deref()
    }
    /// <p>The 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 <code>memoryExpiryDays</code>, and they're available again if you later add a strategy with the same <code>type</code> and <code>name</code>. To delete them, use <code>DeleteMemory</code> before you remove the strategy, or delete the space.</p>
    /// <p>To keep a strategy, include it with the same <code>type</code> and <code>name</code> that <code>GetSpace</code> returns. For a kept strategy, any <code>configuration</code> member 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 with <code>UpdateSpace</code>.</p>
    /// <p>The serialized list can be at most 384 KiB.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.memory_strategies.is_none()`.
    pub fn memory_strategies(&self) -> &[crate::types::MemoryStrategy] {
        self.memory_strategies.as_deref().unwrap_or_default()
    }
    /// <p>How 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.</p>
    pub fn event_expiry_days(&self) -> ::std::option::Option<i32> {
        self.event_expiry_days
    }
    /// <p>How 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. <code>GetSpace</code> then returns 0.</p>
    /// <p>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 <code>UPDATING</code>. Sending the value that the space has stored doesn't.</p>
    pub fn memory_expiry_days(&self) -> ::std::option::Option<i32> {
        self.memory_expiry_days
    }
    /// <p>The model that extracts and consolidates memories for every strategy in the space: <code>anthropic.claude-opus-5-5</code> or <code>anthropic.claude-haiku-5-5</code>. Omit it to leave the current value unchanged. Once set, it can't be cleared back to the service default.</p>
    pub fn extraction_model_id(&self) -> ::std::option::Option<&str> {
        self.extraction_model_id.as_deref()
    }
}
impl UpdateSpaceInput {
    /// Creates a new builder-style object to manufacture [`UpdateSpaceInput`](crate::operation::update_space::UpdateSpaceInput).
    pub fn builder() -> crate::operation::update_space::builders::UpdateSpaceInputBuilder {
        crate::operation::update_space::builders::UpdateSpaceInputBuilder::default()
    }
}

/// A builder for [`UpdateSpaceInput`](crate::operation::update_space::UpdateSpaceInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateSpaceInputBuilder {
    pub(crate) space_id: ::std::option::Option<::std::string::String>,
    pub(crate) memory_strategies: ::std::option::Option<::std::vec::Vec<crate::types::MemoryStrategy>>,
    pub(crate) event_expiry_days: ::std::option::Option<i32>,
    pub(crate) memory_expiry_days: ::std::option::Option<i32>,
    pub(crate) extraction_model_id: ::std::option::Option<::std::string::String>,
}
impl UpdateSpaceInputBuilder {
    /// <p>The ID of the space to update.</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 to update.</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 to update.</p>
    pub fn get_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.space_id
    }
    /// Appends an item to `memory_strategies`.
    ///
    /// To override the contents of this collection use [`set_memory_strategies`](Self::set_memory_strategies).
    ///
    /// <p>The 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 <code>memoryExpiryDays</code>, and they're available again if you later add a strategy with the same <code>type</code> and <code>name</code>. To delete them, use <code>DeleteMemory</code> before you remove the strategy, or delete the space.</p>
    /// <p>To keep a strategy, include it with the same <code>type</code> and <code>name</code> that <code>GetSpace</code> returns. For a kept strategy, any <code>configuration</code> member 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 with <code>UpdateSpace</code>.</p>
    /// <p>The serialized list can be at most 384 KiB.</p>
    pub fn memory_strategies(mut self, input: crate::types::MemoryStrategy) -> Self {
        let mut v = self.memory_strategies.unwrap_or_default();
        v.push(input);
        self.memory_strategies = ::std::option::Option::Some(v);
        self
    }
    /// <p>The 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 <code>memoryExpiryDays</code>, and they're available again if you later add a strategy with the same <code>type</code> and <code>name</code>. To delete them, use <code>DeleteMemory</code> before you remove the strategy, or delete the space.</p>
    /// <p>To keep a strategy, include it with the same <code>type</code> and <code>name</code> that <code>GetSpace</code> returns. For a kept strategy, any <code>configuration</code> member 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 with <code>UpdateSpace</code>.</p>
    /// <p>The serialized list can be at most 384 KiB.</p>
    pub fn set_memory_strategies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MemoryStrategy>>) -> Self {
        self.memory_strategies = input;
        self
    }
    /// <p>The 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 <code>memoryExpiryDays</code>, and they're available again if you later add a strategy with the same <code>type</code> and <code>name</code>. To delete them, use <code>DeleteMemory</code> before you remove the strategy, or delete the space.</p>
    /// <p>To keep a strategy, include it with the same <code>type</code> and <code>name</code> that <code>GetSpace</code> returns. For a kept strategy, any <code>configuration</code> member 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 with <code>UpdateSpace</code>.</p>
    /// <p>The serialized list can be at most 384 KiB.</p>
    pub fn get_memory_strategies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MemoryStrategy>> {
        &self.memory_strategies
    }
    /// <p>How 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.</p>
    pub fn event_expiry_days(mut self, input: i32) -> Self {
        self.event_expiry_days = ::std::option::Option::Some(input);
        self
    }
    /// <p>How 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.</p>
    pub fn set_event_expiry_days(mut self, input: ::std::option::Option<i32>) -> Self {
        self.event_expiry_days = input;
        self
    }
    /// <p>How 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.</p>
    pub fn get_event_expiry_days(&self) -> &::std::option::Option<i32> {
        &self.event_expiry_days
    }
    /// <p>How 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. <code>GetSpace</code> then returns 0.</p>
    /// <p>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 <code>UPDATING</code>. Sending the value that the space has stored doesn't.</p>
    pub fn memory_expiry_days(mut self, input: i32) -> Self {
        self.memory_expiry_days = ::std::option::Option::Some(input);
        self
    }
    /// <p>How 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. <code>GetSpace</code> then returns 0.</p>
    /// <p>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 <code>UPDATING</code>. Sending the value that the space has stored doesn't.</p>
    pub fn set_memory_expiry_days(mut self, input: ::std::option::Option<i32>) -> Self {
        self.memory_expiry_days = input;
        self
    }
    /// <p>How 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. <code>GetSpace</code> then returns 0.</p>
    /// <p>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 <code>UPDATING</code>. Sending the value that the space has stored doesn't.</p>
    pub fn get_memory_expiry_days(&self) -> &::std::option::Option<i32> {
        &self.memory_expiry_days
    }
    /// <p>The model that extracts and consolidates memories for every strategy in the space: <code>anthropic.claude-opus-5-5</code> or <code>anthropic.claude-haiku-5-5</code>. Omit it to leave the current value unchanged. Once set, it can't be cleared back to the service default.</p>
    pub fn extraction_model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.extraction_model_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The model that extracts and consolidates memories for every strategy in the space: <code>anthropic.claude-opus-5-5</code> or <code>anthropic.claude-haiku-5-5</code>. Omit it to leave the current value unchanged. Once set, it can't be cleared back to the service default.</p>
    pub fn set_extraction_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.extraction_model_id = input;
        self
    }
    /// <p>The model that extracts and consolidates memories for every strategy in the space: <code>anthropic.claude-opus-5-5</code> or <code>anthropic.claude-haiku-5-5</code>. Omit it to leave the current value unchanged. Once set, it can't be cleared back to the service default.</p>
    pub fn get_extraction_model_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.extraction_model_id
    }
    /// Consumes the builder and constructs a [`UpdateSpaceInput`](crate::operation::update_space::UpdateSpaceInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::update_space::UpdateSpaceInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_space::UpdateSpaceInput {
            space_id: self.space_id,
            memory_strategies: self.memory_strategies,
            event_expiry_days: self.event_expiry_days,
            memory_expiry_days: self.memory_expiry_days,
            extraction_model_id: self.extraction_model_id,
        })
    }
}