Skip to content

Commit d672781

Browse files
author
hc-github-team-tf-azure
committed
Updating based on d73e91129
1 parent ff63a78 commit d672781

File tree

486 files changed

+38013
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

486 files changed

+38013
-22
lines changed

resource-manager/costmanagement/2023-11-01/pricesheets/model_mcapricesheetproperties.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type MCAPriceSheetProperties struct {
2121
EffectiveStartDate *string `json:"effectiveStartDate,omitempty"`
2222
MarketPrice *string `json:"marketPrice,omitempty"`
2323
MeterCategory *string `json:"meterCategory,omitempty"`
24+
MeterId *string `json:"meterId,omitempty"`
2425
MeterName *string `json:"meterName,omitempty"`
2526
MeterRegion *string `json:"meterRegion,omitempty"`
2627
MeterSubCategory *string `json:"meterSubCategory,omitempty"`

resource-manager/costmanagement/2024-08-01/pricesheets/model_mcapricesheetproperties.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type MCAPriceSheetProperties struct {
2121
EffectiveStartDate *string `json:"effectiveStartDate,omitempty"`
2222
MarketPrice *string `json:"marketPrice,omitempty"`
2323
MeterCategory *string `json:"meterCategory,omitempty"`
24+
MeterId *string `json:"meterId,omitempty"`
2425
MeterName *string `json:"meterName,omitempty"`
2526
MeterRegion *string `json:"meterRegion,omitempty"`
2627
MeterSubCategory *string `json:"meterSubCategory,omitempty"`
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
package v2025_01_21
2+
3+
// Copyright (c) Microsoft Corporation. All rights reserved.
4+
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
5+
6+
import (
7+
"fmt"
8+
9+
"github.com/hashicorp/go-azure-sdk/resource-manager/devopsinfrastructure/2025-01-21/imageversions"
10+
"github.com/hashicorp/go-azure-sdk/resource-manager/devopsinfrastructure/2025-01-21/pools"
11+
"github.com/hashicorp/go-azure-sdk/resource-manager/devopsinfrastructure/2025-01-21/resourcedetails"
12+
"github.com/hashicorp/go-azure-sdk/resource-manager/devopsinfrastructure/2025-01-21/sku"
13+
"github.com/hashicorp/go-azure-sdk/resource-manager/devopsinfrastructure/2025-01-21/subscriptionusages"
14+
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
15+
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
16+
)
17+
18+
type Client struct {
19+
ImageVersions *imageversions.ImageVersionsClient
20+
Pools *pools.PoolsClient
21+
ResourceDetails *resourcedetails.ResourceDetailsClient
22+
Sku *sku.SkuClient
23+
SubscriptionUsages *subscriptionusages.SubscriptionUsagesClient
24+
}
25+
26+
func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) {
27+
imageVersionsClient, err := imageversions.NewImageVersionsClientWithBaseURI(sdkApi)
28+
if err != nil {
29+
return nil, fmt.Errorf("building ImageVersions client: %+v", err)
30+
}
31+
configureFunc(imageVersionsClient.Client)
32+
33+
poolsClient, err := pools.NewPoolsClientWithBaseURI(sdkApi)
34+
if err != nil {
35+
return nil, fmt.Errorf("building Pools client: %+v", err)
36+
}
37+
configureFunc(poolsClient.Client)
38+
39+
resourceDetailsClient, err := resourcedetails.NewResourceDetailsClientWithBaseURI(sdkApi)
40+
if err != nil {
41+
return nil, fmt.Errorf("building ResourceDetails client: %+v", err)
42+
}
43+
configureFunc(resourceDetailsClient.Client)
44+
45+
skuClient, err := sku.NewSkuClientWithBaseURI(sdkApi)
46+
if err != nil {
47+
return nil, fmt.Errorf("building Sku client: %+v", err)
48+
}
49+
configureFunc(skuClient.Client)
50+
51+
subscriptionUsagesClient, err := subscriptionusages.NewSubscriptionUsagesClientWithBaseURI(sdkApi)
52+
if err != nil {
53+
return nil, fmt.Errorf("building SubscriptionUsages client: %+v", err)
54+
}
55+
configureFunc(subscriptionUsagesClient.Client)
56+
57+
return &Client{
58+
ImageVersions: imageVersionsClient,
59+
Pools: poolsClient,
60+
ResourceDetails: resourceDetailsClient,
61+
Sku: skuClient,
62+
SubscriptionUsages: subscriptionUsagesClient,
63+
}, nil
64+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
## `github.com/hashicorp/go-azure-sdk/resource-manager/devopsinfrastructure/2025-01-21/imageversions` Documentation
3+
4+
The `imageversions` SDK allows for interaction with Azure Resource Manager `devopsinfrastructure` (API Version `2025-01-21`).
5+
6+
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).
7+
8+
### Import Path
9+
10+
```go
11+
import "github.com/hashicorp/go-azure-sdk/resource-manager/devopsinfrastructure/2025-01-21/imageversions"
12+
```
13+
14+
15+
### Client Initialization
16+
17+
```go
18+
client := imageversions.NewImageVersionsClientWithBaseURI("https://management.azure.com")
19+
client.Client.Authorizer = authorizer
20+
```
21+
22+
23+
### Example Usage: `ImageVersionsClient.ListByImage`
24+
25+
```go
26+
ctx := context.TODO()
27+
id := imageversions.NewImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "imageName")
28+
29+
// alternatively `client.ListByImage(ctx, id)` can be used to do batched pagination
30+
items, err := client.ListByImageComplete(ctx, id)
31+
if err != nil {
32+
// handle the error
33+
}
34+
for _, item := range items {
35+
// do something
36+
}
37+
```
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package imageversions
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
7+
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
8+
)
9+
10+
// Copyright (c) Microsoft Corporation. All rights reserved.
11+
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
12+
13+
type ImageVersionsClient struct {
14+
Client *resourcemanager.Client
15+
}
16+
17+
func NewImageVersionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ImageVersionsClient, error) {
18+
client, err := resourcemanager.NewClient(sdkApi, "imageversions", defaultApiVersion)
19+
if err != nil {
20+
return nil, fmt.Errorf("instantiating ImageVersionsClient: %+v", err)
21+
}
22+
23+
return &ImageVersionsClient{
24+
Client: client,
25+
}, nil
26+
}
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
package imageversions
2+
3+
import (
4+
"fmt"
5+
"strings"
6+
7+
"github.com/hashicorp/go-azure-helpers/resourcemanager/recaser"
8+
"github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids"
9+
)
10+
11+
// Copyright (c) Microsoft Corporation. All rights reserved.
12+
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
13+
14+
func init() {
15+
recaser.RegisterResourceId(&ImageId{})
16+
}
17+
18+
var _ resourceids.ResourceId = &ImageId{}
19+
20+
// ImageId is a struct representing the Resource ID for a Image
21+
type ImageId struct {
22+
SubscriptionId string
23+
ResourceGroupName string
24+
ImageName string
25+
}
26+
27+
// NewImageID returns a new ImageId struct
28+
func NewImageID(subscriptionId string, resourceGroupName string, imageName string) ImageId {
29+
return ImageId{
30+
SubscriptionId: subscriptionId,
31+
ResourceGroupName: resourceGroupName,
32+
ImageName: imageName,
33+
}
34+
}
35+
36+
// ParseImageID parses 'input' into a ImageId
37+
func ParseImageID(input string) (*ImageId, error) {
38+
parser := resourceids.NewParserFromResourceIdType(&ImageId{})
39+
parsed, err := parser.Parse(input, false)
40+
if err != nil {
41+
return nil, fmt.Errorf("parsing %q: %+v", input, err)
42+
}
43+
44+
id := ImageId{}
45+
if err = id.FromParseResult(*parsed); err != nil {
46+
return nil, err
47+
}
48+
49+
return &id, nil
50+
}
51+
52+
// ParseImageIDInsensitively parses 'input' case-insensitively into a ImageId
53+
// note: this method should only be used for API response data and not user input
54+
func ParseImageIDInsensitively(input string) (*ImageId, error) {
55+
parser := resourceids.NewParserFromResourceIdType(&ImageId{})
56+
parsed, err := parser.Parse(input, true)
57+
if err != nil {
58+
return nil, fmt.Errorf("parsing %q: %+v", input, err)
59+
}
60+
61+
id := ImageId{}
62+
if err = id.FromParseResult(*parsed); err != nil {
63+
return nil, err
64+
}
65+
66+
return &id, nil
67+
}
68+
69+
func (id *ImageId) FromParseResult(input resourceids.ParseResult) error {
70+
var ok bool
71+
72+
if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok {
73+
return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input)
74+
}
75+
76+
if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok {
77+
return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input)
78+
}
79+
80+
if id.ImageName, ok = input.Parsed["imageName"]; !ok {
81+
return resourceids.NewSegmentNotSpecifiedError(id, "imageName", input)
82+
}
83+
84+
return nil
85+
}
86+
87+
// ValidateImageID checks that 'input' can be parsed as a Image ID
88+
func ValidateImageID(input interface{}, key string) (warnings []string, errors []error) {
89+
v, ok := input.(string)
90+
if !ok {
91+
errors = append(errors, fmt.Errorf("expected %q to be a string", key))
92+
return
93+
}
94+
95+
if _, err := ParseImageID(v); err != nil {
96+
errors = append(errors, err)
97+
}
98+
99+
return
100+
}
101+
102+
// ID returns the formatted Image ID
103+
func (id ImageId) ID() string {
104+
fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DevOpsInfrastructure/images/%s"
105+
return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ImageName)
106+
}
107+
108+
// Segments returns a slice of Resource ID Segments which comprise this Image ID
109+
func (id ImageId) Segments() []resourceids.Segment {
110+
return []resourceids.Segment{
111+
resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"),
112+
resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"),
113+
resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"),
114+
resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"),
115+
resourceids.StaticSegment("staticProviders", "providers", "providers"),
116+
resourceids.ResourceProviderSegment("staticMicrosoftDevOpsInfrastructure", "Microsoft.DevOpsInfrastructure", "Microsoft.DevOpsInfrastructure"),
117+
resourceids.StaticSegment("staticImages", "images", "images"),
118+
resourceids.UserSpecifiedSegment("imageName", "imageName"),
119+
}
120+
}
121+
122+
// String returns a human-readable description of this Image ID
123+
func (id ImageId) String() string {
124+
components := []string{
125+
fmt.Sprintf("Subscription: %q", id.SubscriptionId),
126+
fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName),
127+
fmt.Sprintf("Image Name: %q", id.ImageName),
128+
}
129+
return fmt.Sprintf("Image (%s)", strings.Join(components, "\n"))
130+
}

0 commit comments

Comments
 (0)