Skip to content

Interfaces and Operations

TypeSpec.Rest.Resource

ExtensionResourceCollectionOperations

Extension resource operation templates for extension resource collections.

interface TypeSpec.Rest.Resource.ExtensionResourceCollectionOperations<Extension, Resource, Error>

Template Parameters

NameDescription
ExtensionThe extension resource model.
ResourceThe resource model.
ErrorThe error response.

ExtensionResourceCollectionOperations.create

Creates a new instance of the extension resource.

op TypeSpec.Rest.Resource.ExtensionResourceCollectionOperations.create(resource: TypeSpec.Rest.Resource.ResourceCreateModel<Resource>): Extension | TypeSpec.Rest.Resource.ResourceCreatedResponse<Resource> | Error

ExtensionResourceCollectionOperations.list

Lists all instances of the extension resource.

op TypeSpec.Rest.Resource.ExtensionResourceCollectionOperations.list(): TypeSpec.Rest.Resource.CollectionWithNextLink<Resource> | Error

ExtensionResourceCreate

Extension resource create operation template.

interface TypeSpec.Rest.Resource.ExtensionResourceCreate<Extension, Resource, Error>

Template Parameters

NameDescription
ExtensionThe extension resource model.
ResourceThe resource model.
ErrorThe error response.

ExtensionResourceCreate.create

Creates a new instance of the extension resource.

op TypeSpec.Rest.Resource.ExtensionResourceCreate.create(resource: TypeSpec.Rest.Resource.ResourceCreateModel<Resource>): Extension | TypeSpec.Rest.Resource.ResourceCreatedResponse<Resource> | Error

ExtensionResourceCreateOrUpdate

Extension resource create or update operation template.

interface TypeSpec.Rest.Resource.ExtensionResourceCreateOrUpdate<Extension, Resource, Error>

Template Parameters

NameDescription
ExtensionThe extension resource model.
ResourceThe resource model.
ErrorThe error response.

ExtensionResourceCreateOrUpdate.createOrUpdate

Creates or update an instance of the extension resource.

op TypeSpec.Rest.Resource.ExtensionResourceCreateOrUpdate.createOrUpdate(resource: TypeSpec.Rest.Resource.ResourceCreateOrUpdateModel<Resource>): Extension | TypeSpec.Rest.Resource.ResourceCreatedResponse<Resource> | Error

ExtensionResourceDelete

Extension resource delete operation template.

interface TypeSpec.Rest.Resource.ExtensionResourceDelete<Extension, Resource, Error>

Template Parameters

NameDescription
ExtensionThe extension resource model.
ResourceThe resource model.
ErrorThe error response.

ExtensionResourceDelete.delete

Deletes an existing instance of the extension resource.

op TypeSpec.Rest.Resource.ExtensionResourceDelete.delete(): TypeSpec.Rest.Resource.ResourceDeletedResponse | Error

ExtensionResourceInstanceOperations

Extension resource operation templates for extension resource instances.

interface TypeSpec.Rest.Resource.ExtensionResourceInstanceOperations<Extension, Resource, Error>

Template Parameters

NameDescription
ExtensionThe extension resource model.
ResourceThe resource model.
ErrorThe error response.

ExtensionResourceInstanceOperations.get

Gets an instance of the extension resource.

op TypeSpec.Rest.Resource.ExtensionResourceInstanceOperations.get(): Extension | Error

ExtensionResourceInstanceOperations.update

Updates an existing instance of the extension resource.

op TypeSpec.Rest.Resource.ExtensionResourceInstanceOperations.update(properties: TypeSpec.Rest.Resource.ResourceCreateOrUpdateModel<Resource>): Extension | Error

ExtensionResourceInstanceOperations.delete

Deletes an existing instance of the extension resource.

op TypeSpec.Rest.Resource.ExtensionResourceInstanceOperations.delete(): TypeSpec.Rest.Resource.ResourceDeletedResponse | Error

ExtensionResourceList

Extension resource list operation template.

interface TypeSpec.Rest.Resource.ExtensionResourceList<Extension, Resource, Error>

Template Parameters

NameDescription
ExtensionThe extension resource model.
ResourceThe resource model.
ErrorThe error response.

ExtensionResourceList.list

Lists all instances of the extension resource.

op TypeSpec.Rest.Resource.ExtensionResourceList.list(): TypeSpec.Rest.Resource.CollectionWithNextLink<Resource> | Error

ExtensionResourceOperations

Extension resource operation templates for extension resource instances and collections.

interface TypeSpec.Rest.Resource.ExtensionResourceOperations<Extension, Resource, Error>

Template Parameters

NameDescription
ExtensionThe extension resource model.
ResourceThe resource model.
ErrorThe error response.

ExtensionResourceOperations.get

Gets an instance of the extension resource.

op TypeSpec.Rest.Resource.ExtensionResourceOperations.get(): Extension | Error

ExtensionResourceOperations.update

Updates an existing instance of the extension resource.

op TypeSpec.Rest.Resource.ExtensionResourceOperations.update(properties: TypeSpec.Rest.Resource.ResourceCreateOrUpdateModel<Resource>): Extension | Error

ExtensionResourceOperations.delete

Deletes an existing instance of the extension resource.

op TypeSpec.Rest.Resource.ExtensionResourceOperations.delete(): TypeSpec.Rest.Resource.ResourceDeletedResponse | Error

ExtensionResourceOperations.create

Creates a new instance of the extension resource.

op TypeSpec.Rest.Resource.ExtensionResourceOperations.create(resource: TypeSpec.Rest.Resource.ResourceCreateModel<Resource>): Extension | TypeSpec.Rest.Resource.ResourceCreatedResponse<Resource> | Error

ExtensionResourceOperations.list

Lists all instances of the extension resource.

op TypeSpec.Rest.Resource.ExtensionResourceOperations.list(): TypeSpec.Rest.Resource.CollectionWithNextLink<Resource> | Error

ExtensionResourceRead

Extension resource read operation template.

interface TypeSpec.Rest.Resource.ExtensionResourceRead<Extension, Resource, Error>

Template Parameters

NameDescription
ExtensionThe extension resource model.
ResourceThe resource model.
ErrorThe error response.

ExtensionResourceRead.get

Gets an instance of the extension resource.

op TypeSpec.Rest.Resource.ExtensionResourceRead.get(): Extension | Error

ExtensionResourceUpdate

Extension resource update operation template.

interface TypeSpec.Rest.Resource.ExtensionResourceUpdate<Extension, Resource, Error>

Template Parameters

NameDescription
ExtensionThe extension resource model.
ResourceThe resource model.
ErrorThe error response.

ExtensionResourceUpdate.update

Updates an existing instance of the extension resource.

op TypeSpec.Rest.Resource.ExtensionResourceUpdate.update(properties: TypeSpec.Rest.Resource.ResourceCreateOrUpdateModel<Resource>): Extension | Error

ResourceCollectionOperations

Resource operation templates for resource collections.

interface TypeSpec.Rest.Resource.ResourceCollectionOperations<Resource, Error>

Template Parameters

NameDescription
ResourceThe resource model.
ErrorThe error response.

ResourceCollectionOperations.create

Creates a new instance of the resource.

op TypeSpec.Rest.Resource.ResourceCollectionOperations.create(resource: TypeSpec.Rest.Resource.ResourceCreateModel<Resource>): Resource | TypeSpec.Rest.Resource.ResourceCreatedResponse<Resource> | Error

ResourceCollectionOperations.list

Lists all instances of the resource.

op TypeSpec.Rest.Resource.ResourceCollectionOperations.list(): TypeSpec.Rest.Resource.CollectionWithNextLink<Resource> | Error

ResourceCreate

Resource create operation template.

interface TypeSpec.Rest.Resource.ResourceCreate<Resource, Error>

Template Parameters

NameDescription
ResourceThe resource model to create.
ErrorThe error response.

ResourceCreate.create

Creates a new instance of the resource.

op TypeSpec.Rest.Resource.ResourceCreate.create(resource: TypeSpec.Rest.Resource.ResourceCreateModel<Resource>): Resource | TypeSpec.Rest.Resource.ResourceCreatedResponse<Resource> | Error

ResourceCreateOrReplace

Resource create or replace operation template.

interface TypeSpec.Rest.Resource.ResourceCreateOrReplace<Resource, Error>

Template Parameters

NameDescription
ResourceThe resource model to create or replace.
ErrorThe error response.

ResourceCreateOrReplace.createOrReplace

Creates or replaces a instance of the resource.

op TypeSpec.Rest.Resource.ResourceCreateOrReplace.createOrReplace(resource: TypeSpec.Rest.Resource.ResourceCreateModel<Resource>): Resource | TypeSpec.Rest.Resource.ResourceCreatedResponse<Resource> | Error

ResourceCreateOrUpdate

Resource create or update operation template.

interface TypeSpec.Rest.Resource.ResourceCreateOrUpdate<Resource, Error>

Template Parameters

NameDescription
ResourceThe resource model to create or update.
ErrorThe error response.

ResourceCreateOrUpdate.createOrUpdate

Creates or update an instance of the resource.

op TypeSpec.Rest.Resource.ResourceCreateOrUpdate.createOrUpdate(resource: TypeSpec.Rest.Resource.ResourceCreateOrUpdateModel<Resource>): Resource | TypeSpec.Rest.Resource.ResourceCreatedResponse<Resource> | Error

ResourceDelete

Resource delete operation template.

interface TypeSpec.Rest.Resource.ResourceDelete<Resource, Error>

Template Parameters

NameDescription
ResourceThe resource model to delete.
ErrorThe error response.

ResourceDelete.delete

Deletes an existing instance of the resource.

op TypeSpec.Rest.Resource.ResourceDelete.delete(): TypeSpec.Rest.Resource.ResourceDeletedResponse | Error

ResourceInstanceOperations

Resource operation templates for resource instances.

interface TypeSpec.Rest.Resource.ResourceInstanceOperations<Resource, Error>

Template Parameters

NameDescription
ResourceThe resource model.
ErrorThe error response.

ResourceInstanceOperations.get

Gets an instance of the resource.

op TypeSpec.Rest.Resource.ResourceInstanceOperations.get(): Resource | Error

ResourceInstanceOperations.update

Updates an existing instance of the resource.

op TypeSpec.Rest.Resource.ResourceInstanceOperations.update(properties: TypeSpec.Rest.Resource.ResourceCreateOrUpdateModel<Resource>): Resource | Error

ResourceInstanceOperations.delete

Deletes an existing instance of the resource.

op TypeSpec.Rest.Resource.ResourceInstanceOperations.delete(): TypeSpec.Rest.Resource.ResourceDeletedResponse | Error

ResourceList

Resource list operation template.

interface TypeSpec.Rest.Resource.ResourceList<Resource, Error>

Template Parameters

NameDescription
ResourceThe resource model to list.
ErrorThe error response.

ResourceList.list

Lists all instances of the resource.

op TypeSpec.Rest.Resource.ResourceList.list(): TypeSpec.Rest.Resource.CollectionWithNextLink<Resource> | Error

ResourceOperations

Resource operation templates for resources.

interface TypeSpec.Rest.Resource.ResourceOperations<Resource, Error>

Template Parameters

NameDescription
ResourceThe resource model.
ErrorThe error response.

ResourceOperations.get

Gets an instance of the resource.

op TypeSpec.Rest.Resource.ResourceOperations.get(): Resource | Error

ResourceOperations.update

Updates an existing instance of the resource.

op TypeSpec.Rest.Resource.ResourceOperations.update(properties: TypeSpec.Rest.Resource.ResourceCreateOrUpdateModel<Resource>): Resource | Error

ResourceOperations.delete

Deletes an existing instance of the resource.

op TypeSpec.Rest.Resource.ResourceOperations.delete(): TypeSpec.Rest.Resource.ResourceDeletedResponse | Error

ResourceOperations.create

Creates a new instance of the resource.

op TypeSpec.Rest.Resource.ResourceOperations.create(resource: TypeSpec.Rest.Resource.ResourceCreateModel<Resource>): Resource | TypeSpec.Rest.Resource.ResourceCreatedResponse<Resource> | Error

ResourceOperations.list

Lists all instances of the resource.

op TypeSpec.Rest.Resource.ResourceOperations.list(): TypeSpec.Rest.Resource.CollectionWithNextLink<Resource> | Error

ResourceRead

Represents the resource GET operation.

interface TypeSpec.Rest.Resource.ResourceRead<Resource, Error>

Template Parameters

NameDescription
ResourceThe resource model.
ErrorThe error response.

ResourceRead.get

Gets an instance of the resource.

op TypeSpec.Rest.Resource.ResourceRead.get(): Resource | Error

ResourceUpdate

Resource update operation template.

interface TypeSpec.Rest.Resource.ResourceUpdate<Resource, Error>

Template Parameters

NameDescription
ResourceThe resource model to update.
ErrorThe error response.

ResourceUpdate.update

Updates an existing instance of the resource.

op TypeSpec.Rest.Resource.ResourceUpdate.update(properties: TypeSpec.Rest.Resource.ResourceCreateOrUpdateModel<Resource>): Resource | Error

SingletonResourceOperations

Singleton resource operation templates for singleton resource instances.

interface TypeSpec.Rest.Resource.SingletonResourceOperations<Singleton, Resource, Error>

Template Parameters

NameDescription
SingletonThe singleton resource model.
ResourceThe resource model.
ErrorThe error response.

SingletonResourceOperations.get

Gets the singleton resource.

op TypeSpec.Rest.Resource.SingletonResourceOperations.get(): Singleton | Error

SingletonResourceOperations.update

Updates the singleton resource.

op TypeSpec.Rest.Resource.SingletonResourceOperations.update(properties: TypeSpec.Rest.Resource.ResourceCreateOrUpdateModel<Resource>): Singleton | Error

SingletonResourceRead

Singleton resource read operation template.

interface TypeSpec.Rest.Resource.SingletonResourceRead<Singleton, Resource, Error>

Template Parameters

NameDescription
SingletonThe singleton resource model.
ResourceThe resource model.
ErrorThe error response.

SingletonResourceRead.get

Gets the singleton resource.

op TypeSpec.Rest.Resource.SingletonResourceRead.get(): Singleton | Error

SingletonResourceUpdate

Singleton resource update operation template.

interface TypeSpec.Rest.Resource.SingletonResourceUpdate<Singleton, Resource, Error>

Template Parameters

NameDescription
SingletonThe singleton resource model.
ResourceThe resource model.
ErrorThe error response.

SingletonResourceUpdate.update

Updates the singleton resource.

op TypeSpec.Rest.Resource.SingletonResourceUpdate.update(properties: TypeSpec.Rest.Resource.ResourceCreateOrUpdateModel<Resource>): Singleton | Error