Documentation ¶
Index ¶
- type ActionType
- type CheckNameAvailabilityReason
- type CheckNameAvailabilityRequest
- type CheckNameAvailabilityResponse
- type ClientFactory
- type CreatedByType
- type DataPartitionAddOrRemoveRequest
- type DataPartitionNames
- type DataPartitionProperties
- type DataPartitionsList
- type DataPartitionsListResult
- type EnergyResourceUpdate
- type EnergyService
- type EnergyServiceList
- type EnergyServiceProperties
- type EnergyServicesClient
- func (client *EnergyServicesClient) BeginAddPartition(ctx context.Context, resourceGroupName string, resourceName string, ...) (*runtime.Poller[EnergyServicesClientAddPartitionResponse], error)
- func (client *EnergyServicesClient) BeginCreate(ctx context.Context, resourceGroupName string, resourceName string, ...) (*runtime.Poller[EnergyServicesClientCreateResponse], error)
- func (client *EnergyServicesClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, ...) (*runtime.Poller[EnergyServicesClientDeleteResponse], error)
- func (client *EnergyServicesClient) BeginRemovePartition(ctx context.Context, resourceGroupName string, resourceName string, ...) (*runtime.Poller[EnergyServicesClientRemovePartitionResponse], error)
- func (client *EnergyServicesClient) Get(ctx context.Context, resourceGroupName string, resourceName string, ...) (EnergyServicesClientGetResponse, error)
- func (client *EnergyServicesClient) ListPartitions(ctx context.Context, resourceGroupName string, resourceName string, ...) (EnergyServicesClientListPartitionsResponse, error)
- func (client *EnergyServicesClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[EnergyServicesClientListByResourceGroupResponse]
- func (client *EnergyServicesClient) NewListBySubscriptionPager(options *EnergyServicesClientListBySubscriptionOptions) *runtime.Pager[EnergyServicesClientListBySubscriptionResponse]
- func (client *EnergyServicesClient) Update(ctx context.Context, resourceGroupName string, resourceName string, ...) (EnergyServicesClientUpdateResponse, error)
- type EnergyServicesClientAddPartitionResponse
- type EnergyServicesClientBeginAddPartitionOptions
- type EnergyServicesClientBeginCreateOptions
- type EnergyServicesClientBeginDeleteOptions
- type EnergyServicesClientBeginRemovePartitionOptions
- type EnergyServicesClientCreateResponse
- type EnergyServicesClientDeleteResponse
- type EnergyServicesClientGetOptions
- type EnergyServicesClientGetResponse
- type EnergyServicesClientListByResourceGroupOptions
- type EnergyServicesClientListByResourceGroupResponse
- type EnergyServicesClientListBySubscriptionOptions
- type EnergyServicesClientListBySubscriptionResponse
- type EnergyServicesClientListPartitionsOptions
- type EnergyServicesClientListPartitionsResponse
- type EnergyServicesClientRemovePartitionResponse
- type EnergyServicesClientUpdateOptions
- type EnergyServicesClientUpdateResponse
- type ErrorAdditionalInfo
- type ErrorDetail
- type ErrorResponse
- type LocationsClient
- type LocationsClientCheckNameAvailabilityOptions
- type LocationsClientCheckNameAvailabilityResponse
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type Origin
- type ProvisioningState
- type Resource
- type SystemData
Examples ¶
- EnergyServicesClient.BeginAddPartition
- EnergyServicesClient.BeginCreate
- EnergyServicesClient.BeginDelete
- EnergyServicesClient.BeginRemovePartition
- EnergyServicesClient.Get
- EnergyServicesClient.ListPartitions
- EnergyServicesClient.NewListByResourceGroupPager
- EnergyServicesClient.NewListBySubscriptionPager
- EnergyServicesClient.Update
- LocationsClient.CheckNameAvailability
- OperationsClient.List
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 ¶
func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest.
func (*CheckNameAvailabilityRequest) UnmarshalJSON ¶
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 ¶
func (c CheckNameAvailabilityResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResponse.
func (*CheckNameAvailabilityResponse) UnmarshalJSON ¶
func (c *CheckNameAvailabilityResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResponse.
type ClientFactory ¶
type ClientFactory struct {
// contains filtered or unexported fields
}
ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.
func NewClientFactory ¶
func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)
NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClientFactory) NewEnergyServicesClient ¶
func (c *ClientFactory) NewEnergyServicesClient() *EnergyServicesClient
NewEnergyServicesClient creates a new instance of EnergyServicesClient.
func (*ClientFactory) NewLocationsClient ¶
func (c *ClientFactory) NewLocationsClient() *LocationsClient
NewLocationsClient creates a new instance of LocationsClient.
func (*ClientFactory) NewOperationsClient ¶
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 ¶
type DataPartitionAddOrRemoveRequest struct { // Name of the data partition Name *string }
DataPartitionAddOrRemoveRequest - Defines the partition add/ delete action properties.
func (DataPartitionAddOrRemoveRequest) MarshalJSON ¶
func (d DataPartitionAddOrRemoveRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataPartitionAddOrRemoveRequest.
func (*DataPartitionAddOrRemoveRequest) UnmarshalJSON ¶
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 ¶
func (d DataPartitionNames) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataPartitionNames.
func (*DataPartitionNames) UnmarshalJSON ¶
func (d *DataPartitionNames) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataPartitionNames.
type DataPartitionProperties ¶
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 ¶
func (d DataPartitionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataPartitionProperties.
func (*DataPartitionProperties) UnmarshalJSON ¶
func (d *DataPartitionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataPartitionProperties.
type DataPartitionsList ¶
type DataPartitionsList struct {
DataPartitionNames []*DataPartitionNames
}
DataPartitionsList - List of data partitions
func (DataPartitionsList) MarshalJSON ¶
func (d DataPartitionsList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataPartitionsList.
func (*DataPartitionsList) UnmarshalJSON ¶
func (d *DataPartitionsList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataPartitionsList.
type DataPartitionsListResult ¶
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 ¶
func (d DataPartitionsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataPartitionsListResult.
func (*DataPartitionsListResult) UnmarshalJSON ¶
func (d *DataPartitionsListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataPartitionsListResult.
type EnergyResourceUpdate ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
func (client *EnergyServicesClient) BeginAddPartition(ctx context.Context, resourceGroupName string, resourceName string, options *EnergyServicesClientBeginAddPartitionOptions) (*runtime.Poller[EnergyServicesClientAddPartitionResponse], error)
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 ¶
func (client *EnergyServicesClient) BeginRemovePartition(ctx context.Context, resourceGroupName string, resourceName string, options *EnergyServicesClientBeginRemovePartitionOptions) (*runtime.Poller[EnergyServicesClientRemovePartitionResponse], error)
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 ¶
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 ¶
func (client *EnergyServicesClient) NewListByResourceGroupPager(resourceGroupName string, options *EnergyServicesClientListByResourceGroupOptions) *runtime.Pager[EnergyServicesClientListByResourceGroupResponse]
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 ¶
func (client *EnergyServicesClient) NewListBySubscriptionPager(options *EnergyServicesClientListBySubscriptionOptions) *runtime.Pager[EnergyServicesClientListBySubscriptionResponse]
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 ¶
type EnergyServicesClientAddPartitionResponse struct { }
EnergyServicesClientAddPartitionResponse contains the response from method EnergyServicesClient.BeginAddPartition.
type EnergyServicesClientBeginAddPartitionOptions ¶
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 ¶
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 ¶
type EnergyServicesClientListPartitionsOptions struct { }
EnergyServicesClientListPartitionsOptions contains the optional parameters for the EnergyServicesClient.ListPartitions method.
type EnergyServicesClientListPartitionsResponse ¶
type EnergyServicesClientListPartitionsResponse struct { // List of data partitions. DataPartitionsListResult }
EnergyServicesClientListPartitionsResponse contains the response from method EnergyServicesClient.ListPartitions.
type EnergyServicesClientRemovePartitionResponse ¶
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 ¶
func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.
func (*ErrorAdditionalInfo) UnmarshalJSON ¶
func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.
type ErrorDetail ¶
type ErrorDetail struct { // READ-ONLY; The error additional info. AdditionalInfo []*ErrorAdditionalInfo // READ-ONLY; The error code. Code *string // READ-ONLY; The error details. Details []*ErrorDetail // READ-ONLY; The error message. Message *string // READ-ONLY; The error target. Target *string }
ErrorDetail - The error detail.
func (ErrorDetail) MarshalJSON ¶
func (e ErrorDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorDetail.
func (*ErrorDetail) UnmarshalJSON ¶
func (e *ErrorDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail.
type 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 ¶
func (e ErrorResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorResponse.
func (*ErrorResponse) UnmarshalJSON ¶
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 ¶
func (client *LocationsClient) CheckNameAvailability(ctx context.Context, body CheckNameAvailabilityRequest, options *LocationsClientCheckNameAvailabilityOptions) (LocationsClientCheckNameAvailabilityResponse, error)
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 ¶
MarshalJSON implements the json.Marshaller interface for type Operation.
func (*Operation) UnmarshalJSON ¶
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 ¶
func (o OperationDisplay) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
func (*OperationDisplay) UnmarshalJSON ¶
func (o *OperationDisplay) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
type OperationListResult ¶
type OperationListResult struct { // 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 ¶
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 ¶
func (client *OperationsClient) List(ctx context.Context, options *OperationsClientListOptions) (OperationsClientListResponse, error)
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"
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 ¶
MarshalJSON implements the json.Marshaller interface for type Resource.
func (*Resource) UnmarshalJSON ¶
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.