Table of Contents

Class ManagementLockResource

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

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

public class ManagementLockResource : ArmResource, IJsonModel<ManagementLockData>, IPersistableModel<ManagementLockData>
Inheritance
ManagementLockResource
Implements
IJsonModel<ManagementLockData>
IPersistableModel<ManagementLockData>
Inherited Members

Constructors

ManagementLockResource()

Initializes a new instance of the ManagementLockResource class for mocking.

protected ManagementLockResource()

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 ManagementLockData Data { get; }

Property Value

ManagementLockData

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

CreateResourceIdentifier(string, string)

Generate the resource identifier of a ManagementLockResource instance.

public static ResourceIdentifier CreateResourceIdentifier(string scope, string lockName)

Parameters

scope string

The scope.

lockName string

The lockName.

Returns

ResourceIdentifier

Delete(WaitUntil, CancellationToken)

Delete a management lock by scope.

  • Request Path/{scope}/providers/Microsoft.Authorization/locks/{lockName}
  • Operation IdManagementLocks_DeleteByScope
  • Default Api Version2020-05-01
  • ResourceManagementLockResource
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)

Delete a management lock by scope.

  • Request Path/{scope}/providers/Microsoft.Authorization/locks/{lockName}
  • Operation IdManagementLocks_DeleteByScope
  • Default Api Version2020-05-01
  • ResourceManagementLockResource
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)

Get a management lock by scope.

  • Request Path/{scope}/providers/Microsoft.Authorization/locks/{lockName}
  • Operation IdManagementLocks_GetByScope
  • Default Api Version2020-05-01
  • ResourceManagementLockResource
public virtual Response<ManagementLockResource> Get(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<ManagementLockResource>

GetAsync(CancellationToken)

Get a management lock by scope.

  • Request Path/{scope}/providers/Microsoft.Authorization/locks/{lockName}
  • Operation IdManagementLocks_GetByScope
  • Default Api Version2020-05-01
  • ResourceManagementLockResource
public virtual Task<Response<ManagementLockResource>> GetAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<ManagementLockResource>>

Update(WaitUntil, ManagementLockData, CancellationToken)

Create or update a management lock by scope.

  • Request Path/{scope}/providers/Microsoft.Authorization/locks/{lockName}
  • Operation IdManagementLocks_CreateOrUpdateByScope
  • Default Api Version2020-05-01
  • ResourceManagementLockResource
public virtual ArmOperation<ManagementLockResource> Update(WaitUntil waitUntil, ManagementLockData 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 ManagementLockData

Create or update management lock parameters.

cancellationToken CancellationToken

The cancellation token to use.

Returns

ArmOperation<ManagementLockResource>

Exceptions

ArgumentNullException

data is null.

UpdateAsync(WaitUntil, ManagementLockData, CancellationToken)

Create or update a management lock by scope.

  • Request Path/{scope}/providers/Microsoft.Authorization/locks/{lockName}
  • Operation IdManagementLocks_CreateOrUpdateByScope
  • Default Api Version2020-05-01
  • ResourceManagementLockResource
public virtual Task<ArmOperation<ManagementLockResource>> UpdateAsync(WaitUntil waitUntil, ManagementLockData 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 ManagementLockData

Create or update management lock parameters.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<ArmOperation<ManagementLockResource>>

Exceptions

ArgumentNullException

data is null.