WebPubSubChatServiceClient.CreateOrReplaceUserAsync 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 |
|---|---|
| CreateOrReplaceUserAsync(String, RequestContent, MatchConditions, RequestContext) |
[Protocol Method] Create or replace a user. The request body is a polymorphic
|
| CreateOrReplaceUserAsync(String, WebPubSubChatUser, MatchConditions, CancellationToken) |
Create or replace a user. The request body is a polymorphic |
CreateOrReplaceUserAsync(String, RequestContent, MatchConditions, RequestContext)
[Protocol Method] Create or replace a user. The request body is a polymorphic ChatUser (e.g. HumanChatUser) selected by the kind discriminator.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual System.Threading.Tasks.Task<Azure.Response> CreateOrReplaceUserAsync(string userId, Azure.Core.RequestContent content, Azure.MatchConditions matchConditions = default, Azure.RequestContext context = default);
abstract member CreateOrReplaceUserAsync : string * Azure.Core.RequestContent * Azure.MatchConditions * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.CreateOrReplaceUserAsync : string * Azure.Core.RequestContent * Azure.MatchConditions * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function CreateOrReplaceUserAsync (userId As String, content As RequestContent, Optional matchConditions As MatchConditions = Nothing, Optional context As RequestContext = Nothing) As Task(Of Response)
Parameters
- userId
- String
User identifier.
- content
- RequestContent
The content to send as the body of the request.
- matchConditions
- MatchConditions
The content to send as the request conditions of the request.
- context
- RequestContext
The request options, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
Exceptions
userId or content is null.
userId is an empty string, and was expected to be non-empty.
Service returned a non-success status code.
Applies to
CreateOrReplaceUserAsync(String, WebPubSubChatUser, MatchConditions, CancellationToken)
Create or replace a user. The request body is a polymorphic ChatUser (e.g. HumanChatUser) selected by the kind discriminator.
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Messaging.WebPubSub.Chat.WebPubSubChatUser>> CreateOrReplaceUserAsync(string userId, Azure.Messaging.WebPubSub.Chat.WebPubSubChatUser resource, Azure.MatchConditions matchConditions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrReplaceUserAsync : string * Azure.Messaging.WebPubSub.Chat.WebPubSubChatUser * Azure.MatchConditions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Messaging.WebPubSub.Chat.WebPubSubChatUser>>
override this.CreateOrReplaceUserAsync : string * Azure.Messaging.WebPubSub.Chat.WebPubSubChatUser * Azure.MatchConditions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Messaging.WebPubSub.Chat.WebPubSubChatUser>>
Public Overridable Function CreateOrReplaceUserAsync (userId As String, resource As WebPubSubChatUser, Optional matchConditions As MatchConditions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of WebPubSubChatUser))
Parameters
- userId
- String
User identifier.
- resource
- WebPubSubChatUser
The resource instance.
- matchConditions
- MatchConditions
The content to send as the request conditions of the request.
- cancellationToken
- CancellationToken
The cancellation token that can be used to cancel the operation.
Returns
Exceptions
userId or resource is null.
userId is an empty string, and was expected to be non-empty.
Service returned a non-success status code.