Skip to content

Commit

Permalink
Merge pull request #990 from hashicorp/auto-pr/d64c5425
Browse files Browse the repository at this point in the history
Auto PR: Regenerating the Go SDK (e95c510)
  • Loading branch information
tombuildsstuff authored May 16, 2024
2 parents 0025f98 + e95c510 commit 086a731
Show file tree
Hide file tree
Showing 66 changed files with 5,173 additions and 0 deletions.
55 changes: 55 additions & 0 deletions resource-manager/insights/2021-07-01-preview/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package v2021_07_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/insights/2021-07-01-preview/privateendpointconnections"
"github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkresources"
"github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources"
"github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis"
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
)

type Client struct {
PrivateEndpointConnections *privateendpointconnections.PrivateEndpointConnectionsClient
PrivateLinkResources *privatelinkresources.PrivateLinkResourcesClient
PrivateLinkScopedResources *privatelinkscopedresources.PrivateLinkScopedResourcesClient
PrivateLinkScopesAPIs *privatelinkscopesapis.PrivateLinkScopesAPIsClient
}

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

privateLinkResourcesClient, err := privatelinkresources.NewPrivateLinkResourcesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building PrivateLinkResources client: %+v", err)
}
configureFunc(privateLinkResourcesClient.Client)

privateLinkScopedResourcesClient, err := privatelinkscopedresources.NewPrivateLinkScopedResourcesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building PrivateLinkScopedResources client: %+v", err)
}
configureFunc(privateLinkScopedResourcesClient.Client)

privateLinkScopesAPIsClient, err := privatelinkscopesapis.NewPrivateLinkScopesAPIsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building PrivateLinkScopesAPIs client: %+v", err)
}
configureFunc(privateLinkScopesAPIsClient.Client)

return &Client{
PrivateEndpointConnections: privateEndpointConnectionsClient,
PrivateLinkResources: privateLinkResourcesClient,
PrivateLinkScopedResources: privateLinkScopedResourcesClient,
PrivateLinkScopesAPIs: privateLinkScopesAPIsClient,
}, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@

## `github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privateendpointconnections` Documentation

The `privateendpointconnections` SDK allows for interaction with the Azure Resource Manager Service `insights` (API Version `2021-07-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/insights/2021-07-01-preview/privateendpointconnections"
```


### Client Initialization

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


### Example Usage: `PrivateEndpointConnectionsClient.CreateOrUpdate`

```go
ctx := context.TODO()
id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue", "privateEndpointConnectionValue")

payload := privateendpointconnections.PrivateEndpointConnection{
// ...
}


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


### Example Usage: `PrivateEndpointConnectionsClient.Delete`

```go
ctx := context.TODO()
id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue", "privateEndpointConnectionValue")

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


### Example Usage: `PrivateEndpointConnectionsClient.Get`

```go
ctx := context.TODO()
id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue", "privateEndpointConnectionValue")

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: `PrivateEndpointConnectionsClient.ListByPrivateLinkScope`

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

read, err := client.ListByPrivateLinkScope(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package privateendpointconnections

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

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

return &PrivateEndpointConnectionsClient{
Client: client,
}, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
package privateendpointconnections

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

const (
PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating"
PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting"
PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed"
PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded"
)

func PossibleValuesForPrivateEndpointConnectionProvisioningState() []string {
return []string{
string(PrivateEndpointConnectionProvisioningStateCreating),
string(PrivateEndpointConnectionProvisioningStateDeleting),
string(PrivateEndpointConnectionProvisioningStateFailed),
string(PrivateEndpointConnectionProvisioningStateSucceeded),
}
}

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

func parsePrivateEndpointConnectionProvisioningState(input string) (*PrivateEndpointConnectionProvisioningState, error) {
vals := map[string]PrivateEndpointConnectionProvisioningState{
"creating": PrivateEndpointConnectionProvisioningStateCreating,
"deleting": PrivateEndpointConnectionProvisioningStateDeleting,
"failed": PrivateEndpointConnectionProvisioningStateFailed,
"succeeded": PrivateEndpointConnectionProvisioningStateSucceeded,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

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

type PrivateEndpointServiceConnectionStatus string

const (
PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved"
PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending"
PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected"
)

func PossibleValuesForPrivateEndpointServiceConnectionStatus() []string {
return []string{
string(PrivateEndpointServiceConnectionStatusApproved),
string(PrivateEndpointServiceConnectionStatusPending),
string(PrivateEndpointServiceConnectionStatusRejected),
}
}

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

func parsePrivateEndpointServiceConnectionStatus(input string) (*PrivateEndpointServiceConnectionStatus, error) {
vals := map[string]PrivateEndpointServiceConnectionStatus{
"approved": PrivateEndpointServiceConnectionStatusApproved,
"pending": PrivateEndpointServiceConnectionStatusPending,
"rejected": PrivateEndpointServiceConnectionStatusRejected,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

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

0 comments on commit 086a731

Please sign in to comment.