armeducation

package module
v0.4.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: 2

README

Azure Education Module for Go

PkgGoDev

The armeducation module provides operations for working with Azure Education.

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 Education module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/education/armeducation

Authorization

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

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 Education 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 - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.

const (
	ActionTypeInternal ActionType = "Internal"
)

func PossibleActionTypeValues

func PossibleActionTypeValues() []ActionType

PossibleActionTypeValues returns the possible values for the ActionType const type.

type Amount

type Amount struct {
	// The type of currency being used for the value.
	Currency *string

	// Amount value.
	Value *float32
}

Amount - The amount.

func (Amount) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type Amount.

func (*Amount) UnmarshalJSON added in v0.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Amount.

type ClientFactory added in v0.3.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 v0.3.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) NewGrantsClient added in v0.3.0

func (c *ClientFactory) NewGrantsClient() *GrantsClient

NewGrantsClient creates a new instance of GrantsClient.

func (*ClientFactory) NewJoinRequestsClient added in v0.3.0

func (c *ClientFactory) NewJoinRequestsClient() *JoinRequestsClient

NewJoinRequestsClient creates a new instance of JoinRequestsClient.

func (*ClientFactory) NewLabsClient added in v0.3.0

func (c *ClientFactory) NewLabsClient() *LabsClient

NewLabsClient creates a new instance of LabsClient.

func (*ClientFactory) NewManagementClient added in v0.3.0

func (c *ClientFactory) NewManagementClient() *ManagementClient

NewManagementClient creates a new instance of ManagementClient.

func (*ClientFactory) NewOperationsClient added in v0.3.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewStudentLabsClient added in v0.3.0

func (c *ClientFactory) NewStudentLabsClient() *StudentLabsClient

NewStudentLabsClient creates a new instance of StudentLabsClient.

func (*ClientFactory) NewStudentsClient added in v0.3.0

func (c *ClientFactory) NewStudentsClient() *StudentsClient

NewStudentsClient creates a new instance of StudentsClient.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type ErrorResponse

type ErrorResponse struct {
	// Error code
	Code *string

	// Error message indicating why the operation failed.
	Message *string
}

ErrorResponse - Describes the format of Error response.

func (ErrorResponse) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v0.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type ErrorResponseBody

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

ErrorResponseBody - Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

func (ErrorResponseBody) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponseBody.

func (*ErrorResponseBody) UnmarshalJSON added in v0.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseBody.

type GrantDetailProperties

type GrantDetailProperties struct {
	// READ-ONLY; allocated budget
	AllocatedBudget *Amount

	// READ-ONLY; Grant Effective Date
	EffectiveDate *time.Time

	// READ-ONLY; Expiration Date
	ExpirationDate *time.Time

	// READ-ONLY; Offer Cap
	OfferCap *Amount

	// READ-ONLY; Grant Offer Type
	OfferType *GrantType

	// READ-ONLY; Grant status
	Status *GrantStatus
}

GrantDetailProperties - Grant detail properties

func (GrantDetailProperties) MarshalJSON

func (g GrantDetailProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GrantDetailProperties.

func (*GrantDetailProperties) UnmarshalJSON

func (g *GrantDetailProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GrantDetailProperties.

type GrantDetails

type GrantDetails struct {
	// Grant detail properties.
	Properties *GrantDetailProperties

	// 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
}

GrantDetails - Grant details.

func (GrantDetails) MarshalJSON added in v0.2.0

func (g GrantDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GrantDetails.

func (*GrantDetails) UnmarshalJSON added in v0.2.0

func (g *GrantDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GrantDetails.

type GrantListResponse

type GrantListResponse struct {
	// READ-ONLY; The link (url) to the next page of results.
	NextLink *string

	// READ-ONLY; The list of labs.
	Value []*GrantDetails
}

GrantListResponse - List of Grants info.

func (GrantListResponse) MarshalJSON added in v0.2.0

func (g GrantListResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GrantListResponse.

func (*GrantListResponse) UnmarshalJSON added in v0.2.0

func (g *GrantListResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GrantListResponse.

type GrantStatus

type GrantStatus string

GrantStatus - Grant status

const (
	GrantStatusActive   GrantStatus = "Active"
	GrantStatusInactive GrantStatus = "Inactive"
)

func PossibleGrantStatusValues

func PossibleGrantStatusValues() []GrantStatus

PossibleGrantStatusValues returns the possible values for the GrantStatus const type.

type GrantType

type GrantType string

GrantType - Grant Offer Type

const (
	GrantTypeAcademic GrantType = "Academic"
	GrantTypeStudent  GrantType = "Student"
)

func PossibleGrantTypeValues

func PossibleGrantTypeValues() []GrantType

PossibleGrantTypeValues returns the possible values for the GrantType const type.

type GrantsClient

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

GrantsClient contains the methods for the Grants group. Don't use this type directly, use NewGrantsClient() instead.

func NewGrantsClient

func NewGrantsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GrantsClient, error)

NewGrantsClient creates a new instance of GrantsClient with the specified values.

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

func (*GrantsClient) Get

func (client *GrantsClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, options *GrantsClientGetOptions) (GrantsClientGetResponse, error)

Get - Get details for a specific grant linked to the provided billing account and billing profile. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-12-01-preview

  • billingAccountName - Billing account name.
  • billingProfileName - Billing profile name.
  • options - GrantsClientGetOptions contains the optional parameters for the GrantsClient.Get method.
Example (Grant)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/Grant.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/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGrantsClient().Get(ctx, "{billingAccountName}", "{billingProfileName}", &armeducation.GrantsClientGetOptions{IncludeAllocatedBudget: to.Ptr(false)})
	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.GrantDetails = armeducation.GrantDetails{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.Education/Grants"),
	// 	ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Education/grants/default"),
	// 	Properties: &armeducation.GrantDetailProperties{
	// 		EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T09:08:05.505Z"); return t}()),
	// 		ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T09:08:05.505Z"); return t}()),
	// 		OfferCap: &armeducation.Amount{
	// 			Currency: to.Ptr("USD"),
	// 			Value: to.Ptr[float32](100),
	// 		},
	// 		OfferType: to.Ptr(armeducation.GrantTypeStudent),
	// 		Status: to.Ptr(armeducation.GrantStatusActive),
	// 	},
	// }
}
Output:

Example (GrantIncludeAllocatedBudget)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/GrantIncludeAllocatedBudget.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/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGrantsClient().Get(ctx, "{billingAccountName}", "{billingProfileName}", &armeducation.GrantsClientGetOptions{IncludeAllocatedBudget: to.Ptr(false)})
	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.GrantDetails = armeducation.GrantDetails{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.Education/Grants"),
	// 	ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Education/grants/default"),
	// 	Properties: &armeducation.GrantDetailProperties{
	// 		AllocatedBudget: &armeducation.Amount{
	// 			Currency: to.Ptr("USD"),
	// 			Value: to.Ptr[float32](0),
	// 		},
	// 		EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T09:08:05.505Z"); return t}()),
	// 		ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T09:08:05.505Z"); return t}()),
	// 		OfferCap: &armeducation.Amount{
	// 			Currency: to.Ptr("USD"),
	// 			Value: to.Ptr[float32](100),
	// 		},
	// 		OfferType: to.Ptr(armeducation.GrantTypeStudent),
	// 		Status: to.Ptr(armeducation.GrantStatusActive),
	// 	},
	// }
}
Output:

func (*GrantsClient) NewListAllPager

NewListAllPager - Get a list of grants that Microsoft has provided.

Generated from API version 2021-12-01-preview

  • options - GrantsClientListAllOptions contains the optional parameters for the GrantsClient.NewListAllPager method.
Example (GrantList)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/GrantList.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/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGrantsClient().NewListAllPager(&armeducation.GrantsClientListAllOptions{IncludeAllocatedBudget: to.Ptr(false)})
	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.GrantListResponse = armeducation.GrantListResponse{
		// 	Value: []*armeducation.GrantDetails{
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Education/Grants"),
		// 			ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Education/grants/default"),
		// 			Properties: &armeducation.GrantDetailProperties{
		// 				EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T09:08:05.505Z"); return t}()),
		// 				ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T09:08:05.505Z"); return t}()),
		// 				OfferCap: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](1000),
		// 				},
		// 				OfferType: to.Ptr(armeducation.GrantTypeAcademic),
		// 				Status: to.Ptr(armeducation.GrantStatusActive),
		// 			},
		// 	}},
		// }
	}
}
Output:

Example (GrantListIncludeAllocatedBudget)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/GrantListIncludeAllocatedBudget.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/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGrantsClient().NewListAllPager(&armeducation.GrantsClientListAllOptions{IncludeAllocatedBudget: to.Ptr(true)})
	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.GrantListResponse = armeducation.GrantListResponse{
		// 	Value: []*armeducation.GrantDetails{
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Education/Grants"),
		// 			ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Education/grants/default"),
		// 			Properties: &armeducation.GrantDetailProperties{
		// 				AllocatedBudget: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](0),
		// 				},
		// 				EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T09:08:05.505Z"); return t}()),
		// 				ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T09:08:05.505Z"); return t}()),
		// 				OfferCap: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](1000),
		// 				},
		// 				OfferType: to.Ptr(armeducation.GrantTypeAcademic),
		// 				Status: to.Ptr(armeducation.GrantStatusActive),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*GrantsClient) NewListPager

func (client *GrantsClient) NewListPager(billingAccountName string, billingProfileName string, options *GrantsClientListOptions) *runtime.Pager[GrantsClientListResponse]

NewListPager - Get details for a specific grant linked to the provided billing account and billing profile.

Generated from API version 2021-12-01-preview

  • billingAccountName - Billing account name.
  • billingProfileName - Billing profile name.
  • options - GrantsClientListOptions contains the optional parameters for the GrantsClient.NewListPager method.
Example (GrantList)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/GrantDefaultList.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/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGrantsClient().NewListPager("{billingAccountName}", "{billingProfileName}", &armeducation.GrantsClientListOptions{IncludeAllocatedBudget: to.Ptr(false)})
	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.GrantListResponse = armeducation.GrantListResponse{
		// 	Value: []*armeducation.GrantDetails{
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Education/Grants"),
		// 			ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Education/grants/default"),
		// 			Properties: &armeducation.GrantDetailProperties{
		// 				EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T09:08:05.505Z"); return t}()),
		// 				ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T09:08:05.505Z"); return t}()),
		// 				OfferCap: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](1000),
		// 				},
		// 				OfferType: to.Ptr(armeducation.GrantTypeAcademic),
		// 				Status: to.Ptr(armeducation.GrantStatusActive),
		// 			},
		// 	}},
		// }
	}
}
Output:

Example (GrantListIncludeAllocatedBudget)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/GrantDefaultListIncludeAllocatedBudget.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/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGrantsClient().NewListPager("{billingAccountName}", "{billingProfileName}", &armeducation.GrantsClientListOptions{IncludeAllocatedBudget: to.Ptr(false)})
	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.GrantListResponse = armeducation.GrantListResponse{
		// 	Value: []*armeducation.GrantDetails{
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Education/Grants"),
		// 			ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.Education/grants/default"),
		// 			Properties: &armeducation.GrantDetailProperties{
		// 				AllocatedBudget: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](0),
		// 				},
		// 				EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T09:08:05.505Z"); return t}()),
		// 				ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T09:08:05.505Z"); return t}()),
		// 				OfferCap: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](1000),
		// 				},
		// 				OfferType: to.Ptr(armeducation.GrantTypeAcademic),
		// 				Status: to.Ptr(armeducation.GrantStatusActive),
		// 			},
		// 	}},
		// }
	}
}
Output:

type GrantsClientGetOptions

type GrantsClientGetOptions struct {
	// May be used to include information about budget that has been allocated.
	IncludeAllocatedBudget *bool
}

GrantsClientGetOptions contains the optional parameters for the GrantsClient.Get method.

type GrantsClientGetResponse

type GrantsClientGetResponse struct {
	// Grant details.
	GrantDetails
}

GrantsClientGetResponse contains the response from method GrantsClient.Get.

type GrantsClientListAllOptions

type GrantsClientListAllOptions struct {
	// May be used to include information about budget that has been allocated.
	IncludeAllocatedBudget *bool
}

GrantsClientListAllOptions contains the optional parameters for the GrantsClient.NewListAllPager method.

type GrantsClientListAllResponse

type GrantsClientListAllResponse struct {
	// List of Grants info.
	GrantListResponse
}

GrantsClientListAllResponse contains the response from method GrantsClient.NewListAllPager.

type GrantsClientListOptions

type GrantsClientListOptions struct {
	// May be used to include information about budget that has been allocated.
	IncludeAllocatedBudget *bool
}

GrantsClientListOptions contains the optional parameters for the GrantsClient.NewListPager method.

type GrantsClientListResponse

type GrantsClientListResponse struct {
	// List of Grants info.
	GrantListResponse
}

GrantsClientListResponse contains the response from method GrantsClient.NewListPager.

type InviteCodeGenerateRequest

type InviteCodeGenerateRequest struct {
	// the total number of students that can be accepted to the lab.
	MaxStudentCount *float32
}

InviteCodeGenerateRequest - invite code generate request.

func (InviteCodeGenerateRequest) MarshalJSON added in v0.2.0

func (i InviteCodeGenerateRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type InviteCodeGenerateRequest.

func (*InviteCodeGenerateRequest) UnmarshalJSON added in v0.2.0

func (i *InviteCodeGenerateRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type InviteCodeGenerateRequest.

type JoinRequestDetails

type JoinRequestDetails struct {
	// join request properties.
	Properties *JoinRequestProperties

	// 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
}

JoinRequestDetails - join requests.

func (JoinRequestDetails) MarshalJSON added in v0.2.0

func (j JoinRequestDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JoinRequestDetails.

func (*JoinRequestDetails) UnmarshalJSON added in v0.2.0

func (j *JoinRequestDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type JoinRequestDetails.

type JoinRequestList

type JoinRequestList struct {
	// READ-ONLY; the link (url) to the next page of results.
	NextLink *string

	// READ-ONLY; The list of requests.
	Value []*JoinRequestDetails
}

JoinRequestList - list of join requests.

func (JoinRequestList) MarshalJSON added in v0.2.0

func (j JoinRequestList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JoinRequestList.

func (*JoinRequestList) UnmarshalJSON added in v0.2.0

func (j *JoinRequestList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type JoinRequestList.

type JoinRequestProperties

type JoinRequestProperties struct {
	// join request email
	Email *string

	// First Name
	FirstName *string

	// Last Name
	LastName *string

	// Join request status
	Status *JoinRequestStatus
}

JoinRequestProperties - Join request properties.

func (JoinRequestProperties) MarshalJSON added in v0.2.0

func (j JoinRequestProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type JoinRequestProperties.

func (*JoinRequestProperties) UnmarshalJSON added in v0.2.0

func (j *JoinRequestProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type JoinRequestProperties.

type JoinRequestStatus

type JoinRequestStatus string

JoinRequestStatus - Join request status

const (
	JoinRequestStatusDenied  JoinRequestStatus = "Denied"
	JoinRequestStatusPending JoinRequestStatus = "Pending"
)

func PossibleJoinRequestStatusValues

func PossibleJoinRequestStatusValues() []JoinRequestStatus

PossibleJoinRequestStatusValues returns the possible values for the JoinRequestStatus const type.

type JoinRequestsClient

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

JoinRequestsClient contains the methods for the JoinRequests group. Don't use this type directly, use NewJoinRequestsClient() instead.

func NewJoinRequestsClient

func NewJoinRequestsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*JoinRequestsClient, error)

NewJoinRequestsClient creates a new instance of JoinRequestsClient with the specified values.

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

func (*JoinRequestsClient) Approve

func (client *JoinRequestsClient) Approve(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, joinRequestName string, options *JoinRequestsClientApproveOptions) (JoinRequestsClientApproveResponse, error)

Approve - Approve student joining the redeemable lab If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-12-01-preview

  • billingAccountName - Billing account name.
  • billingProfileName - Billing profile name.
  • invoiceSectionName - Invoice section name.
  • joinRequestName - Join name
  • options - JoinRequestsClientApproveOptions contains the optional parameters for the JoinRequestsClient.Approve method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/JoinRequestApproveAndDeny.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewJoinRequestsClient().Approve(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", "{joinRequestName}", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*JoinRequestsClient) Deny

func (client *JoinRequestsClient) Deny(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, joinRequestName string, options *JoinRequestsClientDenyOptions) (JoinRequestsClientDenyResponse, error)

Deny - Deny student joining the redeemable lab If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-12-01-preview

  • billingAccountName - Billing account name.
  • billingProfileName - Billing profile name.
  • invoiceSectionName - Invoice section name.
  • joinRequestName - Join name
  • options - JoinRequestsClientDenyOptions contains the optional parameters for the JoinRequestsClient.Deny method.

func (*JoinRequestsClient) Get

func (client *JoinRequestsClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, joinRequestName string, options *JoinRequestsClientGetOptions) (JoinRequestsClientGetResponse, error)

Get - get student join requests If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-12-01-preview

  • billingAccountName - Billing account name.
  • billingProfileName - Billing profile name.
  • invoiceSectionName - Invoice section name.
  • joinRequestName - Join name
  • options - JoinRequestsClientGetOptions contains the optional parameters for the JoinRequestsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/JoinRequest.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewJoinRequestsClient().Get(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", "{joinRequestName}", 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.JoinRequestDetails = armeducation.JoinRequestDetails{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.Education/JoinRequest"),
	// 	ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Education/labs/default/joinRequests/{joinRequestName}"),
	// 	Properties: &armeducation.JoinRequestProperties{
	// 		Email: to.Ptr("test@contoso.com"),
	// 		FirstName: to.Ptr("test"),
	// 		LastName: to.Ptr("user"),
	// 		Status: to.Ptr(armeducation.JoinRequestStatusPending),
	// 	},
	// }
}
Output:

func (*JoinRequestsClient) NewListPager

func (client *JoinRequestsClient) NewListPager(billingAccountName string, billingProfileName string, invoiceSectionName string, options *JoinRequestsClientListOptions) *runtime.Pager[JoinRequestsClientListResponse]

NewListPager - get student join requests

Generated from API version 2021-12-01-preview

  • billingAccountName - Billing account name.
  • billingProfileName - Billing profile name.
  • invoiceSectionName - Invoice section name.
  • options - JoinRequestsClientListOptions contains the optional parameters for the JoinRequestsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/JoinRequestList.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/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewJoinRequestsClient().NewListPager("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", &armeducation.JoinRequestsClientListOptions{IncludeDenied: to.Ptr(false)})
	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.JoinRequestList = armeducation.JoinRequestList{
		// 	Value: []*armeducation.JoinRequestDetails{
		// 		{
		// 			Name: to.Ptr("{joinRequestName}"),
		// 			Type: to.Ptr("Microsoft.Education/JoinRequest"),
		// 			ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Education/labs/default/joinRequests/{joinRequestName}"),
		// 			Properties: &armeducation.JoinRequestProperties{
		// 				Email: to.Ptr("test@contoso.com"),
		// 				FirstName: to.Ptr("test"),
		// 				LastName: to.Ptr("user"),
		// 				Status: to.Ptr(armeducation.JoinRequestStatusPending),
		// 			},
		// 	}},
		// }
	}
}
Output:

type JoinRequestsClientApproveOptions

type JoinRequestsClientApproveOptions struct {
}

JoinRequestsClientApproveOptions contains the optional parameters for the JoinRequestsClient.Approve method.

type JoinRequestsClientApproveResponse

type JoinRequestsClientApproveResponse struct {
}

JoinRequestsClientApproveResponse contains the response from method JoinRequestsClient.Approve.

type JoinRequestsClientDenyOptions

type JoinRequestsClientDenyOptions struct {
}

JoinRequestsClientDenyOptions contains the optional parameters for the JoinRequestsClient.Deny method.

type JoinRequestsClientDenyResponse

type JoinRequestsClientDenyResponse struct {
}

JoinRequestsClientDenyResponse contains the response from method JoinRequestsClient.Deny.

type JoinRequestsClientGetOptions

type JoinRequestsClientGetOptions struct {
}

JoinRequestsClientGetOptions contains the optional parameters for the JoinRequestsClient.Get method.

type JoinRequestsClientGetResponse

type JoinRequestsClientGetResponse struct {
	// join requests.
	JoinRequestDetails
}

JoinRequestsClientGetResponse contains the response from method JoinRequestsClient.Get.

type JoinRequestsClientListOptions

type JoinRequestsClientListOptions struct {
	// Include denied
	IncludeDenied *bool
}

JoinRequestsClientListOptions contains the optional parameters for the JoinRequestsClient.NewListPager method.

type JoinRequestsClientListResponse

type JoinRequestsClientListResponse struct {
	// list of join requests.
	JoinRequestList
}

JoinRequestsClientListResponse contains the response from method JoinRequestsClient.NewListPager.

type LabDetails

type LabDetails struct {
	// Get lab response properties.
	Properties *LabProperties

	// 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
}

LabDetails - Lab details.

func (LabDetails) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type LabDetails.

func (*LabDetails) UnmarshalJSON added in v0.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LabDetails.

type LabListResult

type LabListResult struct {
	// READ-ONLY; The link (url) to the next page of results.
	NextLink *string

	// READ-ONLY; The list of labs.
	Value []*LabDetails
}

LabListResult - List of labs.

func (LabListResult) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type LabListResult.

func (*LabListResult) UnmarshalJSON added in v0.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type LabListResult.

type LabProperties

type LabProperties struct {
	// REQUIRED; Default monetary cap for each student in this lab
	BudgetPerStudent *Amount

	// REQUIRED; Detail description of this lab
	Description *string

	// REQUIRED; Lab Display Name
	DisplayName *string

	// REQUIRED; Default expiration date for each student in this lab
	ExpirationDate *time.Time

	// READ-ONLY; Lab creation date
	EffectiveDate *time.Time

	// READ-ONLY; invitation code for redeemable lab
	InvitationCode *string

	// READ-ONLY; the total number of students that can be accepted to the lab.
	MaxStudentCount *float32

	// READ-ONLY; The status of this lab
	Status *LabStatus

	// READ-ONLY; Total allocated budget
	TotalAllocatedBudget *Amount

	// READ-ONLY; Total budget
	TotalBudget *Amount
}

LabProperties - Lab detail result properties.

func (LabProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type LabProperties.

func (*LabProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type LabProperties.

type LabStatus

type LabStatus string

LabStatus - The status of this lab

const (
	LabStatusActive  LabStatus = "Active"
	LabStatusDeleted LabStatus = "Deleted"
	LabStatusPending LabStatus = "Pending"
)

func PossibleLabStatusValues

func PossibleLabStatusValues() []LabStatus

PossibleLabStatusValues returns the possible values for the LabStatus const type.

type LabsClient

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

LabsClient contains the methods for the Labs group. Don't use this type directly, use NewLabsClient() instead.

func NewLabsClient

func NewLabsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*LabsClient, error)

NewLabsClient creates a new instance of LabsClient with the specified values.

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

func (*LabsClient) CreateOrUpdate

func (client *LabsClient) CreateOrUpdate(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, parameters LabDetails, options *LabsClientCreateOrUpdateOptions) (LabsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create a new lab or update a previously created lab. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-12-01-preview

  • billingAccountName - Billing account name.
  • billingProfileName - Billing profile name.
  • invoiceSectionName - Invoice section name.
  • parameters - Request parameters that are provided to create lab resource.
  • options - LabsClientCreateOrUpdateOptions contains the optional parameters for the LabsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/CreateLab.json

package main

import (
	"context"
	"log"

	"time"

	"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/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewLabsClient().CreateOrUpdate(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", armeducation.LabDetails{
		Properties: &armeducation.LabProperties{
			Description: to.Ptr("example lab description"),
			BudgetPerStudent: &armeducation.Amount{
				Currency: to.Ptr("USD"),
				Value:    to.Ptr[float32](100),
			},
			DisplayName:    to.Ptr("example lab"),
			ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-09T22:11:29.422Z"); return t }()),
		},
	}, 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.LabDetails = armeducation.LabDetails{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.Education/Labs"),
	// 	ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Education/labs/default"),
	// 	Properties: &armeducation.LabProperties{
	// 		Description: to.Ptr("example lab description"),
	// 		BudgetPerStudent: &armeducation.Amount{
	// 			Currency: to.Ptr("USD"),
	// 			Value: to.Ptr[float32](100),
	// 		},
	// 		DisplayName: to.Ptr("example lab"),
	// 		EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T21:25:56.838Z"); return t}()),
	// 		ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-09T21:25:56.838Z"); return t}()),
	// 		Status: to.Ptr(armeducation.LabStatusActive),
	// 	},
	// }
}
Output:

func (*LabsClient) Delete

func (client *LabsClient) Delete(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, options *LabsClientDeleteOptions) (LabsClientDeleteResponse, error)

Delete - Delete a specific lab associated with the provided billing account name, billing profile name, and invoice section name. Note all students must be removed from the lab in order to delete the lab. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-12-01-preview

  • billingAccountName - Billing account name.
  • billingProfileName - Billing profile name.
  • invoiceSectionName - Invoice section name.
  • options - LabsClientDeleteOptions contains the optional parameters for the LabsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/DeleteLab.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/education/armeducation"
)

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

func (*LabsClient) GenerateInviteCode

func (client *LabsClient) GenerateInviteCode(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, parameters InviteCodeGenerateRequest, options *LabsClientGenerateInviteCodeOptions) (LabsClientGenerateInviteCodeResponse, error)

GenerateInviteCode - Generate invite code for a lab If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-12-01-preview

  • billingAccountName - Billing account name.
  • billingProfileName - Billing profile name.
  • invoiceSectionName - Invoice section name.
  • parameters - Request parameters that are provided to generate invite code.
  • options - LabsClientGenerateInviteCodeOptions contains the optional parameters for the LabsClient.GenerateInviteCode method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/GenerateInviteCode.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/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewLabsClient().GenerateInviteCode(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", armeducation.InviteCodeGenerateRequest{
		MaxStudentCount: to.Ptr[float32](10),
	}, &armeducation.LabsClientGenerateInviteCodeOptions{OnlyUpdateStudentCountParameter: 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.LabDetails = armeducation.LabDetails{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.Education/Labs"),
	// 	ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Education/labs/default"),
	// 	Properties: &armeducation.LabProperties{
	// 		Description: to.Ptr("example lab description"),
	// 		BudgetPerStudent: &armeducation.Amount{
	// 			Currency: to.Ptr("USD"),
	// 			Value: to.Ptr[float32](100),
	// 		},
	// 		DisplayName: to.Ptr("example lab"),
	// 		EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T21:25:56.838Z"); return t}()),
	// 		ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-09T21:25:56.838Z"); return t}()),
	// 		InvitationCode: to.Ptr("exampleIviteCode"),
	// 		MaxStudentCount: to.Ptr[float32](10),
	// 		Status: to.Ptr(armeducation.LabStatusActive),
	// 	},
	// }
}
Output:

func (*LabsClient) Get

func (client *LabsClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, options *LabsClientGetOptions) (LabsClientGetResponse, error)

Get - Get the details for a specific lab associated with the provided billing account name, billing profile name, and invoice section name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-12-01-preview

  • billingAccountName - Billing account name.
  • billingProfileName - Billing profile name.
  • invoiceSectionName - Invoice section name.
  • options - LabsClientGetOptions contains the optional parameters for the LabsClient.Get method.
Example (Lab)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/Lab.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/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewLabsClient().Get(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", &armeducation.LabsClientGetOptions{IncludeBudget: to.Ptr(false)})
	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.LabDetails = armeducation.LabDetails{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.Education/Labs"),
	// 	ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Education/labs/default"),
	// 	Properties: &armeducation.LabProperties{
	// 		Description: to.Ptr("example lab description"),
	// 		BudgetPerStudent: &armeducation.Amount{
	// 			Currency: to.Ptr("USD"),
	// 			Value: to.Ptr[float32](100),
	// 		},
	// 		DisplayName: to.Ptr("example lab"),
	// 		EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T21:25:56.838Z"); return t}()),
	// 		ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-09T21:25:56.838Z"); return t}()),
	// 		InvitationCode: to.Ptr(""),
	// 		MaxStudentCount: to.Ptr[float32](0),
	// 		Status: to.Ptr(armeducation.LabStatusActive),
	// 	},
	// }
}
Output:

Example (LabIncludeBudget)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/LabIncludeBudget.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/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewLabsClient().Get(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", &armeducation.LabsClientGetOptions{IncludeBudget: to.Ptr(true)})
	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.LabDetails = armeducation.LabDetails{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.Education/Labs"),
	// 	ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Education/labs/default"),
	// 	Properties: &armeducation.LabProperties{
	// 		Description: to.Ptr("example lab description"),
	// 		BudgetPerStudent: &armeducation.Amount{
	// 			Currency: to.Ptr("USD"),
	// 			Value: to.Ptr[float32](100),
	// 		},
	// 		DisplayName: to.Ptr("example lab"),
	// 		EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T21:25:56.838Z"); return t}()),
	// 		ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-09T21:25:56.838Z"); return t}()),
	// 		InvitationCode: to.Ptr(""),
	// 		MaxStudentCount: to.Ptr[float32](0),
	// 		Status: to.Ptr(armeducation.LabStatusActive),
	// 		TotalAllocatedBudget: &armeducation.Amount{
	// 			Currency: to.Ptr("USD"),
	// 			Value: to.Ptr[float32](500),
	// 		},
	// 		TotalBudget: &armeducation.Amount{
	// 			Currency: to.Ptr("USD"),
	// 			Value: to.Ptr[float32](500),
	// 		},
	// 	},
	// }
}
Output:

func (*LabsClient) NewListAllPager

func (client *LabsClient) NewListAllPager(billingAccountName string, billingProfileName string, options *LabsClientListAllOptions) *runtime.Pager[LabsClientListAllResponse]

NewListAllPager - Get a list of labs associated with the provided billing account name and billing profile name.

Generated from API version 2021-12-01-preview

  • billingAccountName - Billing account name.
  • billingProfileName - Billing profile name.
  • options - LabsClientListAllOptions contains the optional parameters for the LabsClient.NewListAllPager method.
Example (LabList)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/LabList.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/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLabsClient().NewListAllPager("{billingAccountName}", "{billingProfileName}", &armeducation.LabsClientListAllOptions{IncludeBudget: to.Ptr(false),
		IncludeDeleted: 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.LabListResult = armeducation.LabListResult{
		// 	Value: []*armeducation.LabDetails{
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Education/Labs"),
		// 			ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Education/labs/default"),
		// 			Properties: &armeducation.LabProperties{
		// 				Description: to.Ptr("example lab description"),
		// 				BudgetPerStudent: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](100),
		// 				},
		// 				DisplayName: to.Ptr("example lab"),
		// 				EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T21:25:56.838Z"); return t}()),
		// 				ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-09T21:25:56.838Z"); return t}()),
		// 				Status: to.Ptr(armeducation.LabStatusActive),
		// 			},
		// 	}},
		// }
	}
}
Output:

Example (LabListIncludeBudget)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/LabListIncludeBudget.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/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLabsClient().NewListAllPager("{billingAccountName}", "{billingProfileName}", &armeducation.LabsClientListAllOptions{IncludeBudget: to.Ptr(true),
		IncludeDeleted: 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.LabListResult = armeducation.LabListResult{
		// 	Value: []*armeducation.LabDetails{
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Education/Labs"),
		// 			ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Education/labs/default"),
		// 			Properties: &armeducation.LabProperties{
		// 				Description: to.Ptr("example lab description"),
		// 				BudgetPerStudent: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](100),
		// 				},
		// 				DisplayName: to.Ptr("example lab"),
		// 				EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T21:25:56.838Z"); return t}()),
		// 				ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-09T21:25:56.838Z"); return t}()),
		// 				Status: to.Ptr(armeducation.LabStatusActive),
		// 				TotalAllocatedBudget: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](500),
		// 				},
		// 				TotalBudget: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](500),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*LabsClient) NewListPager

func (client *LabsClient) NewListPager(billingAccountName string, billingProfileName string, invoiceSectionName string, options *LabsClientListOptions) *runtime.Pager[LabsClientListResponse]

NewListPager - Get the details for a specific lab associated with the provided billing account name, billing profile name, and invoice section name.

Generated from API version 2021-12-01-preview

  • billingAccountName - Billing account name.
  • billingProfileName - Billing profile name.
  • invoiceSectionName - Invoice section name.
  • options - LabsClientListOptions contains the optional parameters for the LabsClient.NewListPager method.
Example (LabListWithInvoiceSectionName)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/LabListWithInvoiceSectionName.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/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLabsClient().NewListPager("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", &armeducation.LabsClientListOptions{IncludeBudget: to.Ptr(true)})
	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.LabListResult = armeducation.LabListResult{
		// 	Value: []*armeducation.LabDetails{
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Education/Labs"),
		// 			ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Education/labs/default"),
		// 			Properties: &armeducation.LabProperties{
		// 				Description: to.Ptr("example lab description"),
		// 				BudgetPerStudent: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](100),
		// 				},
		// 				DisplayName: to.Ptr("example lab"),
		// 				EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T21:25:56.838Z"); return t}()),
		// 				ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-09T21:25:56.838Z"); return t}()),
		// 				Status: to.Ptr(armeducation.LabStatusActive),
		// 				TotalAllocatedBudget: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](500),
		// 				},
		// 				TotalBudget: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](500),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

Example (LabListWithInvoiceSectionNameIncludeBudget)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/LabListWithInvoiceSectionNameIncludeBudget.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/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewLabsClient().NewListPager("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", &armeducation.LabsClientListOptions{IncludeBudget: to.Ptr(true)})
	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.LabListResult = armeducation.LabListResult{
		// 	Value: []*armeducation.LabDetails{
		// 		{
		// 			Name: to.Ptr("default"),
		// 			Type: to.Ptr("Microsoft.Education/Labs"),
		// 			ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Education/labs/default"),
		// 			Properties: &armeducation.LabProperties{
		// 				Description: to.Ptr("example lab description"),
		// 				BudgetPerStudent: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](100),
		// 				},
		// 				DisplayName: to.Ptr("example lab"),
		// 				EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T21:25:56.838Z"); return t}()),
		// 				ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-09T21:25:56.838Z"); return t}()),
		// 				Status: to.Ptr(armeducation.LabStatusActive),
		// 				TotalAllocatedBudget: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](500),
		// 				},
		// 				TotalBudget: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](500),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

type LabsClientCreateOrUpdateOptions

type LabsClientCreateOrUpdateOptions struct {
}

LabsClientCreateOrUpdateOptions contains the optional parameters for the LabsClient.CreateOrUpdate method.

type LabsClientCreateOrUpdateResponse

type LabsClientCreateOrUpdateResponse struct {
	// Lab details.
	LabDetails
}

LabsClientCreateOrUpdateResponse contains the response from method LabsClient.CreateOrUpdate.

type LabsClientDeleteOptions

type LabsClientDeleteOptions struct {
}

LabsClientDeleteOptions contains the optional parameters for the LabsClient.Delete method.

type LabsClientDeleteResponse

type LabsClientDeleteResponse struct {
}

LabsClientDeleteResponse contains the response from method LabsClient.Delete.

type LabsClientGenerateInviteCodeOptions

type LabsClientGenerateInviteCodeOptions struct {
	// set this flag to true if you want to update student count without generating a new invite code
	OnlyUpdateStudentCountParameter *bool
}

LabsClientGenerateInviteCodeOptions contains the optional parameters for the LabsClient.GenerateInviteCode method.

type LabsClientGenerateInviteCodeResponse

type LabsClientGenerateInviteCodeResponse struct {
	// Lab details.
	LabDetails
}

LabsClientGenerateInviteCodeResponse contains the response from method LabsClient.GenerateInviteCode.

type LabsClientGetOptions

type LabsClientGetOptions struct {
	// May be used to include budget information.
	IncludeBudget *bool
}

LabsClientGetOptions contains the optional parameters for the LabsClient.Get method.

type LabsClientGetResponse

type LabsClientGetResponse struct {
	// Lab details.
	LabDetails
}

LabsClientGetResponse contains the response from method LabsClient.Get.

type LabsClientListAllOptions

type LabsClientListAllOptions struct {
	// May be used to include budget information.
	IncludeBudget *bool

	// May be used to show deleted items.
	IncludeDeleted *bool
}

LabsClientListAllOptions contains the optional parameters for the LabsClient.NewListAllPager method.

type LabsClientListAllResponse

type LabsClientListAllResponse struct {
	// List of labs.
	LabListResult
}

LabsClientListAllResponse contains the response from method LabsClient.NewListAllPager.

type LabsClientListOptions

type LabsClientListOptions struct {
	// May be used to include budget information.
	IncludeBudget *bool
}

LabsClientListOptions contains the optional parameters for the LabsClient.NewListPager method.

type LabsClientListResponse

type LabsClientListResponse struct {
	// List of labs.
	LabListResult
}

LabsClientListResponse contains the response from method LabsClient.NewListPager.

type ManagementClient

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

ManagementClient contains the methods for the EducationManagementClient group. Don't use this type directly, use NewManagementClient() instead.

func NewManagementClient

func NewManagementClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementClient, error)

NewManagementClient creates a new instance of ManagementClient with the specified values.

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

func (*ManagementClient) RedeemInvitationCode

RedeemInvitationCode - Redeem invite code to join a redeemable lab If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-12-01-preview

  • parameters - Request parameters to provide redeem code.
  • options - ManagementClientRedeemInvitationCodeOptions contains the optional parameters for the ManagementClient.RedeemInvitationCode method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/RedeemCode.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/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewManagementClient().RedeemInvitationCode(ctx, armeducation.RedeemRequest{
		FirstName:  to.Ptr("test"),
		LastName:   to.Ptr("user"),
		RedeemCode: to.Ptr("exampleRedeemCode"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

type ManagementClientRedeemInvitationCodeOptions

type ManagementClientRedeemInvitationCodeOptions struct {
}

ManagementClientRedeemInvitationCodeOptions contains the optional parameters for the ManagementClient.RedeemInvitationCode method.

type ManagementClientRedeemInvitationCodeResponse

type ManagementClientRedeemInvitationCodeResponse struct {
}

ManagementClientRedeemInvitationCodeResponse contains the response from method ManagementClient.RedeemInvitationCode.

type Operation

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

	// READ-ONLY; 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 ARM/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 - Details of a REST API operation, returned from the Resource Provider Operations API

func (Operation) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v0.2.0

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 this particular operation.

func (OperationDisplay) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON added in v0.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

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 resource provider
	Value []*Operation
}

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 added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON added in v0.2.0

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.

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) List

List - Lists all of the available Microsoft.Education API operations. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-12-01-preview

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/GetOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewOperationsClient().List(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.OperationListResult = armeducation.OperationListResult{
	// 	Value: []*armeducation.Operation{
	// 		{
	// 			Name: to.Ptr("Microsoft.Education/grants/read"),
	// 			Display: &armeducation.OperationDisplay{
	// 				Description: to.Ptr("Read all grants"),
	// 				Operation: to.Ptr("Get grants"),
	// 				Provider: to.Ptr("Microsoft Education"),
	// 				Resource: to.Ptr("Grants"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.Education/labs/read"),
	// 			Display: &armeducation.OperationDisplay{
	// 				Description: to.Ptr("Read all labs"),
	// 				Operation: to.Ptr("Get labs"),
	// 				Provider: to.Ptr("Microsoft Edcucation"),
	// 				Resource: to.Ptr("Labs"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.Education/labs/write"),
	// 			Display: &armeducation.OperationDisplay{
	// 				Description: to.Ptr("Create or update lab"),
	// 				Operation: to.Ptr("Create or update lab"),
	// 				Provider: to.Ptr("Microsoft Edcucation"),
	// 				Resource: to.Ptr("Labs"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.Education/labs/delete"),
	// 			Display: &armeducation.OperationDisplay{
	// 				Description: to.Ptr("Delete a lab"),
	// 				Operation: to.Ptr("Delete lab"),
	// 				Provider: to.Ptr("Microsoft Edcucation"),
	// 				Resource: to.Ptr("Labs"),
	// 			},
	// 	}},
	// }
}
Output:

type OperationsClientListOptions

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.List 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.List.

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     Origin = "system"
	OriginUser       Origin = "user"
	OriginUserSystem Origin = "user,system"
)

func PossibleOriginValues

func PossibleOriginValues() []Origin

PossibleOriginValues returns the possible values for the Origin const type.

type RedeemRequest

type RedeemRequest struct {
	// REQUIRED; first name of requester
	FirstName *string

	// REQUIRED; last name of requester
	LastName *string

	// REQUIRED; redeem code
	RedeemCode *string
}

RedeemRequest - redeem request.

func (RedeemRequest) MarshalJSON added in v0.2.0

func (r RedeemRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RedeemRequest.

func (*RedeemRequest) UnmarshalJSON added in v0.2.0

func (r *RedeemRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RedeemRequest.

type Resource

type Resource struct {
	// 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
}

Resource - Common fields that are returned in the response for all Azure Resource Manager resources

func (Resource) MarshalJSON added in v0.2.0

func (r Resource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v0.2.0

func (r *Resource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type StudentDetails

type StudentDetails struct {
	// Get student response properties.
	Properties *StudentProperties

	// 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
}

StudentDetails - Student details.

func (StudentDetails) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type StudentDetails.

func (*StudentDetails) UnmarshalJSON added in v0.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type StudentDetails.

type StudentLabDetails

type StudentLabDetails struct {
	// Student lab properties.
	Properties *StudentLabProperties

	// 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
}

StudentLabDetails - Student lab details.

func (StudentLabDetails) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type StudentLabDetails.

func (*StudentLabDetails) UnmarshalJSON added in v0.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type StudentLabDetails.

type StudentLabListResult

type StudentLabListResult struct {
	// READ-ONLY; The link (url) to the next page of results.
	NextLink *string

	// READ-ONLY; The list of labs.
	Value []*StudentLabDetails
}

StudentLabListResult - List of labs.

func (StudentLabListResult) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type StudentLabListResult.

func (*StudentLabListResult) UnmarshalJSON added in v0.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type StudentLabListResult.

type StudentLabProperties

type StudentLabProperties struct {
	// READ-ONLY; Student Budget
	Budget *Amount

	// READ-ONLY; Detail description of this lab
	Description *string

	// READ-ONLY; Student lab Display Name
	DisplayName *string

	// READ-ONLY; User Added Date
	EffectiveDate *time.Time

	// READ-ONLY; Date the lab will expire and by default will be the expiration date for each student in this lab
	ExpirationDate *time.Time

	// READ-ONLY; Lab Scope. /providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Education/labs/default
	LabScope *string

	// READ-ONLY; Student Role
	Role *StudentRole

	// READ-ONLY; Student Lab Status
	Status *StudentLabStatus

	// READ-ONLY; Subscription Id
	SubscriptionID *string
}

StudentLabProperties - Student lab detail properties

func (StudentLabProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type StudentLabProperties.

func (*StudentLabProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type StudentLabProperties.

type StudentLabStatus

type StudentLabStatus string

StudentLabStatus - Student Lab Status

const (
	StudentLabStatusActive   StudentLabStatus = "Active"
	StudentLabStatusDeleted  StudentLabStatus = "Deleted"
	StudentLabStatusDisabled StudentLabStatus = "Disabled"
	StudentLabStatusExpired  StudentLabStatus = "Expired"
	StudentLabStatusPending  StudentLabStatus = "Pending"
)

func PossibleStudentLabStatusValues

func PossibleStudentLabStatusValues() []StudentLabStatus

PossibleStudentLabStatusValues returns the possible values for the StudentLabStatus const type.

type StudentLabsClient

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

StudentLabsClient contains the methods for the StudentLabs group. Don't use this type directly, use NewStudentLabsClient() instead.

func NewStudentLabsClient

func NewStudentLabsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*StudentLabsClient, error)

NewStudentLabsClient creates a new instance of StudentLabsClient with the specified values.

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

func (*StudentLabsClient) Get

Get - Get the details for a specified lab associated with the student lab. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-12-01-preview

  • studentLabName - Student lab name.
  • options - StudentLabsClientGetOptions contains the optional parameters for the StudentLabsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/StudentLab.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewStudentLabsClient().Get(ctx, "{studentLabName}", 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.StudentLabDetails = armeducation.StudentLabDetails{
	// 	Name: to.Ptr("{studentLabName}"),
	// 	Type: to.Ptr("Microsoft.Education/StudentLabs"),
	// 	ID: to.Ptr(" /providers/Microsoft.Education/studentLabs/{studentLabName}"),
	// 	Properties: &armeducation.StudentLabProperties{
	// 		Description: to.Ptr("example lab description"),
	// 		Budget: &armeducation.Amount{
	// 			Currency: to.Ptr("USD"),
	// 			Value: to.Ptr[float32](100),
	// 		},
	// 		DisplayName: to.Ptr("example lab name"),
	// 		EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T21:54:17.438Z"); return t}()),
	// 		ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-09T21:54:17.438Z"); return t}()),
	// 		LabScope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Education/labs/default"),
	// 		Role: to.Ptr(armeducation.StudentRoleStudent),
	// 		Status: to.Ptr(armeducation.StudentLabStatusActive),
	// 		SubscriptionID: to.Ptr("000000000-0000-0000-0000-00000000000000"),
	// 	},
	// }
}
Output:

func (*StudentLabsClient) NewListAllPager

NewListAllPager - Get a list of all labs associated with the caller of the API.

Generated from API version 2021-12-01-preview

  • options - StudentLabsClientListAllOptions contains the optional parameters for the StudentLabsClient.NewListAllPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/StudentLabList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewStudentLabsClient().NewListAllPager(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.StudentLabListResult = armeducation.StudentLabListResult{
		// 	Value: []*armeducation.StudentLabDetails{
		// 		{
		// 			Name: to.Ptr("{studentLabName}"),
		// 			Type: to.Ptr("Microsoft.Education/StudentLabs"),
		// 			ID: to.Ptr(" /providers/Microsoft.Education/studentLabs/{studentLabName}"),
		// 			Properties: &armeducation.StudentLabProperties{
		// 				Description: to.Ptr("example lab description"),
		// 				Budget: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](100),
		// 				},
		// 				DisplayName: to.Ptr("example lab name"),
		// 				EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T21:54:17.438Z"); return t}()),
		// 				ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-09T21:54:17.438Z"); return t}()),
		// 				LabScope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Education/labs/default"),
		// 				Role: to.Ptr(armeducation.StudentRoleStudent),
		// 				Status: to.Ptr(armeducation.StudentLabStatusActive),
		// 				SubscriptionID: to.Ptr("000000000-0000-0000-0000-00000000000000"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type StudentLabsClientGetOptions

type StudentLabsClientGetOptions struct {
}

StudentLabsClientGetOptions contains the optional parameters for the StudentLabsClient.Get method.

type StudentLabsClientGetResponse

type StudentLabsClientGetResponse struct {
	// Student lab details.
	StudentLabDetails
}

StudentLabsClientGetResponse contains the response from method StudentLabsClient.Get.

type StudentLabsClientListAllOptions

type StudentLabsClientListAllOptions struct {
}

StudentLabsClientListAllOptions contains the optional parameters for the StudentLabsClient.NewListAllPager method.

type StudentLabsClientListAllResponse

type StudentLabsClientListAllResponse struct {
	// List of labs.
	StudentLabListResult
}

StudentLabsClientListAllResponse contains the response from method StudentLabsClient.NewListAllPager.

type StudentListResult

type StudentListResult struct {
	// READ-ONLY; The link (url) to the next page of results.
	NextLink *string

	// READ-ONLY; The list of students.
	Value []*StudentDetails
}

StudentListResult - List of students.

func (StudentListResult) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type StudentListResult.

func (*StudentListResult) UnmarshalJSON added in v0.2.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type StudentListResult.

type StudentProperties

type StudentProperties struct {
	// REQUIRED; Student Budget
	Budget *Amount

	// REQUIRED; Student Email
	Email *string

	// REQUIRED; Date this student is set to expire from the lab.
	ExpirationDate *time.Time

	// REQUIRED; First Name
	FirstName *string

	// REQUIRED; Last Name
	LastName *string

	// REQUIRED; Student Role
	Role *StudentRole

	// Subscription alias
	SubscriptionAlias *string

	// subscription invite last sent date
	SubscriptionInviteLastSentDate *time.Time

	// READ-ONLY; Date student was added to the lab
	EffectiveDate *time.Time

	// READ-ONLY; Student Lab Status
	Status *StudentLabStatus

	// READ-ONLY; Subscription Id
	SubscriptionID *string
}

StudentProperties - Student detail properties

func (StudentProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type StudentProperties.

func (*StudentProperties) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type StudentProperties.

type StudentRole

type StudentRole string

StudentRole - Student Role

const (
	StudentRoleAdmin   StudentRole = "Admin"
	StudentRoleStudent StudentRole = "Student"
)

func PossibleStudentRoleValues

func PossibleStudentRoleValues() []StudentRole

PossibleStudentRoleValues returns the possible values for the StudentRole const type.

type StudentsClient

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

StudentsClient contains the methods for the Students group. Don't use this type directly, use NewStudentsClient() instead.

func NewStudentsClient

func NewStudentsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*StudentsClient, error)

NewStudentsClient creates a new instance of StudentsClient with the specified values.

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

func (*StudentsClient) CreateOrUpdate

func (client *StudentsClient) CreateOrUpdate(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, studentAlias string, parameters StudentDetails, options *StudentsClientCreateOrUpdateOptions) (StudentsClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create and add a new student to the specified lab or update the details of an existing student in a lab. Note the student must have a valid tenant to accept the lab after they have been added to lab. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-12-01-preview

  • billingAccountName - Billing account name.
  • billingProfileName - Billing profile name.
  • invoiceSectionName - Invoice section name.
  • studentAlias - Student alias.
  • parameters - Request parameters that are provided to update student properties.
  • options - StudentsClientCreateOrUpdateOptions contains the optional parameters for the StudentsClient.CreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/CreateStudent.json

package main

import (
	"context"
	"log"

	"time"

	"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/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewStudentsClient().CreateOrUpdate(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", "{studentAlias}", armeducation.StudentDetails{
		Properties: &armeducation.StudentProperties{
			Budget: &armeducation.Amount{
				Currency: to.Ptr("USD"),
				Value:    to.Ptr[float32](100),
			},
			Email:          to.Ptr("test@contoso.com"),
			ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T22:13:21.795Z"); return t }()),
			FirstName:      to.Ptr("test"),
			LastName:       to.Ptr("user"),
			Role:           to.Ptr(armeducation.StudentRoleStudent),
		},
	}, 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.StudentDetails = armeducation.StudentDetails{
	// 	Name: to.Ptr("{studentAlias}"),
	// 	Type: to.Ptr("Microsoft.Education/Students"),
	// 	ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Education/labs/default/students/{studentAlias}"),
	// 	Properties: &armeducation.StudentProperties{
	// 		Budget: &armeducation.Amount{
	// 			Currency: to.Ptr("USD"),
	// 			Value: to.Ptr[float32](100),
	// 		},
	// 		EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T21:43:54.161Z"); return t}()),
	// 		Email: to.Ptr("test@contoso.com"),
	// 		ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-09T21:43:54.161Z"); return t}()),
	// 		FirstName: to.Ptr("test"),
	// 		LastName: to.Ptr("user"),
	// 		Role: to.Ptr(armeducation.StudentRoleStudent),
	// 		Status: to.Ptr(armeducation.StudentLabStatusActive),
	// 		SubscriptionID: to.Ptr("000000000-0000-0000-0000-00000000000000"),
	// 	},
	// }
}
Output:

func (*StudentsClient) Delete

func (client *StudentsClient) Delete(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, studentAlias string, options *StudentsClientDeleteOptions) (StudentsClientDeleteResponse, error)

Delete - Delete the specified student based on the student alias. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-12-01-preview

  • billingAccountName - Billing account name.
  • billingProfileName - Billing profile name.
  • invoiceSectionName - Invoice section name.
  • studentAlias - Student alias.
  • options - StudentsClientDeleteOptions contains the optional parameters for the StudentsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/DeleteStudent.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/education/armeducation"
)

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

func (*StudentsClient) Get

func (client *StudentsClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, studentAlias string, options *StudentsClientGetOptions) (StudentsClientGetResponse, error)

Get - Get the details for a specific student in the specified lab by student alias If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-12-01-preview

  • billingAccountName - Billing account name.
  • billingProfileName - Billing profile name.
  • invoiceSectionName - Invoice section name.
  • studentAlias - Student alias.
  • options - StudentsClientGetOptions contains the optional parameters for the StudentsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/Student.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewStudentsClient().Get(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", "{studentAlias}", 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.StudentDetails = armeducation.StudentDetails{
	// 	Name: to.Ptr("{studentAlias}"),
	// 	Type: to.Ptr("Microsoft.Education/Students"),
	// 	ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Education/labs/default/students/{studentAlias}"),
	// 	Properties: &armeducation.StudentProperties{
	// 		Budget: &armeducation.Amount{
	// 			Currency: to.Ptr("USD"),
	// 			Value: to.Ptr[float32](100),
	// 		},
	// 		EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T21:43:54.161Z"); return t}()),
	// 		Email: to.Ptr("test@contoso.com"),
	// 		ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-09T21:43:54.161Z"); return t}()),
	// 		FirstName: to.Ptr("test"),
	// 		LastName: to.Ptr("user"),
	// 		Role: to.Ptr(armeducation.StudentRoleStudent),
	// 		Status: to.Ptr(armeducation.StudentLabStatusActive),
	// 		SubscriptionAlias: to.Ptr("000000000-0000-0000-0000-00000000000000"),
	// 		SubscriptionID: to.Ptr("000000000-0000-0000-0000-00000000000000"),
	// 		SubscriptionInviteLastSentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T21:43:54.161Z"); return t}()),
	// 	},
	// }
}
Output:

func (*StudentsClient) NewListPager

func (client *StudentsClient) NewListPager(billingAccountName string, billingProfileName string, invoiceSectionName string, options *StudentsClientListOptions) *runtime.Pager[StudentsClientListResponse]

NewListPager - Get a list of details about students that are associated with the specified lab.

Generated from API version 2021-12-01-preview

  • billingAccountName - Billing account name.
  • billingProfileName - Billing profile name.
  • invoiceSectionName - Invoice section name.
  • options - StudentsClientListOptions contains the optional parameters for the StudentsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b9b91929c304f8fb44002267b6c98d9fb9dde014/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/examples/StudentList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/education/armeducation"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeducation.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewStudentsClient().NewListPager("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", &armeducation.StudentsClientListOptions{IncludeDeleted: 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.StudentListResult = armeducation.StudentListResult{
		// 	Value: []*armeducation.StudentDetails{
		// 		{
		// 			Name: to.Ptr("{studentAlias}"),
		// 			Type: to.Ptr("Microsoft.Education/Students"),
		// 			ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Education/labs/default/students/{studentAlias}"),
		// 			Properties: &armeducation.StudentProperties{
		// 				Budget: &armeducation.Amount{
		// 					Currency: to.Ptr("USD"),
		// 					Value: to.Ptr[float32](100),
		// 				},
		// 				EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T21:43:54.161Z"); return t}()),
		// 				Email: to.Ptr("test@contoso.com"),
		// 				ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-09T21:43:54.161Z"); return t}()),
		// 				FirstName: to.Ptr("test"),
		// 				LastName: to.Ptr("user"),
		// 				Role: to.Ptr(armeducation.StudentRoleStudent),
		// 				Status: to.Ptr(armeducation.StudentLabStatusActive),
		// 				SubscriptionAlias: to.Ptr("000000000-0000-0000-0000-00000000000000"),
		// 				SubscriptionID: to.Ptr("000000000-0000-0000-0000-00000000000000"),
		// 				SubscriptionInviteLastSentDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-09T21:43:54.161Z"); return t}()),
		// 			},
		// 	}},
		// }
	}
}
Output:

type StudentsClientCreateOrUpdateOptions

type StudentsClientCreateOrUpdateOptions struct {
}

StudentsClientCreateOrUpdateOptions contains the optional parameters for the StudentsClient.CreateOrUpdate method.

type StudentsClientCreateOrUpdateResponse

type StudentsClientCreateOrUpdateResponse struct {
	// Student details.
	StudentDetails
}

StudentsClientCreateOrUpdateResponse contains the response from method StudentsClient.CreateOrUpdate.

type StudentsClientDeleteOptions

type StudentsClientDeleteOptions struct {
}

StudentsClientDeleteOptions contains the optional parameters for the StudentsClient.Delete method.

type StudentsClientDeleteResponse

type StudentsClientDeleteResponse struct {
}

StudentsClientDeleteResponse contains the response from method StudentsClient.Delete.

type StudentsClientGetOptions

type StudentsClientGetOptions struct {
}

StudentsClientGetOptions contains the optional parameters for the StudentsClient.Get method.

type StudentsClientGetResponse

type StudentsClientGetResponse struct {
	// Student details.
	StudentDetails
}

StudentsClientGetResponse contains the response from method StudentsClient.Get.

type StudentsClientListOptions

type StudentsClientListOptions struct {
	// May be used to show deleted items.
	IncludeDeleted *bool
}

StudentsClientListOptions contains the optional parameters for the StudentsClient.NewListPager method.

type StudentsClientListResponse

type StudentsClientListResponse struct {
	// List of students.
	StudentListResult
}

StudentsClientListResponse contains the response from method StudentsClient.NewListPager.

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