Table of Contents

Class TagResource

Namespace
Azure.ResourceManager.Resources
Assembly
Azure.ResourceManager.dll

A Class representing a TagResource along with the instance operations that can be performed on it. If you have a Azure.Core.ResourceIdentifier you can construct a TagResource from an instance of ArmClient using the GetTagResource method. Otherwise you can get one from its parent resource ArmResource using the GetTagResource method.

public class TagResource : ArmResource, IJsonModel<TagResourceData>, IPersistableModel<TagResourceData>
Inheritance
TagResource
Implements
IJsonModel<TagResourceData>
IPersistableModel<TagResourceData>
Inherited Members

Constructors

TagResource()

Initializes a new instance of the TagResource class for mocking.

protected TagResource()

Fields

ResourceType

Gets the resource type for the operations.

public static readonly ResourceType ResourceType

Field Value

ResourceType

Properties

Data

Gets the data representing this Feature.

public virtual TagResourceData Data { get; }

Property Value

TagResourceData

Exceptions

InvalidOperationException

Throws if there is no data loaded in the current instance.

HasData

Gets whether or not the current instance has data.

public virtual bool HasData { get; }

Property Value

bool

Methods

CreateOrUpdate(WaitUntil, TagResourceData, CancellationToken)

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags.

  • Request Path/{scope}/providers/Microsoft.Resources/tags/default
  • Operation IdTags_CreateOrUpdateAtScope
  • Default Api Version2022-09-01
  • ResourceTagResource
public virtual ArmOperation<TagResource> CreateOrUpdate(WaitUntil waitUntil, TagResourceData data, CancellationToken cancellationToken = default)

Parameters

waitUntil WaitUntil

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

data TagResourceData

The TagResourceData to use.

cancellationToken CancellationToken

The cancellation token to use.

Returns

ArmOperation<TagResource>

Exceptions

ArgumentNullException

data is null.

CreateOrUpdateAsync(WaitUntil, TagResourceData, CancellationToken)

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags.

  • Request Path/{scope}/providers/Microsoft.Resources/tags/default
  • Operation IdTags_CreateOrUpdateAtScope
  • Default Api Version2022-09-01
  • ResourceTagResource
public virtual Task<ArmOperation<TagResource>> CreateOrUpdateAsync(WaitUntil waitUntil, TagResourceData data, CancellationToken cancellationToken = default)

Parameters

waitUntil WaitUntil

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

data TagResourceData

The TagResourceData to use.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<ArmOperation<TagResource>>

Exceptions

ArgumentNullException

data is null.

CreateResourceIdentifier(string)

Generate the resource identifier of a TagResource instance.

public static ResourceIdentifier CreateResourceIdentifier(string scope)

Parameters

scope string

The scope.

Returns

ResourceIdentifier

Delete(WaitUntil, CancellationToken)

Deletes the entire set of tags on a resource or subscription.

  • Request Path/{scope}/providers/Microsoft.Resources/tags/default
  • Operation IdTags_DeleteAtScope
  • Default Api Version2022-09-01
  • ResourceTagResource
public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default)

Parameters

waitUntil WaitUntil

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

cancellationToken CancellationToken

The cancellation token to use.

Returns

ArmOperation

DeleteAsync(WaitUntil, CancellationToken)

Deletes the entire set of tags on a resource or subscription.

  • Request Path/{scope}/providers/Microsoft.Resources/tags/default
  • Operation IdTags_DeleteAtScope
  • Default Api Version2022-09-01
  • ResourceTagResource
public virtual Task<ArmOperation> DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)

Parameters

waitUntil WaitUntil

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

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<ArmOperation>

Get(CancellationToken)

Gets the entire set of tags on a resource or subscription.

  • Request Path/{scope}/providers/Microsoft.Resources/tags/default
  • Operation IdTags_GetAtScope
  • Default Api Version2022-09-01
  • ResourceTagResource
public virtual Response<TagResource> Get(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<TagResource>

GetAsync(CancellationToken)

Gets the entire set of tags on a resource or subscription.

  • Request Path/{scope}/providers/Microsoft.Resources/tags/default
  • Operation IdTags_GetAtScope
  • Default Api Version2022-09-01
  • ResourceTagResource
public virtual Task<Response<TagResource>> GetAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<TagResource>>

Update(WaitUntil, TagResourcePatch, CancellationToken)

This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs.

  • Request Path/{scope}/providers/Microsoft.Resources/tags/default
  • Operation IdTags_UpdateAtScope
  • Default Api Version2022-09-01
  • ResourceTagResource
public virtual ArmOperation<TagResource> Update(WaitUntil waitUntil, TagResourcePatch patch, CancellationToken cancellationToken = default)

Parameters

waitUntil WaitUntil

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

patch TagResourcePatch

The TagResourcePatch to use.

cancellationToken CancellationToken

The cancellation token to use.

Returns

ArmOperation<TagResource>

Exceptions

ArgumentNullException

patch is null.

UpdateAsync(WaitUntil, TagResourcePatch, CancellationToken)

This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs.

  • Request Path/{scope}/providers/Microsoft.Resources/tags/default
  • Operation IdTags_UpdateAtScope
  • Default Api Version2022-09-01
  • ResourceTagResource
public virtual Task<ArmOperation<TagResource>> UpdateAsync(WaitUntil waitUntil, TagResourcePatch patch, CancellationToken cancellationToken = default)

Parameters

waitUntil WaitUntil

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

patch TagResourcePatch

The TagResourcePatch to use.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<ArmOperation<TagResource>>

Exceptions

ArgumentNullException

patch is null.