Skip to content

Commit

Permalink
Merge pull request #939 from hashicorp/auto-pr/c07303de
Browse files Browse the repository at this point in the history
Auto PR: Regenerating the Go SDK (15211b5)
  • Loading branch information
tombuildsstuff authored Mar 22, 2024
2 parents cb0de57 + 15211b5 commit bb1c5a8
Show file tree
Hide file tree
Showing 119 changed files with 8,205 additions and 0 deletions.
100 changes: 100 additions & 0 deletions resource-manager/recoveryservices/2024-02-01/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package v2024_02_01

// 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/recoveryservices/2024-02-01/getprivatelinkresources"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2024-02-01/listprivatelinkresources"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2024-02-01/recoveryservices"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2024-02-01/registeredidentities"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2024-02-01/replicationusages"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2024-02-01/vaultcertificates"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2024-02-01/vaultextendedinfo"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2024-02-01/vaults"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2024-02-01/vaultusages"
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
)

type Client struct {
GetPrivateLinkResources *getprivatelinkresources.GetPrivateLinkResourcesClient
ListPrivateLinkResources *listprivatelinkresources.ListPrivateLinkResourcesClient
RecoveryServices *recoveryservices.RecoveryServicesClient
RegisteredIdentities *registeredidentities.RegisteredIdentitiesClient
ReplicationUsages *replicationusages.ReplicationUsagesClient
VaultCertificates *vaultcertificates.VaultCertificatesClient
VaultExtendedInfo *vaultextendedinfo.VaultExtendedInfoClient
VaultUsages *vaultusages.VaultUsagesClient
Vaults *vaults.VaultsClient
}

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

listPrivateLinkResourcesClient, err := listprivatelinkresources.NewListPrivateLinkResourcesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ListPrivateLinkResources client: %+v", err)
}
configureFunc(listPrivateLinkResourcesClient.Client)

recoveryServicesClient, err := recoveryservices.NewRecoveryServicesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building RecoveryServices client: %+v", err)
}
configureFunc(recoveryServicesClient.Client)

registeredIdentitiesClient, err := registeredidentities.NewRegisteredIdentitiesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building RegisteredIdentities client: %+v", err)
}
configureFunc(registeredIdentitiesClient.Client)

replicationUsagesClient, err := replicationusages.NewReplicationUsagesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ReplicationUsages client: %+v", err)
}
configureFunc(replicationUsagesClient.Client)

vaultCertificatesClient, err := vaultcertificates.NewVaultCertificatesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building VaultCertificates client: %+v", err)
}
configureFunc(vaultCertificatesClient.Client)

vaultExtendedInfoClient, err := vaultextendedinfo.NewVaultExtendedInfoClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building VaultExtendedInfo client: %+v", err)
}
configureFunc(vaultExtendedInfoClient.Client)

vaultUsagesClient, err := vaultusages.NewVaultUsagesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building VaultUsages client: %+v", err)
}
configureFunc(vaultUsagesClient.Client)

vaultsClient, err := vaults.NewVaultsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building Vaults client: %+v", err)
}
configureFunc(vaultsClient.Client)

return &Client{
GetPrivateLinkResources: getPrivateLinkResourcesClient,
ListPrivateLinkResources: listPrivateLinkResourcesClient,
RecoveryServices: recoveryServicesClient,
RegisteredIdentities: registeredIdentitiesClient,
ReplicationUsages: replicationUsagesClient,
VaultCertificates: vaultCertificatesClient,
VaultExtendedInfo: vaultExtendedInfoClient,
VaultUsages: vaultUsagesClient,
Vaults: vaultsClient,
}, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2024-02-01/getprivatelinkresources` Documentation

The `getprivatelinkresources` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2024-02-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/recoveryservices/2024-02-01/getprivatelinkresources"
```


### Client Initialization

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


### Example Usage: `GetPrivateLinkResourcesClient.PrivateLinkResourcesGet`

```go
ctx := context.TODO()
id := getprivatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "privateLinkResourceValue")

read, err := client.PrivateLinkResourcesGet(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 getprivatelinkresources

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

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

return &GetPrivateLinkResourcesClient{
Client: client,
}, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
package getprivatelinkresources

import (
"fmt"
"strings"

"github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids"
)

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

var _ resourceids.ResourceId = &PrivateLinkResourceId{}

// PrivateLinkResourceId is a struct representing the Resource ID for a Private Link Resource
type PrivateLinkResourceId struct {
SubscriptionId string
ResourceGroupName string
VaultName string
PrivateLinkResourceName string
}

// NewPrivateLinkResourceID returns a new PrivateLinkResourceId struct
func NewPrivateLinkResourceID(subscriptionId string, resourceGroupName string, vaultName string, privateLinkResourceName string) PrivateLinkResourceId {
return PrivateLinkResourceId{
SubscriptionId: subscriptionId,
ResourceGroupName: resourceGroupName,
VaultName: vaultName,
PrivateLinkResourceName: privateLinkResourceName,
}
}

// ParsePrivateLinkResourceID parses 'input' into a PrivateLinkResourceId
func ParsePrivateLinkResourceID(input string) (*PrivateLinkResourceId, error) {
parser := resourceids.NewParserFromResourceIdType(&PrivateLinkResourceId{})
parsed, err := parser.Parse(input, false)
if err != nil {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

id := PrivateLinkResourceId{}
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
}

// ParsePrivateLinkResourceIDInsensitively parses 'input' case-insensitively into a PrivateLinkResourceId
// note: this method should only be used for API response data and not user input
func ParsePrivateLinkResourceIDInsensitively(input string) (*PrivateLinkResourceId, error) {
parser := resourceids.NewParserFromResourceIdType(&PrivateLinkResourceId{})
parsed, err := parser.Parse(input, true)
if err != nil {
return nil, fmt.Errorf("parsing %q: %+v", input, err)
}

id := PrivateLinkResourceId{}
if err := id.FromParseResult(*parsed); err != nil {
return nil, err
}

return &id, nil
}

func (id *PrivateLinkResourceId) FromParseResult(input resourceids.ParseResult) error {
var ok bool

if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input)
}

if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input)
}

if id.VaultName, ok = input.Parsed["vaultName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input)
}

if id.PrivateLinkResourceName, ok = input.Parsed["privateLinkResourceName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkResourceName", input)
}

return nil
}

// ValidatePrivateLinkResourceID checks that 'input' can be parsed as a Private Link Resource ID
func ValidatePrivateLinkResourceID(input interface{}, key string) (warnings []string, errors []error) {
v, ok := input.(string)
if !ok {
errors = append(errors, fmt.Errorf("expected %q to be a string", key))
return
}

if _, err := ParsePrivateLinkResourceID(v); err != nil {
errors = append(errors, err)
}

return
}

// ID returns the formatted Private Link Resource ID
func (id PrivateLinkResourceId) ID() string {
fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s/privateLinkResources/%s"
return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.PrivateLinkResourceName)
}

// Segments returns a slice of Resource ID Segments which comprise this Private Link Resource ID
func (id PrivateLinkResourceId) Segments() []resourceids.Segment {
return []resourceids.Segment{
resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"),
resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"),
resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"),
resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"),
resourceids.StaticSegment("staticProviders", "providers", "providers"),
resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"),
resourceids.StaticSegment("staticVaults", "vaults", "vaults"),
resourceids.UserSpecifiedSegment("vaultName", "vaultValue"),
resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"),
resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceValue"),
}
}

// String returns a human-readable description of this Private Link Resource ID
func (id PrivateLinkResourceId) String() string {
components := []string{
fmt.Sprintf("Subscription: %q", id.SubscriptionId),
fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName),
fmt.Sprintf("Vault Name: %q", id.VaultName),
fmt.Sprintf("Private Link Resource Name: %q", id.PrivateLinkResourceName),
}
return fmt.Sprintf("Private Link Resource (%s)", strings.Join(components, "\n"))
}
Loading

0 comments on commit bb1c5a8

Please sign in to comment.