Share via


ApiManagementServiceResource.CreateOrUpdateContentType 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: 2021-08-01
public virtual Azure.Response<Azure.ResourceManager.ApiManagement.Models.ApiManagementContentType> CreateOrUpdateContentType (string contentTypeId, Azure.ETag? ifMatch = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdateContentType : string * Nullable<Azure.ETag> * System.Threading.CancellationToken -> Azure.Response<Azure.ResourceManager.ApiManagement.Models.ApiManagementContentType>
override this.CreateOrUpdateContentType : string * Nullable<Azure.ETag> * System.Threading.CancellationToken -> Azure.Response<Azure.ResourceManager.ApiManagement.Models.ApiManagementContentType>
Public Overridable Function CreateOrUpdateContentType (contentTypeId As String, Optional ifMatch As Nullable(Of ETag) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As 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