aws-sdk-opensearchmemory 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2227 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ require 'seahorse/client/plugins/content_length'
11
+ require 'aws-sdk-core/plugins/credentials_configuration'
12
+ require 'aws-sdk-core/plugins/logging'
13
+ require 'aws-sdk-core/plugins/param_converter'
14
+ require 'aws-sdk-core/plugins/param_validator'
15
+ require 'aws-sdk-core/plugins/user_agent'
16
+ require 'aws-sdk-core/plugins/helpful_socket_errors'
17
+ require 'aws-sdk-core/plugins/retry_errors'
18
+ require 'aws-sdk-core/plugins/global_configuration'
19
+ require 'aws-sdk-core/plugins/regional_endpoint'
20
+ require 'aws-sdk-core/plugins/endpoint_discovery'
21
+ require 'aws-sdk-core/plugins/endpoint_pattern'
22
+ require 'aws-sdk-core/plugins/response_paging'
23
+ require 'aws-sdk-core/plugins/stub_responses'
24
+ require 'aws-sdk-core/plugins/idempotency_token'
25
+ require 'aws-sdk-core/plugins/invocation_id'
26
+ require 'aws-sdk-core/plugins/jsonvalue_converter'
27
+ require 'aws-sdk-core/plugins/client_metrics_plugin'
28
+ require 'aws-sdk-core/plugins/client_metrics_send_plugin'
29
+ require 'aws-sdk-core/plugins/transfer_encoding'
30
+ require 'aws-sdk-core/plugins/http_checksum'
31
+ require 'aws-sdk-core/plugins/checksum_algorithm'
32
+ require 'aws-sdk-core/plugins/request_compression'
33
+ require 'aws-sdk-core/plugins/defaults_mode'
34
+ require 'aws-sdk-core/plugins/recursion_detection'
35
+ require 'aws-sdk-core/plugins/telemetry'
36
+ require 'aws-sdk-core/plugins/sign'
37
+ require 'aws-sdk-core/plugins/protocols/json_rpc'
38
+
39
+ module Aws::OpenSearchMemory
40
+ # An API client for OpenSearchMemory. To construct a client, you need to configure a `:region` and `:credentials`.
41
+ #
42
+ # client = Aws::OpenSearchMemory::Client.new(
43
+ # region: region_name,
44
+ # credentials: credentials,
45
+ # # ...
46
+ # )
47
+ #
48
+ # For details on configuring region and credentials see
49
+ # the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
50
+ #
51
+ # See {#initialize} for a full list of supported configuration options.
52
+ class Client < Seahorse::Client::Base
53
+
54
+ include Aws::ClientStubs
55
+
56
+ @identifier = :opensearchmemory
57
+
58
+ set_api(ClientApi::API)
59
+
60
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
61
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
62
+ add_plugin(Aws::Plugins::Logging)
63
+ add_plugin(Aws::Plugins::ParamConverter)
64
+ add_plugin(Aws::Plugins::ParamValidator)
65
+ add_plugin(Aws::Plugins::UserAgent)
66
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
67
+ add_plugin(Aws::Plugins::RetryErrors)
68
+ add_plugin(Aws::Plugins::GlobalConfiguration)
69
+ add_plugin(Aws::Plugins::RegionalEndpoint)
70
+ add_plugin(Aws::Plugins::EndpointDiscovery)
71
+ add_plugin(Aws::Plugins::EndpointPattern)
72
+ add_plugin(Aws::Plugins::ResponsePaging)
73
+ add_plugin(Aws::Plugins::StubResponses)
74
+ add_plugin(Aws::Plugins::IdempotencyToken)
75
+ add_plugin(Aws::Plugins::InvocationId)
76
+ add_plugin(Aws::Plugins::JsonvalueConverter)
77
+ add_plugin(Aws::Plugins::ClientMetricsPlugin)
78
+ add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
79
+ add_plugin(Aws::Plugins::TransferEncoding)
80
+ add_plugin(Aws::Plugins::HttpChecksum)
81
+ add_plugin(Aws::Plugins::ChecksumAlgorithm)
82
+ add_plugin(Aws::Plugins::RequestCompression)
83
+ add_plugin(Aws::Plugins::DefaultsMode)
84
+ add_plugin(Aws::Plugins::RecursionDetection)
85
+ add_plugin(Aws::Plugins::Telemetry)
86
+ add_plugin(Aws::Plugins::Sign)
87
+ add_plugin(Aws::Plugins::Protocols::JsonRpc)
88
+ add_plugin(Aws::OpenSearchMemory::Plugins::Endpoints)
89
+
90
+ # @overload initialize(options)
91
+ # @param [Hash] options
92
+ #
93
+ # @option options [Array<Seahorse::Client::Plugin>] :plugins ([]])
94
+ # A list of plugins to apply to the client. Each plugin is either a
95
+ # class name or an instance of a plugin class.
96
+ #
97
+ # @option options [required, Aws::CredentialProvider] :credentials
98
+ # Your AWS credentials used for authentication. This can be any class that includes and implements
99
+ # `Aws::CredentialProvider`, or instance of any one of the following classes:
100
+ #
101
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
102
+ # credentials.
103
+ #
104
+ # * `Aws::SharedCredentials` - Used for loading static credentials from a
105
+ # shared file, such as `~/.aws/config`.
106
+ #
107
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
108
+ #
109
+ # * `Aws::AssumeRoleWebIdentityCredentials` - Used when you need to
110
+ # assume a role after providing credentials via the web.
111
+ #
112
+ # * `Aws::SSOCredentials` - Used for loading credentials from AWS SSO using an
113
+ # access token generated from `aws login`.
114
+ #
115
+ # * `Aws::ProcessCredentials` - Used for loading credentials from a
116
+ # process that outputs to stdout.
117
+ #
118
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
119
+ # from an EC2 IMDS on an EC2 instance.
120
+ #
121
+ # * `Aws::ECSCredentials` - Used for loading credentials from
122
+ # instances running in ECS.
123
+ #
124
+ # * `Aws::CognitoIdentityCredentials` - Used for loading credentials
125
+ # from the Cognito Identity service.
126
+ #
127
+ # When `:credentials` are not configured directly, the following locations will be searched for credentials:
128
+ #
129
+ # * `Aws.config[:credentials]`
130
+ #
131
+ # * The `:access_key_id`, `:secret_access_key`, `:session_token`, and
132
+ # `:account_id` options.
133
+ #
134
+ # * `ENV['AWS_ACCESS_KEY_ID']`, `ENV['AWS_SECRET_ACCESS_KEY']`,
135
+ # `ENV['AWS_SESSION_TOKEN']`, and `ENV['AWS_ACCOUNT_ID']`.
136
+ #
137
+ # * `~/.aws/credentials`
138
+ #
139
+ # * `~/.aws/config`
140
+ #
141
+ # * EC2/ECS IMDS instance profile - When used by default, the timeouts are very aggressive.
142
+ # Construct and pass an instance of `Aws::InstanceProfileCredentials` or `Aws::ECSCredentials` to
143
+ # enable retries and extended timeouts. Instance profile credential fetching can be disabled by
144
+ # setting `ENV['AWS_EC2_METADATA_DISABLED']` to `true`.
145
+ #
146
+ # @option options [required, String] :region
147
+ # The AWS region to connect to. The configured `:region` is
148
+ # used to determine the service `:endpoint`. When not passed,
149
+ # a default `:region` is searched for in the following locations:
150
+ #
151
+ # * `Aws.config[:region]`
152
+ # * `ENV['AWS_REGION']`
153
+ # * `ENV['AMAZON_REGION']`
154
+ # * `ENV['AWS_DEFAULT_REGION']`
155
+ # * `~/.aws/credentials`
156
+ # * `~/.aws/config`
157
+ #
158
+ # @option options [String] :access_key_id
159
+ #
160
+ # @option options [String] :account_id
161
+ #
162
+ # @option options [Boolean] :active_endpoint_cache (false)
163
+ # When set to `true`, a thread polling for endpoints will be running in
164
+ # the background every 60 secs (default). Defaults to `false`.
165
+ #
166
+ # @option options [Boolean] :adaptive_retry_wait_to_fill (true)
167
+ # Used only in `adaptive` retry mode. When true, the request will sleep
168
+ # until there is sufficent client side capacity to retry the request.
169
+ # When false, the request will raise a `RetryCapacityNotAvailableError` and will
170
+ # not retry instead of sleeping.
171
+ #
172
+ # @option options [Array<String>] :auth_scheme_preference
173
+ # A list of preferred authentication schemes to use when making a request. Supported values are:
174
+ # `sigv4`, `sigv4a`, `httpBearerAuth`, and `noAuth`. When set using `ENV['AWS_AUTH_SCHEME_PREFERENCE']` or in
175
+ # shared config as `auth_scheme_preference`, the value should be a comma-separated list.
176
+ #
177
+ # @option options [Boolean] :client_side_monitoring (false)
178
+ # When `true`, client-side metrics will be collected for all API requests from
179
+ # this client.
180
+ #
181
+ # @option options [String] :client_side_monitoring_client_id ("")
182
+ # Allows you to provide an identifier for this client which will be attached to
183
+ # all generated client side metrics. Defaults to an empty string.
184
+ #
185
+ # @option options [String] :client_side_monitoring_host ("127.0.0.1")
186
+ # Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client
187
+ # side monitoring agent is running on, where client metrics will be published via UDP.
188
+ #
189
+ # @option options [Integer] :client_side_monitoring_port (31000)
190
+ # Required for publishing client metrics. The port that the client side monitoring
191
+ # agent is running on, where client metrics will be published via UDP.
192
+ #
193
+ # @option options [Aws::ClientSideMonitoring::Publisher] :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher)
194
+ # Allows you to provide a custom client-side monitoring publisher class. By default,
195
+ # will use the Client Side Monitoring Agent Publisher.
196
+ #
197
+ # @option options [Boolean] :convert_params (true)
198
+ # When `true`, an attempt is made to coerce request parameters into
199
+ # the required types.
200
+ #
201
+ # @option options [Boolean] :correct_clock_skew (true)
202
+ # Used only in `standard` and `adaptive` retry modes. Specifies whether
203
+ # to apply a clock skew correction and retry requests with skewed client
204
+ # clocks. Takes effect only when `disable_clock_skew_correction` is not set.
205
+ #
206
+ # @option options [String] :defaults_mode ("legacy")
207
+ # See {Aws::DefaultsModeConfiguration} for a list of the
208
+ # accepted modes and the configuration defaults that are included.
209
+ #
210
+ # @option options [Boolean] :disable_clock_skew_correction
211
+ # Used only in `standard` and `adaptive` retry modes. When `true`, the
212
+ # SDK does not apply a clock skew correction, does not update its stored
213
+ # skew from responses, and does not retry clock skew errors. Clock skew
214
+ # correction is enabled by default.
215
+ #
216
+ # @option options [Boolean] :disable_host_prefix_injection (false)
217
+ # When `true`, the SDK will not prepend the modeled host prefix to the endpoint.
218
+ #
219
+ # @option options [Boolean] :disable_request_compression (false)
220
+ # When set to 'true' the request body will not be compressed
221
+ # for supported operations.
222
+ #
223
+ # @option options [String, URI::HTTPS, URI::HTTP] :endpoint
224
+ # Normally you should not configure the `:endpoint` option
225
+ # directly. This is normally constructed from the `:region`
226
+ # option. Configuring `:endpoint` is normally reserved for
227
+ # connecting to test or custom endpoints. The endpoint should
228
+ # be a URI formatted like:
229
+ #
230
+ # 'http://example.com'
231
+ # 'https://example.com'
232
+ # 'http://example.com:123'
233
+ #
234
+ # @option options [Integer] :endpoint_cache_max_entries (1000)
235
+ # Used for the maximum size limit of the LRU cache storing endpoints data
236
+ # for endpoint discovery enabled operations. Defaults to 1000.
237
+ #
238
+ # @option options [Integer] :endpoint_cache_max_threads (10)
239
+ # Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.
240
+ #
241
+ # @option options [Integer] :endpoint_cache_poll_interval (60)
242
+ # When :endpoint_discovery and :active_endpoint_cache is enabled,
243
+ # Use this option to config the time interval in seconds for making
244
+ # requests fetching endpoints information. Defaults to 60 sec.
245
+ #
246
+ # @option options [Boolean] :endpoint_discovery (false)
247
+ # When set to `true`, endpoint discovery will be enabled for operations when available.
248
+ #
249
+ # @option options [Boolean] :ignore_configured_endpoint_urls
250
+ # Setting to true disables use of endpoint URLs provided via environment
251
+ # variables and the shared configuration file.
252
+ #
253
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
254
+ # The log formatter.
255
+ #
256
+ # @option options [Symbol] :log_level (:info)
257
+ # The log level to send messages to the `:logger` at.
258
+ #
259
+ # @option options [Logger] :logger
260
+ # The Logger instance to send log messages to. If this option
261
+ # is not set, logging will be disabled.
262
+ #
263
+ # @option options [Integer] :max_attempts (3)
264
+ # An integer representing the maximum number attempts that will be made for
265
+ # a single request, including the initial attempt. For example,
266
+ # setting this value to 5 will result in a request being retried up to
267
+ # 4 times. Used in `standard` and `adaptive` retry modes. Defaults to 3,
268
+ # except for DynamoDB and DynamoDB Streams, which default to 4.
269
+ #
270
+ # @option options [String] :profile ("default")
271
+ # Used when loading credentials from the shared credentials file at `HOME/.aws/credentials`.
272
+ # When not specified, 'default' is used.
273
+ #
274
+ # @option options [String] :request_checksum_calculation ("when_supported")
275
+ # Determines when a checksum will be calculated for request payloads. Values are:
276
+ #
277
+ # * `when_supported` - (default) When set, a checksum will be
278
+ # calculated for all request payloads of operations modeled with the
279
+ # `httpChecksum` trait where `requestChecksumRequired` is `true` and/or a
280
+ # `requestAlgorithmMember` is modeled.
281
+ # * `when_required` - When set, a checksum will only be calculated for
282
+ # request payloads of operations modeled with the `httpChecksum` trait where
283
+ # `requestChecksumRequired` is `true` or where a `requestAlgorithmMember`
284
+ # is modeled and supplied.
285
+ #
286
+ # @option options [Integer] :request_min_compression_size_bytes (10240)
287
+ # The minimum size in bytes that triggers compression for request
288
+ # bodies. The value must be non-negative integer value between 0
289
+ # and 10485780 bytes inclusive.
290
+ #
291
+ # @option options [String] :response_checksum_validation ("when_supported")
292
+ # Determines when checksum validation will be performed on response payloads. Values are:
293
+ #
294
+ # * `when_supported` - (default) When set, checksum validation is performed on all
295
+ # response payloads of operations modeled with the `httpChecksum` trait where
296
+ # `responseAlgorithms` is modeled, except when no modeled checksum algorithms
297
+ # are supported.
298
+ # * `when_required` - When set, checksum validation is not performed on
299
+ # response payloads of operations unless the checksum algorithm is supported and
300
+ # the `requestValidationModeMember` member is set to `ENABLED`.
301
+ #
302
+ # @option options [Proc] :retry_backoff
303
+ # A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
304
+ # This option is only used in the `legacy` retry mode.
305
+ #
306
+ # @option options [Float] :retry_base_delay (0.3)
307
+ # The base delay in seconds used by the default backoff function. This option
308
+ # is only used in the `legacy` retry mode.
309
+ #
310
+ # @option options [Symbol] :retry_jitter (:none)
311
+ # A delay randomiser function used by the default backoff function.
312
+ # Some predefined functions can be referenced by name - :none, :equal, :full,
313
+ # otherwise a Proc that takes and returns a number. This option is only used
314
+ # in the `legacy` retry mode.
315
+ #
316
+ # @see https://www.awsarchitectureblog.com/2015/03/backoff.html
317
+ #
318
+ # @option options [Integer] :retry_limit (3)
319
+ # The maximum number of times to retry failed requests. Only
320
+ # ~ 500 level server errors and certain ~ 400 level client errors
321
+ # are retried. Generally, these are throttling errors, data
322
+ # checksum errors, networking errors, timeout errors, auth errors,
323
+ # endpoint discovery, and errors from expired credentials.
324
+ # This option is only used in the `legacy` retry mode.
325
+ #
326
+ # @option options [Integer] :retry_max_delay (0)
327
+ # The maximum number of seconds to delay between retries (0 for no limit)
328
+ # used by the default backoff function. This option is only used in the
329
+ # `legacy` retry mode.
330
+ #
331
+ # @option options [String] :retry_mode ("standard")
332
+ # Specifies which retry algorithm to use. Values are:
333
+ #
334
+ # * `legacy` - The pre-existing retry behavior.
335
+ #
336
+ # * `standard` - A standardized set of retry rules across the AWS SDKs.
337
+ # This includes support for retry quotas, which limit the number of
338
+ # unsuccessful retries a client can make. This is the default value
339
+ # if no retry mode is provided.
340
+ #
341
+ # * `adaptive` - A retry mode that includes all the functionality of
342
+ # `standard` mode along with automatic client side throttling.
343
+ #
344
+ # @option options [String] :sdk_ua_app_id
345
+ # A unique and opaque application ID that is appended to the
346
+ # User-Agent header as app/sdk_ua_app_id. It should have a
347
+ # maximum length of 50. This variable is sourced from environment
348
+ # variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.
349
+ #
350
+ # @option options [String] :secret_access_key
351
+ #
352
+ # @option options [String] :session_token
353
+ #
354
+ # @option options [Array] :sigv4a_signing_region_set
355
+ # A list of regions that should be signed with SigV4a signing. When
356
+ # not passed, a default `:sigv4a_signing_region_set` is searched for
357
+ # in the following locations:
358
+ #
359
+ # * `Aws.config[:sigv4a_signing_region_set]`
360
+ # * `ENV['AWS_SIGV4A_SIGNING_REGION_SET']`
361
+ # * `~/.aws/config`
362
+ #
363
+ # @option options [Boolean] :simple_json (false)
364
+ # Disables request parameter conversion, validation, and formatting.
365
+ # Also disables response data type conversions. The request parameters
366
+ # hash must be formatted exactly as the API expects.This option is useful
367
+ # when you want to ensure the highest level of performance by avoiding
368
+ # overhead of walking request parameters and response data structures.
369
+ #
370
+ # @option options [Boolean] :stub_responses (false)
371
+ # Causes the client to return stubbed responses. By default
372
+ # fake responses are generated and returned. You can specify
373
+ # the response data to return or errors to raise by calling
374
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
375
+ #
376
+ # ** Please note ** When response stubbing is enabled, no HTTP
377
+ # requests are made, and retries are disabled.
378
+ #
379
+ # @option options [Aws::Telemetry::TelemetryProviderBase] :telemetry_provider (Aws::Telemetry::NoOpTelemetryProvider)
380
+ # Allows you to provide a telemetry provider, which is used to
381
+ # emit telemetry data. By default, uses `NoOpTelemetryProvider` which
382
+ # will not record or emit any telemetry data. The SDK supports the
383
+ # following telemetry providers:
384
+ #
385
+ # * OpenTelemetry (OTel) - To use the OTel provider, install and require the
386
+ # `opentelemetry-sdk` gem and then, pass in an instance of a
387
+ # `Aws::Telemetry::OTelProvider` for telemetry provider.
388
+ #
389
+ # @option options [Aws::TokenProvider] :token_provider
390
+ # Your Bearer token used for authentication. This can be any class that includes and implements
391
+ # `Aws::TokenProvider`, or instance of any one of the following classes:
392
+ #
393
+ # * `Aws::StaticTokenProvider` - Used for configuring static, non-refreshing
394
+ # tokens.
395
+ #
396
+ # * `Aws::SSOTokenProvider` - Used for loading tokens from AWS SSO using an
397
+ # access token generated from `aws login`.
398
+ #
399
+ # When `:token_provider` is not configured directly, the `Aws::TokenProviderChain`
400
+ # will be used to search for tokens configured for your profile in shared configuration files.
401
+ #
402
+ # @option options [Boolean] :use_dualstack_endpoint
403
+ # When set to `true`, dualstack enabled endpoints (with `.aws` TLD)
404
+ # will be used if available.
405
+ #
406
+ # @option options [Boolean] :use_fips_endpoint
407
+ # When set to `true`, fips compatible endpoints will be used if available.
408
+ # When a `fips` region is used, the region is normalized and this config
409
+ # is set to `true`.
410
+ #
411
+ # @option options [Boolean] :validate_params (true)
412
+ # When `true`, request parameters are validated before
413
+ # sending the request.
414
+ #
415
+ # @option options [Aws::OpenSearchMemory::EndpointProvider] :endpoint_provider
416
+ # The endpoint provider used to resolve endpoints. Any object that responds to
417
+ # `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
418
+ # `Aws::OpenSearchMemory::EndpointParameters`.
419
+ #
420
+ # @option options [Float] :http_continue_timeout (1)
421
+ # The number of seconds to wait for a 100-continue response before sending the
422
+ # request body. This option has no effect unless the request has "Expect"
423
+ # header set to "100-continue". Defaults to `nil` which disables this
424
+ # behaviour. This value can safely be set per request on the session.
425
+ #
426
+ # @option options [Float] :http_idle_timeout (5)
427
+ # The number of seconds a connection is allowed to sit idle before it
428
+ # is considered stale. Stale connections are closed and removed from the
429
+ # pool before making a request.
430
+ #
431
+ # @option options [Float] :http_open_timeout (15)
432
+ # The default number of seconds to wait for response data.
433
+ # This value can safely be set per-request on the session.
434
+ #
435
+ # @option options [URI::HTTP,String] :http_proxy
436
+ # A proxy to send requests through. Formatted like 'http://proxy.com:123'.
437
+ #
438
+ # @option options [Float] :http_read_timeout (60)
439
+ # The default number of seconds to wait for response data.
440
+ # This value can safely be set per-request on the session.
441
+ #
442
+ # @option options [Boolean] :http_wire_trace (false)
443
+ # When `true`, HTTP debug output will be sent to the `:logger`.
444
+ #
445
+ # @option options [Proc] :on_chunk_received
446
+ # When a Proc object is provided, it will be used as callback when each chunk
447
+ # of the response body is received. It provides three arguments: the chunk,
448
+ # the number of bytes received, and the total number of
449
+ # bytes in the response (or nil if the server did not send a `content-length`).
450
+ #
451
+ # @option options [Proc] :on_chunk_sent
452
+ # When a Proc object is provided, it will be used as callback when each chunk
453
+ # of the request body is sent. It provides three arguments: the chunk,
454
+ # the number of bytes read from the body, and the total number of
455
+ # bytes in the body.
456
+ #
457
+ # @option options [Boolean] :raise_response_errors (true)
458
+ # When `true`, response errors are raised.
459
+ #
460
+ # @option options [String] :ssl_ca_bundle
461
+ # Full path to the SSL certificate authority bundle file that should be used when
462
+ # verifying peer certificates. If you do not pass `:ssl_ca_bundle` or
463
+ # `:ssl_ca_directory` the the system default will be used if available.
464
+ #
465
+ # @option options [String] :ssl_ca_directory
466
+ # Full path of the directory that contains the unbundled SSL certificate
467
+ # authority files for verifying peer certificates. If you do
468
+ # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the system
469
+ # default will be used if available.
470
+ #
471
+ # @option options [String] :ssl_ca_store
472
+ # Sets the X509::Store to verify peer certificate.
473
+ #
474
+ # @option options [OpenSSL::X509::Certificate] :ssl_cert
475
+ # Sets a client certificate when creating http connections.
476
+ #
477
+ # @option options [OpenSSL::PKey] :ssl_key
478
+ # Sets a client key when creating http connections.
479
+ #
480
+ # @option options [Float] :ssl_timeout
481
+ # Sets the SSL timeout in seconds
482
+ #
483
+ # @option options [Boolean] :ssl_verify_peer (true)
484
+ # When `true`, SSL peer certificates are verified when establishing a connection.
485
+ #
486
+ def initialize(*args)
487
+ super
488
+ end
489
+
490
+ # @!group API Operations
491
+
492
+ # Gets up to 10 events by ID, each as `GetEvent` returns it, including
493
+ # its payload.
494
+ #
495
+ # If you supply `actorId` or `sessionId`, every requested event must
496
+ # match it. Each event has its own outcome. The operation reports an
497
+ # event that it can't return in `errors` instead of failing, with an
498
+ # error code named for the exception that `GetEvent` would return for
499
+ # it. The operation reports both an event that doesn't exist and an
500
+ # event outside the supplied scope as `RESOURCE_NOT_FOUND`.
501
+ #
502
+ # The exception is the space's customer managed AWS KMS key: if it is
503
+ # disabled, pending deletion, can't be used for decryption, or was
504
+ # deleted, the whole call fails with `ValidationException`, as
505
+ # `GetEvent` does.
506
+ #
507
+ # @option params [required, String] :space_id
508
+ # The ID of the space.
509
+ #
510
+ # @option params [String] :actor_id
511
+ # The actor that every requested event must belong to. Omit it to skip
512
+ # this check. The operation reports an event that doesn't match in
513
+ # `errors` as `RESOURCE_NOT_FOUND`.
514
+ #
515
+ # @option params [String] :session_id
516
+ # The session that every requested event must belong to. Omit it to skip
517
+ # this check. The operation reports an event that doesn't match in
518
+ # `errors` as `RESOURCE_NOT_FOUND`.
519
+ #
520
+ # @option params [required, Array<String>] :event_ids
521
+ # The IDs of the events to get: 1 to 10, without duplicates.
522
+ #
523
+ # @return [Types::BatchGetEventOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
524
+ #
525
+ # * {Types::BatchGetEventOutput#events #events} => Array&lt;Types::Event&gt;
526
+ # * {Types::BatchGetEventOutput#errors #errors} => Array&lt;Types::BatchGetEventError&gt;
527
+ #
528
+ # @example Request syntax with placeholder values
529
+ #
530
+ # resp = client.batch_get_event({
531
+ # space_id: "SpaceId", # required
532
+ # actor_id: "ActorId",
533
+ # session_id: "SessionId",
534
+ # event_ids: ["EventId"], # required
535
+ # })
536
+ #
537
+ # @example Response structure
538
+ #
539
+ # resp.events #=> Array
540
+ # resp.events[0].event_id #=> String
541
+ # resp.events[0].space_id #=> String
542
+ # resp.events[0].actor_id #=> String
543
+ # resp.events[0].session_id #=> String
544
+ # resp.events[0].payload.conversational.unified.source.object.messages #=> Array
545
+ # resp.events[0].payload.conversational.unified.source.object.messages[0].role #=> String, one of "USER", "ASSISTANT", "SYSTEM"
546
+ # resp.events[0].payload.conversational.unified.source.object.messages[0].content.text #=> String
547
+ # resp.events[0].payload.blob.content_type #=> String, one of "application/pdf", "image/png", "image/jpeg"
548
+ # resp.events[0].payload.blob.source.s3_location.uri #=> String
549
+ # resp.events[0].metadata #=> Hash
550
+ # resp.events[0].metadata["MetadataKey"] #=> String
551
+ # resp.events[0].event_timestamp #=> Time
552
+ # resp.errors #=> Array
553
+ # resp.errors[0].event_id #=> String
554
+ # resp.errors[0].error_code #=> String, one of "RESOURCE_NOT_FOUND", "THROTTLING", "ACCESS_DENIED", "INTERNAL_SERVER"
555
+ # resp.errors[0].message #=> String
556
+ #
557
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/BatchGetEvent AWS API Documentation
558
+ #
559
+ # @overload batch_get_event(params = {})
560
+ # @param [Hash] params ({})
561
+ def batch_get_event(params = {}, options = {})
562
+ req = build_request(:batch_get_event, params)
563
+ req.send_request(options)
564
+ end
565
+
566
+ # Submits an event (conversation turns, structured data, or a PDF
567
+ # document stored in Amazon S3) to a session in a space.
568
+ #
569
+ # The operation returns as soon as the event is saved. `GetEvent` and
570
+ # `ListEvents` return it immediately. `SearchEvents` returns it after
571
+ # it's indexed. `SearchMemories` returns memories extracted from it
572
+ # only after a strategy's extraction trigger fires and the memories are
573
+ # indexed.
574
+ #
575
+ # If the space uses a customer managed AWS KMS key, the call can also
576
+ # fail because of the key. It fails with `AccessDeniedException` if you
577
+ # aren't allowed to use the key, and with `ThrottlingException` if AWS
578
+ # KMS throttles the request. It fails with `ValidationException` if the
579
+ # key is disabled, pending deletion, or deleted.
580
+ #
581
+ # @option params [required, String] :space_id
582
+ # The ID of the space that owns the event, for example
583
+ # `sp-02864597b164`.
584
+ #
585
+ # @option params [required, String] :actor_id
586
+ # The ID of the actor (end user or agent) that the event belongs to.
587
+ #
588
+ # @option params [String] :session_id
589
+ # The session the event belongs to. Send every event of one conversation
590
+ # with the same session ID, so that `SUMMARY` strategies summarize the
591
+ # conversation as one session. If you omit it, the service generates a
592
+ # session ID and returns it.
593
+ #
594
+ # @option params [Time,DateTime,Date,Integer,String] :event_timestamp
595
+ # When the event occurred. The default is the time that the service
596
+ # receives the request.
597
+ #
598
+ # @option params [required, Types::EventPayload] :payload
599
+ # The event content. Set exactly one union member.
600
+ #
601
+ # @option params [Hash<String,String>] :metadata
602
+ # Metadata tags to store with the event. Memories derived from the event
603
+ # carry the same tags. Keys that begin with `x-amz-`, the keys
604
+ # `documentS3Source` and `documentS3Url`, and other keys that the
605
+ # service uses internally are reserved: a request that sets one fails
606
+ # with `ValidationException`, and the message names the key.
607
+ #
608
+ # A space can use at most 50 distinct metadata keys across all of its
609
+ # events and memories. A request that would add a key beyond that fails
610
+ # with `ValidationException`. Reuse an existing key instead.
611
+ #
612
+ # @option params [String] :client_token
613
+ # A unique, case-sensitive identifier that makes the request idempotent.
614
+ # Within 2 hours of the first request, a retry with the same token and
615
+ # the same request, including the same `sessionId`, returns the same
616
+ # event. If you omit `sessionId`, the service generates a new one on
617
+ # each attempt, so a retry fails with `ConflictException`. Reusing the
618
+ # token with different request content also fails with
619
+ # `ConflictException`. `eventTimestamp` isn't compared. After 2 hours,
620
+ # the token starts a new event.
621
+ #
622
+ # **A suitable default value is auto-generated.** You should normally
623
+ # not need to pass this option.**
624
+ #
625
+ # @option params [Boolean] :infer
626
+ # Specifies whether to extract memories from this event. The default is
627
+ # `true`. Set it to `false` to store the event without extraction: the
628
+ # service skips strategies that infer memories, and still indexes the
629
+ # event's turns for `SearchEvents`. A document submitted as a `blob` is
630
+ # still extracted.
631
+ #
632
+ # @return [Types::CreateEventOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
633
+ #
634
+ # * {Types::CreateEventOutput#event #event} => Types::EventDetail
635
+ #
636
+ # @example Request syntax with placeholder values
637
+ #
638
+ # resp = client.create_event({
639
+ # space_id: "SpaceId", # required
640
+ # actor_id: "ActorId", # required
641
+ # session_id: "SessionId",
642
+ # event_timestamp: Time.now,
643
+ # payload: { # required
644
+ # conversational: {
645
+ # unified: {
646
+ # source: { # required
647
+ # object: {
648
+ # messages: [ # required
649
+ # {
650
+ # role: "USER", # required, accepts USER, ASSISTANT, SYSTEM
651
+ # content: { # required
652
+ # text: "MessageText", # required
653
+ # },
654
+ # },
655
+ # ],
656
+ # },
657
+ # },
658
+ # },
659
+ # },
660
+ # structured_data: {
661
+ # source: { # required
662
+ # json: {
663
+ # },
664
+ # },
665
+ # },
666
+ # blob: {
667
+ # content_type: "application/pdf", # required, accepts application/pdf, image/png, image/jpeg
668
+ # source: { # required
669
+ # s3_location: {
670
+ # uri: "S3LocationUriString", # required
671
+ # },
672
+ # },
673
+ # },
674
+ # },
675
+ # metadata: {
676
+ # "MetadataKey" => "MetadataValue",
677
+ # },
678
+ # client_token: "ClientToken",
679
+ # infer: false,
680
+ # })
681
+ #
682
+ # @example Response structure
683
+ #
684
+ # resp.event.event_id #=> String
685
+ # resp.event.space_id #=> String
686
+ # resp.event.actor_id #=> String
687
+ # resp.event.session_id #=> String
688
+ # resp.event.event_timestamp #=> Time
689
+ #
690
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/CreateEvent AWS API Documentation
691
+ #
692
+ # @overload create_event(params = {})
693
+ # @param [Hash] params ({})
694
+ def create_event(params = {}, options = {})
695
+ req = build_request(:create_event, params)
696
+ req.send_request(options)
697
+ end
698
+
699
+ # Writes a memory that you have already formed, without extracting it
700
+ # from events. The service embeds the text as given and stores it as a
701
+ # memory of the named strategy. To have the service extract memories
702
+ # from conversation turns, use `CreateEvent` instead.
703
+ #
704
+ # The operation returns before the memory is searchable. The returned
705
+ # `memoryId` is final, but until the memory is indexed, `GetMemory`,
706
+ # `UpdateMemory`, and `DeleteMemory` return `ResourceNotFoundException`
707
+ # for it.
708
+ #
709
+ # If the request would exceed the service's rate for embedding
710
+ # requests, it fails with `ThrottlingException`. Retry with exponential
711
+ # backoff.
712
+ #
713
+ # If the space uses a customer managed AWS KMS key, the call can also
714
+ # fail because of the key. It fails with `AccessDeniedException` if you
715
+ # aren't allowed to use the key, and with `ThrottlingException` if AWS
716
+ # KMS throttles the request. It fails with `ValidationException` if the
717
+ # key is disabled, pending deletion, or deleted.
718
+ #
719
+ # @option params [required, String] :space_id
720
+ # The ID of the space that owns the memory, for example
721
+ # `sp-02864597b164`.
722
+ #
723
+ # @option params [required, String] :name
724
+ # The name of the strategy that the memory belongs to. The space must
725
+ # already declare the strategy, and the memory's type comes from that
726
+ # strategy. The name must be 1 to 64 characters: letters, digits,
727
+ # periods, hyphens, and underscores, starting with a letter or digit.
728
+ #
729
+ # @option params [required, String] :content
730
+ # The memory text, stored and embedded as provided.
731
+ #
732
+ # @option params [required, String] :actor_id
733
+ # The actor (end user or agent) that owns the memory.
734
+ #
735
+ # @option params [String] :session_id
736
+ # The session that the memory belongs to. If you omit it, the service
737
+ # generates a session ID and returns it.
738
+ #
739
+ # @option params [Hash<String,String>] :metadata
740
+ # Metadata tags to store with the memory. Keys that begin with `x-amz-`,
741
+ # the key `documentS3Source`, and other keys that the service uses
742
+ # internally are reserved: a request that sets one fails with
743
+ # `ValidationException`, and the message names the key.
744
+ #
745
+ # A space can use at most 50 distinct metadata keys across all of its
746
+ # events and memories. A request that would add a key beyond that fails
747
+ # with `ValidationException`. Reuse an existing key instead.
748
+ #
749
+ # @option params [String] :client_token
750
+ # A unique, case-sensitive identifier that makes the request idempotent.
751
+ # Within 2 hours of the first request, a retry with the same token
752
+ # returns the same `memoryId` instead of creating a second memory.
753
+ # Reusing the token with a different `name`, `content`, `metadata`,
754
+ # `actorId`, or `sessionId` fails with `ConflictException`. If you omit
755
+ # `sessionId`, a retry with the same token gets the same session. If you
756
+ # omit the token, each call creates a new memory.
757
+ #
758
+ # **A suitable default value is auto-generated.** You should normally
759
+ # not need to pass this option.**
760
+ #
761
+ # @return [Types::CreateMemoryOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
762
+ #
763
+ # * {Types::CreateMemoryOutput#memory #memory} => Types::CreateMemoryDetail
764
+ #
765
+ # @example Request syntax with placeholder values
766
+ #
767
+ # resp = client.create_memory({
768
+ # space_id: "SpaceId", # required
769
+ # name: "StrategyName", # required
770
+ # content: "CreateMemoryContent", # required
771
+ # actor_id: "ActorId", # required
772
+ # session_id: "SessionId",
773
+ # metadata: {
774
+ # "MetadataKey" => "MetadataValue",
775
+ # },
776
+ # client_token: "ClientToken",
777
+ # })
778
+ #
779
+ # @example Response structure
780
+ #
781
+ # resp.memory.memory_id #=> String
782
+ # resp.memory.space_id #=> String
783
+ # resp.memory.name #=> String
784
+ # resp.memory.actor_id #=> String
785
+ # resp.memory.session_id #=> String
786
+ #
787
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/CreateMemory AWS API Documentation
788
+ #
789
+ # @overload create_memory(params = {})
790
+ # @param [Hash] params ({})
791
+ def create_memory(params = {}, options = {})
792
+ req = build_request(:create_memory, params)
793
+ req.send_request(options)
794
+ end
795
+
796
+ # Creates a space. A space is an AWS resource that stores the events you
797
+ # send and the memories extracted from them, and defines the memory
798
+ # strategies that extract those memories.
799
+ #
800
+ # The operation returns before provisioning finishes, with `status`
801
+ # `CREATING`. Call `GetSpace` until the status is `ACTIVE`, and then use
802
+ # the space. If provisioning fails, the status becomes `FAILED` and
803
+ # `statusReason` says why.
804
+ #
805
+ # @option params [required, String] :name
806
+ # A name for the space, unique within your account in the Region. If
807
+ # another space already has the name, the request fails with
808
+ # `ConflictException`.
809
+ #
810
+ # @option params [Array<Types::MemoryStrategy>] :memory_strategies
811
+ # The memory strategies that extract memories from the space's events:
812
+ # up to 10 strategies, each with a name that is unique within the space.
813
+ #
814
+ # Optional. Omit it, or send an empty list, to create a space with no
815
+ # memory strategies. Such a space stores the conversation events you
816
+ # send it and returns them through `SearchEvents` and `ListEvents`, but
817
+ # extracts no memories and has none to search. You can add strategies
818
+ # later with `UpdateSpace`.
819
+ #
820
+ # The serialized list can be at most 384 KiB.
821
+ #
822
+ # @option params [Integer] :event_expiry_days
823
+ # How many days the space keeps each event, from 1 to 365. The default
824
+ # is 90.
825
+ #
826
+ # @option params [Integer] :memory_expiry_days
827
+ # How many days the space keeps each memory, from 0 to 3650, counted
828
+ # from when the service writes the memory. Updating a memory with
829
+ # `UpdateMemory` doesn't restart the count. 0 means memories never
830
+ # expire. If you omit it, memories never expire.
831
+ #
832
+ # Searches and lists leave out a memory past its expiry, and reading,
833
+ # updating, or deleting it returns `ResourceNotFoundException`.
834
+ #
835
+ # @option params [String] :extraction_model_id
836
+ # The model that extracts and consolidates memories for every strategy
837
+ # in the space, as an Amazon Bedrock model ID without an
838
+ # inference-profile prefix: `anthropic.claude-opus-5-5` or
839
+ # `anthropic.claude-haiku-5-5`. Another value fails with
840
+ # `ValidationException`, and the message lists the supported IDs. Omit
841
+ # it to use the service default, which can change over time and isn't
842
+ # returned by `GetSpace`. Setting a value pins the model.
843
+ #
844
+ # @option params [Types::EncryptionConfiguration] :encryption_configuration
845
+ # The AWS KMS key that encrypts the space's data. Omit it, or omit its
846
+ # `kmsKeyArn`, to use an AWS owned key. You can't change the key after
847
+ # you create the space.
848
+ #
849
+ # @option params [Array<Types::Tag>] :tags
850
+ # The tags to add to the space.
851
+ #
852
+ # @option params [String] :client_token
853
+ # A unique, case-sensitive identifier that makes the request idempotent.
854
+ # A retry with the same token and the same parameters within 2 hours
855
+ # returns the space that the first request created, instead of creating
856
+ # another. Reusing the token with different parameters, or while the
857
+ # first request is still in progress, fails with `ConflictException`.
858
+ #
859
+ # **A suitable default value is auto-generated.** You should normally
860
+ # not need to pass this option.**
861
+ #
862
+ # @return [Types::CreateSpaceResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
863
+ #
864
+ # * {Types::CreateSpaceResponse#space_id #space_id} => String
865
+ # * {Types::CreateSpaceResponse#arn #arn} => String
866
+ # * {Types::CreateSpaceResponse#name #name} => String
867
+ # * {Types::CreateSpaceResponse#status #status} => String
868
+ # * {Types::CreateSpaceResponse#created_at #created_at} => Time
869
+ #
870
+ # @example Request syntax with placeholder values
871
+ #
872
+ # resp = client.create_space({
873
+ # name: "SpaceName", # required
874
+ # memory_strategies: [
875
+ # {
876
+ # type: "SEMANTIC", # required, accepts SEMANTIC, SUMMARY, CUSTOM
877
+ # name: "MemoryStrategyName",
878
+ # description: "MemoryStrategyDescription",
879
+ # configuration: {
880
+ # extraction_prompt: "ExtractionPrompt",
881
+ # extract_every_n_messages: 1,
882
+ # extract_every_n_tokens: 1,
883
+ # idle_timeout_seconds: 1,
884
+ # extraction_seed_top_k: 1,
885
+ # extraction_seed_recent_n: 1,
886
+ # consolidation_enabled: false,
887
+ # },
888
+ # },
889
+ # ],
890
+ # event_expiry_days: 1,
891
+ # memory_expiry_days: 1,
892
+ # extraction_model_id: "ExtractionModelId",
893
+ # encryption_configuration: {
894
+ # kms_key_arn: "String",
895
+ # },
896
+ # tags: [
897
+ # {
898
+ # key: "TagKey", # required
899
+ # value: "TagValue", # required
900
+ # },
901
+ # ],
902
+ # client_token: "ClientToken",
903
+ # })
904
+ #
905
+ # @example Response structure
906
+ #
907
+ # resp.space_id #=> String
908
+ # resp.arn #=> String
909
+ # resp.name #=> String
910
+ # resp.status #=> String, one of "CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"
911
+ # resp.created_at #=> Time
912
+ #
913
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/CreateSpace AWS API Documentation
914
+ #
915
+ # @overload create_space(params = {})
916
+ # @param [Hash] params ({})
917
+ def create_space(params = {}, options = {})
918
+ req = build_request(:create_space, params)
919
+ req.send_request(options)
920
+ end
921
+
922
+ # Deletes an event. Deletion can't be undone. The event stops appearing
923
+ # in `SearchEvents` results shortly after you delete it. Deleting an
924
+ # event that doesn't exist returns `ResourceNotFoundException`.
925
+ #
926
+ # Deleting an event doesn't delete the memories derived from it,
927
+ # because a memory can combine content from several events. To remove
928
+ # them, use `DeleteMemory`.
929
+ #
930
+ # If the space uses a customer managed AWS KMS key, the call can also
931
+ # fail because of the key. It fails with `AccessDeniedException` if you
932
+ # aren't allowed to use the key, and with `ThrottlingException` if AWS
933
+ # KMS throttles the request. It fails with `ValidationException` if the
934
+ # key is disabled, pending deletion, or deleted.
935
+ #
936
+ # @option params [required, String] :space_id
937
+ # The ID of the space.
938
+ #
939
+ # @option params [required, String] :event_id
940
+ # The ID of the event to delete.
941
+ #
942
+ # @option params [String] :actor_id
943
+ # The actor that the event must belong to. Omit it to skip this check.
944
+ # If it doesn't match the stored event, the call fails with
945
+ # `ResourceNotFoundException`, as if the event did not exist.
946
+ #
947
+ # @option params [String] :session_id
948
+ # The session that the event must belong to. Omit it to skip this check.
949
+ # If it doesn't match the stored event, the call fails with
950
+ # `ResourceNotFoundException`, as if the event did not exist.
951
+ #
952
+ # @return [Types::DeleteEventOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
953
+ #
954
+ # * {Types::DeleteEventOutput#event_id #event_id} => String
955
+ #
956
+ # @example Request syntax with placeholder values
957
+ #
958
+ # resp = client.delete_event({
959
+ # space_id: "SpaceId", # required
960
+ # event_id: "EventId", # required
961
+ # actor_id: "ActorId",
962
+ # session_id: "SessionId",
963
+ # })
964
+ #
965
+ # @example Response structure
966
+ #
967
+ # resp.event_id #=> String
968
+ #
969
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/DeleteEvent AWS API Documentation
970
+ #
971
+ # @overload delete_event(params = {})
972
+ # @param [Hash] params ({})
973
+ def delete_event(params = {}, options = {})
974
+ req = build_request(:delete_event, params)
975
+ req.send_request(options)
976
+ end
977
+
978
+ # Deletes a memory, including its content and embedding. Deletion can't
979
+ # be undone. Searches stop returning the memory shortly after you delete
980
+ # it.
981
+ #
982
+ # Deleting a memory that no longer exists returns
983
+ # `ResourceNotFoundException`, so the operation is not idempotent. If
984
+ # you retry deletes, treat that error as success.
985
+ #
986
+ # A memory past its expiry (set from the space's `memoryExpiryDays`
987
+ # when the memory is written) reads as not found: the operation returns
988
+ # `ResourceNotFoundException`, as for a memory that was already deleted.
989
+ #
990
+ # If the space uses a customer managed AWS KMS key, the call can also
991
+ # fail because of the key. It fails with `AccessDeniedException` if you
992
+ # aren't allowed to use the key, and with `ThrottlingException` if AWS
993
+ # KMS throttles the request. It fails with `ValidationException` if the
994
+ # key is disabled, pending deletion, or deleted.
995
+ #
996
+ # @option params [required, String] :space_id
997
+ # The ID of the space that owns the memory.
998
+ #
999
+ # @option params [required, String] :memory_id
1000
+ # The ID of the memory to delete.
1001
+ #
1002
+ # @option params [String] :actor_id
1003
+ # The ID of the actor that the memory must belong to. Omit it to skip
1004
+ # this check. If it doesn't match the stored memory, the call fails
1005
+ # with `ResourceNotFoundException`, as if the memory did not exist.
1006
+ #
1007
+ # @option params [String] :strategy_name
1008
+ # The name of the strategy that the memory must belong to. Omit it to
1009
+ # skip this check. If it doesn't match the stored memory, the call
1010
+ # fails with `ResourceNotFoundException`, as if the memory did not
1011
+ # exist.
1012
+ #
1013
+ # @return [Types::DeleteMemoryOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1014
+ #
1015
+ # * {Types::DeleteMemoryOutput#memory_id #memory_id} => String
1016
+ #
1017
+ # @example Request syntax with placeholder values
1018
+ #
1019
+ # resp = client.delete_memory({
1020
+ # space_id: "SpaceId", # required
1021
+ # memory_id: "MemoryId", # required
1022
+ # actor_id: "ActorId",
1023
+ # strategy_name: "StrategyName",
1024
+ # })
1025
+ #
1026
+ # @example Response structure
1027
+ #
1028
+ # resp.memory_id #=> String
1029
+ #
1030
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/DeleteMemory AWS API Documentation
1031
+ #
1032
+ # @overload delete_memory(params = {})
1033
+ # @param [Hash] params ({})
1034
+ def delete_memory(params = {}, options = {})
1035
+ req = build_request(:delete_memory, params)
1036
+ req.send_request(options)
1037
+ end
1038
+
1039
+ # Deletes a space and its memories. Deletion can't be undone. After you
1040
+ # delete the space, you can't retrieve its events, and the service
1041
+ # removes them when they reach their expiry.
1042
+ #
1043
+ # The operation returns with `status` `DELETING`. When deletion
1044
+ # finishes, `GetSpace` returns `ResourceNotFoundException`. If deletion
1045
+ # fails, the status becomes `FAILED`. A space that is `CREATING` or
1046
+ # `UPDATING` can't be deleted until that finishes: the request fails
1047
+ # with `ConflictException`. Deleting a space that is already `DELETING`
1048
+ # returns `DELETING` again.
1049
+ #
1050
+ # @option params [required, String] :space_id
1051
+ # The ID of the space to delete.
1052
+ #
1053
+ # @return [Types::DeleteSpaceResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1054
+ #
1055
+ # * {Types::DeleteSpaceResponse#space_id #space_id} => String
1056
+ # * {Types::DeleteSpaceResponse#status #status} => String
1057
+ #
1058
+ # @example Request syntax with placeholder values
1059
+ #
1060
+ # resp = client.delete_space({
1061
+ # space_id: "SpaceId", # required
1062
+ # })
1063
+ #
1064
+ # @example Response structure
1065
+ #
1066
+ # resp.space_id #=> String
1067
+ # resp.status #=> String, one of "CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"
1068
+ #
1069
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/DeleteSpace AWS API Documentation
1070
+ #
1071
+ # @overload delete_space(params = {})
1072
+ # @param [Hash] params ({})
1073
+ def delete_space(params = {}, options = {})
1074
+ req = build_request(:delete_space, params)
1075
+ req.send_request(options)
1076
+ end
1077
+
1078
+ # Gets an event by ID, including its payload.
1079
+ #
1080
+ # If the space uses a customer managed AWS KMS key, the call can also
1081
+ # fail because of the key. It fails with `AccessDeniedException` if you
1082
+ # aren't allowed to use the key, and with `ThrottlingException` if AWS
1083
+ # KMS throttles the request. It fails with `ValidationException` if the
1084
+ # key is disabled, pending deletion, or deleted.
1085
+ #
1086
+ # @option params [required, String] :space_id
1087
+ # The ID of the space.
1088
+ #
1089
+ # @option params [required, String] :event_id
1090
+ # The event's ID, as returned by `CreateEvent`, `ListEvents`, or
1091
+ # `SearchEvents`.
1092
+ #
1093
+ # @option params [String] :actor_id
1094
+ # The actor the event must belong to. Omit it to skip this check. If it
1095
+ # doesn't match the stored event, the call fails with
1096
+ # `ResourceNotFoundException`, as if the event did not exist.
1097
+ #
1098
+ # @option params [String] :session_id
1099
+ # The session the event must belong to. Omit it to skip this check. If
1100
+ # it doesn't match the stored event, the call fails with
1101
+ # `ResourceNotFoundException`, as if the event did not exist.
1102
+ #
1103
+ # @return [Types::GetEventOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1104
+ #
1105
+ # * {Types::GetEventOutput#event #event} => Types::Event
1106
+ #
1107
+ # @example Request syntax with placeholder values
1108
+ #
1109
+ # resp = client.get_event({
1110
+ # space_id: "SpaceId", # required
1111
+ # event_id: "EventId", # required
1112
+ # actor_id: "ActorId",
1113
+ # session_id: "SessionId",
1114
+ # })
1115
+ #
1116
+ # @example Response structure
1117
+ #
1118
+ # resp.event.event_id #=> String
1119
+ # resp.event.space_id #=> String
1120
+ # resp.event.actor_id #=> String
1121
+ # resp.event.session_id #=> String
1122
+ # resp.event.payload.conversational.unified.source.object.messages #=> Array
1123
+ # resp.event.payload.conversational.unified.source.object.messages[0].role #=> String, one of "USER", "ASSISTANT", "SYSTEM"
1124
+ # resp.event.payload.conversational.unified.source.object.messages[0].content.text #=> String
1125
+ # resp.event.payload.blob.content_type #=> String, one of "application/pdf", "image/png", "image/jpeg"
1126
+ # resp.event.payload.blob.source.s3_location.uri #=> String
1127
+ # resp.event.metadata #=> Hash
1128
+ # resp.event.metadata["MetadataKey"] #=> String
1129
+ # resp.event.event_timestamp #=> Time
1130
+ #
1131
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/GetEvent AWS API Documentation
1132
+ #
1133
+ # @overload get_event(params = {})
1134
+ # @param [Hash] params ({})
1135
+ def get_event(params = {}, options = {})
1136
+ req = build_request(:get_event, params)
1137
+ req.send_request(options)
1138
+ end
1139
+
1140
+ # Gets a memory by ID, as returned by `SearchMemories` or
1141
+ # `ListMemories`. A memory that doesn't exist returns
1142
+ # `ResourceNotFoundException`. Unlike `SearchMemories`, this operation
1143
+ # also returns memories that consolidation has superseded.
1144
+ #
1145
+ # A memory past its expiry (set from the space's `memoryExpiryDays`
1146
+ # when the memory is written) reads as not found:
1147
+ # `ResourceNotFoundException`, the same answer as for an ID that does
1148
+ # not exist.
1149
+ #
1150
+ # If the space uses a customer managed AWS KMS key, the call can also
1151
+ # fail because of the key. It fails with `AccessDeniedException` if you
1152
+ # aren't allowed to use the key, and with `ThrottlingException` if AWS
1153
+ # KMS throttles the request. It fails with `ValidationException` if the
1154
+ # key is disabled, pending deletion, or deleted.
1155
+ #
1156
+ # @option params [required, String] :space_id
1157
+ # The ID of the space that holds the memory.
1158
+ #
1159
+ # @option params [required, String] :memory_id
1160
+ # The memory's ID, as returned by `SearchMemories` or `ListMemories`.
1161
+ #
1162
+ # @option params [String] :actor_id
1163
+ # The ID of the actor the memory must belong to. Omit it to skip this
1164
+ # check. If it doesn't match the stored memory, the call fails with
1165
+ # `ResourceNotFoundException`, as if the memory did not exist.
1166
+ #
1167
+ # @option params [String] :strategy_name
1168
+ # The name of the strategy the memory must belong to. Omit it to skip
1169
+ # this check. If it doesn't match the stored memory, the call fails
1170
+ # with `ResourceNotFoundException`, as if the memory did not exist.
1171
+ #
1172
+ # @return [Types::GetMemoryOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1173
+ #
1174
+ # * {Types::GetMemoryOutput#memory #memory} => Types::Memory
1175
+ #
1176
+ # @example Request syntax with placeholder values
1177
+ #
1178
+ # resp = client.get_memory({
1179
+ # space_id: "SpaceId", # required
1180
+ # memory_id: "MemoryId", # required
1181
+ # actor_id: "ActorId",
1182
+ # strategy_name: "StrategyName",
1183
+ # })
1184
+ #
1185
+ # @example Response structure
1186
+ #
1187
+ # resp.memory.memory_id #=> String
1188
+ # resp.memory.memory_type #=> String, one of "SEMANTIC", "SUMMARY", "CUSTOM"
1189
+ # resp.memory.strategy_name #=> String
1190
+ # resp.memory.content #=> String
1191
+ # resp.memory.system_metadata.actor_id #=> String
1192
+ # resp.memory.system_metadata.session_id #=> String
1193
+ # resp.memory.system_metadata.created_at #=> Time
1194
+ # resp.memory.system_metadata.updated_at #=> Time
1195
+ # resp.memory.metadata #=> Hash
1196
+ # resp.memory.metadata["MetadataKey"] #=> String
1197
+ #
1198
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/GetMemory AWS API Documentation
1199
+ #
1200
+ # @overload get_memory(params = {})
1201
+ # @param [Hash] params ({})
1202
+ def get_memory(params = {}, options = {})
1203
+ req = build_request(:get_memory, params)
1204
+ req.send_request(options)
1205
+ end
1206
+
1207
+ # Returns a space's configuration and status.
1208
+ #
1209
+ # @option params [required, String] :space_id
1210
+ # The ID of the space.
1211
+ #
1212
+ # @return [Types::GetSpaceResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1213
+ #
1214
+ # * {Types::GetSpaceResponse#space_id #space_id} => String
1215
+ # * {Types::GetSpaceResponse#arn #arn} => String
1216
+ # * {Types::GetSpaceResponse#name #name} => String
1217
+ # * {Types::GetSpaceResponse#status #status} => String
1218
+ # * {Types::GetSpaceResponse#status_reason #status_reason} => String
1219
+ # * {Types::GetSpaceResponse#created_at #created_at} => Time
1220
+ # * {Types::GetSpaceResponse#memory_strategies #memory_strategies} => Array&lt;Types::MemoryStrategy&gt;
1221
+ # * {Types::GetSpaceResponse#event_expiry_days #event_expiry_days} => Integer
1222
+ # * {Types::GetSpaceResponse#memory_expiry_days #memory_expiry_days} => Integer
1223
+ # * {Types::GetSpaceResponse#extraction_model_id #extraction_model_id} => String
1224
+ # * {Types::GetSpaceResponse#encryption_configuration #encryption_configuration} => Types::EncryptionConfiguration
1225
+ #
1226
+ # @example Request syntax with placeholder values
1227
+ #
1228
+ # resp = client.get_space({
1229
+ # space_id: "SpaceId", # required
1230
+ # })
1231
+ #
1232
+ # @example Response structure
1233
+ #
1234
+ # resp.space_id #=> String
1235
+ # resp.arn #=> String
1236
+ # resp.name #=> String
1237
+ # resp.status #=> String, one of "CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"
1238
+ # resp.status_reason #=> String
1239
+ # resp.created_at #=> Time
1240
+ # resp.memory_strategies #=> Array
1241
+ # resp.memory_strategies[0].type #=> String, one of "SEMANTIC", "SUMMARY", "CUSTOM"
1242
+ # resp.memory_strategies[0].name #=> String
1243
+ # resp.memory_strategies[0].description #=> String
1244
+ # resp.memory_strategies[0].configuration.extraction_prompt #=> String
1245
+ # resp.memory_strategies[0].configuration.extract_every_n_messages #=> Integer
1246
+ # resp.memory_strategies[0].configuration.extract_every_n_tokens #=> Integer
1247
+ # resp.memory_strategies[0].configuration.idle_timeout_seconds #=> Integer
1248
+ # resp.memory_strategies[0].configuration.extraction_seed_top_k #=> Integer
1249
+ # resp.memory_strategies[0].configuration.extraction_seed_recent_n #=> Integer
1250
+ # resp.memory_strategies[0].configuration.consolidation_enabled #=> Boolean
1251
+ # resp.event_expiry_days #=> Integer
1252
+ # resp.memory_expiry_days #=> Integer
1253
+ # resp.extraction_model_id #=> String
1254
+ # resp.encryption_configuration.kms_key_arn #=> String
1255
+ #
1256
+ #
1257
+ # The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
1258
+ #
1259
+ # * space_active
1260
+ # * space_deleted
1261
+ #
1262
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/GetSpace AWS API Documentation
1263
+ #
1264
+ # @overload get_space(params = {})
1265
+ # @param [Hash] params ({})
1266
+ def get_space(params = {}, options = {})
1267
+ req = build_request(:get_space, params)
1268
+ req.send_request(options)
1269
+ end
1270
+
1271
+ # Lists the events in a session, sorted by time. Optionally limit the
1272
+ # results to events whose `eventTimestamp` falls between
1273
+ # `eventTimestampAfter` and `eventTimestampBefore`. Returns event
1274
+ # metadata only. Call `GetEvent` for the payload. For full-text or
1275
+ # relevance search, use `SearchEvents`.
1276
+ #
1277
+ # If the space uses a customer managed AWS KMS key, the call can also
1278
+ # fail because of the key. It fails with `AccessDeniedException` if you
1279
+ # aren't allowed to use the key, and with `ThrottlingException` if AWS
1280
+ # KMS throttles the request. It fails with `ValidationException` if the
1281
+ # key is disabled, pending deletion, or deleted.
1282
+ #
1283
+ # @option params [required, String] :space_id
1284
+ # The ID of the space.
1285
+ #
1286
+ # @option params [required, String] :actor_id
1287
+ # The actor whose events to list.
1288
+ #
1289
+ # @option params [required, String] :session_id
1290
+ # The session whose events to list. To find events across sessions, use
1291
+ # `SearchEvents`.
1292
+ #
1293
+ # @option params [Time,DateTime,Date,Integer,String] :event_timestamp_before
1294
+ # Inclusive upper bound on `eventTimestamp`: only events at or before
1295
+ # this time are returned. Omit for no upper bound.
1296
+ #
1297
+ # @option params [Time,DateTime,Date,Integer,String] :event_timestamp_after
1298
+ # Inclusive lower bound on `eventTimestamp`: only events at or after
1299
+ # this time are returned. Omit for no lower bound.
1300
+ #
1301
+ # If it's later than `eventTimestampBefore`, the request fails with
1302
+ # `ValidationException`.
1303
+ #
1304
+ # @option params [String] :sort_order
1305
+ # The order of the results by `eventTimestamp`: `ASC` or `DESC`. The
1306
+ # default is `DESC`, most recent first.
1307
+ #
1308
+ # @option params [Hash<String,String>] :metadata_filters
1309
+ # Returns only events whose metadata contains every one of these
1310
+ # key-value pairs. Omit, or leave empty, for no metadata filter. The
1311
+ # service applies the filter after it reads events, so a page can hold
1312
+ # fewer than `maxResults` events, or none, and still return a
1313
+ # `nextToken`. Keep paging until `nextToken` is absent.
1314
+ #
1315
+ # @option params [Integer] :max_results
1316
+ # The maximum number of events to return, from 1 to 100. The default is
1317
+ # 20.
1318
+ #
1319
+ # @option params [String] :next_token
1320
+ # The token for the next set of results. Use the value returned in the
1321
+ # previous response in the next request to retrieve the next set of
1322
+ # results.
1323
+ #
1324
+ # @return [Types::ListEventsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1325
+ #
1326
+ # * {Types::ListEventsOutput#events #events} => Array&lt;Types::EventSummary&gt;
1327
+ # * {Types::ListEventsOutput#next_token #next_token} => String
1328
+ #
1329
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
1330
+ #
1331
+ # @example Request syntax with placeholder values
1332
+ #
1333
+ # resp = client.list_events({
1334
+ # space_id: "SpaceId", # required
1335
+ # actor_id: "ActorId", # required
1336
+ # session_id: "SessionId", # required
1337
+ # event_timestamp_before: Time.now,
1338
+ # event_timestamp_after: Time.now,
1339
+ # sort_order: "ASC", # accepts ASC, DESC
1340
+ # metadata_filters: {
1341
+ # "MetadataKey" => "MetadataValue",
1342
+ # },
1343
+ # max_results: 1,
1344
+ # next_token: "PaginationToken",
1345
+ # })
1346
+ #
1347
+ # @example Response structure
1348
+ #
1349
+ # resp.events #=> Array
1350
+ # resp.events[0].event_id #=> String
1351
+ # resp.events[0].metadata #=> Hash
1352
+ # resp.events[0].metadata["MetadataKey"] #=> String
1353
+ # resp.events[0].event_timestamp #=> Time
1354
+ # resp.next_token #=> String
1355
+ #
1356
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/ListEvents AWS API Documentation
1357
+ #
1358
+ # @overload list_events(params = {})
1359
+ # @param [Hash] params ({})
1360
+ def list_events(params = {}, options = {})
1361
+ req = build_request(:list_events, params)
1362
+ req.send_request(options)
1363
+ end
1364
+
1365
+ # Lists a space's memories without a query, for example the most recent
1366
+ # memories or the memories of one strategy. Filter by strategy and
1367
+ # optionally by owning actor or session, sort by creation or update
1368
+ # time, and page through the results. Results have no relevance score.
1369
+ # To query or filter by metadata, use `SearchMemories`.
1370
+ #
1371
+ # If memories are written or deleted while you page, the results can
1372
+ # skip a memory or return it twice. You can page through only a limited
1373
+ # number of results. A request past that limit fails with
1374
+ # `ValidationException` (reason `invalidNextToken`), and the message
1375
+ # gives the limit.
1376
+ #
1377
+ # Memories past their expiry (set from the space's `memoryExpiryDays`
1378
+ # when each memory is written) are left out. Unlike `SearchMemories`,
1379
+ # this operation also returns memories that consolidation has
1380
+ # superseded.
1381
+ #
1382
+ # If the space uses a customer managed AWS KMS key, the call can also
1383
+ # fail because of the key. It fails with `AccessDeniedException` if you
1384
+ # aren't allowed to use the key, and with `ThrottlingException` if AWS
1385
+ # KMS throttles the request. It fails with `ValidationException` if the
1386
+ # key is disabled, pending deletion, or deleted.
1387
+ #
1388
+ # @option params [required, String] :space_id
1389
+ # The space whose memories to list.
1390
+ #
1391
+ # @option params [Array<Types::StrategySelector>] :memory_strategies
1392
+ # The strategies to list, as selectors. A selector without
1393
+ # `memoryStrategyNames` lists every strategy of its type, and omitting
1394
+ # `memoryStrategies` lists every strategy in the space. A name that is
1395
+ # not a declared strategy of that type fails with `ValidationException`.
1396
+ #
1397
+ # @option params [Array<String>] :actor_ids
1398
+ # Lists only memories owned by one of these actors. Combined with
1399
+ # `sessionIds` by AND: a memory must match both filters when both are
1400
+ # given. Omit for no actor filter. An empty list fails validation. A
1401
+ # memory stored without an actor never matches an actor filter.
1402
+ #
1403
+ # @option params [Array<String>] :session_ids
1404
+ # Lists only memories from one of these sessions. Combined with
1405
+ # `actorIds` by AND. Omit for no session filter. An empty list fails
1406
+ # validation. A memory stored without a session never matches a session
1407
+ # filter.
1408
+ #
1409
+ # @option params [String] :sort_by
1410
+ # The timestamp to sort by, as returned in `systemMetadata`:
1411
+ # `CREATED_AT` (the default) or `UPDATED_AT`.
1412
+ #
1413
+ # @option params [String] :sort_order
1414
+ # The sort order: `ASC` or `DESC`. The default is `DESC`, most recent
1415
+ # first.
1416
+ #
1417
+ # @option params [Integer] :max_results
1418
+ # The maximum number of memories to return, from 1 to 100. The default
1419
+ # is 20.
1420
+ #
1421
+ # @option params [String] :next_token
1422
+ # The token for the next set of results. Use the value returned in the
1423
+ # previous response in the next request to retrieve the next set of
1424
+ # results.
1425
+ #
1426
+ # @return [Types::ListMemoriesOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1427
+ #
1428
+ # * {Types::ListMemoriesOutput#memories #memories} => Array&lt;Types::MemoryListSummary&gt;
1429
+ # * {Types::ListMemoriesOutput#next_token #next_token} => String
1430
+ #
1431
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
1432
+ #
1433
+ # @example Request syntax with placeholder values
1434
+ #
1435
+ # resp = client.list_memories({
1436
+ # space_id: "SpaceId", # required
1437
+ # memory_strategies: [
1438
+ # {
1439
+ # memory_type: "SEMANTIC", # required, accepts SEMANTIC, SUMMARY, CUSTOM
1440
+ # memory_strategy_names: ["StrategyName"],
1441
+ # },
1442
+ # ],
1443
+ # actor_ids: ["ActorId"],
1444
+ # session_ids: ["SessionId"],
1445
+ # sort_by: "CREATED_AT", # accepts CREATED_AT, UPDATED_AT
1446
+ # sort_order: "ASC", # accepts ASC, DESC
1447
+ # max_results: 1,
1448
+ # next_token: "PaginationToken",
1449
+ # })
1450
+ #
1451
+ # @example Response structure
1452
+ #
1453
+ # resp.memories #=> Array
1454
+ # resp.memories[0].memory_id #=> String
1455
+ # resp.memories[0].memory_type #=> String, one of "SEMANTIC", "SUMMARY", "CUSTOM"
1456
+ # resp.memories[0].strategy_name #=> String
1457
+ # resp.memories[0].system_metadata.actor_id #=> String
1458
+ # resp.memories[0].system_metadata.session_id #=> String
1459
+ # resp.memories[0].system_metadata.created_at #=> Time
1460
+ # resp.memories[0].system_metadata.updated_at #=> Time
1461
+ # resp.memories[0].metadata #=> Hash
1462
+ # resp.memories[0].metadata["MetadataKey"] #=> String
1463
+ # resp.next_token #=> String
1464
+ #
1465
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/ListMemories AWS API Documentation
1466
+ #
1467
+ # @overload list_memories(params = {})
1468
+ # @param [Hash] params ({})
1469
+ def list_memories(params = {}, options = {})
1470
+ req = build_request(:list_memories, params)
1471
+ req.send_request(options)
1472
+ end
1473
+
1474
+ # Lists the spaces in your account in the current Region.
1475
+ #
1476
+ # @option params [Integer] :max_results
1477
+ # The maximum number of spaces to return, from 1 to 100. The default is
1478
+ # 100.
1479
+ #
1480
+ # @option params [String] :next_token
1481
+ # The token for the next set of results. Use the value returned in the
1482
+ # previous response in the next request to retrieve the next set of
1483
+ # results.
1484
+ #
1485
+ # @return [Types::ListSpacesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1486
+ #
1487
+ # * {Types::ListSpacesResponse#spaces #spaces} => Array&lt;Types::SpaceSummary&gt;
1488
+ # * {Types::ListSpacesResponse#next_token #next_token} => String
1489
+ #
1490
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
1491
+ #
1492
+ # @example Request syntax with placeholder values
1493
+ #
1494
+ # resp = client.list_spaces({
1495
+ # max_results: 1,
1496
+ # next_token: "NextToken",
1497
+ # })
1498
+ #
1499
+ # @example Response structure
1500
+ #
1501
+ # resp.spaces #=> Array
1502
+ # resp.spaces[0].space_id #=> String
1503
+ # resp.spaces[0].arn #=> String
1504
+ # resp.spaces[0].name #=> String
1505
+ # resp.spaces[0].status #=> String, one of "CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"
1506
+ # resp.spaces[0].created_at #=> Time
1507
+ # resp.next_token #=> String
1508
+ #
1509
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/ListSpaces AWS API Documentation
1510
+ #
1511
+ # @overload list_spaces(params = {})
1512
+ # @param [Hash] params ({})
1513
+ def list_spaces(params = {}, options = {})
1514
+ req = build_request(:list_spaces, params)
1515
+ req.send_request(options)
1516
+ end
1517
+
1518
+ # Lists the tags for the specified space.
1519
+ #
1520
+ # @option params [required, String] :resource_arn
1521
+ # The Amazon Resource Name (ARN) of the space.
1522
+ #
1523
+ # @return [Types::ListTagsForResourceResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1524
+ #
1525
+ # * {Types::ListTagsForResourceResponse#tags #tags} => Array&lt;Types::Tag&gt;
1526
+ #
1527
+ # @example Request syntax with placeholder values
1528
+ #
1529
+ # resp = client.list_tags_for_resource({
1530
+ # resource_arn: "SpaceArn", # required
1531
+ # })
1532
+ #
1533
+ # @example Response structure
1534
+ #
1535
+ # resp.tags #=> Array
1536
+ # resp.tags[0].key #=> String
1537
+ # resp.tags[0].value #=> String
1538
+ #
1539
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/ListTagsForResource AWS API Documentation
1540
+ #
1541
+ # @overload list_tags_for_resource(params = {})
1542
+ # @param [Hash] params ({})
1543
+ def list_tags_for_resource(params = {}, options = {})
1544
+ req = build_request(:list_tags_for_resource, params)
1545
+ req.send_request(options)
1546
+ end
1547
+
1548
+ # Searches a space's events by relevance. It works like
1549
+ # `SearchMemories` without the memory type and strategy selector. The
1550
+ # query is a subset of the OpenSearch Query DSL. The service validates
1551
+ # it, limits the search to the actor in `actorId` and the sessions in
1552
+ # `sessionIds`, and returns ranked results. Each result is the matching
1553
+ # chunk of an event, not the whole event. You can page through only a
1554
+ # limited number of results. A request past that limit fails with
1555
+ # `ValidationException` (reason `invalidNextToken`), and the message
1556
+ # gives the limit.
1557
+ #
1558
+ # If the results are larger than 5 MiB, the request fails with
1559
+ # `ValidationException` (reason `queryBodyTooLarge`). Lower
1560
+ # `maxResults`.
1561
+ #
1562
+ # If the request would exceed the service's rate for embedding
1563
+ # requests, it fails with `ThrottlingException`. Retry with exponential
1564
+ # backoff.
1565
+ #
1566
+ # If the space uses a customer managed AWS KMS key, the call can also
1567
+ # fail because of the key. It fails with `AccessDeniedException` if you
1568
+ # aren't allowed to use the key, and with `ThrottlingException` if AWS
1569
+ # KMS throttles the request. It fails with `ValidationException` if the
1570
+ # key is disabled, pending deletion, or deleted.
1571
+ #
1572
+ # @option params [required, String] :space_id
1573
+ # The space whose events to search. Use `actorId` and `sessionIds` to
1574
+ # narrow the search within it.
1575
+ #
1576
+ # @option params [required, String] :actor_id
1577
+ # The actor whose events to search (exact match). Required: every search
1578
+ # covers exactly one actor, and an event stored without an actor is
1579
+ # never returned. Narrow the search further with `sessionIds`, combined
1580
+ # by AND. This is the only way to filter by actor: a query that
1581
+ # references `system_metadata.actor_id` fails with `ValidationException`
1582
+ # (reason `nonFilterableField`).
1583
+ #
1584
+ # @option params [Array<String>] :session_ids
1585
+ # Returns only events from one of these sessions (exact match). Combined
1586
+ # with `actorId` by AND. Omit for no session filter. An empty list fails
1587
+ # validation. An event stored without a session never matches a session
1588
+ # filter. This is the only way to filter by session: a query that
1589
+ # references `system_metadata.session_id` fails with
1590
+ # `ValidationException` (reason `nonFilterableField`).
1591
+ #
1592
+ # @option params [required, Hash,Array,String,Numeric,Boolean] :query
1593
+ # The query: a subset of the OpenSearch Query DSL (see `SearchQuery`),
1594
+ # validated by the same rules as on `SearchMemories`. Query event text
1595
+ # as `text` and embeddings as `vector`. A search covers both
1596
+ # conversation turns and chunks of documents submitted as a `blob`. You
1597
+ # can't use actor and session fields here. Use the top-level `actorId`
1598
+ # and `sessionIds`.
1599
+ #
1600
+ # To search only the content of particular events, filter on `event_ids`
1601
+ # with `term` or `terms`, for example with the `sourceEventIds` that a
1602
+ # `SearchMemories` result returns. A `terms` clause on `event_ids` can
1603
+ # list up to 10 event IDs. More IDs fail with `ValidationException`
1604
+ # (reason `queryBodyTooLarge`). You can use `event_ids` only in `term`,
1605
+ # `terms`, and `exists` queries.
1606
+ #
1607
+ # Document type used to carry open content
1608
+ # (Hash,Array,String,Numeric,Boolean). A document type value is
1609
+ # serialized using the same format as its surroundings and requires no
1610
+ # additional encoding or escaping.
1611
+ #
1612
+ # @option params [Hash,Array,String,Numeric,Boolean] :sort
1613
+ # The sort order (see `SearchSort`). Omit to return the most relevant
1614
+ # events first.
1615
+ #
1616
+ # Document type used to carry open content
1617
+ # (Hash,Array,String,Numeric,Boolean). A document type value is
1618
+ # serialized using the same format as its surroundings and requires no
1619
+ # additional encoding or escaping.
1620
+ #
1621
+ # @option params [Integer] :max_results
1622
+ # The maximum number of events to return, from 1 to 100. The default is
1623
+ # 20.
1624
+ #
1625
+ # @option params [String] :next_token
1626
+ # The token for the next set of results. Use the value returned in the
1627
+ # previous response in the next request to retrieve the next set of
1628
+ # results.
1629
+ #
1630
+ # @return [Types::SearchEventsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1631
+ #
1632
+ # * {Types::SearchEventsOutput#events #events} => Array&lt;Types::EventSearchSummary&gt;
1633
+ # * {Types::SearchEventsOutput#next_token #next_token} => String
1634
+ #
1635
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
1636
+ #
1637
+ # @example Request syntax with placeholder values
1638
+ #
1639
+ # resp = client.search_events({
1640
+ # space_id: "SpaceId", # required
1641
+ # actor_id: "ActorId", # required
1642
+ # session_ids: ["SessionId"],
1643
+ # query: { # required
1644
+ # },
1645
+ # sort: {
1646
+ # },
1647
+ # max_results: 1,
1648
+ # next_token: "PaginationToken",
1649
+ # })
1650
+ #
1651
+ # @example Response structure
1652
+ #
1653
+ # resp.events #=> Array
1654
+ # resp.events[0].event_id #=> String
1655
+ # resp.events[0].score #=> Float
1656
+ # resp.events[0].system_metadata.actor_id #=> String
1657
+ # resp.events[0].system_metadata.session_id #=> String
1658
+ # resp.events[0].system_metadata.created_at #=> Time
1659
+ # resp.events[0].system_metadata.updated_at #=> Time
1660
+ # resp.events[0].metadata #=> Hash
1661
+ # resp.events[0].metadata["MetadataKey"] #=> String
1662
+ # resp.events[0].matched_content #=> String
1663
+ # resp.next_token #=> String
1664
+ #
1665
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/SearchEvents AWS API Documentation
1666
+ #
1667
+ # @overload search_events(params = {})
1668
+ # @param [Hash] params ({})
1669
+ def search_events(params = {}, options = {})
1670
+ req = build_request(:search_events, params)
1671
+ req.send_request(options)
1672
+ end
1673
+
1674
+ # Searches a space's memories by relevance. The query is a subset of
1675
+ # the OpenSearch Query DSL. The service validates it, limits the search
1676
+ # to the requested strategies and to the actor in `actorId`, and returns
1677
+ # one ranked list of memories. You can page through only a limited
1678
+ # number of results. A request past that limit fails with
1679
+ # `ValidationException` (reason `invalidNextToken`), and the message
1680
+ # gives the limit.
1681
+ #
1682
+ # Memories past their expiry (set from the space's `memoryExpiryDays`
1683
+ # when each memory is written) are left out of the results. Only current
1684
+ # memories are returned: a memory that consolidation has superseded (an
1685
+ # older version of a fact that a newer memory replaced) is left out.
1686
+ #
1687
+ # If the results are larger than 5 MiB, the request fails with
1688
+ # `ValidationException` (reason `queryBodyTooLarge`). Lower
1689
+ # `maxResults`.
1690
+ #
1691
+ # If the request would exceed the service's rate for embedding
1692
+ # requests, it fails with `ThrottlingException`. Retry with exponential
1693
+ # backoff.
1694
+ #
1695
+ # If the space uses a customer managed AWS KMS key, the call can also
1696
+ # fail because of the key. It fails with `AccessDeniedException` if you
1697
+ # aren't allowed to use the key, and with `ThrottlingException` if AWS
1698
+ # KMS throttles the request. It fails with `ValidationException` if the
1699
+ # key is disabled, pending deletion, or deleted.
1700
+ #
1701
+ # @option params [required, String] :space_id
1702
+ # The space to search. Use `actorId` to narrow the search within it.
1703
+ #
1704
+ # @option params [Array<Types::StrategySelector>] :memory_strategies
1705
+ # The strategies to search, as a list of selectors. Each selector names
1706
+ # a memory type and, optionally, specific strategy names of that type. A
1707
+ # space can hold several strategies of the same type. A selector without
1708
+ # `memoryStrategyNames` searches every strategy of its type, and
1709
+ # omitting `memoryStrategies` searches every strategy in the space. A
1710
+ # name that is not a declared strategy of that type fails with
1711
+ # `ValidationException`.
1712
+ #
1713
+ # @option params [required, String] :actor_id
1714
+ # The actor whose memories to search (exact match). Required: every
1715
+ # search covers exactly one actor, and a memory stored without an actor
1716
+ # is never returned. This is the only way to filter by actor: a query
1717
+ # that references `system_metadata.actor_id` fails with
1718
+ # `ValidationException` (reason `nonFilterableField`).
1719
+ #
1720
+ # @option params [required, Hash,Array,String,Numeric,Boolean] :query
1721
+ # The query: a subset of the OpenSearch Query DSL (see `SearchQuery`).
1722
+ # You can't use the actor and session fields `system_metadata.actor_id`
1723
+ # and `system_metadata.session_id` here. Use the top-level `actorId` to
1724
+ # filter by actor. Searching memories doesn't filter by session.
1725
+ #
1726
+ # Document type used to carry open content
1727
+ # (Hash,Array,String,Numeric,Boolean). A document type value is
1728
+ # serialized using the same format as its surroundings and requires no
1729
+ # additional encoding or escaping.
1730
+ #
1731
+ # @option params [Hash,Array,String,Numeric,Boolean] :sort
1732
+ # The sort order (see `SearchSort`). Omit to return the most relevant
1733
+ # memories first.
1734
+ #
1735
+ # Document type used to carry open content
1736
+ # (Hash,Array,String,Numeric,Boolean). A document type value is
1737
+ # serialized using the same format as its surroundings and requires no
1738
+ # additional encoding or escaping.
1739
+ #
1740
+ # @option params [Integer] :max_results
1741
+ # The maximum number of memories to return, from 1 to 100. The default
1742
+ # is 20.
1743
+ #
1744
+ # @option params [String] :next_token
1745
+ # The token for the next set of results. Use the value returned in the
1746
+ # previous response in the next request to retrieve the next set of
1747
+ # results.
1748
+ #
1749
+ # @return [Types::SearchMemoriesOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1750
+ #
1751
+ # * {Types::SearchMemoriesOutput#memories #memories} => Array&lt;Types::MemorySearchSummary&gt;
1752
+ # * {Types::SearchMemoriesOutput#next_token #next_token} => String
1753
+ #
1754
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
1755
+ #
1756
+ # @example Request syntax with placeholder values
1757
+ #
1758
+ # resp = client.search_memories({
1759
+ # space_id: "SpaceId", # required
1760
+ # memory_strategies: [
1761
+ # {
1762
+ # memory_type: "SEMANTIC", # required, accepts SEMANTIC, SUMMARY, CUSTOM
1763
+ # memory_strategy_names: ["StrategyName"],
1764
+ # },
1765
+ # ],
1766
+ # actor_id: "ActorId", # required
1767
+ # query: { # required
1768
+ # },
1769
+ # sort: {
1770
+ # },
1771
+ # max_results: 1,
1772
+ # next_token: "PaginationToken",
1773
+ # })
1774
+ #
1775
+ # @example Response structure
1776
+ #
1777
+ # resp.memories #=> Array
1778
+ # resp.memories[0].memory_id #=> String
1779
+ # resp.memories[0].memory_type #=> String, one of "SEMANTIC", "SUMMARY", "CUSTOM"
1780
+ # resp.memories[0].strategy_name #=> String
1781
+ # resp.memories[0].content #=> String
1782
+ # resp.memories[0].score #=> Float
1783
+ # resp.memories[0].system_metadata.actor_id #=> String
1784
+ # resp.memories[0].system_metadata.session_id #=> String
1785
+ # resp.memories[0].system_metadata.created_at #=> Time
1786
+ # resp.memories[0].system_metadata.updated_at #=> Time
1787
+ # resp.memories[0].metadata #=> Hash
1788
+ # resp.memories[0].metadata["MetadataKey"] #=> String
1789
+ # resp.memories[0].source_event_ids #=> Array
1790
+ # resp.memories[0].source_event_ids[0] #=> String
1791
+ # resp.next_token #=> String
1792
+ #
1793
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/SearchMemories AWS API Documentation
1794
+ #
1795
+ # @overload search_memories(params = {})
1796
+ # @param [Hash] params ({})
1797
+ def search_memories(params = {}, options = {})
1798
+ req = build_request(:search_memories, params)
1799
+ req.send_request(options)
1800
+ end
1801
+
1802
+ # Adds the specified tags to the specified space.
1803
+ #
1804
+ # @option params [required, String] :resource_arn
1805
+ # The Amazon Resource Name (ARN) of the space.
1806
+ #
1807
+ # @option params [required, Array<Types::Tag>] :tags
1808
+ # The tags to add to the space.
1809
+ #
1810
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
1811
+ #
1812
+ # @example Request syntax with placeholder values
1813
+ #
1814
+ # resp = client.tag_resource({
1815
+ # resource_arn: "SpaceArn", # required
1816
+ # tags: [ # required
1817
+ # {
1818
+ # key: "TagKey", # required
1819
+ # value: "TagValue", # required
1820
+ # },
1821
+ # ],
1822
+ # })
1823
+ #
1824
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/TagResource AWS API Documentation
1825
+ #
1826
+ # @overload tag_resource(params = {})
1827
+ # @param [Hash] params ({})
1828
+ def tag_resource(params = {}, options = {})
1829
+ req = build_request(:tag_resource, params)
1830
+ req.send_request(options)
1831
+ end
1832
+
1833
+ # Removes the specified tags from the specified space.
1834
+ #
1835
+ # @option params [required, String] :resource_arn
1836
+ # The Amazon Resource Name (ARN) of the space.
1837
+ #
1838
+ # @option params [required, Array<String>] :tag_keys
1839
+ # The keys of the tags to remove from the space.
1840
+ #
1841
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
1842
+ #
1843
+ # @example Request syntax with placeholder values
1844
+ #
1845
+ # resp = client.untag_resource({
1846
+ # resource_arn: "SpaceArn", # required
1847
+ # tag_keys: ["TagKey"], # required
1848
+ # })
1849
+ #
1850
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/UntagResource AWS API Documentation
1851
+ #
1852
+ # @overload untag_resource(params = {})
1853
+ # @param [Hash] params ({})
1854
+ def untag_resource(params = {}, options = {})
1855
+ req = build_request(:untag_resource, params)
1856
+ req.send_request(options)
1857
+ end
1858
+
1859
+ # Updates a memory in place. Supply only the fields to change. Omitted
1860
+ # fields keep their stored values. A request must supply `content` or
1861
+ # `metadata`, or it fails with `ValidationException`. Supplying
1862
+ # `content` re-embeds the memory. A change to metadata alone doesn't.
1863
+ #
1864
+ # The memory keeps its `memoryId` across updates. Shortly after an
1865
+ # update, searches stop returning the previous content.
1866
+ #
1867
+ # `memoryType` can't be changed. To change it, delete the memory and
1868
+ # create a new one.
1869
+ #
1870
+ # A memory past its expiry (set from the space's `memoryExpiryDays`
1871
+ # when the memory is written) reads as not found: the operation fails
1872
+ # with `ResourceNotFoundException` and changes nothing. An update does
1873
+ # not move the expiry.
1874
+ #
1875
+ # Concurrent updates to one memory are last-writer-wins. There is no
1876
+ # version check. To avoid lost updates, serialize your updates to a
1877
+ # memory.
1878
+ #
1879
+ # If you supply `content` and the request would exceed the service's
1880
+ # rate for embedding requests, it fails with `ThrottlingException`.
1881
+ # Retry with exponential backoff.
1882
+ #
1883
+ # If the space uses a customer managed AWS KMS key, the call can also
1884
+ # fail because of the key. It fails with `AccessDeniedException` if you
1885
+ # aren't allowed to use the key, and with `ThrottlingException` if AWS
1886
+ # KMS throttles the request. It fails with `ValidationException` if the
1887
+ # key is disabled, pending deletion, or deleted.
1888
+ #
1889
+ # @option params [required, String] :space_id
1890
+ # The ID of the space that owns the memory, for example
1891
+ # `sp-02864597b164`.
1892
+ #
1893
+ # @option params [required, String] :memory_id
1894
+ # The ID of the memory to update.
1895
+ #
1896
+ # @option params [String] :content
1897
+ # Replacement memory text. Supplying it re-embeds the memory. Omit to
1898
+ # leave the text unchanged.
1899
+ #
1900
+ # @option params [Hash<String,String>] :metadata
1901
+ # The metadata tags to apply. By default this map replaces the stored
1902
+ # metadata, and any key not present is removed. Set `metadataMode` to
1903
+ # `MERGE` to keep the keys you don't supply. Limits apply to the
1904
+ # resulting metadata, not to the request. Keys that begin with `x-amz-`
1905
+ # and the key `documentS3Source` are reserved: a request that sets one
1906
+ # fails with `ValidationException`.
1907
+ #
1908
+ # A space can use at most 50 distinct metadata keys across all of its
1909
+ # events and memories. A request that would add a key beyond that fails
1910
+ # with `ValidationException`. Reuse an existing key instead.
1911
+ #
1912
+ # @option params [String] :metadata_mode
1913
+ # How `metadata` combines with what is stored. The default is `REPLACE`.
1914
+ #
1915
+ # @option params [String] :actor_id
1916
+ # The ID of the actor that the memory must belong to. Omit it to skip
1917
+ # this check. If it doesn't match the stored memory, the call fails
1918
+ # with `ResourceNotFoundException`, as if the memory did not exist.
1919
+ #
1920
+ # @option params [String] :strategy_name
1921
+ # The name of the strategy that the memory must belong to. Omit it to
1922
+ # skip this check. If it doesn't match the stored memory, the call
1923
+ # fails with `ResourceNotFoundException`, as if the memory did not
1924
+ # exist.
1925
+ #
1926
+ # @return [Types::UpdateMemoryOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1927
+ #
1928
+ # * {Types::UpdateMemoryOutput#memory #memory} => Types::Memory
1929
+ #
1930
+ # @example Request syntax with placeholder values
1931
+ #
1932
+ # resp = client.update_memory({
1933
+ # space_id: "SpaceId", # required
1934
+ # memory_id: "MemoryId", # required
1935
+ # content: "MemoryUpdateContent",
1936
+ # metadata: {
1937
+ # "MetadataKey" => "MetadataValue",
1938
+ # },
1939
+ # metadata_mode: "REPLACE", # accepts REPLACE, MERGE
1940
+ # actor_id: "ActorId",
1941
+ # strategy_name: "StrategyName",
1942
+ # })
1943
+ #
1944
+ # @example Response structure
1945
+ #
1946
+ # resp.memory.memory_id #=> String
1947
+ # resp.memory.memory_type #=> String, one of "SEMANTIC", "SUMMARY", "CUSTOM"
1948
+ # resp.memory.strategy_name #=> String
1949
+ # resp.memory.content #=> String
1950
+ # resp.memory.system_metadata.actor_id #=> String
1951
+ # resp.memory.system_metadata.session_id #=> String
1952
+ # resp.memory.system_metadata.created_at #=> Time
1953
+ # resp.memory.system_metadata.updated_at #=> Time
1954
+ # resp.memory.metadata #=> Hash
1955
+ # resp.memory.metadata["MetadataKey"] #=> String
1956
+ #
1957
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/UpdateMemory AWS API Documentation
1958
+ #
1959
+ # @overload update_memory(params = {})
1960
+ # @param [Hash] params ({})
1961
+ def update_memory(params = {}, options = {})
1962
+ req = build_request(:update_memory, params)
1963
+ req.send_request(options)
1964
+ end
1965
+
1966
+ # Updates a space's memory strategies, retention settings, or
1967
+ # extraction model. Supply only the fields to change. Omitted fields
1968
+ # keep their current values.
1969
+ #
1970
+ # If the request changes the set of strategies, a strategy's
1971
+ # configuration, a retention setting, or the extraction model, the space
1972
+ # moves to `UPDATING`. When the change is complete, the space returns to
1973
+ # `ACTIVE`, or moves to `FAILED` if the change can't be applied. While
1974
+ # the space is `UPDATING`, `GetSpace` returns the previous
1975
+ # configuration. A request that only changes strategy descriptions or
1976
+ # repeats the values the space has stored is applied immediately and
1977
+ # doesn't change the status. Sending a retention value that the space
1978
+ # never set also moves the space to `UPDATING`, even one that matches
1979
+ # the behavior without it, such as 90 for `eventExpiryDays` or 0 for
1980
+ # `memoryExpiryDays`. A space that is `CREATING`, `UPDATING`, or
1981
+ # `DELETING` can't be updated: the request fails with
1982
+ # `ConflictException`.
1983
+ #
1984
+ # @option params [required, String] :space_id
1985
+ # The ID of the space to update.
1986
+ #
1987
+ # @option params [Array<Types::MemoryStrategy>] :memory_strategies
1988
+ # The complete new list of memory strategies. The service removes
1989
+ # strategies that aren't in the list from the space. Removing a
1990
+ # strategy stops extraction for it but doesn't delete its memories:
1991
+ # they're kept, until they expire if the space sets `memoryExpiryDays`,
1992
+ # and they're available again if you later add a strategy with the same
1993
+ # `type` and `name`. To delete them, use `DeleteMemory` before you
1994
+ # remove the strategy, or delete the space.
1995
+ #
1996
+ # To keep a strategy, include it with the same `type` and `name` that
1997
+ # `GetSpace` returns. For a kept strategy, any `configuration` member
1998
+ # you omit keeps its current value. It doesn't return to the default,
1999
+ # and you can't clear a member once it's set. Omit this field to leave
2000
+ # the strategies unchanged. The list must name at least one strategy.
2001
+ # You can't remove every strategy from a space with `UpdateSpace`.
2002
+ #
2003
+ # The serialized list can be at most 384 KiB.
2004
+ #
2005
+ # @option params [Integer] :event_expiry_days
2006
+ # How many days the space keeps each event, from 1 to 365. Omit it to
2007
+ # leave the current value unchanged. Events already stored keep the
2008
+ # expiry they were written with.
2009
+ #
2010
+ # @option params [Integer] :memory_expiry_days
2011
+ # How many days the space keeps each memory, from 0 to 3650. 0 means
2012
+ # memories never expire. Omit it to leave the current value unchanged.
2013
+ # You can't clear the setting. To make memories written from then on
2014
+ # never expire, send 0. `GetSpace` then returns 0.
2015
+ #
2016
+ # A change applies to memories written after it. Memories already stored
2017
+ # keep the expiry they were written with. A memory the service rewrites
2018
+ # later, such as a summary it keeps up to date, takes the setting in
2019
+ # force at that rewrite. A change moves the space to `UPDATING`. Sending
2020
+ # the value that the space has stored doesn't.
2021
+ #
2022
+ # @option params [String] :extraction_model_id
2023
+ # The model that extracts and consolidates memories for every strategy
2024
+ # in the space: `anthropic.claude-opus-5-5` or
2025
+ # `anthropic.claude-haiku-5-5`. Omit it to leave the current value
2026
+ # unchanged. Once set, it can't be cleared back to the service default.
2027
+ #
2028
+ # @return [Types::UpdateSpaceResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
2029
+ #
2030
+ # * {Types::UpdateSpaceResponse#space_id #space_id} => String
2031
+ # * {Types::UpdateSpaceResponse#status #status} => String
2032
+ #
2033
+ # @example Request syntax with placeholder values
2034
+ #
2035
+ # resp = client.update_space({
2036
+ # space_id: "SpaceId", # required
2037
+ # memory_strategies: [
2038
+ # {
2039
+ # type: "SEMANTIC", # required, accepts SEMANTIC, SUMMARY, CUSTOM
2040
+ # name: "MemoryStrategyName",
2041
+ # description: "MemoryStrategyDescription",
2042
+ # configuration: {
2043
+ # extraction_prompt: "ExtractionPrompt",
2044
+ # extract_every_n_messages: 1,
2045
+ # extract_every_n_tokens: 1,
2046
+ # idle_timeout_seconds: 1,
2047
+ # extraction_seed_top_k: 1,
2048
+ # extraction_seed_recent_n: 1,
2049
+ # consolidation_enabled: false,
2050
+ # },
2051
+ # },
2052
+ # ],
2053
+ # event_expiry_days: 1,
2054
+ # memory_expiry_days: 1,
2055
+ # extraction_model_id: "ExtractionModelId",
2056
+ # })
2057
+ #
2058
+ # @example Response structure
2059
+ #
2060
+ # resp.space_id #=> String
2061
+ # resp.status #=> String, one of "CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "FAILED"
2062
+ #
2063
+ # @see http://docs.aws.amazon.com/goto/WebAPI/opensearchmemory-2026-08-24/UpdateSpace AWS API Documentation
2064
+ #
2065
+ # @overload update_space(params = {})
2066
+ # @param [Hash] params ({})
2067
+ def update_space(params = {}, options = {})
2068
+ req = build_request(:update_space, params)
2069
+ req.send_request(options)
2070
+ end
2071
+
2072
+ # @!endgroup
2073
+
2074
+ # @param params ({})
2075
+ # @api private
2076
+ def build_request(operation_name, params = {})
2077
+ handlers = @handlers.for(operation_name)
2078
+ tracer = config.telemetry_provider.tracer_provider.tracer(
2079
+ Aws::Telemetry.module_to_tracer_name('Aws::OpenSearchMemory')
2080
+ )
2081
+ context = Seahorse::Client::RequestContext.new(
2082
+ operation_name: operation_name,
2083
+ operation: config.api.operation(operation_name),
2084
+ client: self,
2085
+ params: params,
2086
+ config: config,
2087
+ tracer: tracer
2088
+ )
2089
+ context[:gem_name] = 'aws-sdk-opensearchmemory'
2090
+ context[:gem_version] = '1.0.0'
2091
+ Seahorse::Client::Request.new(handlers, context)
2092
+ end
2093
+
2094
+ # Polls an API operation until a resource enters a desired state.
2095
+ #
2096
+ # ## Basic Usage
2097
+ #
2098
+ # A waiter will call an API operation until:
2099
+ #
2100
+ # * It is successful
2101
+ # * It enters a terminal state
2102
+ # * It makes the maximum number of attempts
2103
+ #
2104
+ # In between attempts, the waiter will sleep.
2105
+ #
2106
+ # # polls in a loop, sleeping between attempts
2107
+ # client.wait_until(waiter_name, params)
2108
+ #
2109
+ # ## Configuration
2110
+ #
2111
+ # You can configure the maximum number of polling attempts, and the
2112
+ # delay (in seconds) between each polling attempt. You can pass
2113
+ # configuration as the final arguments hash.
2114
+ #
2115
+ # # poll for ~25 seconds
2116
+ # client.wait_until(waiter_name, params, {
2117
+ # max_attempts: 5,
2118
+ # delay: 5,
2119
+ # })
2120
+ #
2121
+ # ## Callbacks
2122
+ #
2123
+ # You can be notified before each polling attempt and before each
2124
+ # delay. If you throw `:success` or `:failure` from these callbacks,
2125
+ # it will terminate the waiter.
2126
+ #
2127
+ # started_at = Time.now
2128
+ # client.wait_until(waiter_name, params, {
2129
+ #
2130
+ # # disable max attempts
2131
+ # max_attempts: nil,
2132
+ #
2133
+ # # poll for 1 hour, instead of a number of attempts
2134
+ # before_wait: -> (attempts, response) do
2135
+ # throw :failure if Time.now - started_at > 3600
2136
+ # end
2137
+ # })
2138
+ #
2139
+ # ## Handling Errors
2140
+ #
2141
+ # When a waiter is unsuccessful, it will raise an error.
2142
+ # All of the failure errors extend from
2143
+ # {Aws::Waiters::Errors::WaiterFailed}.
2144
+ #
2145
+ # begin
2146
+ # client.wait_until(...)
2147
+ # rescue Aws::Waiters::Errors::WaiterFailed
2148
+ # # resource did not enter the desired state in time
2149
+ # end
2150
+ #
2151
+ # ## Valid Waiters
2152
+ #
2153
+ # The following table lists the valid waiter names, the operations they call,
2154
+ # and the default `:delay` and `:max_attempts` values.
2155
+ #
2156
+ # | waiter_name | params | :delay | :max_attempts |
2157
+ # | ------------- | ------------------ | -------- | ------------- |
2158
+ # | space_active | {Client#get_space} | 10 | 60 |
2159
+ # | space_deleted | {Client#get_space} | 10 | 60 |
2160
+ #
2161
+ # @raise [Errors::FailureStateError] Raised when the waiter terminates
2162
+ # because the waiter has entered a state that it will not transition
2163
+ # out of, preventing success.
2164
+ #
2165
+ # @raise [Errors::TooManyAttemptsError] Raised when the configured
2166
+ # maximum number of attempts have been made, and the waiter is not
2167
+ # yet successful.
2168
+ #
2169
+ # @raise [Errors::UnexpectedError] Raised when an error is encounted
2170
+ # while polling for a resource that is not expected.
2171
+ #
2172
+ # @raise [Errors::NoSuchWaiterError] Raised when you request to wait
2173
+ # for an unknown state.
2174
+ #
2175
+ # @return [Boolean] Returns `true` if the waiter was successful.
2176
+ # @param [Symbol] waiter_name
2177
+ # @param [Hash] params ({})
2178
+ # @param [Hash] options ({})
2179
+ # @option options [Integer] :max_attempts
2180
+ # @option options [Integer] :delay
2181
+ # @option options [Proc] :before_attempt
2182
+ # @option options [Proc] :before_wait
2183
+ def wait_until(waiter_name, params = {}, options = {})
2184
+ w = waiter(waiter_name, options)
2185
+ yield(w.waiter) if block_given? # deprecated
2186
+ w.wait(params)
2187
+ end
2188
+
2189
+ # @api private
2190
+ # @deprecated
2191
+ def waiter_names
2192
+ waiters.keys
2193
+ end
2194
+
2195
+ private
2196
+
2197
+ # @param [Symbol] waiter_name
2198
+ # @param [Hash] options ({})
2199
+ def waiter(waiter_name, options = {})
2200
+ waiter_class = waiters[waiter_name]
2201
+ if waiter_class
2202
+ waiter_class.new(options.merge(client: self))
2203
+ else
2204
+ raise Aws::Waiters::Errors::NoSuchWaiterError.new(waiter_name, waiters.keys)
2205
+ end
2206
+ end
2207
+
2208
+ def waiters
2209
+ {
2210
+ space_active: Waiters::SpaceActive,
2211
+ space_deleted: Waiters::SpaceDeleted
2212
+ }
2213
+ end
2214
+
2215
+ class << self
2216
+
2217
+ # @api private
2218
+ attr_reader :identifier
2219
+
2220
+ # @api private
2221
+ def errors_module
2222
+ Errors
2223
+ end
2224
+
2225
+ end
2226
+ end
2227
+ end