FoundryStateStore.SetItemAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| SetItemAsync(String, IDictionary<String,BinaryData>, IReadOnlyDictionary<String,String>, ETag, Boolean, CancellationToken) |
Creates or replaces one item by key. |
| SetItemAsync(String, IDictionary<String,BinaryData>, IReadOnlyDictionary<String,String>, ETag, Boolean, String, CancellationToken) |
Creates or replaces one item by key. |
SetItemAsync(String, IDictionary<String,BinaryData>, IReadOnlyDictionary<String,String>, ETag, Boolean, CancellationToken)
- Source:
- FoundryStateStore.cs
Creates or replaces one item by key.
public virtual System.Threading.Tasks.Task<Azure.AI.AgentServer.Core.Storage.StateStoreItemRef> SetItemAsync(string key, System.Collections.Generic.IDictionary<string,BinaryData> value, System.Collections.Generic.IReadOnlyDictionary<string,string>? tags = default, Azure.ETag ifMatch = default, bool requireExists = false, System.Threading.CancellationToken cancellationToken = default);
abstract member SetItemAsync : string * System.Collections.Generic.IDictionary<string, BinaryData> * System.Collections.Generic.IReadOnlyDictionary<string, string> * Azure.ETag * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.AI.AgentServer.Core.Storage.StateStoreItemRef>
override this.SetItemAsync : string * System.Collections.Generic.IDictionary<string, BinaryData> * System.Collections.Generic.IReadOnlyDictionary<string, string> * Azure.ETag * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.AI.AgentServer.Core.Storage.StateStoreItemRef>
Public Overridable Function SetItemAsync (key As String, value As IDictionary(Of String, BinaryData), Optional tags As IReadOnlyDictionary(Of String, String) = Nothing, Optional ifMatch As ETag = Nothing, Optional requireExists As Boolean = false, Optional cancellationToken As CancellationToken = Nothing) As Task(Of StateStoreItemRef)
Parameters
- key
- String
The item key.
- value
- IDictionary<String,BinaryData>
The item value as a JSON object.
- tags
- IReadOnlyDictionary<String,String>
Optional item metadata tags.
- ifMatch
- ETag
Optional optimistic-concurrency token. Mutually exclusive with requireExists.
- requireExists
- Boolean
When true, requires the item to already exist (sends If-Match: *). Mutually exclusive with ifMatch.
- cancellationToken
- CancellationToken
A cancellation token.
Returns
A reference to the written item.
Applies to
SetItemAsync(String, IDictionary<String,BinaryData>, IReadOnlyDictionary<String,String>, ETag, Boolean, String, CancellationToken)
- Source:
- FoundryStateStore.cs
Creates or replaces one item by key.
public virtual System.Threading.Tasks.Task<Azure.AI.AgentServer.Core.Storage.StateStoreItemRef> SetItemAsync(string key, System.Collections.Generic.IDictionary<string,BinaryData> value, System.Collections.Generic.IReadOnlyDictionary<string,string>? tags, Azure.ETag ifMatch, bool requireExists, string? callId, System.Threading.CancellationToken cancellationToken = default);
abstract member SetItemAsync : string * System.Collections.Generic.IDictionary<string, BinaryData> * System.Collections.Generic.IReadOnlyDictionary<string, string> * Azure.ETag * bool * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.AI.AgentServer.Core.Storage.StateStoreItemRef>
override this.SetItemAsync : string * System.Collections.Generic.IDictionary<string, BinaryData> * System.Collections.Generic.IReadOnlyDictionary<string, string> * Azure.ETag * bool * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.AI.AgentServer.Core.Storage.StateStoreItemRef>
Public Overridable Function SetItemAsync (key As String, value As IDictionary(Of String, BinaryData), tags As IReadOnlyDictionary(Of String, String), ifMatch As ETag, requireExists As Boolean, callId As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of StateStoreItemRef)
Parameters
- key
- String
The item key.
- value
- IDictionary<String,BinaryData>
The item value as a JSON object.
- tags
- IReadOnlyDictionary<String,String>
Optional item metadata tags.
- ifMatch
- ETag
Optional optimistic-concurrency token. Mutually exclusive with requireExists.
- requireExists
- Boolean
When true, requires the item to already exist (sends If-Match: *). Mutually exclusive with ifMatch.
- callId
- String
The Foundry call ID to forward, or null to use the current request context.
- cancellationToken
- CancellationToken
A cancellation token.
Returns
A reference to the written item.