Table of Contents

Class ManagementGroupSubscriptionCollection

Namespace
Azure.ResourceManager.ManagementGroups
Assembly
Azure.ResourceManager.dll

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

public class ManagementGroupSubscriptionCollection : ArmCollection, IEnumerable<ManagementGroupSubscriptionResource>, IEnumerable, IAsyncEnumerable<ManagementGroupSubscriptionResource>
Inheritance
ManagementGroupSubscriptionCollection
Implements
Inherited Members

Constructors

ManagementGroupSubscriptionCollection()

Initializes a new instance of the ManagementGroupSubscriptionCollection class for mocking.

protected ManagementGroupSubscriptionCollection()

Methods

CreateOrUpdate(WaitUntil, string, string, CancellationToken)

Associates existing subscription with the management group.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}
  • Operation IdManagementGroupSubscriptions_Create
  • Default Api Version2021-04-01
  • ResourceManagementGroupSubscriptionResource
public virtual ArmOperation<ManagementGroupSubscriptionResource> CreateOrUpdate(WaitUntil waitUntil, string subscriptionId, string cacheControl = null, 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.

subscriptionId string

Subscription ID.

cacheControl string

Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.

cancellationToken CancellationToken

The cancellation token to use.

Returns

ArmOperation<ManagementGroupSubscriptionResource>

Exceptions

ArgumentException

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

ArgumentNullException

subscriptionId is null.

CreateOrUpdateAsync(WaitUntil, string, string, CancellationToken)

Associates existing subscription with the management group.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}
  • Operation IdManagementGroupSubscriptions_Create
  • Default Api Version2021-04-01
  • ResourceManagementGroupSubscriptionResource
public virtual Task<ArmOperation<ManagementGroupSubscriptionResource>> CreateOrUpdateAsync(WaitUntil waitUntil, string subscriptionId, string cacheControl = null, 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.

subscriptionId string

Subscription ID.

cacheControl string

Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<ArmOperation<ManagementGroupSubscriptionResource>>

Exceptions

ArgumentException

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

ArgumentNullException

subscriptionId is null.

Exists(string, string, CancellationToken)

Checks to see if the resource exists in azure.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}
  • Operation IdManagementGroupSubscriptions_GetSubscription
  • Default Api Version2021-04-01
  • ResourceManagementGroupSubscriptionResource
public virtual Response<bool> Exists(string subscriptionId, string cacheControl = null, CancellationToken cancellationToken = default)

Parameters

subscriptionId string

Subscription ID.

cacheControl string

Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<bool>

Exceptions

ArgumentException

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

ArgumentNullException

subscriptionId is null.

ExistsAsync(string, string, CancellationToken)

Checks to see if the resource exists in azure.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}
  • Operation IdManagementGroupSubscriptions_GetSubscription
  • Default Api Version2021-04-01
  • ResourceManagementGroupSubscriptionResource
public virtual Task<Response<bool>> ExistsAsync(string subscriptionId, string cacheControl = null, CancellationToken cancellationToken = default)

Parameters

subscriptionId string

Subscription ID.

cacheControl string

Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<bool>>

Exceptions

ArgumentException

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

ArgumentNullException

subscriptionId is null.

Get(string, string, CancellationToken)

Retrieves details about given subscription which is associated with the management group.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}
  • Operation IdManagementGroupSubscriptions_GetSubscription
  • Default Api Version2021-04-01
  • ResourceManagementGroupSubscriptionResource
public virtual Response<ManagementGroupSubscriptionResource> Get(string subscriptionId, string cacheControl = null, CancellationToken cancellationToken = default)

Parameters

subscriptionId string

Subscription ID.

cacheControl string

Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Response<ManagementGroupSubscriptionResource>

Exceptions

ArgumentException

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

ArgumentNullException

subscriptionId is null.

GetAll(string, CancellationToken)

Retrieves details about all subscriptions which are associated with the management group.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions
  • Operation IdManagementGroupSubscriptions_GetSubscriptionsUnderManagementGroup
  • Default Api Version2021-04-01
  • ResourceManagementGroupSubscriptionResource
public virtual Pageable<ManagementGroupSubscriptionResource> GetAll(string skipToken = null, CancellationToken cancellationToken = default)

Parameters

skipToken string

Page continuation token is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a token parameter that specifies a starting point to use for subsequent calls.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Pageable<ManagementGroupSubscriptionResource>

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

GetAllAsync(string, CancellationToken)

Retrieves details about all subscriptions which are associated with the management group.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions
  • Operation IdManagementGroupSubscriptions_GetSubscriptionsUnderManagementGroup
  • Default Api Version2021-04-01
  • ResourceManagementGroupSubscriptionResource
public virtual AsyncPageable<ManagementGroupSubscriptionResource> GetAllAsync(string skipToken = null, CancellationToken cancellationToken = default)

Parameters

skipToken string

Page continuation token is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a token parameter that specifies a starting point to use for subsequent calls.

cancellationToken CancellationToken

The cancellation token to use.

Returns

AsyncPageable<ManagementGroupSubscriptionResource>

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

GetAsync(string, string, CancellationToken)

Retrieves details about given subscription which is associated with the management group.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}
  • Operation IdManagementGroupSubscriptions_GetSubscription
  • Default Api Version2021-04-01
  • ResourceManagementGroupSubscriptionResource
public virtual Task<Response<ManagementGroupSubscriptionResource>> GetAsync(string subscriptionId, string cacheControl = null, CancellationToken cancellationToken = default)

Parameters

subscriptionId string

Subscription ID.

cacheControl string

Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<Response<ManagementGroupSubscriptionResource>>

Exceptions

ArgumentException

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

ArgumentNullException

subscriptionId is null.

GetIfExists(string, string, CancellationToken)

Tries to get details for this resource from the service.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}
  • Operation IdManagementGroupSubscriptions_GetSubscription
  • Default Api Version2021-04-01
  • ResourceManagementGroupSubscriptionResource
public virtual NullableResponse<ManagementGroupSubscriptionResource> GetIfExists(string subscriptionId, string cacheControl = null, CancellationToken cancellationToken = default)

Parameters

subscriptionId string

Subscription ID.

cacheControl string

Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.

cancellationToken CancellationToken

The cancellation token to use.

Returns

NullableResponse<ManagementGroupSubscriptionResource>

Exceptions

ArgumentException

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

ArgumentNullException

subscriptionId is null.

GetIfExistsAsync(string, string, CancellationToken)

Tries to get details for this resource from the service.

  • Request Path/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}
  • Operation IdManagementGroupSubscriptions_GetSubscription
  • Default Api Version2021-04-01
  • ResourceManagementGroupSubscriptionResource
public virtual Task<NullableResponse<ManagementGroupSubscriptionResource>> GetIfExistsAsync(string subscriptionId, string cacheControl = null, CancellationToken cancellationToken = default)

Parameters

subscriptionId string

Subscription ID.

cacheControl string

Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.

cancellationToken CancellationToken

The cancellation token to use.

Returns

Task<NullableResponse<ManagementGroupSubscriptionResource>>

Exceptions

ArgumentException

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

ArgumentNullException

subscriptionId is null.