armmanagementgroups

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 15 Imported by: 4

README

Azure Management Groups Module for Go

PkgGoDev

The armmanagementgroups module provides operations for working with Azure Management Groups.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Management Groups module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Management Groups. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Client Factory

Azure Management Groups module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armmanagementgroups.NewClientFactory(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
clientFactory, err := armmanagementgroups.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewClient()

Fakes

The fake package contains types used for constructing in-memory fake servers used in unit tests. This allows writing tests to cover various success/error conditions without the need for connecting to a live service.

Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Management Groups label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient added in v0.3.0

type APIClient struct {
	// contains filtered or unexported fields
}

APIClient contains the methods for the ManagementGroupsAPI group. Don't use this type directly, use NewAPIClient() instead.

func NewAPIClient added in v0.3.0

func NewAPIClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*APIClient, error)

NewAPIClient creates a new instance of APIClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*APIClient) CheckNameAvailability added in v0.3.0

func (client *APIClient) CheckNameAvailability(ctx context.Context, checkNameAvailabilityRequest CheckNameAvailabilityRequest, options *APIClientCheckNameAvailabilityOptions) (APIClientCheckNameAvailabilityResponse, error)

CheckNameAvailability - Checks if the specified management group name is valid and unique If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-04-01

  • checkNameAvailabilityRequest - Management group name availability check parameters.
  • options - APIClientCheckNameAvailabilityOptions contains the optional parameters for the APIClient.CheckNameAvailability method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/CheckManagementGroupNameAvailability.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIClient().CheckNameAvailability(ctx, armmanagementgroups.CheckNameAvailabilityRequest{
		Name: to.Ptr("nameTocheck"),
		Type: to.Ptr("Microsoft.Management/managementGroups"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.CheckNameAvailabilityResult = armmanagementgroups.CheckNameAvailabilityResult{
	// 	Message: to.Ptr("Error message"),
	// 	NameAvailable: to.Ptr(false),
	// 	Reason: to.Ptr(armmanagementgroups.ReasonAlreadyExists),
	// }
}
Output:

func (*APIClient) StartTenantBackfill added in v0.3.0

StartTenantBackfill - Starts backfilling subscriptions for the Tenant. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-04-01

  • options - APIClientStartTenantBackfillOptions contains the optional parameters for the APIClient.StartTenantBackfill method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/StartTenantBackfillRequest.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIClient().StartTenantBackfill(ctx, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.TenantBackfillStatusResult = armmanagementgroups.TenantBackfillStatusResult{
	// 	Status: to.Ptr(armmanagementgroups.StatusStarted),
	// 	TenantID: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// }
}
Output:

func (*APIClient) TenantBackfillStatus added in v0.3.0

TenantBackfillStatus - Gets tenant backfill status If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-04-01

  • options - APIClientTenantBackfillStatusOptions contains the optional parameters for the APIClient.TenantBackfillStatus method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/TenantBackfillStatusRequest.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAPIClient().TenantBackfillStatus(ctx, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.TenantBackfillStatusResult = armmanagementgroups.TenantBackfillStatusResult{
	// 	Status: to.Ptr(armmanagementgroups.StatusStarted),
	// 	TenantID: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// }
}
Output:

type APIClientCheckNameAvailabilityOptions added in v0.3.0

type APIClientCheckNameAvailabilityOptions struct {
}

APIClientCheckNameAvailabilityOptions contains the optional parameters for the APIClient.CheckNameAvailability method.

type APIClientCheckNameAvailabilityResponse added in v0.3.0

type APIClientCheckNameAvailabilityResponse struct {
	// Describes the result of the request to check management group name availability.
	CheckNameAvailabilityResult
}

APIClientCheckNameAvailabilityResponse contains the response from method APIClient.CheckNameAvailability.

type APIClientStartTenantBackfillOptions added in v0.3.0

type APIClientStartTenantBackfillOptions struct {
}

APIClientStartTenantBackfillOptions contains the optional parameters for the APIClient.StartTenantBackfill method.

type APIClientStartTenantBackfillResponse added in v0.3.0

type APIClientStartTenantBackfillResponse struct {
	// The tenant backfill status
	TenantBackfillStatusResult
}

APIClientStartTenantBackfillResponse contains the response from method APIClient.StartTenantBackfill.

type APIClientTenantBackfillStatusOptions added in v0.3.0

type APIClientTenantBackfillStatusOptions struct {
}

APIClientTenantBackfillStatusOptions contains the optional parameters for the APIClient.TenantBackfillStatus method.

type APIClientTenantBackfillStatusResponse added in v0.3.0

type APIClientTenantBackfillStatusResponse struct {
	// The tenant backfill status
	TenantBackfillStatusResult
}

APIClientTenantBackfillStatusResponse contains the response from method APIClient.TenantBackfillStatus.

type AzureAsyncOperationResults

type AzureAsyncOperationResults struct {
	// The generic properties of a management group.
	Properties *ManagementGroupInfoProperties

	// READ-ONLY; The fully qualified ID for the management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string

	// READ-ONLY; The name of the management group. For example, 00000000-0000-0000-0000-000000000000
	Name *string

	// READ-ONLY; The current status of the asynchronous operation performed . For example, Running, Succeeded, Failed
	Status *string

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups
	Type *string
}

AzureAsyncOperationResults - The results of Azure-AsyncOperation.

func (AzureAsyncOperationResults) MarshalJSON added in v1.1.0

func (a AzureAsyncOperationResults) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AzureAsyncOperationResults.

func (*AzureAsyncOperationResults) UnmarshalJSON added in v1.1.0

func (a *AzureAsyncOperationResults) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AzureAsyncOperationResults.

type CheckNameAvailabilityRequest

type CheckNameAvailabilityRequest struct {
	// the name to check for availability
	Name *string

	// fully qualified resource type which includes provider namespace
	Type *string
}

CheckNameAvailabilityRequest - Management group name availability check parameters.

func (CheckNameAvailabilityRequest) MarshalJSON added in v1.1.0

func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest.

func (*CheckNameAvailabilityRequest) UnmarshalJSON added in v1.1.0

func (c *CheckNameAvailabilityRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityRequest.

type CheckNameAvailabilityResult

type CheckNameAvailabilityResult struct {
	// READ-ONLY; Required if nameAvailable == false. Localized. If reason == invalid, provide the user with the reason why the
	// given name is invalid, and provide the resource naming requirements so that the user can
	// select a valid name. If reason == AlreadyExists, explain that is already in use, and direct them to select a different
	// name.
	Message *string

	// READ-ONLY; Required. True indicates name is valid and available. False indicates the name is invalid, unavailable, or both.
	NameAvailable *bool

	// READ-ONLY; Required if nameAvailable == false. Invalid indicates the name provided does not match the resource provider's
	// naming requirements (incorrect length, unsupported characters, etc.) AlreadyExists
	// indicates that the name is already in use and is therefore unavailable.
	Reason *Reason
}

CheckNameAvailabilityResult - Describes the result of the request to check management group name availability.

func (CheckNameAvailabilityResult) MarshalJSON added in v1.1.0

func (c CheckNameAvailabilityResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResult.

func (*CheckNameAvailabilityResult) UnmarshalJSON added in v1.1.0

func (c *CheckNameAvailabilityResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResult.

type Client added in v0.3.0

type Client struct {
	// contains filtered or unexported fields
}

Client contains the methods for the ManagementGroups group. Don't use this type directly, use NewClient() instead.

func NewClient added in v0.3.0

func NewClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error)

NewClient creates a new instance of Client with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*Client) BeginCreateOrUpdate added in v0.3.0

func (client *Client) BeginCreateOrUpdate(ctx context.Context, groupID string, createManagementGroupRequest CreateManagementGroupRequest, options *ClientBeginCreateOrUpdateOptions) (*runtime.Poller[ClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Create or update a management group. If a management group is already created and a subsequent create request is issued with different properties, the management group properties will be updated. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-04-01

  • groupID - Management Group ID.
  • createManagementGroupRequest - Management group creation parameters.
  • options - ClientBeginCreateOrUpdateOptions contains the optional parameters for the Client.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/PutManagementGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewClient().BeginCreateOrUpdate(ctx, "ChildGroup", armmanagementgroups.CreateManagementGroupRequest{
		Properties: &armmanagementgroups.CreateManagementGroupProperties{
			DisplayName: to.Ptr("ChildGroup"),
			Details: &armmanagementgroups.CreateManagementGroupDetails{
				Parent: &armmanagementgroups.CreateParentGroupInfo{
					ID: to.Ptr("/providers/Microsoft.Management/managementGroups/RootGroup"),
				},
			},
		},
	}, &armmanagementgroups.ClientBeginCreateOrUpdateOptions{CacheControl: to.Ptr("no-cache")})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ManagementGroup = armmanagementgroups.ManagementGroup{
	// 	Name: to.Ptr("ChildGroup"),
	// 	Type: to.Ptr("Microsoft.Management/managementGroups"),
	// 	ID: to.Ptr("/providers/Microsoft.Management/managementGroups/ChildGroup"),
	// 	Properties: &armmanagementgroups.ManagementGroupProperties{
	// 		DisplayName: to.Ptr("ChildGroup"),
	// 		TenantID: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 		Details: &armmanagementgroups.ManagementGroupDetails{
	// 			Parent: &armmanagementgroups.ParentGroupInfo{
	// 				Name: to.Ptr("RootGroup"),
	// 				DisplayName: to.Ptr("RootGroup"),
	// 				ID: to.Ptr("/providers/Microsoft.Management/managementGroups/RootGroup"),
	// 			},
	// 			UpdatedBy: to.Ptr("16b8ef21-5c9f-420c-bcc9-e4f8c9f30b4b"),
	// 			UpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()),
	// 			Version: to.Ptr[int32](1),
	// 		},
	// 	},
	// }
}
Output:

func (*Client) BeginDelete added in v0.3.0

func (client *Client) BeginDelete(ctx context.Context, groupID string, options *ClientBeginDeleteOptions) (*runtime.Poller[ClientDeleteResponse], error)

BeginDelete - Delete management group. If a management group contains child resources, the request will fail. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-04-01

  • groupID - Management Group ID.
  • options - ClientBeginDeleteOptions contains the optional parameters for the Client.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/DeleteManagementGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewClient().BeginDelete(ctx, "GroupToDelete", &armmanagementgroups.ClientBeginDeleteOptions{CacheControl: to.Ptr("no-cache")})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*Client) Get added in v0.3.0

func (client *Client) Get(ctx context.Context, groupID string, options *ClientGetOptions) (ClientGetResponse, error)

Get - Get the details of the management group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-04-01

  • groupID - Management Group ID.
  • options - ClientGetOptions contains the optional parameters for the Client.Get method.
Example (GetManagementGroup)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/GetManagementGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewClient().Get(ctx, "20000000-0001-0000-0000-000000000000", &armmanagementgroups.ClientGetOptions{Expand: nil,
		Recurse:      nil,
		Filter:       nil,
		CacheControl: to.Ptr("no-cache"),
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ManagementGroup = armmanagementgroups.ManagementGroup{
	// 	Name: to.Ptr("20000000-0001-0000-0000-000000000000"),
	// 	Type: to.Ptr("Microsoft.Management/managementGroups"),
	// 	ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0001-0000-0000-000000000000"),
	// 	Properties: &armmanagementgroups.ManagementGroupProperties{
	// 		DisplayName: to.Ptr("Group 1 Tenant 2"),
	// 		TenantID: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 		Details: &armmanagementgroups.ManagementGroupDetails{
	// 			Parent: &armmanagementgroups.ParentGroupInfo{
	// 				Name: to.Ptr("RootGroup"),
	// 				DisplayName: to.Ptr("RootGroup"),
	// 				ID: to.Ptr("/providers/Microsoft.Management/managementGroups/RootGroup"),
	// 			},
	// 			UpdatedBy: to.Ptr("16b8ef21-5c9f-420c-bcc9-e4f8c9f30b4b"),
	// 			UpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()),
	// 			Version: to.Ptr[int32](1),
	// 		},
	// 	},
	// }
}
Output:

Example (GetManagementGroupWithAncestors)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/GetManagementGroupWithAncestors.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewClient().Get(ctx, "20000000-0001-0000-0000-00000000000", &armmanagementgroups.ClientGetOptions{Expand: to.Ptr(armmanagementgroups.ManagementGroupExpandTypeAncestors),
		Recurse:      nil,
		Filter:       nil,
		CacheControl: to.Ptr("no-cache"),
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ManagementGroup = armmanagementgroups.ManagementGroup{
	// 	Name: to.Ptr("20000000-0001-0000-0000-000000000000"),
	// 	Type: to.Ptr("Microsoft.Management/managementGroups"),
	// 	ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0001-0000-0000-000000000000"),
	// 	Properties: &armmanagementgroups.ManagementGroupProperties{
	// 		DisplayName: to.Ptr("Group 1 Tenant 2"),
	// 		TenantID: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 		Details: &armmanagementgroups.ManagementGroupDetails{
	// 			ManagementGroupAncestorsChain: []*armmanagementgroups.ManagementGroupPathElement{
	// 				{
	// 					Name: to.Ptr("20000000-0000-0000-0000-000000000001"),
	// 					DisplayName: to.Ptr("Parent display name"),
	// 				},
	// 				{
	// 					Name: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 					DisplayName: to.Ptr("Grandparent display name"),
	// 			}},
	// 			Parent: &armmanagementgroups.ParentGroupInfo{
	// 				Name: to.Ptr("20000000-0000-0000-0000-000000000001"),
	// 				DisplayName: to.Ptr("Parent display name"),
	// 				ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0000-0000-0000-000000000001"),
	// 			},
	// 			UpdatedBy: to.Ptr("Test"),
	// 			UpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()),
	// 			Version: to.Ptr[int32](1),
	// 		},
	// 	},
	// }
}
Output:

Example (GetManagementGroupWithExpand)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/GetManagementGroupWithExpand.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewClient().Get(ctx, "20000000-0001-0000-0000-000000000000", &armmanagementgroups.ClientGetOptions{Expand: to.Ptr(armmanagementgroups.ManagementGroupExpandTypeChildren),
		Recurse:      nil,
		Filter:       nil,
		CacheControl: to.Ptr("no-cache"),
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ManagementGroup = armmanagementgroups.ManagementGroup{
	// 	Name: to.Ptr("20000000-0001-0000-0000-000000000000"),
	// 	Type: to.Ptr("Microsoft.Management/managementGroups"),
	// 	ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0001-0000-0000-000000000000"),
	// 	Properties: &armmanagementgroups.ManagementGroupProperties{
	// 		Children: []*armmanagementgroups.ManagementGroupChildInfo{
	// 			{
	// 				Name: to.Ptr("20000000-0002-0000-0000-000000000000"),
	// 				Type: to.Ptr(armmanagementgroups.ManagementGroupChildTypeMicrosoftManagementManagementGroups),
	// 				DisplayName: to.Ptr("Group 2 Tenant 2"),
	// 				ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0002-0000-0000-000000000000"),
	// 			},
	// 			{
	// 				Name: to.Ptr("20000000-0003-0000-0000-000000000000"),
	// 				Type: to.Ptr(armmanagementgroups.ManagementGroupChildTypeMicrosoftManagementManagementGroups),
	// 				DisplayName: to.Ptr("Group 3 Tenant 2"),
	// 				ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0003-0000-0000-000000000000"),
	// 			},
	// 			{
	// 				Name: to.Ptr("10000000-F004-0000-0000-000000000000"),
	// 				Type: to.Ptr(armmanagementgroups.ManagementGroupChildTypeSubscriptions),
	// 				DisplayName: to.Ptr("Subscription 4 Tenant 1"),
	// 				ID: to.Ptr("/subscriptions/10000000-F004-0000-0000-000000000000"),
	// 			},
	// 			{
	// 				Name: to.Ptr("20000000-F005-0000-0000-000000000000"),
	// 				Type: to.Ptr(armmanagementgroups.ManagementGroupChildTypeSubscriptions),
	// 				DisplayName: to.Ptr("Subscription 5 Tenant 2"),
	// 				ID: to.Ptr("/subscriptions/20000000-F005-0000-0000-000000000000"),
	// 			},
	// 			{
	// 				Name: to.Ptr("30000000-F003-0000-0000-000000000000"),
	// 				Type: to.Ptr(armmanagementgroups.ManagementGroupChildTypeSubscriptions),
	// 				DisplayName: to.Ptr("Subscription 3 Tenant 3"),
	// 				ID: to.Ptr("/subscriptions/30000000-F003-0000-0000-000000000000"),
	// 		}},
	// 		DisplayName: to.Ptr("Group 1 Tenant 2"),
	// 		TenantID: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 		Details: &armmanagementgroups.ManagementGroupDetails{
	// 			Parent: &armmanagementgroups.ParentGroupInfo{
	// 				Name: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 				DisplayName: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 				ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0000-0000-0000-000000000000"),
	// 			},
	// 			UpdatedBy: to.Ptr("Test"),
	// 			UpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()),
	// 			Version: to.Ptr[int32](1),
	// 		},
	// 	},
	// }
}
Output:

Example (GetManagementGroupWithPath)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/GetManagementGroupWithPath.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewClient().Get(ctx, "20000000-0001-0000-0000-000000000000", &armmanagementgroups.ClientGetOptions{Expand: to.Ptr(armmanagementgroups.ManagementGroupExpandTypePath),
		Recurse:      nil,
		Filter:       nil,
		CacheControl: to.Ptr("no-cache"),
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ManagementGroup = armmanagementgroups.ManagementGroup{
	// 	Name: to.Ptr("20000000-0001-0000-0000-000000000000"),
	// 	Type: to.Ptr("Microsoft.Management/managementGroups"),
	// 	ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0001-0000-0000-000000000000"),
	// 	Properties: &armmanagementgroups.ManagementGroupProperties{
	// 		DisplayName: to.Ptr("Group 1 Tenant 2"),
	// 		TenantID: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 		Details: &armmanagementgroups.ManagementGroupDetails{
	// 			Path: []*armmanagementgroups.ManagementGroupPathElement{
	// 				{
	// 					Name: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 					DisplayName: to.Ptr("Grandparent display name"),
	// 				},
	// 				{
	// 					Name: to.Ptr("20000000-0000-0000-0000-000000000001"),
	// 					DisplayName: to.Ptr("Parent display name"),
	// 			}},
	// 			Parent: &armmanagementgroups.ParentGroupInfo{
	// 				Name: to.Ptr("20000000-0000-0000-0000-000000000001"),
	// 				DisplayName: to.Ptr("Parent display name"),
	// 				ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0000-0000-0000-000000000001"),
	// 			},
	// 			UpdatedBy: to.Ptr("Test"),
	// 			UpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()),
	// 			Version: to.Ptr[int32](1),
	// 		},
	// 	},
	// }
}
Output:

Example (GetManagementGroupsWithExpandAndRecurse)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/GetManagementGroupWithExpandAndRecurse.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewClient().Get(ctx, "20000000-0001-0000-0000-000000000000", &armmanagementgroups.ClientGetOptions{Expand: to.Ptr(armmanagementgroups.ManagementGroupExpandTypeChildren),
		Recurse:      to.Ptr(true),
		Filter:       nil,
		CacheControl: to.Ptr("no-cache"),
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ManagementGroup = armmanagementgroups.ManagementGroup{
	// 	Name: to.Ptr("RootGroup"),
	// 	Type: to.Ptr("Microsoft.Management/managementGroups"),
	// 	ID: to.Ptr("/providers/Microsoft.Management/managementGroups/RootGroup"),
	// 	Properties: &armmanagementgroups.ManagementGroupProperties{
	// 		Children: []*armmanagementgroups.ManagementGroupChildInfo{
	// 			{
	// 				Name: to.Ptr("Child"),
	// 				Type: to.Ptr(armmanagementgroups.ManagementGroupChildTypeMicrosoftManagementManagementGroups),
	// 				Children: []*armmanagementgroups.ManagementGroupChildInfo{
	// 					{
	// 						Name: to.Ptr("Leaf"),
	// 						Type: to.Ptr(armmanagementgroups.ManagementGroupChildTypeMicrosoftManagementManagementGroups),
	// 						Children: []*armmanagementgroups.ManagementGroupChildInfo{
	// 							{
	// 								Name: to.Ptr("728bcbe4-8d56-4510-86c2-4921b8beefbc"),
	// 								Type: to.Ptr(armmanagementgroups.ManagementGroupChildTypeSubscriptions),
	// 								DisplayName: to.Ptr("Pay-As-You-Go"),
	// 								ID: to.Ptr("/subscriptions/728bcbe4-8d56-4510-86c2-4921b8beefbc"),
	// 						}},
	// 						DisplayName: to.Ptr("Leaf"),
	// 						ID: to.Ptr("/providers/Microsoft.Management/managementGroups/Leaf"),
	// 				}},
	// 				DisplayName: to.Ptr("Child"),
	// 				ID: to.Ptr("/providers/Microsoft.Management/managementGroups/Child"),
	// 			},
	// 			{
	// 				Name: to.Ptr("AnotherChild"),
	// 				Type: to.Ptr(armmanagementgroups.ManagementGroupChildTypeMicrosoftManagementManagementGroups),
	// 				DisplayName: to.Ptr("Leaf"),
	// 				ID: to.Ptr("/providers/Microsoft.Management/managementGroups/AnotherChild"),
	// 		}},
	// 		DisplayName: to.Ptr("RootGroup"),
	// 		TenantID: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 		Details: &armmanagementgroups.ManagementGroupDetails{
	// 			Parent: &armmanagementgroups.ParentGroupInfo{
	// 				Name: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 				DisplayName: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 				ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0000-0000-0000-000000000000"),
	// 			},
	// 			UpdatedBy: to.Ptr("bd490e30-04cb-433e-b8c8-6066959a8bab"),
	// 			UpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T02:26:49.002Z"); return t}()),
	// 			Version: to.Ptr[int32](2),
	// 		},
	// 	},
	// }
}
Output:

func (*Client) NewGetDescendantsPager added in v0.6.0

func (client *Client) NewGetDescendantsPager(groupID string, options *ClientGetDescendantsOptions) *runtime.Pager[ClientGetDescendantsResponse]

NewGetDescendantsPager - List all entities that descend from a management group.

Generated from API version 2021-04-01

  • groupID - Management Group ID.
  • options - ClientGetDescendantsOptions contains the optional parameters for the Client.NewGetDescendantsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/GetDescendants.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewClient().NewGetDescendantsPager("20000000-0000-0000-0000-000000000000", &armmanagementgroups.ClientGetDescendantsOptions{Skiptoken: nil,
		Top: nil,
	})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.DescendantListResult = armmanagementgroups.DescendantListResult{
		// 	Value: []*armmanagementgroups.DescendantInfo{
		// 		{
		// 			Name: to.Ptr("20000000-0001-0000-0000-000000000000"),
		// 			Type: to.Ptr("Microsoft.Management/managementGroups"),
		// 			ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0001-0000-0000-000000000000"),
		// 			Properties: &armmanagementgroups.DescendantInfoProperties{
		// 				DisplayName: to.Ptr("Group 1"),
		// 				Parent: &armmanagementgroups.DescendantParentGroupInfo{
		// 					ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0000-0000-0000-000000000000"),
		// 				},
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("20000000-0004-0000-0000-000000000000"),
		// 			Type: to.Ptr("Microsoft.Management/managementGroups/subscriptions"),
		// 			ID: to.Ptr("/subscriptions/20000000-0004-0000-0000-000000000000"),
		// 			Properties: &armmanagementgroups.DescendantInfoProperties{
		// 				DisplayName: to.Ptr("Subscription 4"),
		// 				Parent: &armmanagementgroups.DescendantParentGroupInfo{
		// 					ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0000-0000-0000-000000000000"),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*Client) NewListPager added in v0.6.0

func (client *Client) NewListPager(options *ClientListOptions) *runtime.Pager[ClientListResponse]

NewListPager - List management groups for the authenticated user.

Generated from API version 2021-04-01

  • options - ClientListOptions contains the optional parameters for the Client.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/ListManagementGroups.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewClient().NewListPager(&armmanagementgroups.ClientListOptions{CacheControl: to.Ptr("no-cache"),
		Skiptoken: nil,
	})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ManagementGroupListResult = armmanagementgroups.ManagementGroupListResult{
		// 	Value: []*armmanagementgroups.ManagementGroupInfo{
		// 		{
		// 			Name: to.Ptr("20000000-0001-0000-0000-000000000000"),
		// 			Type: to.Ptr("Microsoft.Management/managementGroups"),
		// 			ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0001-0000-0000-000000000000"),
		// 			Properties: &armmanagementgroups.ManagementGroupInfoProperties{
		// 				DisplayName: to.Ptr("Group 1 Tenant 2"),
		// 				TenantID: to.Ptr("20000000-0000-0000-0000-000000000000"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("20000000-0004-0000-0000-000000000000"),
		// 			Type: to.Ptr("Microsoft.Management/managementGroups"),
		// 			ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0004-0000-0000-000000000000"),
		// 			Properties: &armmanagementgroups.ManagementGroupInfoProperties{
		// 				DisplayName: to.Ptr("Group 4 Tenant 2"),
		// 				TenantID: to.Ptr("20000000-0000-0000-0000-000000000000"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*Client) Update added in v0.3.0

func (client *Client) Update(ctx context.Context, groupID string, patchGroupRequest PatchManagementGroupRequest, options *ClientUpdateOptions) (ClientUpdateResponse, error)

Update - Update a management group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-04-01

  • groupID - Management Group ID.
  • patchGroupRequest - Management group patch parameters.
  • options - ClientUpdateOptions contains the optional parameters for the Client.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/PatchManagementGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewClient().Update(ctx, "ChildGroup", armmanagementgroups.PatchManagementGroupRequest{
		DisplayName:   to.Ptr("AlternateDisplayName"),
		ParentGroupID: to.Ptr("/providers/Microsoft.Management/managementGroups/AlternateRootGroup"),
	}, &armmanagementgroups.ClientUpdateOptions{CacheControl: to.Ptr("no-cache")})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ManagementGroup = armmanagementgroups.ManagementGroup{
	// 	Name: to.Ptr("ChildGroup"),
	// 	Type: to.Ptr("Microsoft.Management/managementGroups"),
	// 	ID: to.Ptr("/providers/Microsoft.Management/managementGroups/ChildGroup"),
	// 	Properties: &armmanagementgroups.ManagementGroupProperties{
	// 		DisplayName: to.Ptr("AlternateDisplayName"),
	// 		TenantID: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 		Details: &armmanagementgroups.ManagementGroupDetails{
	// 			Parent: &armmanagementgroups.ParentGroupInfo{
	// 				Name: to.Ptr("AlternateRootGroup"),
	// 				DisplayName: to.Ptr("AlternateRootGroup"),
	// 				ID: to.Ptr("/providers/Microsoft.Management/managementGroups/AlternateRootGroup"),
	// 			},
	// 			UpdatedBy: to.Ptr("bd490e30-04cb-433e-b8c8-6066959a8bab"),
	// 			UpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T02:46:59.054Z"); return t}()),
	// 			Version: to.Ptr[int32](2),
	// 		},
	// 	},
	// }
}
Output:

type ClientBeginCreateOrUpdateOptions added in v0.3.0

type ClientBeginCreateOrUpdateOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *string

	// Resumes the LRO from the provided token.
	ResumeToken string
}

ClientBeginCreateOrUpdateOptions contains the optional parameters for the Client.BeginCreateOrUpdate method.

type ClientBeginDeleteOptions added in v0.3.0

type ClientBeginDeleteOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *string

	// Resumes the LRO from the provided token.
	ResumeToken string
}

ClientBeginDeleteOptions contains the optional parameters for the Client.BeginDelete method.

type ClientCreateOrUpdateResponse added in v0.3.0

type ClientCreateOrUpdateResponse struct {
	// The management group details.
	ManagementGroup
}

ClientCreateOrUpdateResponse contains the response from method Client.BeginCreateOrUpdate.

type ClientDeleteResponse added in v0.3.0

type ClientDeleteResponse struct {
	// The results of Azure-AsyncOperation.
	AzureAsyncOperationResults
}

ClientDeleteResponse contains the response from method Client.BeginDelete.

type ClientFactory added in v1.1.0

type ClientFactory struct {
	// contains filtered or unexported fields
}

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory added in v1.1.0

func NewClientFactory(credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewAPIClient added in v1.1.0

func (c *ClientFactory) NewAPIClient() *APIClient

NewAPIClient creates a new instance of APIClient.

func (*ClientFactory) NewClient added in v1.1.0

func (c *ClientFactory) NewClient() *Client

NewClient creates a new instance of Client.

func (*ClientFactory) NewEntitiesClient added in v1.1.0

func (c *ClientFactory) NewEntitiesClient() *EntitiesClient

NewEntitiesClient creates a new instance of EntitiesClient.

func (*ClientFactory) NewHierarchySettingsClient added in v1.1.0

func (c *ClientFactory) NewHierarchySettingsClient() *HierarchySettingsClient

NewHierarchySettingsClient creates a new instance of HierarchySettingsClient.

func (*ClientFactory) NewManagementGroupSubscriptionsClient added in v1.1.0

func (c *ClientFactory) NewManagementGroupSubscriptionsClient() *ManagementGroupSubscriptionsClient

NewManagementGroupSubscriptionsClient creates a new instance of ManagementGroupSubscriptionsClient.

func (*ClientFactory) NewOperationsClient added in v1.1.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

type ClientGetDescendantsOptions added in v0.3.0

type ClientGetDescendantsOptions struct {
	// 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.
	Skiptoken *string

	// Number of elements to return when retrieving results. Passing this in will override $skipToken.
	Top *int32
}

ClientGetDescendantsOptions contains the optional parameters for the Client.NewGetDescendantsPager method.

type ClientGetDescendantsResponse added in v0.3.0

type ClientGetDescendantsResponse struct {
	// Describes the result of the request to view descendants.
	DescendantListResult
}

ClientGetDescendantsResponse contains the response from method Client.NewGetDescendantsPager.

type ClientGetOptions added in v0.3.0

type ClientGetOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *string

	// The $expand=children query string parameter allows clients to request inclusion of children in the response payload. $expand=path
	// includes the path from the root group to the current group.
	// $expand=ancestors includes the ancestor Ids of the current group.
	Expand *ManagementGroupExpandType

	// A filter which allows the exclusion of subscriptions from results (i.e. '$filter=children.childType ne Subscription')
	Filter *string

	// The $recurse=true query string parameter allows clients to request inclusion of entire hierarchy in the response payload.
	// Note that $expand=children must be passed up if $recurse is set to true.
	Recurse *bool
}

ClientGetOptions contains the optional parameters for the Client.Get method.

type ClientGetResponse added in v0.3.0

type ClientGetResponse struct {
	// The management group details.
	ManagementGroup
}

ClientGetResponse contains the response from method Client.Get.

type ClientListOptions added in v0.3.0

type ClientListOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *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.
	Skiptoken *string
}

ClientListOptions contains the optional parameters for the Client.NewListPager method.

type ClientListResponse added in v0.3.0

type ClientListResponse struct {
	// Describes the result of the request to list management groups.
	ManagementGroupListResult
}

ClientListResponse contains the response from method Client.NewListPager.

type ClientUpdateOptions added in v0.3.0

type ClientUpdateOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *string
}

ClientUpdateOptions contains the optional parameters for the Client.Update method.

type ClientUpdateResponse added in v0.3.0

type ClientUpdateResponse struct {
	// The management group details.
	ManagementGroup
}

ClientUpdateResponse contains the response from method Client.Update.

type CreateManagementGroupChildInfo

type CreateManagementGroupChildInfo struct {
	// READ-ONLY; The list of children.
	Children []*CreateManagementGroupChildInfo

	// READ-ONLY; The friendly name of the child resource.
	DisplayName *string

	// READ-ONLY; The fully qualified ID for the child resource (management group or subscription). For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string

	// READ-ONLY; The name of the child entity.
	Name *string

	// READ-ONLY; The fully qualified resource type which includes provider namespace (e.g. Microsoft.Management/managementGroups)
	Type *ManagementGroupChildType
}

CreateManagementGroupChildInfo - The child information of a management group used during creation.

func (CreateManagementGroupChildInfo) MarshalJSON

func (c CreateManagementGroupChildInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CreateManagementGroupChildInfo.

func (*CreateManagementGroupChildInfo) UnmarshalJSON added in v1.1.0

func (c *CreateManagementGroupChildInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CreateManagementGroupChildInfo.

type CreateManagementGroupDetails

type CreateManagementGroupDetails struct {
	// (Optional) The ID of the parent management group used during creation.
	Parent *CreateParentGroupInfo

	// READ-ONLY; The identity of the principal or process that updated the object.
	UpdatedBy *string

	// READ-ONLY; The date and time when this object was last updated.
	UpdatedTime *time.Time

	// READ-ONLY; The version number of the object.
	Version *int32
}

CreateManagementGroupDetails - The details of a management group used during creation.

func (CreateManagementGroupDetails) MarshalJSON

func (c CreateManagementGroupDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CreateManagementGroupDetails.

func (*CreateManagementGroupDetails) UnmarshalJSON

func (c *CreateManagementGroupDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CreateManagementGroupDetails.

type CreateManagementGroupProperties

type CreateManagementGroupProperties struct {
	// The details of a management group used during creation.
	Details *CreateManagementGroupDetails

	// The friendly name of the management group. If no value is passed then this field will be set to the groupId.
	DisplayName *string

	// READ-ONLY; The list of children.
	Children []*CreateManagementGroupChildInfo

	// READ-ONLY; The AAD Tenant ID associated with the management group. For example, 00000000-0000-0000-0000-000000000000
	TenantID *string
}

CreateManagementGroupProperties - The generic properties of a management group used during creation.

func (CreateManagementGroupProperties) MarshalJSON

func (c CreateManagementGroupProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CreateManagementGroupProperties.

func (*CreateManagementGroupProperties) UnmarshalJSON added in v1.1.0

func (c *CreateManagementGroupProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CreateManagementGroupProperties.

type CreateManagementGroupRequest

type CreateManagementGroupRequest struct {
	// The name of the management group. For example, 00000000-0000-0000-0000-000000000000
	Name *string

	// The generic properties of a management group used during creation.
	Properties *CreateManagementGroupProperties

	// READ-ONLY; The fully qualified ID for the management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups
	Type *string
}

CreateManagementGroupRequest - Management group creation parameters.

func (CreateManagementGroupRequest) MarshalJSON added in v1.1.0

func (c CreateManagementGroupRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CreateManagementGroupRequest.

func (*CreateManagementGroupRequest) UnmarshalJSON added in v1.1.0

func (c *CreateManagementGroupRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CreateManagementGroupRequest.

type CreateOrUpdateSettingsProperties

type CreateOrUpdateSettingsProperties struct {
	// Settings that sets the default Management Group under which new subscriptions get added in this tenant. For example, /providers/Microsoft.Management/managementGroups/defaultGroup
	DefaultManagementGroup *string

	// Indicates whether RBAC access is required upon group creation under the root Management Group. If set to true, user will
	// require Microsoft.Management/managementGroups/write action on the root
	// Management Group scope in order to create new Groups directly under the root. This will prevent new users from creating
	// new Management Groups, unless they are given access.
	RequireAuthorizationForGroupCreation *bool
}

CreateOrUpdateSettingsProperties - The properties of the request to create or update Management Group settings

func (CreateOrUpdateSettingsProperties) MarshalJSON added in v1.1.0

func (c CreateOrUpdateSettingsProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CreateOrUpdateSettingsProperties.

func (*CreateOrUpdateSettingsProperties) UnmarshalJSON added in v1.1.0

func (c *CreateOrUpdateSettingsProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CreateOrUpdateSettingsProperties.

type CreateOrUpdateSettingsRequest

type CreateOrUpdateSettingsRequest struct {
	// The properties of the request to create or update Management Group settings
	Properties *CreateOrUpdateSettingsProperties
}

CreateOrUpdateSettingsRequest - Parameters for creating or updating Management Group settings

func (CreateOrUpdateSettingsRequest) MarshalJSON

func (c CreateOrUpdateSettingsRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CreateOrUpdateSettingsRequest.

func (*CreateOrUpdateSettingsRequest) UnmarshalJSON added in v1.1.0

func (c *CreateOrUpdateSettingsRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CreateOrUpdateSettingsRequest.

type CreateParentGroupInfo

type CreateParentGroupInfo struct {
	// The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string

	// READ-ONLY; The friendly name of the parent management group.
	DisplayName *string

	// READ-ONLY; The name of the parent management group
	Name *string
}

CreateParentGroupInfo - (Optional) The ID of the parent management group used during creation.

func (CreateParentGroupInfo) MarshalJSON added in v1.1.0

func (c CreateParentGroupInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CreateParentGroupInfo.

func (*CreateParentGroupInfo) UnmarshalJSON added in v1.1.0

func (c *CreateParentGroupInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CreateParentGroupInfo.

type DescendantInfo

type DescendantInfo struct {
	// The generic properties of an descendant.
	Properties *DescendantInfoProperties

	// READ-ONLY; The fully qualified ID for the descendant. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	// or /subscriptions/0000000-0000-0000-0000-000000000000
	ID *string

	// READ-ONLY; The name of the descendant. For example, 00000000-0000-0000-0000-000000000000
	Name *string

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups or /subscriptions
	Type *string
}

DescendantInfo - The descendant.

func (DescendantInfo) MarshalJSON added in v1.1.0

func (d DescendantInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DescendantInfo.

func (*DescendantInfo) UnmarshalJSON added in v1.1.0

func (d *DescendantInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DescendantInfo.

type DescendantInfoProperties

type DescendantInfoProperties struct {
	// The friendly name of the management group.
	DisplayName *string

	// The ID of the parent management group.
	Parent *DescendantParentGroupInfo
}

DescendantInfoProperties - The generic properties of an descendant.

func (DescendantInfoProperties) MarshalJSON added in v1.1.0

func (d DescendantInfoProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DescendantInfoProperties.

func (*DescendantInfoProperties) UnmarshalJSON added in v1.1.0

func (d *DescendantInfoProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DescendantInfoProperties.

type DescendantListResult

type DescendantListResult struct {
	// The list of descendants.
	Value []*DescendantInfo

	// READ-ONLY; The URL to use for getting the next set of results.
	NextLink *string
}

DescendantListResult - Describes the result of the request to view descendants.

func (DescendantListResult) MarshalJSON

func (d DescendantListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DescendantListResult.

func (*DescendantListResult) UnmarshalJSON added in v1.1.0

func (d *DescendantListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DescendantListResult.

type DescendantParentGroupInfo

type DescendantParentGroupInfo struct {
	// The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string
}

DescendantParentGroupInfo - The ID of the parent management group.

func (DescendantParentGroupInfo) MarshalJSON added in v1.1.0

func (d DescendantParentGroupInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DescendantParentGroupInfo.

func (*DescendantParentGroupInfo) UnmarshalJSON added in v1.1.0

func (d *DescendantParentGroupInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DescendantParentGroupInfo.

type EntitiesClient

type EntitiesClient struct {
	// contains filtered or unexported fields
}

EntitiesClient contains the methods for the Entities group. Don't use this type directly, use NewEntitiesClient() instead.

func NewEntitiesClient

func NewEntitiesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*EntitiesClient, error)

NewEntitiesClient creates a new instance of EntitiesClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*EntitiesClient) NewListPager added in v0.6.0

NewListPager - List all entities (Management Groups, Subscriptions, etc.) for the authenticated user.

Generated from API version 2021-04-01

  • options - EntitiesClientListOptions contains the optional parameters for the EntitiesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/GetEntities.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewEntitiesClient().NewListPager(&armmanagementgroups.EntitiesClientListOptions{Skiptoken: nil,
		Skip:         nil,
		Top:          nil,
		Select:       nil,
		Search:       nil,
		Filter:       nil,
		View:         nil,
		GroupName:    nil,
		CacheControl: nil,
	})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.EntityListResult = armmanagementgroups.EntityListResult{
		// 	Value: []*armmanagementgroups.EntityInfo{
		// 		{
		// 			Name: to.Ptr("20000000-0001-0000-0000-000000000000"),
		// 			Type: to.Ptr("Microsoft.Management/managementGroups"),
		// 			ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0001-0000-0000-000000000000"),
		// 			Properties: &armmanagementgroups.EntityInfoProperties{
		// 				DisplayName: to.Ptr("Group 1 Tenant 2"),
		// 				InheritedPermissions: to.Ptr(armmanagementgroups.PermissionsView),
		// 				NumberOfChildGroups: to.Ptr[int32](1),
		// 				NumberOfChildren: to.Ptr[int32](2),
		// 				NumberOfDescendants: to.Ptr[int32](3),
		// 				Parent: &armmanagementgroups.EntityParentGroupInfo{
		// 					ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0000-0000-0000-000000000000"),
		// 				},
		// 				ParentDisplayNameChain: []*string{
		// 					to.Ptr("Tenant Root Group"),
		// 					to.Ptr("Group 1 Tenant 2 Parent")},
		// 					ParentNameChain: []*string{
		// 						to.Ptr("TenantRootGroup"),
		// 						to.Ptr("Group1Tenant2Parent")},
		// 						Permissions: to.Ptr(armmanagementgroups.PermissionsView),
		// 						TenantID: to.Ptr("20000000-0000-0000-0000-000000000000"),
		// 					},
		// 				},
		// 				{
		// 					Name: to.Ptr("20000000-0004-0000-0000-000000000000"),
		// 					Type: to.Ptr("Microsoft.Management/managementGroups"),
		// 					ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0004-0000-0000-000000000000"),
		// 					Properties: &armmanagementgroups.EntityInfoProperties{
		// 						DisplayName: to.Ptr("Group 4 Tenant 2"),
		// 						InheritedPermissions: to.Ptr(armmanagementgroups.PermissionsDelete),
		// 						NumberOfChildGroups: to.Ptr[int32](0),
		// 						NumberOfChildren: to.Ptr[int32](0),
		// 						NumberOfDescendants: to.Ptr[int32](0),
		// 						Parent: &armmanagementgroups.EntityParentGroupInfo{
		// 							ID: to.Ptr("/providers/Microsoft.Management/managementGroups/20000000-0000-0000-0000-000000000000"),
		// 						},
		// 						ParentDisplayNameChain: []*string{
		// 							to.Ptr("Tenant Root Group"),
		// 							to.Ptr("Group 4 Tenant 2 Parent")},
		// 							ParentNameChain: []*string{
		// 								to.Ptr("TenantRootGroup"),
		// 								to.Ptr("Group4 Tenant2Parent")},
		// 								Permissions: to.Ptr(armmanagementgroups.PermissionsDelete),
		// 								TenantID: to.Ptr("20000000-0000-0000-0000-000000000000"),
		// 							},
		// 					}},
		// 				}
	}
}
Output:

type EntitiesClientListOptions added in v0.3.0

type EntitiesClientListOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *string

	// The filter parameter allows you to filter on the the name or display name fields. You can check for equality on the name
	// field (e.g. name eq '{entityName}') and you can check for substrings on either
	// the name or display name fields(e.g. contains(name, '{substringToSearch}'), contains(displayName, '{substringToSearch')).
	// Note that the '{entityName}' and '{substringToSearch}' fields are checked case
	// insensitively.
	Filter *string

	// A filter which allows the get entities call to focus on a particular group (i.e. "$filter=name eq 'groupName'")
	GroupName *string

	// The $search parameter is used in conjunction with the $filter parameter to return three different outputs depending on
	// the parameter passed in. With $search=AllowedParents the API will return the
	// entity info of all groups that the requested entity will be able to reparent to as determined by the user's permissions.
	// With $search=AllowedChildren the API will return the entity info of all
	// entities that can be added as children of the requested entity. With $search=ParentAndFirstLevelChildren the API will return
	// the parent and first level of children that the user has either direct
	// access to or indirect access via one of their descendants. With $search=ParentOnly the API will return only the group if
	// the user has access to at least one of the descendants of the group. With
	// $search=ChildrenOnly the API will return only the first level of children of the group entity info specified in $filter.
	// The user must have direct access to the children entities or one of it's
	// descendants for it to show up in the results.
	Search *EntitySearchType

	// This parameter specifies the fields to include in the response. Can include any combination of Name,DisplayName,Type,ParentDisplayNameChain,ParentChain,
	// e.g.
	// '$select=Name,DisplayName,Type,ParentDisplayNameChain,ParentNameChain'. When specified the $select parameter can override
	// select in $skipToken.
	Select *string

	// Number of entities to skip over when retrieving results. Passing this in will override $skipToken.
	Skip *int32

	// 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.
	Skiptoken *string

	// Number of elements to return when retrieving results. Passing this in will override $skipToken.
	Top *int32

	// The view parameter allows clients to filter the type of data that is returned by the getEntities call.
	View *EntityViewParameterType
}

EntitiesClientListOptions contains the optional parameters for the EntitiesClient.NewListPager method.

type EntitiesClientListResponse added in v0.3.0

type EntitiesClientListResponse struct {
	// Describes the result of the request to view entities.
	EntityListResult
}

EntitiesClientListResponse contains the response from method EntitiesClient.NewListPager.

type EntityHierarchyItem

type EntityHierarchyItem struct {
	// The generic properties of a management group.
	Properties *EntityHierarchyItemProperties

	// READ-ONLY; The fully qualified ID for the management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string

	// READ-ONLY; The name of the management group. For example, 00000000-0000-0000-0000-000000000000
	Name *string

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups
	Type *string
}

EntityHierarchyItem - The management group details for the hierarchy view.

func (EntityHierarchyItem) MarshalJSON added in v1.1.0

func (e EntityHierarchyItem) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EntityHierarchyItem.

func (*EntityHierarchyItem) UnmarshalJSON added in v1.1.0

func (e *EntityHierarchyItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EntityHierarchyItem.

type EntityHierarchyItemProperties

type EntityHierarchyItemProperties struct {
	// The list of children.
	Children []*EntityHierarchyItem

	// The friendly name of the management group.
	DisplayName *string

	// The users specific permissions to this item.
	Permissions *Permissions
}

EntityHierarchyItemProperties - The generic properties of a management group.

func (EntityHierarchyItemProperties) MarshalJSON

func (e EntityHierarchyItemProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EntityHierarchyItemProperties.

func (*EntityHierarchyItemProperties) UnmarshalJSON added in v1.1.0

func (e *EntityHierarchyItemProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EntityHierarchyItemProperties.

type EntityInfo

type EntityInfo struct {
	// The generic properties of an entity.
	Properties *EntityInfoProperties

	// READ-ONLY; The fully qualified ID for the entity. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string

	// READ-ONLY; The name of the entity. For example, 00000000-0000-0000-0000-000000000000
	Name *string

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups
	Type *string
}

EntityInfo - The entity.

func (EntityInfo) MarshalJSON added in v1.1.0

func (e EntityInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EntityInfo.

func (*EntityInfo) UnmarshalJSON added in v1.1.0

func (e *EntityInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EntityInfo.

type EntityInfoProperties

type EntityInfoProperties struct {
	// The friendly name of the management group.
	DisplayName *string

	// The users specific permissions to this item.
	InheritedPermissions *Permissions

	// Number of children is the number of Groups that are exactly one level underneath the current Group.
	NumberOfChildGroups *int32

	// Number of children is the number of Groups and Subscriptions that are exactly one level underneath the current Group.
	NumberOfChildren *int32

	// Number of Descendants
	NumberOfDescendants *int32

	// (Optional) The ID of the parent management group.
	Parent *EntityParentGroupInfo

	// The parent display name chain from the root group to the immediate parent
	ParentDisplayNameChain []*string

	// The parent name chain from the root group to the immediate parent
	ParentNameChain []*string

	// The users specific permissions to this item.
	Permissions *Permissions

	// The AAD Tenant ID associated with the entity. For example, 00000000-0000-0000-0000-000000000000
	TenantID *string
}

EntityInfoProperties - The generic properties of an entity.

func (EntityInfoProperties) MarshalJSON

func (e EntityInfoProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EntityInfoProperties.

func (*EntityInfoProperties) UnmarshalJSON added in v1.1.0

func (e *EntityInfoProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EntityInfoProperties.

type EntityListResult

type EntityListResult struct {
	// The list of entities.
	Value []*EntityInfo

	// READ-ONLY; Total count of records that match the filter
	Count *int32

	// READ-ONLY; The URL to use for getting the next set of results.
	NextLink *string
}

EntityListResult - Describes the result of the request to view entities.

func (EntityListResult) MarshalJSON

func (e EntityListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EntityListResult.

func (*EntityListResult) UnmarshalJSON added in v1.1.0

func (e *EntityListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EntityListResult.

type EntityParentGroupInfo

type EntityParentGroupInfo struct {
	// The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string
}

EntityParentGroupInfo - (Optional) The ID of the parent management group.

func (EntityParentGroupInfo) MarshalJSON added in v1.1.0

func (e EntityParentGroupInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EntityParentGroupInfo.

func (*EntityParentGroupInfo) UnmarshalJSON added in v1.1.0

func (e *EntityParentGroupInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EntityParentGroupInfo.

type EntitySearchType added in v0.4.0

type EntitySearchType string
const (
	EntitySearchTypeAllowedChildren             EntitySearchType = "AllowedChildren"
	EntitySearchTypeAllowedParents              EntitySearchType = "AllowedParents"
	EntitySearchTypeChildrenOnly                EntitySearchType = "ChildrenOnly"
	EntitySearchTypeParentAndFirstLevelChildren EntitySearchType = "ParentAndFirstLevelChildren"
	EntitySearchTypeParentOnly                  EntitySearchType = "ParentOnly"
)

func PossibleEntitySearchTypeValues added in v0.4.0

func PossibleEntitySearchTypeValues() []EntitySearchType

PossibleEntitySearchTypeValues returns the possible values for the EntitySearchType const type.

type EntityViewParameterType added in v0.4.0

type EntityViewParameterType string
const (
	EntityViewParameterTypeAudit             EntityViewParameterType = "Audit"
	EntityViewParameterTypeFullHierarchy     EntityViewParameterType = "FullHierarchy"
	EntityViewParameterTypeGroupsOnly        EntityViewParameterType = "GroupsOnly"
	EntityViewParameterTypeSubscriptionsOnly EntityViewParameterType = "SubscriptionsOnly"
)

func PossibleEntityViewParameterTypeValues added in v0.4.0

func PossibleEntityViewParameterTypeValues() []EntityViewParameterType

PossibleEntityViewParameterTypeValues returns the possible values for the EntityViewParameterType const type.

type ErrorDetails

type ErrorDetails struct {
	// One of a server-defined set of error codes.
	Code *string

	// A human-readable representation of the error's details.
	Details *string

	// A human-readable representation of the error.
	Message *string
}

ErrorDetails - The details of the error.

func (ErrorDetails) MarshalJSON added in v1.1.0

func (e ErrorDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorDetails.

func (*ErrorDetails) UnmarshalJSON added in v1.1.0

func (e *ErrorDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetails.

type ErrorResponse

type ErrorResponse struct {
	// The details of the error.
	Error *ErrorDetails
}

ErrorResponse - The error object.

func (ErrorResponse) MarshalJSON added in v1.1.0

func (e ErrorResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v1.1.0

func (e *ErrorResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type HierarchySettings

type HierarchySettings struct {
	// The generic properties of hierarchy settings.
	Properties *HierarchySettingsProperties

	// READ-ONLY; The fully qualified ID for the settings object. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000/settings/default.
	ID *string

	// READ-ONLY; The name of the object. In this case, default.
	Name *string

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups/settings.
	Type *string
}

HierarchySettings - Settings defined at the Management Group scope.

func (HierarchySettings) MarshalJSON added in v1.1.0

func (h HierarchySettings) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type HierarchySettings.

func (*HierarchySettings) UnmarshalJSON added in v1.1.0

func (h *HierarchySettings) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type HierarchySettings.

type HierarchySettingsClient

type HierarchySettingsClient struct {
	// contains filtered or unexported fields
}

HierarchySettingsClient contains the methods for the HierarchySettings group. Don't use this type directly, use NewHierarchySettingsClient() instead.

func NewHierarchySettingsClient

func NewHierarchySettingsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*HierarchySettingsClient, error)

NewHierarchySettingsClient creates a new instance of HierarchySettingsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*HierarchySettingsClient) CreateOrUpdate

CreateOrUpdate - Creates or updates the hierarchy settings defined at the Management Group level. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-04-01

  • groupID - Management Group ID.
  • createTenantSettingsRequest - Tenant level settings request parameter.
  • options - HierarchySettingsClientCreateOrUpdateOptions contains the optional parameters for the HierarchySettingsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/PutHierarchySettings.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewHierarchySettingsClient().CreateOrUpdate(ctx, "root", armmanagementgroups.CreateOrUpdateSettingsRequest{
		Properties: &armmanagementgroups.CreateOrUpdateSettingsProperties{
			DefaultManagementGroup:               to.Ptr("/providers/Microsoft.Management/managementGroups/DefaultGroup"),
			RequireAuthorizationForGroupCreation: to.Ptr(true),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.HierarchySettings = armmanagementgroups.HierarchySettings{
	// 	Name: to.Ptr("root"),
	// 	Type: to.Ptr("Microsoft.Management/managementGroups/settings"),
	// 	ID: to.Ptr("/providers/Microsoft.Management/managementGroups/root/settings/default"),
	// 	Properties: &armmanagementgroups.HierarchySettingsProperties{
	// 		DefaultManagementGroup: to.Ptr("/providers/Microsoft.Management/managementGroups/DefaultGroup"),
	// 		RequireAuthorizationForGroupCreation: to.Ptr(true),
	// 		TenantID: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 	},
	// }
}
Output:

func (*HierarchySettingsClient) Delete

Delete - Deletes the hierarchy settings defined at the Management Group level. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-04-01

  • groupID - Management Group ID.
  • options - HierarchySettingsClientDeleteOptions contains the optional parameters for the HierarchySettingsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/DeleteHierarchySettings.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewHierarchySettingsClient().Delete(ctx, "root", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*HierarchySettingsClient) Get

Get - Gets the hierarchy settings defined at the Management Group level. Settings can only be set on the root Management Group of the hierarchy. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-04-01

  • groupID - Management Group ID.
  • options - HierarchySettingsClientGetOptions contains the optional parameters for the HierarchySettingsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/GetHierarchySettings.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewHierarchySettingsClient().Get(ctx, "root", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.HierarchySettings = armmanagementgroups.HierarchySettings{
	// 	Name: to.Ptr("root"),
	// 	Type: to.Ptr("Microsoft.Management/managementGroups/settings"),
	// 	ID: to.Ptr("/providers/Microsoft.Management/managementGroups/root/settings/default"),
	// 	Properties: &armmanagementgroups.HierarchySettingsProperties{
	// 		DefaultManagementGroup: to.Ptr("/providers/Microsoft.Management/managementGroups/DefaultGroup"),
	// 		RequireAuthorizationForGroupCreation: to.Ptr(true),
	// 		TenantID: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 	},
	// }
}
Output:

func (*HierarchySettingsClient) List

List - Gets all the hierarchy settings defined at the Management Group level. Settings can only be set on the root Management Group of the hierarchy. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-04-01

  • groupID - Management Group ID.
  • options - HierarchySettingsClientListOptions contains the optional parameters for the HierarchySettingsClient.List method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/ListHierarchySettings.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewHierarchySettingsClient().List(ctx, "root", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.HierarchySettingsList = armmanagementgroups.HierarchySettingsList{
	// 	Value: []*armmanagementgroups.HierarchySettingsInfo{
	// 		{
	// 			Name: to.Ptr("root"),
	// 			Type: to.Ptr("Microsoft.Management/managementGroups/settings"),
	// 			ID: to.Ptr("/providers/Microsoft.Management/managementGroups/root/settings/default"),
	// 			Properties: &armmanagementgroups.HierarchySettingsProperties{
	// 				DefaultManagementGroup: to.Ptr("/providers/Microsoft.Management/managementGroups/DefaultGroup"),
	// 				RequireAuthorizationForGroupCreation: to.Ptr(true),
	// 				TenantID: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 			},
	// 	}},
	// }
}
Output:

func (*HierarchySettingsClient) Update

Update - Updates the hierarchy settings defined at the Management Group level. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-04-01

  • groupID - Management Group ID.
  • createTenantSettingsRequest - Tenant level settings request parameter.
  • options - HierarchySettingsClientUpdateOptions contains the optional parameters for the HierarchySettingsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/PatchHierarchySettings.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewHierarchySettingsClient().Update(ctx, "root", armmanagementgroups.CreateOrUpdateSettingsRequest{
		Properties: &armmanagementgroups.CreateOrUpdateSettingsProperties{
			DefaultManagementGroup:               to.Ptr("/providers/Microsoft.Management/managementGroups/DefaultGroup"),
			RequireAuthorizationForGroupCreation: to.Ptr(true),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.HierarchySettings = armmanagementgroups.HierarchySettings{
	// 	Name: to.Ptr("root"),
	// 	Type: to.Ptr("Microsoft.Management/managementGroups/settings"),
	// 	ID: to.Ptr("/providers/Microsoft.Management/managementGroups/root/settings/default"),
	// 	Properties: &armmanagementgroups.HierarchySettingsProperties{
	// 		DefaultManagementGroup: to.Ptr("/providers/Microsoft.Management/managementGroups/DefaultGroup"),
	// 		RequireAuthorizationForGroupCreation: to.Ptr(true),
	// 		TenantID: to.Ptr("20000000-0000-0000-0000-000000000000"),
	// 	},
	// }
}
Output:

type HierarchySettingsClientCreateOrUpdateOptions added in v0.3.0

type HierarchySettingsClientCreateOrUpdateOptions struct {
}

HierarchySettingsClientCreateOrUpdateOptions contains the optional parameters for the HierarchySettingsClient.CreateOrUpdate method.

type HierarchySettingsClientCreateOrUpdateResponse added in v0.3.0

type HierarchySettingsClientCreateOrUpdateResponse struct {
	// Settings defined at the Management Group scope.
	HierarchySettings
}

HierarchySettingsClientCreateOrUpdateResponse contains the response from method HierarchySettingsClient.CreateOrUpdate.

type HierarchySettingsClientDeleteOptions added in v0.3.0

type HierarchySettingsClientDeleteOptions struct {
}

HierarchySettingsClientDeleteOptions contains the optional parameters for the HierarchySettingsClient.Delete method.

type HierarchySettingsClientDeleteResponse added in v0.3.0

type HierarchySettingsClientDeleteResponse struct {
}

HierarchySettingsClientDeleteResponse contains the response from method HierarchySettingsClient.Delete.

type HierarchySettingsClientGetOptions added in v0.3.0

type HierarchySettingsClientGetOptions struct {
}

HierarchySettingsClientGetOptions contains the optional parameters for the HierarchySettingsClient.Get method.

type HierarchySettingsClientGetResponse added in v0.3.0

type HierarchySettingsClientGetResponse struct {
	// Settings defined at the Management Group scope.
	HierarchySettings
}

HierarchySettingsClientGetResponse contains the response from method HierarchySettingsClient.Get.

type HierarchySettingsClientListOptions added in v0.3.0

type HierarchySettingsClientListOptions struct {
}

HierarchySettingsClientListOptions contains the optional parameters for the HierarchySettingsClient.List method.

type HierarchySettingsClientListResponse added in v0.3.0

type HierarchySettingsClientListResponse struct {
	// Lists all hierarchy settings.
	HierarchySettingsList
}

HierarchySettingsClientListResponse contains the response from method HierarchySettingsClient.List.

type HierarchySettingsClientUpdateOptions added in v0.3.0

type HierarchySettingsClientUpdateOptions struct {
}

HierarchySettingsClientUpdateOptions contains the optional parameters for the HierarchySettingsClient.Update method.

type HierarchySettingsClientUpdateResponse added in v0.3.0

type HierarchySettingsClientUpdateResponse struct {
	// Settings defined at the Management Group scope.
	HierarchySettings
}

HierarchySettingsClientUpdateResponse contains the response from method HierarchySettingsClient.Update.

type HierarchySettingsInfo

type HierarchySettingsInfo struct {
	// The generic properties of hierarchy settings.
	Properties *HierarchySettingsProperties

	// READ-ONLY; The fully qualified ID for the settings object. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000/settings/default.
	ID *string

	// READ-ONLY; The name of the object. In this case, default.
	Name *string

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups/settings.
	Type *string
}

HierarchySettingsInfo - The hierarchy settings resource.

func (HierarchySettingsInfo) MarshalJSON added in v1.1.0

func (h HierarchySettingsInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type HierarchySettingsInfo.

func (*HierarchySettingsInfo) UnmarshalJSON added in v1.1.0

func (h *HierarchySettingsInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type HierarchySettingsInfo.

type HierarchySettingsList

type HierarchySettingsList struct {
	// The list of hierarchy settings.
	Value []*HierarchySettingsInfo

	// READ-ONLY; The URL to use for getting the next set of results.
	NextLink *string
}

HierarchySettingsList - Lists all hierarchy settings.

func (HierarchySettingsList) MarshalJSON

func (h HierarchySettingsList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type HierarchySettingsList.

func (*HierarchySettingsList) UnmarshalJSON added in v1.1.0

func (h *HierarchySettingsList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type HierarchySettingsList.

type HierarchySettingsProperties

type HierarchySettingsProperties struct {
	// Settings that sets the default Management Group under which new subscriptions get added in this tenant. For example, /providers/Microsoft.Management/managementGroups/defaultGroup
	DefaultManagementGroup *string

	// Indicates whether RBAC access is required upon group creation under the root Management Group. If set to true, user will
	// require Microsoft.Management/managementGroups/write action on the root
	// Management Group scope in order to create new Groups directly under the root. This will prevent new users from creating
	// new Management Groups, unless they are given access.
	RequireAuthorizationForGroupCreation *bool

	// The AAD Tenant ID associated with the hierarchy settings. For example, 00000000-0000-0000-0000-000000000000
	TenantID *string
}

HierarchySettingsProperties - The generic properties of hierarchy settings.

func (HierarchySettingsProperties) MarshalJSON added in v1.1.0

func (h HierarchySettingsProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type HierarchySettingsProperties.

func (*HierarchySettingsProperties) UnmarshalJSON added in v1.1.0

func (h *HierarchySettingsProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type HierarchySettingsProperties.

type ListSubscriptionUnderManagementGroup

type ListSubscriptionUnderManagementGroup struct {
	// The list of subscriptions.
	Value []*SubscriptionUnderManagementGroup

	// READ-ONLY; The URL to use for getting the next set of results.
	NextLink *string
}

ListSubscriptionUnderManagementGroup - The details of all subscriptions under management group.

func (ListSubscriptionUnderManagementGroup) MarshalJSON

func (l ListSubscriptionUnderManagementGroup) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ListSubscriptionUnderManagementGroup.

func (*ListSubscriptionUnderManagementGroup) UnmarshalJSON added in v1.1.0

func (l *ListSubscriptionUnderManagementGroup) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ListSubscriptionUnderManagementGroup.

type ManagementGroup

type ManagementGroup struct {
	// The generic properties of a management group.
	Properties *ManagementGroupProperties

	// READ-ONLY; The fully qualified ID for the management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string

	// READ-ONLY; The name of the management group. For example, 00000000-0000-0000-0000-000000000000
	Name *string

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups
	Type *string
}

ManagementGroup - The management group details.

func (ManagementGroup) MarshalJSON added in v1.1.0

func (m ManagementGroup) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagementGroup.

func (*ManagementGroup) UnmarshalJSON added in v1.1.0

func (m *ManagementGroup) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagementGroup.

type ManagementGroupChildInfo

type ManagementGroupChildInfo struct {
	// The list of children.
	Children []*ManagementGroupChildInfo

	// The friendly name of the child resource.
	DisplayName *string

	// The fully qualified ID for the child resource (management group or subscription). For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string

	// The name of the child entity.
	Name *string

	// The fully qualified resource type which includes provider namespace (e.g. Microsoft.Management/managementGroups)
	Type *ManagementGroupChildType
}

ManagementGroupChildInfo - The child information of a management group.

func (ManagementGroupChildInfo) MarshalJSON

func (m ManagementGroupChildInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagementGroupChildInfo.

func (*ManagementGroupChildInfo) UnmarshalJSON added in v1.1.0

func (m *ManagementGroupChildInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagementGroupChildInfo.

type ManagementGroupChildType

type ManagementGroupChildType string

ManagementGroupChildType - The type of child resource.

const (
	ManagementGroupChildTypeMicrosoftManagementManagementGroups ManagementGroupChildType = "Microsoft.Management/managementGroups"
	ManagementGroupChildTypeSubscriptions                       ManagementGroupChildType = "/subscriptions"
)

func PossibleManagementGroupChildTypeValues

func PossibleManagementGroupChildTypeValues() []ManagementGroupChildType

PossibleManagementGroupChildTypeValues returns the possible values for the ManagementGroupChildType const type.

type ManagementGroupDetails

type ManagementGroupDetails struct {
	// The ancestors of the management group.
	ManagementGroupAncestors []*string

	// The ancestors of the management group displayed in reversed order, from immediate parent to the root.
	ManagementGroupAncestorsChain []*ManagementGroupPathElement

	// (Optional) The ID of the parent management group.
	Parent *ParentGroupInfo

	// The path from the root to the current group.
	Path []*ManagementGroupPathElement

	// The identity of the principal or process that updated the object.
	UpdatedBy *string

	// The date and time when this object was last updated.
	UpdatedTime *time.Time

	// The version number of the object.
	Version *int32
}

ManagementGroupDetails - The details of a management group.

func (ManagementGroupDetails) MarshalJSON

func (m ManagementGroupDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagementGroupDetails.

func (*ManagementGroupDetails) UnmarshalJSON

func (m *ManagementGroupDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagementGroupDetails.

type ManagementGroupExpandType added in v0.4.0

type ManagementGroupExpandType string
const (
	ManagementGroupExpandTypeAncestors ManagementGroupExpandType = "ancestors"
	ManagementGroupExpandTypeChildren  ManagementGroupExpandType = "children"
	ManagementGroupExpandTypePath      ManagementGroupExpandType = "path"
)

func PossibleManagementGroupExpandTypeValues added in v0.4.0

func PossibleManagementGroupExpandTypeValues() []ManagementGroupExpandType

PossibleManagementGroupExpandTypeValues returns the possible values for the ManagementGroupExpandType const type.

type ManagementGroupInfo

type ManagementGroupInfo struct {
	// The generic properties of a management group.
	Properties *ManagementGroupInfoProperties

	// READ-ONLY; The fully qualified ID for the management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string

	// READ-ONLY; The name of the management group. For example, 00000000-0000-0000-0000-000000000000
	Name *string

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups
	Type *string
}

ManagementGroupInfo - The management group resource.

func (ManagementGroupInfo) MarshalJSON added in v1.1.0

func (m ManagementGroupInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagementGroupInfo.

func (*ManagementGroupInfo) UnmarshalJSON added in v1.1.0

func (m *ManagementGroupInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagementGroupInfo.

type ManagementGroupInfoProperties

type ManagementGroupInfoProperties struct {
	// The friendly name of the management group.
	DisplayName *string

	// The AAD Tenant ID associated with the management group. For example, 00000000-0000-0000-0000-000000000000
	TenantID *string
}

ManagementGroupInfoProperties - The generic properties of a management group.

func (ManagementGroupInfoProperties) MarshalJSON added in v1.1.0

func (m ManagementGroupInfoProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagementGroupInfoProperties.

func (*ManagementGroupInfoProperties) UnmarshalJSON added in v1.1.0

func (m *ManagementGroupInfoProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagementGroupInfoProperties.

type ManagementGroupListResult

type ManagementGroupListResult struct {
	// The list of management groups.
	Value []*ManagementGroupInfo

	// READ-ONLY; The URL to use for getting the next set of results.
	NextLink *string
}

ManagementGroupListResult - Describes the result of the request to list management groups.

func (ManagementGroupListResult) MarshalJSON

func (m ManagementGroupListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagementGroupListResult.

func (*ManagementGroupListResult) UnmarshalJSON added in v1.1.0

func (m *ManagementGroupListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagementGroupListResult.

type ManagementGroupPathElement

type ManagementGroupPathElement struct {
	// The friendly name of the group.
	DisplayName *string

	// The name of the group.
	Name *string
}

ManagementGroupPathElement - A path element of a management group ancestors.

func (ManagementGroupPathElement) MarshalJSON added in v1.1.0

func (m ManagementGroupPathElement) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagementGroupPathElement.

func (*ManagementGroupPathElement) UnmarshalJSON added in v1.1.0

func (m *ManagementGroupPathElement) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagementGroupPathElement.

type ManagementGroupProperties

type ManagementGroupProperties struct {
	// The list of children.
	Children []*ManagementGroupChildInfo

	// The details of a management group.
	Details *ManagementGroupDetails

	// The friendly name of the management group.
	DisplayName *string

	// The AAD Tenant ID associated with the management group. For example, 00000000-0000-0000-0000-000000000000
	TenantID *string
}

ManagementGroupProperties - The generic properties of a management group.

func (ManagementGroupProperties) MarshalJSON

func (m ManagementGroupProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagementGroupProperties.

func (*ManagementGroupProperties) UnmarshalJSON added in v1.1.0

func (m *ManagementGroupProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagementGroupProperties.

type ManagementGroupSubscriptionsClient

type ManagementGroupSubscriptionsClient struct {
	// contains filtered or unexported fields
}

ManagementGroupSubscriptionsClient contains the methods for the ManagementGroupSubscriptions group. Don't use this type directly, use NewManagementGroupSubscriptionsClient() instead.

func NewManagementGroupSubscriptionsClient

func NewManagementGroupSubscriptionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementGroupSubscriptionsClient, error)

NewManagementGroupSubscriptionsClient creates a new instance of ManagementGroupSubscriptionsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ManagementGroupSubscriptionsClient) Create

Create - Associates existing subscription with the management group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-04-01

  • groupID - Management Group ID.
  • subscriptionID - Subscription ID.
  • options - ManagementGroupSubscriptionsClientCreateOptions contains the optional parameters for the ManagementGroupSubscriptionsClient.Create method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/AddManagementGroupSubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagementGroupSubscriptionsClient().Create(ctx, "Group", "728bcbe4-8d56-4510-86c2-4921b8beefbc", &armmanagementgroups.ManagementGroupSubscriptionsClientCreateOptions{CacheControl: to.Ptr("no-cache")})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.SubscriptionUnderManagementGroup = armmanagementgroups.SubscriptionUnderManagementGroup{
	// 	Name: to.Ptr("728bcbe4-8d56-4510-86c2-4921b8beefbc"),
	// 	Type: to.Ptr("Microsoft.Management/managementGroups/subscriptions"),
	// 	ID: to.Ptr(" /providers/Microsoft.Management/managementGroups/Group/subscriptions/728bcbe4-8d56-4510-86c2-4921b8beefbc"),
	// 	Properties: &armmanagementgroups.SubscriptionUnderManagementGroupProperties{
	// 		DisplayName: to.Ptr("Group"),
	// 		Parent: &armmanagementgroups.DescendantParentGroupInfo{
	// 			ID: to.Ptr("/providers/Microsoft.Management/managementGroups/Group"),
	// 		},
	// 		State: to.Ptr("Active"),
	// 		Tenant: to.Ptr("e751ac82-623b-4913-8d74-22637c832373"),
	// 	},
	// }
}
Output:

func (*ManagementGroupSubscriptionsClient) Delete

Delete - De-associates subscription from the management group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-04-01

  • groupID - Management Group ID.
  • subscriptionID - Subscription ID.
  • options - ManagementGroupSubscriptionsClientDeleteOptions contains the optional parameters for the ManagementGroupSubscriptionsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/RemoveManagementGroupSubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewManagementGroupSubscriptionsClient().Delete(ctx, "Group", "728bcbe4-8d56-4510-86c2-4921b8beefbc", &armmanagementgroups.ManagementGroupSubscriptionsClientDeleteOptions{CacheControl: to.Ptr("no-cache")})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ManagementGroupSubscriptionsClient) GetSubscription

GetSubscription - Retrieves details about given subscription which is associated with the management group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-04-01

  • groupID - Management Group ID.
  • subscriptionID - Subscription ID.
  • options - ManagementGroupSubscriptionsClientGetSubscriptionOptions contains the optional parameters for the ManagementGroupSubscriptionsClient.GetSubscription method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/GetSubscriptionFromManagementGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagementGroupSubscriptionsClient().GetSubscription(ctx, "Group", "728bcbe4-8d56-4510-86c2-4921b8beefbc", &armmanagementgroups.ManagementGroupSubscriptionsClientGetSubscriptionOptions{CacheControl: to.Ptr("no-cache")})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.SubscriptionUnderManagementGroup = armmanagementgroups.SubscriptionUnderManagementGroup{
	// 	Name: to.Ptr("728bcbe4-8d56-4510-86c2-4921b8beefbc"),
	// 	Type: to.Ptr("Microsoft.Management/managementGroups/subscriptions"),
	// 	ID: to.Ptr(" /providers/Microsoft.Management/managementGroups/Group/subscriptions/728bcbe4-8d56-4510-86c2-4921b8beefbc"),
	// 	Properties: &armmanagementgroups.SubscriptionUnderManagementGroupProperties{
	// 		DisplayName: to.Ptr("Group"),
	// 		Parent: &armmanagementgroups.DescendantParentGroupInfo{
	// 			ID: to.Ptr("/providers/Microsoft.Management/managementGroups/Group"),
	// 		},
	// 		State: to.Ptr("Active"),
	// 		Tenant: to.Ptr("e751ac82-623b-4913-8d74-22637c832373"),
	// 	},
	// }
}
Output:

func (*ManagementGroupSubscriptionsClient) NewGetSubscriptionsUnderManagementGroupPager added in v0.6.0

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

Generated from API version 2021-04-01

  • groupID - Management Group ID.
  • options - ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupOptions contains the optional parameters for the ManagementGroupSubscriptionsClient.NewGetSubscriptionsUnderManagementGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/GetAllSubscriptionsFromManagementGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewManagementGroupSubscriptionsClient().NewGetSubscriptionsUnderManagementGroupPager("Group", &armmanagementgroups.ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupOptions{Skiptoken: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ListSubscriptionUnderManagementGroup = armmanagementgroups.ListSubscriptionUnderManagementGroup{
		// 	Value: []*armmanagementgroups.SubscriptionUnderManagementGroup{
		// 		{
		// 			Name: to.Ptr("728bcbe4-8d56-4510-86c2-4921b8beefbc"),
		// 			Type: to.Ptr("Microsoft.Management/managementGroups/subscriptions"),
		// 			ID: to.Ptr("/providers/Microsoft.Management/managementGroups/Group/subscriptions/728bcbe4-8d56-4510-86c2-4921b8beefbc"),
		// 			Properties: &armmanagementgroups.SubscriptionUnderManagementGroupProperties{
		// 				DisplayName: to.Ptr("S5"),
		// 				Parent: &armmanagementgroups.DescendantParentGroupInfo{
		// 					ID: to.Ptr("/providers/Microsoft.Management/managementGroups/Group"),
		// 				},
		// 				State: to.Ptr("Active"),
		// 				Tenant: to.Ptr("e751ac82-623b-4913-8d74-22637c832373"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ManagementGroupSubscriptionsClientCreateOptions added in v0.3.0

type ManagementGroupSubscriptionsClientCreateOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *string
}

ManagementGroupSubscriptionsClientCreateOptions contains the optional parameters for the ManagementGroupSubscriptionsClient.Create method.

type ManagementGroupSubscriptionsClientCreateResponse added in v0.3.0

type ManagementGroupSubscriptionsClientCreateResponse struct {
	// The details of subscription under management group.
	SubscriptionUnderManagementGroup
}

ManagementGroupSubscriptionsClientCreateResponse contains the response from method ManagementGroupSubscriptionsClient.Create.

type ManagementGroupSubscriptionsClientDeleteOptions added in v0.3.0

type ManagementGroupSubscriptionsClientDeleteOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *string
}

ManagementGroupSubscriptionsClientDeleteOptions contains the optional parameters for the ManagementGroupSubscriptionsClient.Delete method.

type ManagementGroupSubscriptionsClientDeleteResponse added in v0.3.0

type ManagementGroupSubscriptionsClientDeleteResponse struct {
}

ManagementGroupSubscriptionsClientDeleteResponse contains the response from method ManagementGroupSubscriptionsClient.Delete.

type ManagementGroupSubscriptionsClientGetSubscriptionOptions added in v0.3.0

type ManagementGroupSubscriptionsClientGetSubscriptionOptions struct {
	// Indicates whether the request should utilize any caches. Populate the header with 'no-cache' value to bypass existing caches.
	CacheControl *string
}

ManagementGroupSubscriptionsClientGetSubscriptionOptions contains the optional parameters for the ManagementGroupSubscriptionsClient.GetSubscription method.

type ManagementGroupSubscriptionsClientGetSubscriptionResponse added in v0.3.0

type ManagementGroupSubscriptionsClientGetSubscriptionResponse struct {
	// The details of subscription under management group.
	SubscriptionUnderManagementGroup
}

ManagementGroupSubscriptionsClientGetSubscriptionResponse contains the response from method ManagementGroupSubscriptionsClient.GetSubscription.

type ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupOptions added in v0.3.0

type ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupOptions struct {
	// 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.
	Skiptoken *string
}

ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupOptions contains the optional parameters for the ManagementGroupSubscriptionsClient.NewGetSubscriptionsUnderManagementGroupPager method.

type ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupResponse added in v0.3.0

type ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupResponse struct {
	// The details of all subscriptions under management group.
	ListSubscriptionUnderManagementGroup
}

ManagementGroupSubscriptionsClientGetSubscriptionsUnderManagementGroupResponse contains the response from method ManagementGroupSubscriptionsClient.NewGetSubscriptionsUnderManagementGroupPager.

type Operation

type Operation struct {
	// The object that represents the operation.
	Display *OperationDisplayProperties

	// READ-ONLY; Operation name: {provider}/{resource}/{operation}.
	Name *string
}

Operation supported by the Microsoft.Management resource provider.

func (Operation) MarshalJSON added in v1.1.0

func (o Operation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v1.1.0

func (o *Operation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplayProperties

type OperationDisplayProperties struct {
	// READ-ONLY; Operation description.
	Description *string

	// READ-ONLY; The operation that can be performed.
	Operation *string

	// READ-ONLY; The name of the provider.
	Provider *string

	// READ-ONLY; The resource on which the operation is performed.
	Resource *string
}

OperationDisplayProperties - The object that represents the operation.

func (OperationDisplayProperties) MarshalJSON added in v1.1.0

func (o OperationDisplayProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationDisplayProperties.

func (*OperationDisplayProperties) UnmarshalJSON added in v1.1.0

func (o *OperationDisplayProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplayProperties.

type OperationListResult

type OperationListResult struct {
	// READ-ONLY; URL to get the next set of operation list results if there are any.
	NextLink *string

	// READ-ONLY; List of operations supported by the Microsoft.Management resource provider.
	Value []*Operation
}

OperationListResult - Describes the result of the request to list Microsoft.Management operations.

func (OperationListResult) MarshalJSON

func (o OperationListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON added in v1.1.0

func (o *OperationListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationResults

type OperationResults struct {
	// The generic properties of a management group.
	Properties *ManagementGroupInfoProperties

	// READ-ONLY; The fully qualified ID for the management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string

	// READ-ONLY; The name of the management group. For example, 00000000-0000-0000-0000-000000000000
	Name *string

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups
	Type *string
}

OperationResults - The results of an asynchronous operation.

func (OperationResults) MarshalJSON added in v1.1.0

func (o OperationResults) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationResults.

func (*OperationResults) UnmarshalJSON added in v1.1.0

func (o *OperationResults) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationResults.

type OperationsClient

type OperationsClient struct {
	// contains filtered or unexported fields
}

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationsClient) NewListPager added in v0.6.0

NewListPager - Lists all of the available Management REST API operations.

Generated from API version 2021-04-01

  • options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/examples/ListOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmanagementgroups.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationsClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.OperationListResult = armmanagementgroups.OperationListResult{
		// 	Value: []*armmanagementgroups.Operation{
		// 		{
		// 			Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"),
		// 			Display: &armmanagementgroups.OperationDisplayProperties{
		// 				Description: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"),
		// 				Operation: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"),
		// 				Provider: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"),
		// 				Resource: to.Ptr("aaaaaaaaaaaaa"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type OperationsClientListOptions added in v0.3.0

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.

type OperationsClientListResponse added in v0.3.0

type OperationsClientListResponse struct {
	// Describes the result of the request to list Microsoft.Management operations.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type ParentGroupInfo

type ParentGroupInfo struct {
	// The friendly name of the parent management group.
	DisplayName *string

	// The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ID *string

	// The name of the parent management group
	Name *string
}

ParentGroupInfo - (Optional) The ID of the parent management group.

func (ParentGroupInfo) MarshalJSON added in v1.1.0

func (p ParentGroupInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ParentGroupInfo.

func (*ParentGroupInfo) UnmarshalJSON added in v1.1.0

func (p *ParentGroupInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ParentGroupInfo.

type PatchManagementGroupRequest

type PatchManagementGroupRequest struct {
	// The friendly name of the management group.
	DisplayName *string

	// (Optional) The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000
	ParentGroupID *string
}

PatchManagementGroupRequest - Management group patch parameters.

func (PatchManagementGroupRequest) MarshalJSON

func (p PatchManagementGroupRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PatchManagementGroupRequest.

func (*PatchManagementGroupRequest) UnmarshalJSON added in v1.1.0

func (p *PatchManagementGroupRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PatchManagementGroupRequest.

type Permissions

type Permissions string

Permissions - The users specific permissions to this item.

const (
	PermissionsDelete   Permissions = "delete"
	PermissionsEdit     Permissions = "edit"
	PermissionsNoaccess Permissions = "noaccess"
	PermissionsView     Permissions = "view"
)

func PossiblePermissionsValues

func PossiblePermissionsValues() []Permissions

PossiblePermissionsValues returns the possible values for the Permissions const type.

type Reason

type Reason string

Reason - Required if nameAvailable == false. Invalid indicates the name provided does not match the resource provider's naming requirements (incorrect length, unsupported characters, etc.) AlreadyExists indicates that the name is already in use and is therefore unavailable.

const (
	ReasonAlreadyExists Reason = "AlreadyExists"
	ReasonInvalid       Reason = "Invalid"
)

func PossibleReasonValues

func PossibleReasonValues() []Reason

PossibleReasonValues returns the possible values for the Reason const type.

type Status

type Status string

Status - The status of the Tenant Backfill

const (
	StatusCancelled                Status = "Cancelled"
	StatusCompleted                Status = "Completed"
	StatusFailed                   Status = "Failed"
	StatusNotStarted               Status = "NotStarted"
	StatusNotStartedButGroupsExist Status = "NotStartedButGroupsExist"
	StatusStarted                  Status = "Started"
)

func PossibleStatusValues

func PossibleStatusValues() []Status

PossibleStatusValues returns the possible values for the Status const type.

type SubscriptionUnderManagementGroup

type SubscriptionUnderManagementGroup struct {
	// The generic properties of subscription under a management group.
	Properties *SubscriptionUnderManagementGroupProperties

	// READ-ONLY; The fully qualified ID for the subscription. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000/subscriptions/0000000-0000-0000-0000-000000000001
	ID *string

	// READ-ONLY; The stringified id of the subscription. For example, 00000000-0000-0000-0000-000000000000
	Name *string

	// READ-ONLY; The type of the resource. For example, Microsoft.Management/managementGroups/subscriptions
	Type *string
}

SubscriptionUnderManagementGroup - The details of subscription under management group.

func (SubscriptionUnderManagementGroup) MarshalJSON added in v1.1.0

func (s SubscriptionUnderManagementGroup) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SubscriptionUnderManagementGroup.

func (*SubscriptionUnderManagementGroup) UnmarshalJSON added in v1.1.0

func (s *SubscriptionUnderManagementGroup) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionUnderManagementGroup.

type SubscriptionUnderManagementGroupProperties

type SubscriptionUnderManagementGroupProperties struct {
	// The friendly name of the subscription.
	DisplayName *string

	// The ID of the parent management group.
	Parent *DescendantParentGroupInfo

	// The state of the subscription.
	State *string

	// The AAD Tenant ID associated with the subscription. For example, 00000000-0000-0000-0000-000000000000
	Tenant *string
}

SubscriptionUnderManagementGroupProperties - The generic properties of subscription under a management group.

func (SubscriptionUnderManagementGroupProperties) MarshalJSON added in v1.1.0

MarshalJSON implements the json.Marshaller interface for type SubscriptionUnderManagementGroupProperties.

func (*SubscriptionUnderManagementGroupProperties) UnmarshalJSON added in v1.1.0

func (s *SubscriptionUnderManagementGroupProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionUnderManagementGroupProperties.

type TenantBackfillStatusResult

type TenantBackfillStatusResult struct {
	// READ-ONLY; The status of the Tenant Backfill
	Status *Status

	// READ-ONLY; The AAD Tenant ID associated with the management group. For example, 00000000-0000-0000-0000-000000000000
	TenantID *string
}

TenantBackfillStatusResult - The tenant backfill status

func (TenantBackfillStatusResult) MarshalJSON added in v1.1.0

func (t TenantBackfillStatusResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TenantBackfillStatusResult.

func (*TenantBackfillStatusResult) UnmarshalJSON added in v1.1.0

func (t *TenantBackfillStatusResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TenantBackfillStatusResult.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL