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 (89dfcd9600231083945f5c560dcd85a204d2b9fc) #827

Merged
merged 1 commit into from
Jan 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions resource-manager/azurestackhci/2023-09-01-preview/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package v2023_09_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/azurestackhci/2023-09-01-preview/galleryimages"
"github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/guestagents"
"github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata"
"github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks"
"github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages"
"github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces"
"github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers"
"github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks"
"github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances"
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
)

type Client struct {
GalleryImages *galleryimages.GalleryImagesClient
GuestAgents *guestagents.GuestAgentsClient
HybridIdentityMetadata *hybrididentitymetadata.HybridIdentityMetadataClient
LogicalNetworks *logicalnetworks.LogicalNetworksClient
MarketplaceGalleryImages *marketplacegalleryimages.MarketplaceGalleryImagesClient
NetworkInterfaces *networkinterfaces.NetworkInterfacesClient
StorageContainers *storagecontainers.StorageContainersClient
VirtualHardDisks *virtualharddisks.VirtualHardDisksClient
VirtualMachineInstances *virtualmachineinstances.VirtualMachineInstancesClient
}

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

guestAgentsClient, err := guestagents.NewGuestAgentsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building GuestAgents client: %+v", err)
}
configureFunc(guestAgentsClient.Client)

hybridIdentityMetadataClient, err := hybrididentitymetadata.NewHybridIdentityMetadataClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building HybridIdentityMetadata client: %+v", err)
}
configureFunc(hybridIdentityMetadataClient.Client)

logicalNetworksClient, err := logicalnetworks.NewLogicalNetworksClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building LogicalNetworks client: %+v", err)
}
configureFunc(logicalNetworksClient.Client)

marketplaceGalleryImagesClient, err := marketplacegalleryimages.NewMarketplaceGalleryImagesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building MarketplaceGalleryImages client: %+v", err)
}
configureFunc(marketplaceGalleryImagesClient.Client)

networkInterfacesClient, err := networkinterfaces.NewNetworkInterfacesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building NetworkInterfaces client: %+v", err)
}
configureFunc(networkInterfacesClient.Client)

storageContainersClient, err := storagecontainers.NewStorageContainersClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building StorageContainers client: %+v", err)
}
configureFunc(storageContainersClient.Client)

virtualHardDisksClient, err := virtualharddisks.NewVirtualHardDisksClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building VirtualHardDisks client: %+v", err)
}
configureFunc(virtualHardDisksClient.Client)

virtualMachineInstancesClient, err := virtualmachineinstances.NewVirtualMachineInstancesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building VirtualMachineInstances client: %+v", err)
}
configureFunc(virtualMachineInstancesClient.Client)

return &Client{
GalleryImages: galleryImagesClient,
GuestAgents: guestAgentsClient,
HybridIdentityMetadata: hybridIdentityMetadataClient,
LogicalNetworks: logicalNetworksClient,
MarketplaceGalleryImages: marketplaceGalleryImagesClient,
NetworkInterfaces: networkInterfacesClient,
StorageContainers: storageContainersClient,
VirtualHardDisks: virtualHardDisksClient,
VirtualMachineInstances: virtualMachineInstancesClient,
}, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@

## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/galleryimages` Documentation

The `galleryimages` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-09-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-sdk/resource-manager/azurestackhci/2023-09-01-preview/galleryimages"
```


### Client Initialization

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


### Example Usage: `GalleryImagesClient.CreateOrUpdate`

```go
ctx := context.TODO()
id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryImageValue")

payload := galleryimages.GalleryImages{
// ...
}


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


### Example Usage: `GalleryImagesClient.Delete`

```go
ctx := context.TODO()
id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryImageValue")

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


### Example Usage: `GalleryImagesClient.Get`

```go
ctx := context.TODO()
id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryImageValue")

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: `GalleryImagesClient.List`

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

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


### Example Usage: `GalleryImagesClient.ListAll`

```go
ctx := context.TODO()
id := galleryimages.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

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


### Example Usage: `GalleryImagesClient.Update`

```go
ctx := context.TODO()
id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryImageValue")

payload := galleryimages.GalleryImagesUpdateRequest{
// ...
}


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

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 GalleryImagesClient struct {
Client *resourcemanager.Client
}

func NewGalleryImagesClientWithBaseURI(sdkApi sdkEnv.Api) (*GalleryImagesClient, error) {
client, err := resourcemanager.NewResourceManagerClient(sdkApi, "galleryimages", defaultApiVersion)
if err != nil {
return nil, fmt.Errorf("instantiating GalleryImagesClient: %+v", err)
}

return &GalleryImagesClient{
Client: client,
}, nil
}
Loading