armoep

package module
v0.6.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: 14 Imported by: 2

README

Azure Open Energy Platform Module for Go

PkgGoDev

The armoep module provides operations for working with Azure Open Energy Platform.

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 Open Energy Platform module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oep/armoep

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Open Energy Platform. 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 Open Energy Platform 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 := armoep.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 := armoep.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.LocationsClient()

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 Open Energy Platform 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 CheckNameAvailabilityReason

type CheckNameAvailabilityReason string

CheckNameAvailabilityReason - The reason why the given name is not available.

const (
	CheckNameAvailabilityReasonAlreadyExists CheckNameAvailabilityReason = "AlreadyExists"
	CheckNameAvailabilityReasonInvalid       CheckNameAvailabilityReason = "Invalid"
)

func PossibleCheckNameAvailabilityReasonValues

func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason

PossibleCheckNameAvailabilityReasonValues returns the possible values for the CheckNameAvailabilityReason const type.

type CheckNameAvailabilityRequest

type CheckNameAvailabilityRequest struct {
	// The name of the resource for which availability needs to be checked.
	Name *string

	// The resource type.
	Type *string
}

CheckNameAvailabilityRequest - The check availability request body.

func (CheckNameAvailabilityRequest) MarshalJSON added in v0.5.0

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

MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest.

func (*CheckNameAvailabilityRequest) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityRequest.

type CheckNameAvailabilityResponse

type CheckNameAvailabilityResponse struct {
	// Detailed reason why the given name is available.
	Message *string

	// Indicates if the resource name is available.
	NameAvailable *bool

	// The reason why the given name is not available.
	Reason *CheckNameAvailabilityReason
}

CheckNameAvailabilityResponse - The check availability result.

func (CheckNameAvailabilityResponse) MarshalJSON added in v0.5.0

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

MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResponse.

func (*CheckNameAvailabilityResponse) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResponse.

type ClientFactory added in v0.5.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.5.0

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

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

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

func (*ClientFactory) NewEnergyServicesClient added in v0.5.0

func (c *ClientFactory) NewEnergyServicesClient() *EnergyServicesClient

NewEnergyServicesClient creates a new instance of EnergyServicesClient.

func (*ClientFactory) NewLocationsClient added in v0.5.0

func (c *ClientFactory) NewLocationsClient() *LocationsClient

NewLocationsClient creates a new instance of LocationsClient.

func (*ClientFactory) NewOperationsClient added in v0.5.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

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

type DataPartitionAddOrRemoveRequest struct {
	// Name of the data partition
	Name *string
}

DataPartitionAddOrRemoveRequest - Defines the partition add/ delete action properties.

func (DataPartitionAddOrRemoveRequest) MarshalJSON added in v0.5.0

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

MarshalJSON implements the json.Marshaller interface for type DataPartitionAddOrRemoveRequest.

func (*DataPartitionAddOrRemoveRequest) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DataPartitionAddOrRemoveRequest.

type DataPartitionNames

type DataPartitionNames struct {
	Name *string
}

DataPartitionNames - The list of Energy services resource's Data Partition Names.

func (DataPartitionNames) MarshalJSON added in v0.5.0

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

MarshalJSON implements the json.Marshaller interface for type DataPartitionNames.

func (*DataPartitionNames) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DataPartitionNames.

type DataPartitionProperties added in v0.4.0

type DataPartitionProperties struct {
	// Name of the data partition
	Name *string

	// Name of the data partition
	ProvisioningState *string
}

DataPartitionProperties - Defines the properties of an individual data partition.

func (DataPartitionProperties) MarshalJSON added in v0.5.0

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

MarshalJSON implements the json.Marshaller interface for type DataPartitionProperties.

func (*DataPartitionProperties) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DataPartitionProperties.

type DataPartitionsList added in v0.4.0

type DataPartitionsList struct {
	DataPartitionNames []*DataPartitionNames
}

DataPartitionsList - List of data partitions

func (DataPartitionsList) MarshalJSON added in v0.5.0

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

MarshalJSON implements the json.Marshaller interface for type DataPartitionsList.

func (*DataPartitionsList) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DataPartitionsList.

type DataPartitionsListResult added in v0.4.0

type DataPartitionsListResult struct {
	// List of data partitions along with their properties in a given OEP resource.
	Value []*DataPartitionProperties
}

DataPartitionsListResult - List of data partitions.

func (DataPartitionsListResult) MarshalJSON added in v0.5.0

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

MarshalJSON implements the json.Marshaller interface for type DataPartitionsListResult.

func (*DataPartitionsListResult) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type DataPartitionsListResult.

type EnergyResourceUpdate

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

EnergyResourceUpdate - The resource model definition used for updating a tracked ARM resource.

func (EnergyResourceUpdate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EnergyResourceUpdate.

func (*EnergyResourceUpdate) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type EnergyResourceUpdate.

type EnergyService

type EnergyService struct {
	// REQUIRED; Geo-location where the resource lives.
	Location   *string
	Properties *EnergyServiceProperties

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

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

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

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

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

func (EnergyService) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EnergyService.

func (*EnergyService) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type EnergyService.

type EnergyServiceList

type EnergyServiceList struct {
	// The link used to get the next page of oep resources list.
	NextLink *string

	// The list of oep resources.
	Value []*EnergyService
}

EnergyServiceList - The list of oep resources.

func (EnergyServiceList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EnergyServiceList.

func (*EnergyServiceList) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type EnergyServiceList.

type EnergyServiceProperties

type EnergyServiceProperties struct {
	AuthAppID          *string
	DataPartitionNames []*DataPartitionNames

	// READ-ONLY
	DNSName *string

	// READ-ONLY
	ProvisioningState *ProvisioningState
}

func (EnergyServiceProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type EnergyServiceProperties.

func (*EnergyServiceProperties) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type EnergyServiceProperties.

type EnergyServicesClient

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

EnergyServicesClient contains the methods for the EnergyServices group. Don't use this type directly, use NewEnergyServicesClient() instead.

func NewEnergyServicesClient

func NewEnergyServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EnergyServicesClient, error)

NewEnergyServicesClient creates a new instance of EnergyServicesClient with the specified values.

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

func (*EnergyServicesClient) BeginAddPartition added in v0.4.0

BeginAddPartition - Method that gets called if new partition is to be added in a resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-04-04-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The resource name.
  • options - EnergyServicesClientBeginAddPartitionOptions contains the optional parameters for the EnergyServicesClient.BeginAddPartition method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2022-04-04-preview/examples/EnergyServices_AddPartition_MaximumSet_Gen.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/oep/armoep"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoep.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewEnergyServicesClient().BeginAddPartition(ctx, "rgoep", "a", &armoep.EnergyServicesClientBeginAddPartitionOptions{Body: &armoep.DataPartitionAddOrRemoveRequest{
		Name: to.Ptr("aaaaaaaaaaaaaaaaaa"),
	},
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*EnergyServicesClient) BeginCreate

func (client *EnergyServicesClient) BeginCreate(ctx context.Context, resourceGroupName string, resourceName string, options *EnergyServicesClientBeginCreateOptions) (*runtime.Poller[EnergyServicesClientCreateResponse], error)

BeginCreate - Method that gets called if subscribed for ResourceCreationBegin trigger. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-04-04-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The resource name.
  • options - EnergyServicesClientBeginCreateOptions contains the optional parameters for the EnergyServicesClient.BeginCreate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2022-04-04-preview/examples/OepResource_Create.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oep/armoep"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoep.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewEnergyServicesClient().BeginCreate(ctx, "DummyResourceGroupName", "DummyResourceName", &armoep.EnergyServicesClientBeginCreateOptions{Body: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.EnergyService = armoep.EnergyService{
	// 	Name: to.Ptr("DummyResourceName"),
	// 	Type: to.Ptr("Microsoft.OEP/oepResource"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/DummyResourceGroupName/providers/Microsoft.OEP/oepResource/DummyResourceName"),
	// 	Location: to.Ptr("WestUS"),
	// 	Properties: &armoep.EnergyServiceProperties{
	// 		AuthAppID: to.Ptr("sample-id"),
	// 		DataPartitionNames: []*armoep.DataPartitionNames{
	// 			{
	// 				Name: to.Ptr("dataPartition1"),
	// 			},
	// 			{
	// 				Name: to.Ptr("dataPartition2"),
	// 		}},
	// 		ProvisioningState: to.Ptr(armoep.ProvisioningStateSucceeded),
	// 	},
	// 	Tags: map[string]*string{
	// 		"additionalProps1": to.Ptr("additional properties"),
	// 	},
	// }
}
Output:

func (*EnergyServicesClient) BeginDelete

func (client *EnergyServicesClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, options *EnergyServicesClientBeginDeleteOptions) (*runtime.Poller[EnergyServicesClientDeleteResponse], error)

BeginDelete - Deletes oep resource If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-04-04-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The resource name.
  • options - EnergyServicesClientBeginDeleteOptions contains the optional parameters for the EnergyServicesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2022-04-04-preview/examples/OepResource_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oep/armoep"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoep.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewEnergyServicesClient().BeginDelete(ctx, "DummyResourceGroupName", "DummyResourceName", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*EnergyServicesClient) BeginRemovePartition added in v0.4.0

BeginRemovePartition - Method that gets called if new partition is to be removed from a resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-04-04-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The resource name.
  • options - EnergyServicesClientBeginRemovePartitionOptions contains the optional parameters for the EnergyServicesClient.BeginRemovePartition method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2022-04-04-preview/examples/EnergyServices_RemovePartition_MaximumSet_Gen.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/oep/armoep"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoep.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewEnergyServicesClient().BeginRemovePartition(ctx, "rgoep", "aaaaaaa", &armoep.EnergyServicesClientBeginRemovePartitionOptions{Body: &armoep.DataPartitionAddOrRemoveRequest{
		Name: to.Ptr("aaaaaaaaaaaaaaaaaa"),
	},
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*EnergyServicesClient) Get

func (client *EnergyServicesClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *EnergyServicesClientGetOptions) (EnergyServicesClientGetResponse, error)

Get - Returns oep resource for a given name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-04-04-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The resource name.
  • options - EnergyServicesClientGetOptions contains the optional parameters for the EnergyServicesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2022-04-04-preview/examples/OepResource_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oep/armoep"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoep.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewEnergyServicesClient().Get(ctx, "DummyResourceGroupName", "DummyResourceName", 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.EnergyService = armoep.EnergyService{
	// 	Name: to.Ptr("DummyResourceName"),
	// 	Type: to.Ptr("Microsoft.OEP/oepResource"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/DummyResourceGroupName/providers/Microsoft.OEP/oepResource/DummyResourceName"),
	// 	Location: to.Ptr("WestUS"),
	// 	Properties: &armoep.EnergyServiceProperties{
	// 		AuthAppID: to.Ptr("sample-id"),
	// 		DataPartitionNames: []*armoep.DataPartitionNames{
	// 			{
	// 				Name: to.Ptr("dataPartition1"),
	// 			},
	// 			{
	// 				Name: to.Ptr("dataPartition2"),
	// 		}},
	// 		ProvisioningState: to.Ptr(armoep.ProvisioningStateSucceeded),
	// 	},
	// 	Tags: map[string]*string{
	// 		"additionalProps1": to.Ptr("additional properties"),
	// 	},
	// }
}
Output:

func (*EnergyServicesClient) ListPartitions added in v0.4.0

func (client *EnergyServicesClient) ListPartitions(ctx context.Context, resourceGroupName string, resourceName string, options *EnergyServicesClientListPartitionsOptions) (EnergyServicesClientListPartitionsResponse, error)

ListPartitions - Method that gets called when list of partitions is requested. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-04-04-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The resource name.
  • options - EnergyServicesClientListPartitionsOptions contains the optional parameters for the EnergyServicesClient.ListPartitions method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2022-04-04-preview/examples/EnergyServices_ListPartitions_MaximumSet_Gen.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oep/armoep"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoep.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewEnergyServicesClient().ListPartitions(ctx, "rgoep", "aaaaaaaaaaaaaaaaaaa", 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.DataPartitionsListResult = armoep.DataPartitionsListResult{
	// 	Value: []*armoep.DataPartitionProperties{
	// 		{
	// 			Name: to.Ptr("aaaaaaaaaaa"),
	// 			ProvisioningState: to.Ptr("Succeeded"),
	// 	}},
	// }
}
Output:

func (*EnergyServicesClient) NewListByResourceGroupPager added in v0.3.0

NewListByResourceGroupPager - Returns list of oep resources..

Generated from API version 2022-04-04-preview

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2022-04-04-preview/examples/OepResource_ListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oep/armoep"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoep.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewEnergyServicesClient().NewListByResourceGroupPager("DummyResourceGroupName", 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.EnergyServiceList = armoep.EnergyServiceList{
		// 	Value: []*armoep.EnergyService{
		// 		{
		// 			Name: to.Ptr("DummyResourceName"),
		// 			Type: to.Ptr("Microsoft.OEP/oepResource"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/DummyResourceGroupName/providers/Microsoft.OEP/oepResource/DummyResourceName"),
		// 			Location: to.Ptr("WestUS"),
		// 			Properties: &armoep.EnergyServiceProperties{
		// 				AuthAppID: to.Ptr("sample-id"),
		// 				DataPartitionNames: []*armoep.DataPartitionNames{
		// 					{
		// 						Name: to.Ptr("dataPartition1"),
		// 					},
		// 					{
		// 						Name: to.Ptr("dataPartition2"),
		// 				}},
		// 				ProvisioningState: to.Ptr(armoep.ProvisioningStateSucceeded),
		// 			},
		// 			Tags: map[string]*string{
		// 				"additionalProps1": to.Ptr("additional properties"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*EnergyServicesClient) NewListBySubscriptionPager added in v0.3.0

NewListBySubscriptionPager - Lists a collection of oep resources under the given Azure Subscription ID.

Generated from API version 2022-04-04-preview

  • options - EnergyServicesClientListBySubscriptionOptions contains the optional parameters for the EnergyServicesClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2022-04-04-preview/examples/OepResource_ListBySubscriptionId.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oep/armoep"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoep.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewEnergyServicesClient().NewListBySubscriptionPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.EnergyServiceList = armoep.EnergyServiceList{
		// 	Value: []*armoep.EnergyService{
		// 		{
		// 			Name: to.Ptr("DummyResourceName"),
		// 			Type: to.Ptr("Microsoft.OEP/oepResource"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/DummyResourceGroupName/providers/Microsoft.OEP/oepResource/DummyResourceName"),
		// 			Location: to.Ptr("WestUS"),
		// 			Properties: &armoep.EnergyServiceProperties{
		// 				AuthAppID: to.Ptr("sample-id"),
		// 				DataPartitionNames: []*armoep.DataPartitionNames{
		// 					{
		// 						Name: to.Ptr("dataPartition1"),
		// 					},
		// 					{
		// 						Name: to.Ptr("dataPartition2"),
		// 				}},
		// 				ProvisioningState: to.Ptr(armoep.ProvisioningStateSucceeded),
		// 			},
		// 			Tags: map[string]*string{
		// 				"additionalProps1": to.Ptr("additional properties"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*EnergyServicesClient) Update

func (client *EnergyServicesClient) Update(ctx context.Context, resourceGroupName string, resourceName string, options *EnergyServicesClientUpdateOptions) (EnergyServicesClientUpdateResponse, error)

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

Generated from API version 2022-04-04-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • resourceName - The resource name.
  • options - EnergyServicesClientUpdateOptions contains the optional parameters for the EnergyServicesClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2022-04-04-preview/examples/OepResource_Update.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oep/armoep"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoep.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewEnergyServicesClient().Update(ctx, "DummyResourceGroupName", "DummyResourceName", &armoep.EnergyServicesClientUpdateOptions{Body: 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.EnergyService = armoep.EnergyService{
	// 	Name: to.Ptr("DummyResourceName"),
	// 	Type: to.Ptr("Microsoft.OEP/oepResource"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/DummyResourceGroupName/providers/Microsoft.OEP/oepResource/DummyResourceName"),
	// 	Location: to.Ptr("WestUS"),
	// 	Properties: &armoep.EnergyServiceProperties{
	// 		AuthAppID: to.Ptr("sample-id"),
	// 		DataPartitionNames: []*armoep.DataPartitionNames{
	// 			{
	// 				Name: to.Ptr("dataPartition1"),
	// 			},
	// 			{
	// 				Name: to.Ptr("dataPartition2"),
	// 		}},
	// 		ProvisioningState: to.Ptr(armoep.ProvisioningStateSucceeded),
	// 	},
	// 	Tags: map[string]*string{
	// 		"additionalProps1": to.Ptr("additional properties"),
	// 	},
	// }
}
Output:

type EnergyServicesClientAddPartitionResponse added in v0.4.0

type EnergyServicesClientAddPartitionResponse struct {
}

EnergyServicesClientAddPartitionResponse contains the response from method EnergyServicesClient.BeginAddPartition.

type EnergyServicesClientBeginAddPartitionOptions added in v0.4.0

type EnergyServicesClientBeginAddPartitionOptions struct {
	// add partition action payload
	Body *DataPartitionAddOrRemoveRequest

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

EnergyServicesClientBeginAddPartitionOptions contains the optional parameters for the EnergyServicesClient.BeginAddPartition method.

type EnergyServicesClientBeginCreateOptions

type EnergyServicesClientBeginCreateOptions struct {
	// Request body.
	Body *EnergyService

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

EnergyServicesClientBeginCreateOptions contains the optional parameters for the EnergyServicesClient.BeginCreate method.

type EnergyServicesClientBeginDeleteOptions

type EnergyServicesClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

EnergyServicesClientBeginDeleteOptions contains the optional parameters for the EnergyServicesClient.BeginDelete method.

type EnergyServicesClientBeginRemovePartitionOptions added in v0.4.0

type EnergyServicesClientBeginRemovePartitionOptions struct {
	// remove partition action payload
	Body *DataPartitionAddOrRemoveRequest

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

EnergyServicesClientBeginRemovePartitionOptions contains the optional parameters for the EnergyServicesClient.BeginRemovePartition method.

type EnergyServicesClientCreateResponse

type EnergyServicesClientCreateResponse struct {
	EnergyService
}

EnergyServicesClientCreateResponse contains the response from method EnergyServicesClient.BeginCreate.

type EnergyServicesClientDeleteResponse

type EnergyServicesClientDeleteResponse struct {
}

EnergyServicesClientDeleteResponse contains the response from method EnergyServicesClient.BeginDelete.

type EnergyServicesClientGetOptions

type EnergyServicesClientGetOptions struct {
}

EnergyServicesClientGetOptions contains the optional parameters for the EnergyServicesClient.Get method.

type EnergyServicesClientGetResponse

type EnergyServicesClientGetResponse struct {
	EnergyService
}

EnergyServicesClientGetResponse contains the response from method EnergyServicesClient.Get.

type EnergyServicesClientListByResourceGroupOptions

type EnergyServicesClientListByResourceGroupOptions struct {
}

EnergyServicesClientListByResourceGroupOptions contains the optional parameters for the EnergyServicesClient.NewListByResourceGroupPager method.

type EnergyServicesClientListByResourceGroupResponse

type EnergyServicesClientListByResourceGroupResponse struct {
	// The list of oep resources.
	EnergyServiceList
}

EnergyServicesClientListByResourceGroupResponse contains the response from method EnergyServicesClient.NewListByResourceGroupPager.

type EnergyServicesClientListBySubscriptionOptions

type EnergyServicesClientListBySubscriptionOptions struct {
}

EnergyServicesClientListBySubscriptionOptions contains the optional parameters for the EnergyServicesClient.NewListBySubscriptionPager method.

type EnergyServicesClientListBySubscriptionResponse

type EnergyServicesClientListBySubscriptionResponse struct {
	// The list of oep resources.
	EnergyServiceList
}

EnergyServicesClientListBySubscriptionResponse contains the response from method EnergyServicesClient.NewListBySubscriptionPager.

type EnergyServicesClientListPartitionsOptions added in v0.4.0

type EnergyServicesClientListPartitionsOptions struct {
}

EnergyServicesClientListPartitionsOptions contains the optional parameters for the EnergyServicesClient.ListPartitions method.

type EnergyServicesClientListPartitionsResponse added in v0.4.0

type EnergyServicesClientListPartitionsResponse struct {
	// List of data partitions.
	DataPartitionsListResult
}

EnergyServicesClientListPartitionsResponse contains the response from method EnergyServicesClient.ListPartitions.

type EnergyServicesClientRemovePartitionResponse added in v0.4.0

type EnergyServicesClientRemovePartitionResponse struct {
}

EnergyServicesClientRemovePartitionResponse contains the response from method EnergyServicesClient.BeginRemovePartition.

type EnergyServicesClientUpdateOptions

type EnergyServicesClientUpdateOptions struct {
	Body *EnergyResourceUpdate
}

EnergyServicesClientUpdateOptions contains the optional parameters for the EnergyServicesClient.Update method.

type EnergyServicesClientUpdateResponse

type EnergyServicesClientUpdateResponse struct {
	EnergyService
}

EnergyServicesClientUpdateResponse contains the response from method EnergyServicesClient.Update.

type ErrorAdditionalInfo

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

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

ErrorAdditionalInfo - The resource management error additional info.

func (ErrorAdditionalInfo) MarshalJSON added in v0.5.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.

func (*ErrorAdditionalInfo) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.

type ErrorDetail

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

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

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

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

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

ErrorDetail - The error detail.

func (ErrorDetail) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ErrorDetail.

func (*ErrorDetail) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail.

type ErrorResponse

type ErrorResponse struct {
	// The error object.
	Error *ErrorDetail
}

ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).

func (ErrorResponse) MarshalJSON added in v0.5.0

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

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type LocationsClient

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

LocationsClient contains the methods for the Locations group. Don't use this type directly, use NewLocationsClient() instead.

func NewLocationsClient

func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationsClient, error)

NewLocationsClient creates a new instance of LocationsClient with the specified values.

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

func (*LocationsClient) CheckNameAvailability

CheckNameAvailability - Checks the name availability of the resource with requested resource name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-04-04-preview

  • body - NameAvailabilityRequest object.
  • options - LocationsClientCheckNameAvailabilityOptions contains the optional parameters for the LocationsClient.CheckNameAvailability method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2022-04-04-preview/examples/Locations_CheckNameAvailability.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/oep/armoep"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoep.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewLocationsClient().CheckNameAvailability(ctx, armoep.CheckNameAvailabilityRequest{
		Name: to.Ptr("sample-name"),
		Type: to.Ptr("Microsoft.OEP/oepResource"),
	}, 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.CheckNameAvailabilityResponse = armoep.CheckNameAvailabilityResponse{
	// 	NameAvailable: to.Ptr(true),
	// }
}
Output:

type LocationsClientCheckNameAvailabilityOptions

type LocationsClientCheckNameAvailabilityOptions struct {
}

LocationsClientCheckNameAvailabilityOptions contains the optional parameters for the LocationsClient.CheckNameAvailability method.

type LocationsClientCheckNameAvailabilityResponse

type LocationsClientCheckNameAvailabilityResponse struct {
	// The check availability result.
	CheckNameAvailabilityResponse
}

LocationsClientCheckNameAvailabilityResponse contains the response from method LocationsClient.CheckNameAvailability.

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.5.0

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v0.5.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.5.0

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON added in v0.5.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

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

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON added in v0.5.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 the available operations of Microsoft.OpenEnergyPlatform resource provider. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-04-04-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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2022-04-04-preview/examples/Operations_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/oep/armoep"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armoep.NewClientFactory("<subscription-id>", 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 = armoep.OperationListResult{
	// 	Value: []*armoep.Operation{
	// 		{
	// 			Name: to.Ptr("Microsoft.OpenEnergyPlatform/register/action"),
	// 			Display: &armoep.OperationDisplay{
	// 				Description: to.Ptr("Register the subscription for Microsoft.OpenEnergyPlatform"),
	// 				Operation: to.Ptr("Register the Microsoft.OpenEnergyPlatform"),
	// 				Provider: to.Ptr("Microsoft.OpenEnergyPlatform"),
	// 				Resource: to.Ptr("Microsoft.OpenEnergyPlatform"),
	// 			},
	// 			IsDataAction: to.Ptr(false),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.OpenEnergyPlatform/unregister/action"),
	// 			Display: &armoep.OperationDisplay{
	// 				Description: to.Ptr("Unregister the subscription for Microsoft.OpenEnergyPlatform"),
	// 				Operation: to.Ptr("Unregister the Microsoft.OpenEnergyPlatform"),
	// 				Provider: to.Ptr("Microsoft.OpenEnergyPlatform"),
	// 				Resource: to.Ptr("Microsoft.OpenEnergyPlatform"),
	// 			},
	// 			IsDataAction: to.Ptr(false),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.OpenEnergyPlatform/Locations/OperationStatuses/read"),
	// 			Display: &armoep.OperationDisplay{
	// 				Description: to.Ptr("read OperationStatuses"),
	// 				Operation: to.Ptr("read_OperationStatuses"),
	// 				Provider: to.Ptr("Microsoft.OpenEnergyPlatform"),
	// 				Resource: to.Ptr("Locations/OperationStatuses"),
	// 			},
	// 			IsDataAction: to.Ptr(false),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.OpenEnergyPlatform/Locations/OperationStatuses/write"),
	// 			Display: &armoep.OperationDisplay{
	// 				Description: to.Ptr("write OperationStatuses"),
	// 				Operation: to.Ptr("write_OperationStatuses"),
	// 				Provider: to.Ptr("Microsoft.OpenEnergyPlatform"),
	// 				Resource: to.Ptr("Locations/OperationStatuses"),
	// 			},
	// 			IsDataAction: to.Ptr(false),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.OpenEnergyPlatform/energyServices/read"),
	// 			Display: &armoep.OperationDisplay{
	// 				Description: to.Ptr("Returns list of oep resources.."),
	// 				Operation: to.Ptr("OepResources_ListByResourceGroup"),
	// 				Provider: to.Ptr("Microsoft.OpenEnergyPlatform"),
	// 				Resource: to.Ptr("energyServices"),
	// 			},
	// 			IsDataAction: to.Ptr(false),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.OpenEnergyPlatform/energyServices/read"),
	// 			Display: &armoep.OperationDisplay{
	// 				Description: to.Ptr("Lists a collection of oep resources under the given Azure Subscription ID."),
	// 				Operation: to.Ptr("OepResources_ListBySubscriptionId"),
	// 				Provider: to.Ptr("Microsoft.OpenEnergyPlatform"),
	// 				Resource: to.Ptr("energyServices"),
	// 			},
	// 			IsDataAction: to.Ptr(false),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.OpenEnergyPlatform/energyServices/read"),
	// 			Display: &armoep.OperationDisplay{
	// 				Description: to.Ptr("Returns oep resource for a given name."),
	// 				Operation: to.Ptr("OepResources_Get"),
	// 				Provider: to.Ptr("Microsoft.OpenEnergyPlatform"),
	// 				Resource: to.Ptr("energyServices"),
	// 			},
	// 			IsDataAction: to.Ptr(false),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.OpenEnergyPlatform/energyServices/write"),
	// 			Display: &armoep.OperationDisplay{
	// 				Description: to.Ptr("Method that gets called if subscribed for ResourceCreationBegin trigger."),
	// 				Operation: to.Ptr("OepResources_Create"),
	// 				Provider: to.Ptr("Microsoft.OpenEnergyPlatform"),
	// 				Resource: to.Ptr("energyServices"),
	// 			},
	// 			IsDataAction: to.Ptr(false),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.OpenEnergyPlatform/energyServices/delete"),
	// 			Display: &armoep.OperationDisplay{
	// 				Description: to.Ptr("Deletes oep resource"),
	// 				Operation: to.Ptr("OepResources_Delete"),
	// 				Provider: to.Ptr("Microsoft.OpenEnergyPlatform"),
	// 				Resource: to.Ptr("energyServices"),
	// 			},
	// 			IsDataAction: to.Ptr(false),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.OpenEnergyPlatform/energyServices/write"),
	// 			Display: &armoep.OperationDisplay{
	// 				Description: to.Ptr("write energyServices"),
	// 				Operation: to.Ptr("OepResources_Update"),
	// 				Provider: to.Ptr("Microsoft.OpenEnergyPlatform"),
	// 				Resource: to.Ptr("energyServices"),
	// 			},
	// 			IsDataAction: to.Ptr(false),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.OpenEnergyPlatform/Operations/read"),
	// 			Display: &armoep.OperationDisplay{
	// 				Description: to.Ptr("read Operations"),
	// 				Operation: to.Ptr("read_Operations"),
	// 				Provider: to.Ptr("Microsoft.OpenEnergyPlatform"),
	// 				Resource: to.Ptr("Operations"),
	// 			},
	// 			IsDataAction: to.Ptr(false),
	// 		},
	// 		{
	// 			Name: to.Ptr("Microsoft.OpenEnergyPlatform/checkNameAvailability/action"),
	// 			Display: &armoep.OperationDisplay{
	// 				Description: to.Ptr("action checkNameAvailability"),
	// 				Operation: to.Ptr("action_checkNameAvailability"),
	// 				Provider: to.Ptr("Microsoft.OpenEnergyPlatform"),
	// 				Resource: to.Ptr("checkNameAvailability"),
	// 			},
	// 			IsDataAction: to.Ptr(false),
	// 	}},
	// }
}
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 ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateCanceled  ProvisioningState = "Canceled"
	ProvisioningStateCreating  ProvisioningState = "Creating"
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	ProvisioningStateUnknown   ProvisioningState = "Unknown"
	ProvisioningStateUpdating  ProvisioningState = "Updating"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

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.5.0

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

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v0.5.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

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