Table of Contents

Class TenantPolicySetDefinitionCollection

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

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

public class TenantPolicySetDefinitionCollection : ArmCollection, IEnumerable<TenantPolicySetDefinitionResource>, IEnumerable, IAsyncEnumerable<TenantPolicySetDefinitionResource>
Inheritance
TenantPolicySetDefinitionCollection
Implements
Inherited Members

Constructors

TenantPolicySetDefinitionCollection()

Initializes a new instance of the TenantPolicySetDefinitionCollection class for mocking.

protected TenantPolicySetDefinitionCollection()

Methods

Exists(string, CancellationToken)

Checks to see if the resource exists in azure.

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

Parameters

policySetDefinitionName string

The name of the policy set definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<bool>

Exceptions

ArgumentException

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

ArgumentNullException

policySetDefinitionName is null.

ExistsAsync(string, CancellationToken)

Checks to see if the resource exists in azure.

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

Parameters

policySetDefinitionName string

The name of the policy set definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<bool>>

Exceptions

ArgumentException

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

ArgumentNullException

policySetDefinitionName is null.

Get(string, CancellationToken)

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

  • Request Path/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}
  • Operation IdPolicySetDefinitions_GetBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicySetDefinitionResource
public virtual Response<TenantPolicySetDefinitionResource> Get(string policySetDefinitionName, CancellationToken cancellationToken = default)

Parameters

policySetDefinitionName string

The name of the policy set definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<TenantPolicySetDefinitionResource>

Exceptions

ArgumentException

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

ArgumentNullException

policySetDefinitionName is null.

GetAll(string, int?, CancellationToken)

This operation retrieves a list of all the built-in policy set definitions that match the optional given $filter. If $filter='category -eq {value}' is provided, the returned list only includes all built-in policy set definitions whose category match the {value}.

  • Request Path/providers/Microsoft.Authorization/policySetDefinitions
  • Operation IdPolicySetDefinitions_ListBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicySetDefinitionResource
public virtual Pageable<TenantPolicySetDefinitionResource> 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 set definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy set 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 set 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<TenantPolicySetDefinitionResource>

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

GetAllAsync(string, int?, CancellationToken)

This operation retrieves a list of all the built-in policy set definitions that match the optional given $filter. If $filter='category -eq {value}' is provided, the returned list only includes all built-in policy set definitions whose category match the {value}.

  • Request Path/providers/Microsoft.Authorization/policySetDefinitions
  • Operation IdPolicySetDefinitions_ListBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicySetDefinitionResource
public virtual AsyncPageable<TenantPolicySetDefinitionResource> 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 set definitions that at the given scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy set 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 set 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<TenantPolicySetDefinitionResource>

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

GetAsync(string, CancellationToken)

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

  • Request Path/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}
  • Operation IdPolicySetDefinitions_GetBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicySetDefinitionResource
public virtual Task<Response<TenantPolicySetDefinitionResource>> GetAsync(string policySetDefinitionName, CancellationToken cancellationToken = default)

Parameters

policySetDefinitionName string

The name of the policy set definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<TenantPolicySetDefinitionResource>>

Exceptions

ArgumentException

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

ArgumentNullException

policySetDefinitionName is null.

GetIfExists(string, CancellationToken)

Tries to get details for this resource from the service.

  • Request Path/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}
  • Operation IdPolicySetDefinitions_GetBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicySetDefinitionResource
public virtual NullableResponse<TenantPolicySetDefinitionResource> GetIfExists(string policySetDefinitionName, CancellationToken cancellationToken = default)

Parameters

policySetDefinitionName string

The name of the policy set definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

NullableResponse<TenantPolicySetDefinitionResource>

Exceptions

ArgumentException

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

ArgumentNullException

policySetDefinitionName is null.

GetIfExistsAsync(string, CancellationToken)

Tries to get details for this resource from the service.

  • Request Path/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}
  • Operation IdPolicySetDefinitions_GetBuiltIn
  • Default Api Version2021-06-01
  • ResourceTenantPolicySetDefinitionResource
public virtual Task<NullableResponse<TenantPolicySetDefinitionResource>> GetIfExistsAsync(string policySetDefinitionName, CancellationToken cancellationToken = default)

Parameters

policySetDefinitionName string

The name of the policy set definition to get.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<NullableResponse<TenantPolicySetDefinitionResource>>

Exceptions

ArgumentException

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

ArgumentNullException

policySetDefinitionName is null.