-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hc-github-team-tf-azure
committed
Sep 10, 2024
1 parent
4c5d3e5
commit ec67f7d
Showing
31 changed files
with
2,306 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package v2023_11_01 | ||
|
||
// 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/fabric/2023-11-01/fabriccapacities" | ||
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" | ||
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" | ||
) | ||
|
||
type Client struct { | ||
FabricCapacities *fabriccapacities.FabricCapacitiesClient | ||
} | ||
|
||
func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { | ||
fabricCapacitiesClient, err := fabriccapacities.NewFabricCapacitiesClientWithBaseURI(sdkApi) | ||
if err != nil { | ||
return nil, fmt.Errorf("building FabricCapacities client: %+v", err) | ||
} | ||
configureFunc(fabricCapacitiesClient.Client) | ||
|
||
return &Client{ | ||
FabricCapacities: fabricCapacitiesClient, | ||
}, nil | ||
} |
196 changes: 196 additions & 0 deletions
196
resource-manager/fabric/2023-11-01/fabriccapacities/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
|
||
## `github.com/hashicorp/go-azure-sdk/resource-manager/fabric/2023-11-01/fabriccapacities` Documentation | ||
|
||
The `fabriccapacities` SDK allows for interaction with the Azure Resource Manager Service `fabric` (API Version `2023-11-01`). | ||
|
||
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-helpers/resourcemanager/commonids" | ||
import "github.com/hashicorp/go-azure-sdk/resource-manager/fabric/2023-11-01/fabriccapacities" | ||
``` | ||
|
||
|
||
### Client Initialization | ||
|
||
```go | ||
client := fabriccapacities.NewFabricCapacitiesClientWithBaseURI("https://management.azure.com") | ||
client.Client.Authorizer = authorizer | ||
``` | ||
|
||
|
||
### Example Usage: `FabricCapacitiesClient.CheckNameAvailability` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := fabriccapacities.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") | ||
|
||
payload := fabriccapacities.CheckNameAvailabilityRequest{ | ||
// ... | ||
} | ||
|
||
|
||
read, err := client.CheckNameAvailability(ctx, id, payload) | ||
if err != nil { | ||
// handle the error | ||
} | ||
if model := read.Model; model != nil { | ||
// do something with the model/response object | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `FabricCapacitiesClient.CreateOrUpdate` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := fabriccapacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityValue") | ||
|
||
payload := fabriccapacities.FabricCapacity{ | ||
// ... | ||
} | ||
|
||
|
||
if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { | ||
// handle the error | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `FabricCapacitiesClient.Delete` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := fabriccapacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityValue") | ||
|
||
if err := client.DeleteThenPoll(ctx, id); err != nil { | ||
// handle the error | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `FabricCapacitiesClient.Get` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := fabriccapacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityValue") | ||
|
||
read, err := client.Get(ctx, id) | ||
if err != nil { | ||
// handle the error | ||
} | ||
if model := read.Model; model != nil { | ||
// do something with the model/response object | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `FabricCapacitiesClient.ListByResourceGroup` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") | ||
|
||
// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination | ||
items, err := client.ListByResourceGroupComplete(ctx, id) | ||
if err != nil { | ||
// handle the error | ||
} | ||
for _, item := range items { | ||
// do something | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `FabricCapacitiesClient.ListBySubscription` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") | ||
|
||
// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination | ||
items, err := client.ListBySubscriptionComplete(ctx, id) | ||
if err != nil { | ||
// handle the error | ||
} | ||
for _, item := range items { | ||
// do something | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `FabricCapacitiesClient.ListSkus` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") | ||
|
||
// alternatively `client.ListSkus(ctx, id)` can be used to do batched pagination | ||
items, err := client.ListSkusComplete(ctx, id) | ||
if err != nil { | ||
// handle the error | ||
} | ||
for _, item := range items { | ||
// do something | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `FabricCapacitiesClient.ListSkusForCapacity` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := fabriccapacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityValue") | ||
|
||
// alternatively `client.ListSkusForCapacity(ctx, id)` can be used to do batched pagination | ||
items, err := client.ListSkusForCapacityComplete(ctx, id) | ||
if err != nil { | ||
// handle the error | ||
} | ||
for _, item := range items { | ||
// do something | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `FabricCapacitiesClient.Resume` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := fabriccapacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityValue") | ||
|
||
if err := client.ResumeThenPoll(ctx, id); err != nil { | ||
// handle the error | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `FabricCapacitiesClient.Suspend` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := fabriccapacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityValue") | ||
|
||
if err := client.SuspendThenPoll(ctx, id); err != nil { | ||
// handle the error | ||
} | ||
``` | ||
|
||
|
||
### Example Usage: `FabricCapacitiesClient.Update` | ||
|
||
```go | ||
ctx := context.TODO() | ||
id := fabriccapacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityValue") | ||
|
||
payload := fabriccapacities.FabricCapacityUpdate{ | ||
// ... | ||
} | ||
|
||
|
||
if err := client.UpdateThenPoll(ctx, id, payload); err != nil { | ||
// handle the error | ||
} | ||
``` |
26 changes: 26 additions & 0 deletions
26
resource-manager/fabric/2023-11-01/fabriccapacities/client.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package fabriccapacities | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" | ||
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" | ||
) | ||
|
||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See NOTICE.txt in the project root for license information. | ||
|
||
type FabricCapacitiesClient struct { | ||
Client *resourcemanager.Client | ||
} | ||
|
||
func NewFabricCapacitiesClientWithBaseURI(sdkApi sdkEnv.Api) (*FabricCapacitiesClient, error) { | ||
client, err := resourcemanager.NewResourceManagerClient(sdkApi, "fabriccapacities", defaultApiVersion) | ||
if err != nil { | ||
return nil, fmt.Errorf("instantiating FabricCapacitiesClient: %+v", err) | ||
} | ||
|
||
return &FabricCapacitiesClient{ | ||
Client: client, | ||
}, nil | ||
} |
Oops, something went wrong.