Share via


ApiManagementServiceResource.CreateOrUpdateContentTypeAsync Method

Definition

Creates or updates the developer portal's content type. Content types describe content items' properties, validation rules, and constraints. Custom content types' identifiers need to start with the c- prefix. Built-in content types can't be modified.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}
  • Operation Id: ContentType_CreateOrUpdate
  • Default Api Version: 2023-03-01-preview
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.ApiManagement.Models.ApiManagementContentType>> CreateOrUpdateContentTypeAsync (string contentTypeId, Azure.ETag? ifMatch = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdateContentTypeAsync : string * Nullable<Azure.ETag> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.ApiManagement.Models.ApiManagementContentType>>
override this.CreateOrUpdateContentTypeAsync : string * Nullable<Azure.ETag> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.ApiManagement.Models.ApiManagementContentType>>
Public Overridable Function CreateOrUpdateContentTypeAsync (contentTypeId As String, Optional ifMatch As Nullable(Of ETag) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of ApiManagementContentType))

Parameters

contentTypeId
String

Content type identifier.

ifMatch
Nullable<ETag>

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

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

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

contentTypeId is null.

Applies to