Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto PR: Regenerating the Go SDK (54d8a60b59f93e61ca18978eec74ad497c4b1fbd) #1159

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type MCAPriceSheetProperties struct {
EffectiveStartDate *string `json:"effectiveStartDate,omitempty"`
MarketPrice *string `json:"marketPrice,omitempty"`
MeterCategory *string `json:"meterCategory,omitempty"`
MeterId *string `json:"meterId,omitempty"`
MeterName *string `json:"meterName,omitempty"`
MeterRegion *string `json:"meterRegion,omitempty"`
MeterSubCategory *string `json:"meterSubCategory,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type MCAPriceSheetProperties struct {
EffectiveStartDate *string `json:"effectiveStartDate,omitempty"`
MarketPrice *string `json:"marketPrice,omitempty"`
MeterCategory *string `json:"meterCategory,omitempty"`
MeterId *string `json:"meterId,omitempty"`
MeterName *string `json:"meterName,omitempty"`
MeterRegion *string `json:"meterRegion,omitempty"`
MeterSubCategory *string `json:"meterSubCategory,omitempty"`
Expand Down
64 changes: 64 additions & 0 deletions resource-manager/devopsinfrastructure/2025-01-21/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package v2025_01_21

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.

import (
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/devopsinfrastructure/2025-01-21/imageversions"
"github.com/hashicorp/go-azure-sdk/resource-manager/devopsinfrastructure/2025-01-21/pools"
"github.com/hashicorp/go-azure-sdk/resource-manager/devopsinfrastructure/2025-01-21/resourcedetails"
"github.com/hashicorp/go-azure-sdk/resource-manager/devopsinfrastructure/2025-01-21/sku"
"github.com/hashicorp/go-azure-sdk/resource-manager/devopsinfrastructure/2025-01-21/subscriptionusages"
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
)

type Client struct {
ImageVersions *imageversions.ImageVersionsClient
Pools *pools.PoolsClient
ResourceDetails *resourcedetails.ResourceDetailsClient
Sku *sku.SkuClient
SubscriptionUsages *subscriptionusages.SubscriptionUsagesClient
}

func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) {
imageVersionsClient, err := imageversions.NewImageVersionsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ImageVersions client: %+v", err)
}
configureFunc(imageVersionsClient.Client)

poolsClient, err := pools.NewPoolsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building Pools client: %+v", err)
}
configureFunc(poolsClient.Client)

resourceDetailsClient, err := resourcedetails.NewResourceDetailsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ResourceDetails client: %+v", err)
}
configureFunc(resourceDetailsClient.Client)

skuClient, err := sku.NewSkuClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building Sku client: %+v", err)
}
configureFunc(skuClient.Client)

subscriptionUsagesClient, err := subscriptionusages.NewSubscriptionUsagesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building SubscriptionUsages client: %+v", err)
}
configureFunc(subscriptionUsagesClient.Client)

return &Client{
ImageVersions: imageVersionsClient,
Pools: poolsClient,
ResourceDetails: resourceDetailsClient,
Sku: skuClient,
SubscriptionUsages: subscriptionUsagesClient,
}, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

## `github.com/hashicorp/go-azure-sdk/resource-manager/devopsinfrastructure/2025-01-21/imageversions` Documentation

The `imageversions` SDK allows for interaction with Azure Resource Manager `devopsinfrastructure` (API Version `2025-01-21`).

This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs).

### Import Path

```go
import "github.com/hashicorp/go-azure-sdk/resource-manager/devopsinfrastructure/2025-01-21/imageversions"
```


### Client Initialization

```go
client := imageversions.NewImageVersionsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer
```


### Example Usage: `ImageVersionsClient.ListByImage`

```go
ctx := context.TODO()
id := imageversions.NewImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "imageName")

// alternatively `client.ListByImage(ctx, id)` can be used to do batched pagination
items, err := client.ListByImageComplete(ctx, id)
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dataproductscatalogs
package imageversions

import (
"fmt"
Expand All @@ -10,17 +10,17 @@ import (
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.

type DataProductsCatalogsClient struct {
type ImageVersionsClient struct {
Client *resourcemanager.Client
}

func NewDataProductsCatalogsClientWithBaseURI(sdkApi sdkEnv.Api) (*DataProductsCatalogsClient, error) {
client, err := resourcemanager.NewClient(sdkApi, "dataproductscatalogs", defaultApiVersion)
func NewImageVersionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ImageVersionsClient, error) {
client, err := resourcemanager.NewClient(sdkApi, "imageversions", defaultApiVersion)
if err != nil {
return nil, fmt.Errorf("instantiating DataProductsCatalogsClient: %+v", err)
return nil, fmt.Errorf("instantiating ImageVersionsClient: %+v", err)
}

return &DataProductsCatalogsClient{
return &ImageVersionsClient{
Client: client,
}, nil
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package datatypes
package imageversions

import (
"fmt"
Expand All @@ -12,61 +12,61 @@ import (
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.

func init() {
recaser.RegisterResourceId(&DataProductId{})
recaser.RegisterResourceId(&ImageId{})
}

var _ resourceids.ResourceId = &DataProductId{}
var _ resourceids.ResourceId = &ImageId{}

// DataProductId is a struct representing the Resource ID for a Data Product
type DataProductId struct {
// ImageId is a struct representing the Resource ID for a Image
type ImageId struct {
SubscriptionId string
ResourceGroupName string
DataProductName string
ImageName string
}

// NewDataProductID returns a new DataProductId struct
func NewDataProductID(subscriptionId string, resourceGroupName string, dataProductName string) DataProductId {
return DataProductId{
// NewImageID returns a new ImageId struct
func NewImageID(subscriptionId string, resourceGroupName string, imageName string) ImageId {
return ImageId{
SubscriptionId: subscriptionId,
ResourceGroupName: resourceGroupName,
DataProductName: dataProductName,
ImageName: imageName,
}
}

// ParseDataProductID parses 'input' into a DataProductId
func ParseDataProductID(input string) (*DataProductId, error) {
parser := resourceids.NewParserFromResourceIdType(&DataProductId{})
// ParseImageID parses 'input' into a ImageId
func ParseImageID(input string) (*ImageId, error) {
parser := resourceids.NewParserFromResourceIdType(&ImageId{})
parsed, err := parser.Parse(input, false)
if err != nil {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

id := DataProductId{}
id := ImageId{}
if err = id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
}

// ParseDataProductIDInsensitively parses 'input' case-insensitively into a DataProductId
// ParseImageIDInsensitively parses 'input' case-insensitively into a ImageId
// note: this method should only be used for API response data and not user input
func ParseDataProductIDInsensitively(input string) (*DataProductId, error) {
parser := resourceids.NewParserFromResourceIdType(&DataProductId{})
func ParseImageIDInsensitively(input string) (*ImageId, error) {
parser := resourceids.NewParserFromResourceIdType(&ImageId{})
parsed, err := parser.Parse(input, true)
if err != nil {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

id := DataProductId{}
id := ImageId{}
if err = id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
}

func (id *DataProductId) FromParseResult(input resourceids.ParseResult) error {
func (id *ImageId) FromParseResult(input resourceids.ParseResult) error {
var ok bool

if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok {
Expand All @@ -77,54 +77,54 @@ func (id *DataProductId) FromParseResult(input resourceids.ParseResult) error {
return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input)
}

if id.DataProductName, ok = input.Parsed["dataProductName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "dataProductName", input)
if id.ImageName, ok = input.Parsed["imageName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "imageName", input)
}

return nil
}

// ValidateDataProductID checks that 'input' can be parsed as a Data Product ID
func ValidateDataProductID(input interface{}, key string) (warnings []string, errors []error) {
// ValidateImageID checks that 'input' can be parsed as a Image ID
func ValidateImageID(input interface{}, key string) (warnings []string, errors []error) {
v, ok := input.(string)
if !ok {
errors = append(errors, fmt.Errorf("expected %q to be a string", key))
return
}

if _, err := ParseDataProductID(v); err != nil {
if _, err := ParseImageID(v); err != nil {
errors = append(errors, err)
}

return
}

// ID returns the formatted Data Product ID
func (id DataProductId) ID() string {
fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetworkAnalytics/dataProducts/%s"
return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DataProductName)
// ID returns the formatted Image ID
func (id ImageId) ID() string {
fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DevOpsInfrastructure/images/%s"
return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ImageName)
}

// Segments returns a slice of Resource ID Segments which comprise this Data Product ID
func (id DataProductId) Segments() []resourceids.Segment {
// Segments returns a slice of Resource ID Segments which comprise this Image ID
func (id ImageId) Segments() []resourceids.Segment {
return []resourceids.Segment{
resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"),
resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"),
resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"),
resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"),
resourceids.StaticSegment("staticProviders", "providers", "providers"),
resourceids.ResourceProviderSegment("staticMicrosoftNetworkAnalytics", "Microsoft.NetworkAnalytics", "Microsoft.NetworkAnalytics"),
resourceids.StaticSegment("staticDataProducts", "dataProducts", "dataProducts"),
resourceids.UserSpecifiedSegment("dataProductName", "dataProductName"),
resourceids.ResourceProviderSegment("staticMicrosoftDevOpsInfrastructure", "Microsoft.DevOpsInfrastructure", "Microsoft.DevOpsInfrastructure"),
resourceids.StaticSegment("staticImages", "images", "images"),
resourceids.UserSpecifiedSegment("imageName", "imageName"),
}
}

// String returns a human-readable description of this Data Product ID
func (id DataProductId) String() string {
// String returns a human-readable description of this Image ID
func (id ImageId) String() string {
components := []string{
fmt.Sprintf("Subscription: %q", id.SubscriptionId),
fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName),
fmt.Sprintf("Data Product Name: %q", id.DataProductName),
fmt.Sprintf("Image Name: %q", id.ImageName),
}
return fmt.Sprintf("Data Product (%s)", strings.Join(components, "\n"))
return fmt.Sprintf("Image (%s)", strings.Join(components, "\n"))
}
Loading
Loading