Table of Contents

Class TenantPolicyDefinitionCollection

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

A class representing a collection of TenantPolicyDefinitionResource and their operations. Each TenantPolicyDefinitionResource in the collection will belong to the same instance of TenantResource. To get a TenantPolicyDefinitionCollection instance call the GetTenantPolicyDefinitions method from an instance of TenantResource.

public class TenantPolicyDefinitionCollection : ArmCollection, IEnumerable<TenantPolicyDefinitionResource>, IEnumerable, IAsyncEnumerable<TenantPolicyDefinitionResource>
Inheritance
TenantPolicyDefinitionCollection
Implements
Inherited Members

Constructors

TenantPolicyDefinitionCollection()

Initializes a new instance of the TenantPolicyDefinitionCollection class for mocking.

protected TenantPolicyDefinitionCollection()

Methods

Exists(string, CancellationToken)

Checks to see if the resource exists in azure.

  • Request Path/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
  • Operation IdPolicyDefinitions_GetBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicyDefinitionResource
public virtual Response<bool> Exists(string policyDefinitionName, CancellationToken cancellationToken = default)

Parameters

policyDefinitionName string

The name of the built-in policy definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<bool>

Exceptions

ArgumentException

policyDefinitionName is an empty string, and was expected to be non-empty.

ArgumentNullException

policyDefinitionName is null.

ExistsAsync(string, CancellationToken)

Checks to see if the resource exists in azure.

  • Request Path/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
  • Operation IdPolicyDefinitions_GetBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicyDefinitionResource
public virtual Task<Response<bool>> ExistsAsync(string policyDefinitionName, CancellationToken cancellationToken = default)

Parameters

policyDefinitionName string

The name of the built-in policy definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<bool>>

Exceptions

ArgumentException

policyDefinitionName is an empty string, and was expected to be non-empty.

ArgumentNullException

policyDefinitionName is null.

Get(string, CancellationToken)

This operation retrieves the built-in policy definition with the given name.

  • Request Path/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
  • Operation IdPolicyDefinitions_GetBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicyDefinitionResource
public virtual Response<TenantPolicyDefinitionResource> Get(string policyDefinitionName, CancellationToken cancellationToken = default)

Parameters

policyDefinitionName string

The name of the built-in policy definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<TenantPolicyDefinitionResource>

Exceptions

ArgumentException

policyDefinitionName is an empty string, and was expected to be non-empty.

ArgumentNullException

policyDefinitionName is null.

GetAll(string, int?, CancellationToken)

This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose category match the {value}.

  • Request Path/providers/Microsoft.Authorization/policyDefinitions
  • Operation IdPolicyDefinitions_ListBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicyDefinitionResource
public virtual Pageable<TenantPolicyDefinitionResource> GetAll(string filter = null, int? top = null, CancellationToken cancellationToken = default)

Parameters

filter string

The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category match the {value}.

top int?

Maximum number of records to return. When the $top filter is not provided, it will return 500 records.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Pageable<TenantPolicyDefinitionResource>

A collection of TenantPolicyDefinitionResource that may take multiple service requests to iterate over.

GetAllAsync(string, int?, CancellationToken)

This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose category match the {value}.

  • Request Path/providers/Microsoft.Authorization/policyDefinitions
  • Operation IdPolicyDefinitions_ListBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicyDefinitionResource
public virtual AsyncPageable<TenantPolicyDefinitionResource> GetAllAsync(string filter = null, int? top = null, CancellationToken cancellationToken = default)

Parameters

filter string

The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category match the {value}.

top int?

Maximum number of records to return. When the $top filter is not provided, it will return 500 records.

cancellationToken CancellationToken

The cancellation token to use.

Returns

AsyncPageable<TenantPolicyDefinitionResource>

An async collection of TenantPolicyDefinitionResource that may take multiple service requests to iterate over.

GetAsync(string, CancellationToken)

This operation retrieves the built-in policy definition with the given name.

  • Request Path/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
  • Operation IdPolicyDefinitions_GetBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicyDefinitionResource
public virtual Task<Response<TenantPolicyDefinitionResource>> GetAsync(string policyDefinitionName, CancellationToken cancellationToken = default)

Parameters

policyDefinitionName string

The name of the built-in policy definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<TenantPolicyDefinitionResource>>

Exceptions

ArgumentException

policyDefinitionName is an empty string, and was expected to be non-empty.

ArgumentNullException

policyDefinitionName is null.

GetIfExists(string, CancellationToken)

Tries to get details for this resource from the service.

  • Request Path/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
  • Operation IdPolicyDefinitions_GetBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicyDefinitionResource
public virtual NullableResponse<TenantPolicyDefinitionResource> GetIfExists(string policyDefinitionName, CancellationToken cancellationToken = default)

Parameters

policyDefinitionName string

The name of the built-in policy definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

NullableResponse<TenantPolicyDefinitionResource>

Exceptions

ArgumentException

policyDefinitionName is an empty string, and was expected to be non-empty.

ArgumentNullException

policyDefinitionName is null.

GetIfExistsAsync(string, CancellationToken)

Tries to get details for this resource from the service.

  • Request Path/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}
  • Operation IdPolicyDefinitions_GetBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicyDefinitionResource
public virtual Task<NullableResponse<TenantPolicyDefinitionResource>> GetIfExistsAsync(string policyDefinitionName, CancellationToken cancellationToken = default)

Parameters

policyDefinitionName string

The name of the built-in policy definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<NullableResponse<TenantPolicyDefinitionResource>>

Exceptions

ArgumentException

policyDefinitionName is an empty string, and was expected to be non-empty.

ArgumentNullException

policyDefinitionName is null.