Share via


ServiceWorkspaceSubscriptionCollection.CreateOrUpdateAsync Method

Definition

Creates or updates the subscription of specified user to the specified product.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/subscriptions/{sid}
  • Operation Id: WorkspaceSubscription_CreateOrUpdate
  • Default Api Version: 2023-03-01-preview
  • Resource: ServiceWorkspaceSubscriptionResource
public virtual System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.ApiManagement.ServiceWorkspaceSubscriptionResource>> CreateOrUpdateAsync (Azure.WaitUntil waitUntil, string sid, Azure.ResourceManager.ApiManagement.Models.ApiManagementSubscriptionCreateOrUpdateContent content, bool? notify = default, Azure.ETag? ifMatch = default, Azure.ResourceManager.ApiManagement.Models.AppType? appType = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.ApiManagement.Models.ApiManagementSubscriptionCreateOrUpdateContent * Nullable<bool> * Nullable<Azure.ETag> * Nullable<Azure.ResourceManager.ApiManagement.Models.AppType> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.ApiManagement.ServiceWorkspaceSubscriptionResource>>
override this.CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.ApiManagement.Models.ApiManagementSubscriptionCreateOrUpdateContent * Nullable<bool> * Nullable<Azure.ETag> * Nullable<Azure.ResourceManager.ApiManagement.Models.AppType> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.ApiManagement.ServiceWorkspaceSubscriptionResource>>
Public Overridable Function CreateOrUpdateAsync (waitUntil As WaitUntil, sid As String, content As ApiManagementSubscriptionCreateOrUpdateContent, Optional notify As Nullable(Of Boolean) = Nothing, Optional ifMatch As Nullable(Of ETag) = Nothing, Optional appType As Nullable(Of AppType) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ArmOperation(Of ServiceWorkspaceSubscriptionResource))

Parameters

waitUntil
WaitUntil

Completed if the method should wait to return until the long-running operation has completed on the service; Started if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.

sid
String

Subscription entity Identifier. The entity represents the association between a user and a product in API Management.

notify
Nullable<Boolean>

Notify change in Subscription State.

  • If false, do not send any email notification for change of state of subscription
  • If true, send email notification of change of state of subscription
ifMatch
Nullable<ETag>

ETag of the Entity. Not required when creating an entity, but required when updating an entity.

appType
Nullable<AppType>

Determines the type of application which send the create user request. Default is legacy publisher portal.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

sid is an empty string, and was expected to be non-empty.

sid or content is null.

Applies to