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 (61c40928bddee3aa860739e9cac9e83a92586e7e) #567

Merged
merged 1 commit into from
Jul 26, 2023
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
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
82 changes: 82 additions & 0 deletions resource-manager/databoxedge/2023-07-01/addons/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

## `github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2023-07-01/addons` Documentation

The `addons` SDK allows for interaction with the Azure Resource Manager Service `databoxedge` (API Version `2023-07-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/databoxedge/2023-07-01/addons"
```


### Client Initialization

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


### Example Usage: `AddonsClient.CreateOrUpdate`

```go
ctx := context.TODO()
id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue", "roleValue", "addonValue")

payload := addons.Addon{
// ...
}


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


### Example Usage: `AddonsClient.Delete`

```go
ctx := context.TODO()
id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue", "roleValue", "addonValue")

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


### Example Usage: `AddonsClient.Get`

```go
ctx := context.TODO()
id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue", "roleValue", "addonValue")

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: `AddonsClient.ListByRole`

```go
ctx := context.TODO()
id := addons.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceValue", "roleValue")

// alternatively `client.ListByRole(ctx, id)` can be used to do batched pagination
items, err := client.ListByRoleComplete(ctx, id)
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
```
26 changes: 26 additions & 0 deletions resource-manager/databoxedge/2023-07-01/addons/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package addons

import (
"fmt"

"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
"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 AddonsClient struct {
Client *resourcemanager.Client
}

func NewAddonsClientWithBaseURI(api environments.Api) (*AddonsClient, error) {
client, err := resourcemanager.NewResourceManagerClient(api, "addons", defaultApiVersion)
if err != nil {
return nil, fmt.Errorf("instantiating AddonsClient: %+v", err)
}

return &AddonsClient{
Client: client,
}, nil
}
233 changes: 233 additions & 0 deletions resource-manager/databoxedge/2023-07-01/addons/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
package addons

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 AddonState string

const (
AddonStateCreated AddonState = "Created"
AddonStateCreating AddonState = "Creating"
AddonStateDeleting AddonState = "Deleting"
AddonStateFailed AddonState = "Failed"
AddonStateInvalid AddonState = "Invalid"
AddonStateReconfiguring AddonState = "Reconfiguring"
AddonStateUpdating AddonState = "Updating"
)

func PossibleValuesForAddonState() []string {
return []string{
string(AddonStateCreated),
string(AddonStateCreating),
string(AddonStateDeleting),
string(AddonStateFailed),
string(AddonStateInvalid),
string(AddonStateReconfiguring),
string(AddonStateUpdating),
}
}

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

func parseAddonState(input string) (*AddonState, error) {
vals := map[string]AddonState{
"created": AddonStateCreated,
"creating": AddonStateCreating,
"deleting": AddonStateDeleting,
"failed": AddonStateFailed,
"invalid": AddonStateInvalid,
"reconfiguring": AddonStateReconfiguring,
"updating": AddonStateUpdating,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

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

type AddonType string

const (
AddonTypeArcForKubernetes AddonType = "ArcForKubernetes"
AddonTypeIotEdge AddonType = "IotEdge"
)

func PossibleValuesForAddonType() []string {
return []string{
string(AddonTypeArcForKubernetes),
string(AddonTypeIotEdge),
}
}

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

func parseAddonType(input string) (*AddonType, error) {
vals := map[string]AddonType{
"arcforkubernetes": AddonTypeArcForKubernetes,
"iotedge": AddonTypeIotEdge,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

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

type EncryptionAlgorithm string

const (
EncryptionAlgorithmAESTwoFiveSix EncryptionAlgorithm = "AES256"
EncryptionAlgorithmNone EncryptionAlgorithm = "None"
EncryptionAlgorithmRSAESPKCSOneVOneFive EncryptionAlgorithm = "RSAES_PKCS1_v_1_5"
)

func PossibleValuesForEncryptionAlgorithm() []string {
return []string{
string(EncryptionAlgorithmAESTwoFiveSix),
string(EncryptionAlgorithmNone),
string(EncryptionAlgorithmRSAESPKCSOneVOneFive),
}
}

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

func parseEncryptionAlgorithm(input string) (*EncryptionAlgorithm, error) {
vals := map[string]EncryptionAlgorithm{
"aes256": EncryptionAlgorithmAESTwoFiveSix,
"none": EncryptionAlgorithmNone,
"rsaes_pkcs1_v_1_5": EncryptionAlgorithmRSAESPKCSOneVOneFive,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

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

type HostPlatformType string

const (
HostPlatformTypeKubernetesCluster HostPlatformType = "KubernetesCluster"
HostPlatformTypeLinuxVM HostPlatformType = "LinuxVM"
)

func PossibleValuesForHostPlatformType() []string {
return []string{
string(HostPlatformTypeKubernetesCluster),
string(HostPlatformTypeLinuxVM),
}
}

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

func parseHostPlatformType(input string) (*HostPlatformType, error) {
vals := map[string]HostPlatformType{
"kubernetescluster": HostPlatformTypeKubernetesCluster,
"linuxvm": HostPlatformTypeLinuxVM,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

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

type PlatformType string

const (
PlatformTypeLinux PlatformType = "Linux"
PlatformTypeWindows PlatformType = "Windows"
)

func PossibleValuesForPlatformType() []string {
return []string{
string(PlatformTypeLinux),
string(PlatformTypeWindows),
}
}

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

func parsePlatformType(input string) (*PlatformType, error) {
vals := map[string]PlatformType{
"linux": PlatformTypeLinux,
"windows": PlatformTypeWindows,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

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