// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_space::_update_space_input::UpdateSpaceInputBuilder;
pub use crate::operation::update_space::_update_space_output::UpdateSpaceOutputBuilder;
impl crate::operation::update_space::builders::UpdateSpaceInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::update_space::UpdateSpaceOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::update_space::UpdateSpaceError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.update_space();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `UpdateSpace`.
///
/// <p>Updates a space's memory strategies, retention settings, or extraction model. Supply only the fields to change. Omitted fields keep their current values.</p>
/// <p>If the request changes the set of strategies, a strategy's configuration, a retention setting, or the extraction model, the space moves to <code>UPDATING</code>. When the change is complete, the space returns to <code>ACTIVE</code>, or moves to <code>FAILED</code> if the change can't be applied. While the space is <code>UPDATING</code>, <code>GetSpace</code> returns the previous configuration. A request that only changes strategy descriptions or repeats the values the space has stored is applied immediately and doesn't change the status. Sending a retention value that the space never set also moves the space to <code>UPDATING</code>, even one that matches the behavior without it, such as 90 for <code>eventExpiryDays</code> or 0 for <code>memoryExpiryDays</code>. A space that is <code>CREATING</code>, <code>UPDATING</code>, or <code>DELETING</code> can't be updated: the request fails with <code>ConflictException</code>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateSpaceFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::update_space::builders::UpdateSpaceInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::update_space::UpdateSpaceOutput,
crate::operation::update_space::UpdateSpaceError,
> for UpdateSpaceFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::update_space::UpdateSpaceOutput,
crate::operation::update_space::UpdateSpaceError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl UpdateSpaceFluentBuilder {
/// Creates a new `UpdateSpaceFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the UpdateSpace as a reference.
pub fn as_input(&self) -> &crate::operation::update_space::builders::UpdateSpaceInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::update_space::UpdateSpaceOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::update_space::UpdateSpaceError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::update_space::UpdateSpace::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::update_space::UpdateSpace::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::update_space::UpdateSpaceOutput,
crate::operation::update_space::UpdateSpaceError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>The ID of the space to update.</p>
pub fn space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.space_id(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.inner = self.inner.set_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.inner.get_space_id()
}
///
/// Appends an item to `memoryStrategies`.
///
/// 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 {
self.inner = self.inner.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 set_memory_strategies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MemoryStrategy>>) -> Self {
self.inner = self.inner.set_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.inner.get_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.inner = self.inner.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 set_event_expiry_days(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_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.inner.get_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.inner = self.inner.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 set_memory_expiry_days(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_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.inner.get_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.inner = self.inner.extraction_model_id(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.inner = self.inner.set_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.inner.get_extraction_model_id()
}
}