Table of Contents

Class GenericResourceCollection

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

A class representing collection of GenericResource and their operations over its parent.

public class GenericResourceCollection : ArmCollection
Inheritance
GenericResourceCollection
Inherited Members

Constructors

GenericResourceCollection()

Initializes a new instance of the GenericResourceCollection class for mocking.

protected GenericResourceCollection()

Methods

CreateOrUpdate(WaitUntil, ResourceIdentifier, GenericResourceData, CancellationToken)

Create a resource by ID.

public virtual ArmOperation<GenericResource> CreateOrUpdate(WaitUntil waitUntil, ResourceIdentifier resourceId, GenericResourceData data, CancellationToken cancellationToken = default)

Parameters

waitUntil WaitUntil

"F:Azure.WaitUntil.Completed" if the method should wait to return until the long-running operation has completed on the service; "F: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.

resourceId ResourceIdentifier

The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.

data GenericResourceData

Create or update resource parameters.

cancellationToken CancellationToken

The cancellation token to use.

Returns

ArmOperation<GenericResource>

Exceptions

ArgumentNullException

resourceId or data is null.

CreateOrUpdateAsync(WaitUntil, ResourceIdentifier, GenericResourceData, CancellationToken)

Create a resource by ID.

public virtual Task<ArmOperation<GenericResource>> CreateOrUpdateAsync(WaitUntil waitUntil, ResourceIdentifier resourceId, GenericResourceData data, CancellationToken cancellationToken = default)

Parameters

waitUntil WaitUntil

"F:Azure.WaitUntil.Completed" if the method should wait to return until the long-running operation has completed on the service; "F: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.

resourceId ResourceIdentifier

The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.

data GenericResourceData

Create or update resource parameters.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<ArmOperation<GenericResource>>

Exceptions

ArgumentNullException

resourceId, or data is null.

Exists(ResourceIdentifier, CancellationToken)

Tries to get details for this resource from the service.

public virtual Response<bool> Exists(ResourceIdentifier resourceId, CancellationToken cancellationToken = default)

Parameters

resourceId ResourceIdentifier

The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<bool>

Exceptions

ArgumentNullException

resourceId is null.

ExistsAsync(ResourceIdentifier, CancellationToken)

Tries to get details for this resource from the service.

public virtual Task<Response<bool>> ExistsAsync(ResourceIdentifier resourceId, CancellationToken cancellationToken = default)

Parameters

resourceId ResourceIdentifier

The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<bool>>

Exceptions

ArgumentNullException

resourceId is null.

Get(ResourceIdentifier, CancellationToken)

Gets a resource by ID.

public virtual Response<GenericResource> Get(ResourceIdentifier resourceId, CancellationToken cancellationToken = default)

Parameters

resourceId ResourceIdentifier

The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<GenericResource>

Exceptions

ArgumentNullException

resourceId is null.

GetAsync(ResourceIdentifier, CancellationToken)

Gets a resource by ID.

public virtual Task<Response<GenericResource>> GetAsync(ResourceIdentifier resourceId, CancellationToken cancellationToken = default)

Parameters

resourceId ResourceIdentifier

The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<GenericResource>>

Exceptions

ArgumentNullException

resourceId is null.