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 (64badb74c5ba8b8ace25aa16448213a638e6e478) #1060

Merged
merged 1 commit into from
Aug 19, 2024
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
  •  
  •  
  •  
28 changes: 28 additions & 0 deletions resource-manager/azurefleet/2024-05-01-preview/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package v2024_05_01_preview

// 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/azurefleet/2024-05-01-preview/fleets"
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
)

type Client struct {
Fleets *fleets.FleetsClient
}

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

return &Client{
Fleets: fleetsClient,
}, nil
}
134 changes: 134 additions & 0 deletions resource-manager/azurefleet/2024-05-01-preview/fleets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@

## `github.com/hashicorp/go-azure-sdk/resource-manager/azurefleet/2024-05-01-preview/fleets` Documentation

The `fleets` SDK allows for interaction with the Azure Resource Manager Service `azurefleet` (API Version `2024-05-01-preview`).

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/azurefleet/2024-05-01-preview/fleets"
```


### Client Initialization

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


### Example Usage: `FleetsClient.CreateOrUpdate`

```go
ctx := context.TODO()
id := fleets.NewFleetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue")

payload := fleets.Fleet{
// ...
}


if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil {
// handle the error
}
```


### Example Usage: `FleetsClient.Delete`

```go
ctx := context.TODO()
id := fleets.NewFleetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue")

if err := client.DeleteThenPoll(ctx, id); err != nil {
// handle the error
}
```


### Example Usage: `FleetsClient.Get`

```go
ctx := context.TODO()
id := fleets.NewFleetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue")

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: `FleetsClient.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: `FleetsClient.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: `FleetsClient.ListVirtualMachineScaleSets`

```go
ctx := context.TODO()
id := fleets.NewFleetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue")

// alternatively `client.ListVirtualMachineScaleSets(ctx, id)` can be used to do batched pagination
items, err := client.ListVirtualMachineScaleSetsComplete(ctx, id)
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
```


### Example Usage: `FleetsClient.Update`

```go
ctx := context.TODO()
id := fleets.NewFleetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue")

payload := fleets.FleetUpdate{
// ...
}


if err := client.UpdateThenPoll(ctx, id, payload); err != nil {
// handle the error
}
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tenantconfiguration
package fleets

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 TenantConfigurationClient struct {
type FleetsClient struct {
Client *resourcemanager.Client
}

func NewTenantConfigurationClientWithBaseURI(sdkApi sdkEnv.Api) (*TenantConfigurationClient, error) {
client, err := resourcemanager.NewResourceManagerClient(sdkApi, "tenantconfiguration", defaultApiVersion)
func NewFleetsClientWithBaseURI(sdkApi sdkEnv.Api) (*FleetsClient, error) {
client, err := resourcemanager.NewResourceManagerClient(sdkApi, "fleets", defaultApiVersion)
if err != nil {
return nil, fmt.Errorf("instantiating TenantConfigurationClient: %+v", err)
return nil, fmt.Errorf("instantiating FleetsClient: %+v", err)
}

return &TenantConfigurationClient{
return &FleetsClient{
Client: client,
}, nil
}
Loading
Loading