Table of Contents

Class ManagementGroupPolicySetDefinitionCollection

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

A class representing a collection of ManagementGroupPolicySetDefinitionResource and their operations. Each ManagementGroupPolicySetDefinitionResource in the collection will belong to the same instance of ManagementGroupResource. To get a ManagementGroupPolicySetDefinitionCollection instance call the GetManagementGroupPolicySetDefinitions method from an instance of ManagementGroupResource.

public class ManagementGroupPolicySetDefinitionCollection : ArmCollection, IEnumerable<ManagementGroupPolicySetDefinitionResource>, IEnumerable, IAsyncEnumerable<ManagementGroupPolicySetDefinitionResource>
Inheritance
ManagementGroupPolicySetDefinitionCollection
Implements
Inherited Members

Constructors

ManagementGroupPolicySetDefinitionCollection()

Initializes a new instance of the ManagementGroupPolicySetDefinitionCollection class for mocking.

protected ManagementGroupPolicySetDefinitionCollection()

Methods

CreateOrUpdate(WaitUntil, string, PolicySetDefinitionData, CancellationToken)

This operation creates or updates a policy set definition in the given management group with the given name.

  • Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}
  • Operation IdPolicySetDefinitions_CreateOrUpdateAtManagementGroup
  • Default Api Version2021-06-01
  • ResourceManagementGroupPolicySetDefinitionResource
public virtual ArmOperation<ManagementGroupPolicySetDefinitionResource> CreateOrUpdate(WaitUntil waitUntil, string policySetDefinitionName, PolicySetDefinitionData 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.

policySetDefinitionName string

The name of the policy set definition to create.

data PolicySetDefinitionData

The policy set definition properties.

cancellationToken CancellationToken

The cancellation token to use.

Returns

ArmOperation<ManagementGroupPolicySetDefinitionResource>

Exceptions

ArgumentException

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

ArgumentNullException

policySetDefinitionName or data is null.

CreateOrUpdateAsync(WaitUntil, string, PolicySetDefinitionData, CancellationToken)

This operation creates or updates a policy set definition in the given management group with the given name.

  • Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}
  • Operation IdPolicySetDefinitions_CreateOrUpdateAtManagementGroup
  • Default Api Version2021-06-01
  • ResourceManagementGroupPolicySetDefinitionResource
public virtual Task<ArmOperation<ManagementGroupPolicySetDefinitionResource>> CreateOrUpdateAsync(WaitUntil waitUntil, string policySetDefinitionName, PolicySetDefinitionData 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.

policySetDefinitionName string

The name of the policy set definition to create.

data PolicySetDefinitionData

The policy set definition properties.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<ArmOperation<ManagementGroupPolicySetDefinitionResource>>

Exceptions

ArgumentException

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

ArgumentNullException

policySetDefinitionName or data is null.

Exists(string, CancellationToken)

Checks to see if the resource exists in azure.

  • Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}
  • Operation IdPolicySetDefinitions_GetAtManagementGroup
  • Default Api Version2021-06-01
  • ResourceManagementGroupPolicySetDefinitionResource
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.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}
  • Operation IdPolicySetDefinitions_GetAtManagementGroup
  • Default Api Version2021-06-01
  • ResourceManagementGroupPolicySetDefinitionResource
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 policy set definition in the given management group with the given name.

  • Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}
  • Operation IdPolicySetDefinitions_GetAtManagementGroup
  • Default Api Version2021-06-01
  • ResourceManagementGroupPolicySetDefinitionResource
public virtual Response<ManagementGroupPolicySetDefinitionResource> 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<ManagementGroupPolicySetDefinitionResource>

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 policy set definitions in a given management group that match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with the management group, including those that apply directly or from management groups that contain the given management group. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given management group. 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 and Custom. If $filter='category -eq {value}' is provided, the returned list only includes all policy set definitions whose category match the {value}.

  • Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions
  • Operation IdPolicySetDefinitions_ListByManagementGroup
  • Default Api Version2021-06-01
  • ResourceManagementGroupPolicySetDefinitionResource
public virtual Pageable<ManagementGroupPolicySetDefinitionResource> 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<ManagementGroupPolicySetDefinitionResource>

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

GetAllAsync(string, int?, CancellationToken)

This operation retrieves a list of all the policy set definitions in a given management group that match the optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with the management group, including those that apply directly or from management groups that contain the given management group. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given management group. 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 and Custom. If $filter='category -eq {value}' is provided, the returned list only includes all policy set definitions whose category match the {value}.

  • Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions
  • Operation IdPolicySetDefinitions_ListByManagementGroup
  • Default Api Version2021-06-01
  • ResourceManagementGroupPolicySetDefinitionResource
public virtual AsyncPageable<ManagementGroupPolicySetDefinitionResource> 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<ManagementGroupPolicySetDefinitionResource>

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

GetAsync(string, CancellationToken)

This operation retrieves the policy set definition in the given management group with the given name.

  • Request Path/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}
  • Operation IdPolicySetDefinitions_GetAtManagementGroup
  • Default Api Version2021-06-01
  • ResourceManagementGroupPolicySetDefinitionResource
public virtual Task<Response<ManagementGroupPolicySetDefinitionResource>> 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<ManagementGroupPolicySetDefinitionResource>>

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.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}
  • Operation IdPolicySetDefinitions_GetAtManagementGroup
  • Default Api Version2021-06-01
  • ResourceManagementGroupPolicySetDefinitionResource
public virtual NullableResponse<ManagementGroupPolicySetDefinitionResource> 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<ManagementGroupPolicySetDefinitionResource>

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.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}
  • Operation IdPolicySetDefinitions_GetAtManagementGroup
  • Default Api Version2021-06-01
  • ResourceManagementGroupPolicySetDefinitionResource
public virtual Task<NullableResponse<ManagementGroupPolicySetDefinitionResource>> 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<ManagementGroupPolicySetDefinitionResource>>

Exceptions

ArgumentException

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

ArgumentNullException

policySetDefinitionName is null.