armprogramenrollment

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: MIT Imports: 14 Imported by: 0

README

Azure ProgramEnrollment Module for Go

The armprogramenrollment module provides operations for working with Azure ProgramEnrollment.

Source code

Getting started

Prerequisites

  • An Azure subscription
  • Supported version of Go (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 ProgramEnrollment module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/programenrollment/armprogramenrollment

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure ProgramEnrollment. 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 ProgramEnrollment 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 := armprogramenrollment.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 := armprogramenrollment.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.NewEduEnrollmentsClient()

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 ProgramEnrollment 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 ActionType

type ActionType string

ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.

const (
	// ActionTypeInternal - Actions are for internal-only APIs.
	ActionTypeInternal ActionType = "Internal"
)

func PossibleActionTypeValues

func PossibleActionTypeValues() []ActionType

PossibleActionTypeValues returns the possible values for the ActionType const type.

type ClientFactory

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

func NewClientFactory(subscriptionID string, 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.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewEduEnrollmentsClient

func (c *ClientFactory) NewEduEnrollmentsClient() *EduEnrollmentsClient

NewEduEnrollmentsClient creates a new instance of EduEnrollmentsClient.

func (*ClientFactory) NewOperationsClient

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

type CreatedByType

type CreatedByType string

CreatedByType - The kind of entity that created the resource.

const (
	// CreatedByTypeApplication - The entity was created by an application.
	CreatedByTypeApplication CreatedByType = "Application"
	// CreatedByTypeKey - The entity was created by a key.
	CreatedByTypeKey CreatedByType = "Key"
	// CreatedByTypeManagedIdentity - The entity was created by a managed identity.
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	// CreatedByTypeUser - The entity was created by a user.
	CreatedByTypeUser CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type DomainGroup

type DomainGroup struct {
	// REQUIRED; The edu domain names in this group.
	DomainNames []*string

	// The Entra tenant ID that owns these domains. Defaults to the caller's tenant if omitted.
	TenantID *string

	// READ-ONLY; Failure detail when state is Failed or ActionRequired. Omitted otherwise.
	FailureReason *ErrorDetail

	// READ-ONLY; The assessment state of this domain group.
	State *DomainGroupState
}

DomainGroup - A group of edu domains scoped to an Entra tenant.

func (DomainGroup) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type DomainGroup.

func (*DomainGroup) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type DomainGroup.

type DomainGroupState

type DomainGroupState string

DomainGroupState - The assessment state of a domain group.

const (
	// DomainGroupStateActionRequired - Action is required to complete assessment.
	DomainGroupStateActionRequired DomainGroupState = "ActionRequired"
	// DomainGroupStateFailed - Assessment failed.
	DomainGroupStateFailed DomainGroupState = "Failed"
	// DomainGroupStatePending - Assessment is pending.
	DomainGroupStatePending DomainGroupState = "Pending"
	// DomainGroupStateSucceeded - Assessment succeeded.
	DomainGroupStateSucceeded DomainGroupState = "Succeeded"
)

func PossibleDomainGroupStateValues

func PossibleDomainGroupStateValues() []DomainGroupState

PossibleDomainGroupStateValues returns the possible values for the DomainGroupState const type.

type EduEnrollment

type EduEnrollment struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string

	// The resource-specific properties for this resource.
	Properties *EduEnrollmentProperties

	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

EduEnrollment - An education program enrollment that groups Entra domains under a single sovereign/edu program scope.

func (EduEnrollment) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EduEnrollment.

func (*EduEnrollment) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type EduEnrollment.

type EduEnrollmentListResult

type EduEnrollmentListResult struct {
	// REQUIRED; The EduEnrollment items on this page
	Value []*EduEnrollment

	// The link to the next page of items
	NextLink *string
}

EduEnrollmentListResult - The response of a EduEnrollment list operation.

func (EduEnrollmentListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EduEnrollmentListResult.

func (*EduEnrollmentListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type EduEnrollmentListResult.

type EduEnrollmentPatch

type EduEnrollmentPatch struct {
	// Resource tags.
	Tags map[string]*string
}

EduEnrollmentPatch - The type used for update operations of the EduEnrollment.

func (EduEnrollmentPatch) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EduEnrollmentPatch.

func (*EduEnrollmentPatch) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type EduEnrollmentPatch.

type EduEnrollmentProperties

type EduEnrollmentProperties struct {
	// REQUIRED; The domain groups associated with this enrollment.
	Domains []*DomainGroup

	// READ-ONLY; Failure detail when provisioningState is Failed. Omitted otherwise.
	FailureReason *ErrorDetail

	// READ-ONLY; The status of the last operation.
	ProvisioningState *ProvisioningState
}

EduEnrollmentProperties - Details of the Program EduEnrollment.

func (EduEnrollmentProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EduEnrollmentProperties.

func (*EduEnrollmentProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type EduEnrollmentProperties.

type EduEnrollmentsClient

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

EduEnrollmentsClient contains the methods for the EduEnrollments group. Don't use this type directly, use NewEduEnrollmentsClient() instead.

Generated from API version 2026-03-01-preview

func NewEduEnrollmentsClient

func NewEduEnrollmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EduEnrollmentsClient, error)

NewEduEnrollmentsClient creates a new instance of EduEnrollmentsClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - Contains optional client configuration. Pass nil to accept the default values.

func (*EduEnrollmentsClient) BeginCreateOrUpdate

func (client *EduEnrollmentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, enrollmentName string, resource EduEnrollment, options *EduEnrollmentsClientBeginCreateOrUpdateOptions) (*runtime.Poller[EduEnrollmentsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates the specified edu enrollment. If the operation fails it returns an *azcore.ResponseError type.

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • enrollmentName - The name of the edu enrollment
  • resource - Resource create parameters.
  • options - EduEnrollmentsClientBeginCreateOrUpdateOptions contains the optional parameters for the EduEnrollmentsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: 2026-03-01-preview/EduEnrollments_CreateOrUpdate.json

package main

import (
	"context"
	"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/programenrollment/armprogramenrollment"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprogramenrollment.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewEduEnrollmentsClient().BeginCreateOrUpdate(ctx, "testrg", "default", armprogramenrollment.EduEnrollment{
		Location: to.Ptr("eastus"),
		Properties: &armprogramenrollment.EduEnrollmentProperties{
			Domains: []*armprogramenrollment.DomainGroup{
				{
					DomainNames: []*string{
						to.Ptr("university.edu"),
						to.Ptr("college.edu"),
					},
					TenantID: to.Ptr("00000000-0000-0000-0000-000000000001"),
				},
			},
		},
	}, nil)
	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 poll 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 = armprogramenrollment.EduEnrollmentsClientCreateOrUpdateResponse{
	// 	EduEnrollment: armprogramenrollment.EduEnrollment{
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.ProgramEnrollment/eduEnrollments/default"),
	// 		Name: to.Ptr("default"),
	// 		Type: to.Ptr("Microsoft.ProgramEnrollment/eduEnrollments"),
	// 		Location: to.Ptr("eastus"),
	// 		Properties: &armprogramenrollment.EduEnrollmentProperties{
	// 			ProvisioningState: to.Ptr(armprogramenrollment.ProvisioningStateSucceeded),
	// 			Domains: []*armprogramenrollment.DomainGroup{
	// 				{
	// 					DomainNames: []*string{
	// 						to.Ptr("university.edu"),
	// 						to.Ptr("college.edu"),
	// 					},
	// 					TenantID: to.Ptr("00000000-0000-0000-0000-000000000001"),
	// 					State: to.Ptr(armprogramenrollment.DomainGroupStateSucceeded),
	// 				},
	// 			},
	// 		},
	// 		SystemData: &armprogramenrollment.SystemData{
	// 			CreatedBy: to.Ptr("user@example.com"),
	// 			CreatedByType: to.Ptr(armprogramenrollment.CreatedByTypeUser),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("user@example.com"),
	// 			LastModifiedByType: to.Ptr(armprogramenrollment.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
	// 		},
	// 	},
	// }
}

func (*EduEnrollmentsClient) BeginDelete

func (client *EduEnrollmentsClient) BeginDelete(ctx context.Context, resourceGroupName string, enrollmentName string, options *EduEnrollmentsClientBeginDeleteOptions) (*runtime.Poller[EduEnrollmentsClientDeleteResponse], error)

BeginDelete - Deletes the specified edu enrollment. If the operation fails it returns an *azcore.ResponseError type.

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • enrollmentName - The name of the edu enrollment
  • options - EduEnrollmentsClientBeginDeleteOptions contains the optional parameters for the EduEnrollmentsClient.BeginDelete method.
Example

Generated from example definition: 2026-03-01-preview/EduEnrollments_Delete.json

package main

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/programenrollment/armprogramenrollment"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprogramenrollment.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewEduEnrollmentsClient().BeginDelete(ctx, "testrg", "default", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to poll the result: %v", err)
	}
}

func (*EduEnrollmentsClient) Get

func (client *EduEnrollmentsClient) Get(ctx context.Context, resourceGroupName string, enrollmentName string, options *EduEnrollmentsClientGetOptions) (EduEnrollmentsClientGetResponse, error)

Get - Gets the specified edu enrollment. If the operation fails it returns an *azcore.ResponseError type.

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • enrollmentName - The name of the edu enrollment
  • options - EduEnrollmentsClientGetOptions contains the optional parameters for the EduEnrollmentsClient.Get method.
Example

Generated from example definition: 2026-03-01-preview/EduEnrollments_Get.json

package main

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/programenrollment/armprogramenrollment"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprogramenrollment.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewEduEnrollmentsClient().Get(ctx, "testrg", "default", 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 = armprogramenrollment.EduEnrollmentsClientGetResponse{
	// 	EduEnrollment: armprogramenrollment.EduEnrollment{
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.ProgramEnrollment/eduEnrollments/default"),
	// 		Name: to.Ptr("default"),
	// 		Type: to.Ptr("Microsoft.ProgramEnrollment/eduEnrollments"),
	// 		Location: to.Ptr("eastus"),
	// 		Properties: &armprogramenrollment.EduEnrollmentProperties{
	// 			ProvisioningState: to.Ptr(armprogramenrollment.ProvisioningStateSucceeded),
	// 			Domains: []*armprogramenrollment.DomainGroup{
	// 				{
	// 					DomainNames: []*string{
	// 						to.Ptr("university.edu"),
	// 						to.Ptr("college.edu"),
	// 					},
	// 					TenantID: to.Ptr("00000000-0000-0000-0000-000000000001"),
	// 					State: to.Ptr(armprogramenrollment.DomainGroupStateSucceeded),
	// 				},
	// 			},
	// 		},
	// 		SystemData: &armprogramenrollment.SystemData{
	// 			CreatedBy: to.Ptr("user@example.com"),
	// 			CreatedByType: to.Ptr(armprogramenrollment.CreatedByTypeUser),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("user@example.com"),
	// 			LastModifiedByType: to.Ptr(armprogramenrollment.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
	// 		},
	// 	},
	// }
}

func (*EduEnrollmentsClient) NewListByResourceGroupPager

NewListByResourceGroupPager - Lists the edu enrollments in a resource group.

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - EduEnrollmentsClientListByResourceGroupOptions contains the optional parameters for the EduEnrollmentsClient.NewListByResourceGroupPager method.
Example

Generated from example definition: 2026-03-01-preview/EduEnrollments_ListByResourceGroup.json

package main

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/programenrollment/armprogramenrollment"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprogramenrollment.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewEduEnrollmentsClient().NewListByResourceGroupPager("testrg", 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 = armprogramenrollment.EduEnrollmentsClientListByResourceGroupResponse{
		// 	EduEnrollmentListResult: armprogramenrollment.EduEnrollmentListResult{
		// 		Value: []*armprogramenrollment.EduEnrollment{
		// 			{
		// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.ProgramEnrollment/eduEnrollments/default"),
		// 				Name: to.Ptr("default"),
		// 				Type: to.Ptr("Microsoft.ProgramEnrollment/eduEnrollments"),
		// 				Location: to.Ptr("eastus"),
		// 				Properties: &armprogramenrollment.EduEnrollmentProperties{
		// 					ProvisioningState: to.Ptr(armprogramenrollment.ProvisioningStateSucceeded),
		// 					Domains: []*armprogramenrollment.DomainGroup{
		// 						{
		// 							DomainNames: []*string{
		// 								to.Ptr("university.edu"),
		// 								to.Ptr("college.edu"),
		// 							},
		// 							TenantID: to.Ptr("00000000-0000-0000-0000-000000000001"),
		// 							State: to.Ptr(armprogramenrollment.DomainGroupStateSucceeded),
		// 						},
		// 					},
		// 				},
		// 				SystemData: &armprogramenrollment.SystemData{
		// 					CreatedBy: to.Ptr("user@example.com"),
		// 					CreatedByType: to.Ptr(armprogramenrollment.CreatedByTypeUser),
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("user@example.com"),
		// 					LastModifiedByType: to.Ptr(armprogramenrollment.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

func (*EduEnrollmentsClient) NewListBySubscriptionPager

NewListBySubscriptionPager - Lists the edu enrollments in a subscription.

  • options - EduEnrollmentsClientListBySubscriptionOptions contains the optional parameters for the EduEnrollmentsClient.NewListBySubscriptionPager method.
Example

Generated from example definition: 2026-03-01-preview/EduEnrollments_ListBySubscription.json

package main

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/programenrollment/armprogramenrollment"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprogramenrollment.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewEduEnrollmentsClient().NewListBySubscriptionPager(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 = armprogramenrollment.EduEnrollmentsClientListBySubscriptionResponse{
		// 	EduEnrollmentListResult: armprogramenrollment.EduEnrollmentListResult{
		// 		Value: []*armprogramenrollment.EduEnrollment{
		// 			{
		// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.ProgramEnrollment/eduEnrollments/default"),
		// 				Name: to.Ptr("default"),
		// 				Type: to.Ptr("Microsoft.ProgramEnrollment/eduEnrollments"),
		// 				Location: to.Ptr("eastus"),
		// 				Properties: &armprogramenrollment.EduEnrollmentProperties{
		// 					ProvisioningState: to.Ptr(armprogramenrollment.ProvisioningStateSucceeded),
		// 					Domains: []*armprogramenrollment.DomainGroup{
		// 						{
		// 							DomainNames: []*string{
		// 								to.Ptr("university.edu"),
		// 								to.Ptr("college.edu"),
		// 							},
		// 							TenantID: to.Ptr("00000000-0000-0000-0000-000000000001"),
		// 							State: to.Ptr(armprogramenrollment.DomainGroupStateSucceeded),
		// 						},
		// 					},
		// 				},
		// 				SystemData: &armprogramenrollment.SystemData{
		// 					CreatedBy: to.Ptr("user@example.com"),
		// 					CreatedByType: to.Ptr(armprogramenrollment.CreatedByTypeUser),
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("user@example.com"),
		// 					LastModifiedByType: to.Ptr(armprogramenrollment.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

func (*EduEnrollmentsClient) Update

func (client *EduEnrollmentsClient) Update(ctx context.Context, resourceGroupName string, enrollmentName string, properties EduEnrollmentPatch, options *EduEnrollmentsClientUpdateOptions) (EduEnrollmentsClientUpdateResponse, error)

Update - Updates the specified edu enrollment. If the operation fails it returns an *azcore.ResponseError type.

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • enrollmentName - The name of the edu enrollment
  • properties - The resource properties to be updated.
  • options - EduEnrollmentsClientUpdateOptions contains the optional parameters for the EduEnrollmentsClient.Update method.
Example

Generated from example definition: 2026-03-01-preview/EduEnrollments_Update.json

package main

import (
	"context"
	"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/programenrollment/armprogramenrollment"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprogramenrollment.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewEduEnrollmentsClient().Update(ctx, "testrg", "default", armprogramenrollment.EduEnrollmentPatch{
		Tags: map[string]*string{
			"env": to.Ptr("test"),
		},
	}, 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 = armprogramenrollment.EduEnrollmentsClientUpdateResponse{
	// 	EduEnrollment: armprogramenrollment.EduEnrollment{
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.ProgramEnrollment/eduEnrollments/default"),
	// 		Name: to.Ptr("default"),
	// 		Type: to.Ptr("Microsoft.ProgramEnrollment/eduEnrollments"),
	// 		Location: to.Ptr("eastus"),
	// 		Tags: map[string]*string{
	// 			"env": to.Ptr("test"),
	// 		},
	// 		Properties: &armprogramenrollment.EduEnrollmentProperties{
	// 			ProvisioningState: to.Ptr(armprogramenrollment.ProvisioningStateSucceeded),
	// 			Domains: []*armprogramenrollment.DomainGroup{
	// 				{
	// 					DomainNames: []*string{
	// 						to.Ptr("university.edu"),
	// 						to.Ptr("college.edu"),
	// 					},
	// 					TenantID: to.Ptr("00000000-0000-0000-0000-000000000001"),
	// 					State: to.Ptr(armprogramenrollment.DomainGroupStateSucceeded),
	// 				},
	// 			},
	// 		},
	// 		SystemData: &armprogramenrollment.SystemData{
	// 			CreatedBy: to.Ptr("user@example.com"),
	// 			CreatedByType: to.Ptr(armprogramenrollment.CreatedByTypeUser),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("user@example.com"),
	// 			LastModifiedByType: to.Ptr(armprogramenrollment.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-02T00:00:00.000Z"); return t}()),
	// 		},
	// 	},
	// }
}

type EduEnrollmentsClientBeginCreateOrUpdateOptions

type EduEnrollmentsClientBeginCreateOrUpdateOptions struct {
	// Resumes the long-running operation from the provided token.
	ResumeToken string
}

EduEnrollmentsClientBeginCreateOrUpdateOptions contains the optional parameters for the EduEnrollmentsClient.BeginCreateOrUpdate method.

type EduEnrollmentsClientBeginDeleteOptions

type EduEnrollmentsClientBeginDeleteOptions struct {
	// Resumes the long-running operation from the provided token.
	ResumeToken string
}

EduEnrollmentsClientBeginDeleteOptions contains the optional parameters for the EduEnrollmentsClient.BeginDelete method.

type EduEnrollmentsClientCreateOrUpdateResponse

type EduEnrollmentsClientCreateOrUpdateResponse struct {
	// An education program enrollment that groups Entra domains under a single sovereign/edu program scope.
	EduEnrollment
}

EduEnrollmentsClientCreateOrUpdateResponse contains the response from method EduEnrollmentsClient.BeginCreateOrUpdate.

type EduEnrollmentsClientDeleteResponse

type EduEnrollmentsClientDeleteResponse struct {
}

EduEnrollmentsClientDeleteResponse contains the response from method EduEnrollmentsClient.BeginDelete.

type EduEnrollmentsClientGetOptions

type EduEnrollmentsClientGetOptions struct {
}

EduEnrollmentsClientGetOptions contains the optional parameters for the EduEnrollmentsClient.Get method.

type EduEnrollmentsClientGetResponse

type EduEnrollmentsClientGetResponse struct {
	// An education program enrollment that groups Entra domains under a single sovereign/edu program scope.
	EduEnrollment
}

EduEnrollmentsClientGetResponse contains the response from method EduEnrollmentsClient.Get.

type EduEnrollmentsClientListByResourceGroupOptions

type EduEnrollmentsClientListByResourceGroupOptions struct {
}

EduEnrollmentsClientListByResourceGroupOptions contains the optional parameters for the EduEnrollmentsClient.NewListByResourceGroupPager method.

type EduEnrollmentsClientListByResourceGroupResponse

type EduEnrollmentsClientListByResourceGroupResponse struct {
	// The response of a EduEnrollment list operation.
	EduEnrollmentListResult
}

EduEnrollmentsClientListByResourceGroupResponse contains the response from method EduEnrollmentsClient.NewListByResourceGroupPager.

type EduEnrollmentsClientListBySubscriptionOptions

type EduEnrollmentsClientListBySubscriptionOptions struct {
}

EduEnrollmentsClientListBySubscriptionOptions contains the optional parameters for the EduEnrollmentsClient.NewListBySubscriptionPager method.

type EduEnrollmentsClientListBySubscriptionResponse

type EduEnrollmentsClientListBySubscriptionResponse struct {
	// The response of a EduEnrollment list operation.
	EduEnrollmentListResult
}

EduEnrollmentsClientListBySubscriptionResponse contains the response from method EduEnrollmentsClient.NewListBySubscriptionPager.

type EduEnrollmentsClientUpdateOptions

type EduEnrollmentsClientUpdateOptions struct {
}

EduEnrollmentsClientUpdateOptions contains the optional parameters for the EduEnrollmentsClient.Update method.

type EduEnrollmentsClientUpdateResponse

type EduEnrollmentsClientUpdateResponse struct {
	// An education program enrollment that groups Entra domains under a single sovereign/edu program scope.
	EduEnrollment
}

EduEnrollmentsClientUpdateResponse contains the response from method EduEnrollmentsClient.Update.

type ErrorAdditionalInfo

type ErrorAdditionalInfo struct {
	// READ-ONLY; The additional info.
	Info any

	// READ-ONLY; The additional info type.
	Type *string
}

ErrorAdditionalInfo - The resource management error additional info.

func (ErrorAdditionalInfo) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.

func (*ErrorAdditionalInfo) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.

type ErrorDetail

type ErrorDetail struct {
	// READ-ONLY; The error additional info.
	AdditionalInfo []*ErrorAdditionalInfo

	// READ-ONLY; The error code.
	Code *string

	// READ-ONLY; The error details.
	Details []*ErrorDetail

	// READ-ONLY; The error message.
	Message *string

	// READ-ONLY; The error target.
	Target *string
}

ErrorDetail - The error detail.

func (ErrorDetail) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorDetail.

func (*ErrorDetail) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail.

type Operation

type Operation struct {
	// Localized display information for this particular operation.
	Display *OperationDisplay

	// READ-ONLY; Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
	ActionType *ActionType

	// READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure
	// Resource Manager/control-plane operations.
	IsDataAction *bool

	// READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write",
	// "Microsoft.Compute/virtualMachines/capture/action"
	Name *string

	// READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
	// value is "user,system"
	Origin *Origin
}

Operation - REST API Operation

Details of a REST API operation, returned from the Resource Provider Operations API

func (Operation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views.
	Description *string

	// READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual
	// Machine", "Restart Virtual Machine".
	Operation *string

	// READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft
	// Compute".
	Provider *string

	// READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job
	// Schedule Collections".
	Resource *string
}

OperationDisplay - Localized display information for an operation.

func (OperationDisplay) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

type OperationListResult struct {
	// REQUIRED; The Operation items on this page
	Value []*Operation

	// The link to the next page of items
	NextLink *string
}

OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.

func (OperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

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.

Generated from API version 2026-03-01-preview

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 - Contains optional client configuration. Pass nil to accept the default values.

func (*OperationsClient) NewListPager

NewListPager - List the operations for the provider

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

Generated from example definition: 2026-03-01-preview/Operations_List.json

package main

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/programenrollment/armprogramenrollment"
	"log"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armprogramenrollment.NewClientFactory("<subscriptionID>", 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 = armprogramenrollment.OperationsClientListResponse{
		// 	OperationListResult: armprogramenrollment.OperationListResult{
		// 		Value: []*armprogramenrollment.Operation{
		// 			{
		// 				Name: to.Ptr("Microsoft.ProgramEnrollment/eduEnrollments/read"),
		// 				Display: &armprogramenrollment.OperationDisplay{
		// 					Provider: to.Ptr("Microsoft.ProgramEnrollment"),
		// 					Resource: to.Ptr("eduEnrollments"),
		// 					Operation: to.Ptr("Read edu enrollments"),
		// 					Description: to.Ptr("Read edu enrollments"),
		// 				},
		// 				IsDataAction: to.Ptr(false),
		// 			},
		// 			{
		// 				Name: to.Ptr("Microsoft.ProgramEnrollment/eduEnrollments/write"),
		// 				Display: &armprogramenrollment.OperationDisplay{
		// 					Provider: to.Ptr("Microsoft.ProgramEnrollment"),
		// 					Resource: to.Ptr("eduEnrollments"),
		// 					Operation: to.Ptr("Write edu enrollments"),
		// 					Description: to.Ptr("Create or update edu enrollments"),
		// 				},
		// 				IsDataAction: to.Ptr(false),
		// 			},
		// 			{
		// 				Name: to.Ptr("Microsoft.ProgramEnrollment/eduEnrollments/delete"),
		// 				Display: &armprogramenrollment.OperationDisplay{
		// 					Provider: to.Ptr("Microsoft.ProgramEnrollment"),
		// 					Resource: to.Ptr("eduEnrollments"),
		// 					Operation: to.Ptr("Delete edu enrollments"),
		// 					Description: to.Ptr("Delete edu enrollments"),
		// 				},
		// 				IsDataAction: to.Ptr(false),
		// 			},
		// 		},
		// 	},
		// }
	}
}

type OperationsClientListOptions

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse

type OperationsClientListResponse struct {
	// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type Origin

type Origin string

Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"

const (
	// OriginSystem - Indicates the operation is initiated by a system.
	OriginSystem Origin = "system"
	// OriginUser - Indicates the operation is initiated by a user.
	OriginUser Origin = "user"
	// OriginUserSystem - Indicates the operation is initiated by a user or system.
	OriginUserSystem Origin = "user,system"
)

func PossibleOriginValues

func PossibleOriginValues() []Origin

PossibleOriginValues returns the possible values for the Origin const type.

type ProvisioningState

type ProvisioningState string

ProvisioningState - The status of the current operation.

const (
	// ProvisioningStateCanceled - Resource creation was canceled.
	ProvisioningStateCanceled ProvisioningState = "Canceled"
	// ProvisioningStateDeleting - Deletion in progress
	ProvisioningStateDeleting ProvisioningState = "Deleting"
	// ProvisioningStateFailed - Resource creation failed.
	ProvisioningStateFailed ProvisioningState = "Failed"
	// ProvisioningStateProvisioning - Initial provisioning in progress
	ProvisioningStateProvisioning ProvisioningState = "Provisioning"
	// ProvisioningStateSucceeded - Resource has been created.
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	// ProvisioningStateUpdating - Update in progress
	ProvisioningStateUpdating ProvisioningState = "Updating"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time

	// The identity that created the resource.
	CreatedBy *string

	// The type of identity that created the resource.
	CreatedByType *CreatedByType

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time

	// The identity that last modified the resource.
	LastModifiedBy *string

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType
}

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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