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 (04795be8032484cdfd48c289e676ee0a5065fe67) #869

Merged
merged 1 commit into from
Feb 1, 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
  •  
  •  
  •  
103 changes: 103 additions & 0 deletions resource-manager/synapse/2021-06-01/bigdatapools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@

## `github.com/hashicorp/go-azure-sdk/resource-manager/synapse/2021-06-01/bigdatapools` Documentation

The `bigdatapools` SDK allows for interaction with the Azure Resource Manager Service `synapse` (API Version `2021-06-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-sdk/resource-manager/synapse/2021-06-01/bigdatapools"
```


### Client Initialization

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


### Example Usage: `BigDataPoolsClient.CreateOrUpdate`

```go
ctx := context.TODO()
id := bigdatapools.NewBigDataPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bigDataPoolValue")

payload := bigdatapools.BigDataPoolResourceInfo{
// ...
}


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


### Example Usage: `BigDataPoolsClient.Delete`

```go
ctx := context.TODO()
id := bigdatapools.NewBigDataPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bigDataPoolValue")

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


### Example Usage: `BigDataPoolsClient.Get`

```go
ctx := context.TODO()
id := bigdatapools.NewBigDataPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bigDataPoolValue")

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: `BigDataPoolsClient.ListByWorkspace`

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

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


### Example Usage: `BigDataPoolsClient.Update`

```go
ctx := context.TODO()
id := bigdatapools.NewBigDataPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bigDataPoolValue")

payload := bigdatapools.BigDataPoolPatchInfo{
// ...
}


read, err := client.Update(ctx, id, payload)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
```
26 changes: 26 additions & 0 deletions resource-manager/synapse/2021-06-01/bigdatapools/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package bigdatapools

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

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

return &BigDataPoolsClient{
Client: client,
}, nil
}
154 changes: 154 additions & 0 deletions resource-manager/synapse/2021-06-01/bigdatapools/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
package bigdatapools

import (
"encoding/json"
"fmt"
"strings"
)

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

type ConfigurationType string

const (
ConfigurationTypeArtifact ConfigurationType = "Artifact"
ConfigurationTypeFile ConfigurationType = "File"
)

func PossibleValuesForConfigurationType() []string {
return []string{
string(ConfigurationTypeArtifact),
string(ConfigurationTypeFile),
}
}

func (s *ConfigurationType) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseConfigurationType(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}

func parseConfigurationType(input string) (*ConfigurationType, error) {
vals := map[string]ConfigurationType{
"artifact": ConfigurationTypeArtifact,
"file": ConfigurationTypeFile,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// otherwise presume it's an undefined value and best-effort it
out := ConfigurationType(input)
return &out, nil
}

type NodeSize string

const (
NodeSizeLarge NodeSize = "Large"
NodeSizeMedium NodeSize = "Medium"
NodeSizeNone NodeSize = "None"
NodeSizeSmall NodeSize = "Small"
NodeSizeXLarge NodeSize = "XLarge"
NodeSizeXXLarge NodeSize = "XXLarge"
NodeSizeXXXLarge NodeSize = "XXXLarge"
)

func PossibleValuesForNodeSize() []string {
return []string{
string(NodeSizeLarge),
string(NodeSizeMedium),
string(NodeSizeNone),
string(NodeSizeSmall),
string(NodeSizeXLarge),
string(NodeSizeXXLarge),
string(NodeSizeXXXLarge),
}
}

func (s *NodeSize) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseNodeSize(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}

func parseNodeSize(input string) (*NodeSize, error) {
vals := map[string]NodeSize{
"large": NodeSizeLarge,
"medium": NodeSizeMedium,
"none": NodeSizeNone,
"small": NodeSizeSmall,
"xlarge": NodeSizeXLarge,
"xxlarge": NodeSizeXXLarge,
"xxxlarge": NodeSizeXXXLarge,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// otherwise presume it's an undefined value and best-effort it
out := NodeSize(input)
return &out, nil
}

type NodeSizeFamily string

const (
NodeSizeFamilyHardwareAcceleratedFPGA NodeSizeFamily = "HardwareAcceleratedFPGA"
NodeSizeFamilyHardwareAcceleratedGPU NodeSizeFamily = "HardwareAcceleratedGPU"
NodeSizeFamilyMemoryOptimized NodeSizeFamily = "MemoryOptimized"
NodeSizeFamilyNone NodeSizeFamily = "None"
)

func PossibleValuesForNodeSizeFamily() []string {
return []string{
string(NodeSizeFamilyHardwareAcceleratedFPGA),
string(NodeSizeFamilyHardwareAcceleratedGPU),
string(NodeSizeFamilyMemoryOptimized),
string(NodeSizeFamilyNone),
}
}

func (s *NodeSizeFamily) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseNodeSizeFamily(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}

func parseNodeSizeFamily(input string) (*NodeSizeFamily, error) {
vals := map[string]NodeSizeFamily{
"hardwareacceleratedfpga": NodeSizeFamilyHardwareAcceleratedFPGA,
"hardwareacceleratedgpu": NodeSizeFamilyHardwareAcceleratedGPU,
"memoryoptimized": NodeSizeFamilyMemoryOptimized,
"none": NodeSizeFamilyNone,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// otherwise presume it's an undefined value and best-effort it
out := NodeSizeFamily(input)
return &out, nil
}
Loading
Loading