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 (fd1fe76f52d1acac3f5b8f0389cfc22ae039a9bb) #950

Merged
merged 1 commit into from
Apr 2, 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
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

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

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


### Client Initialization

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


### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksListByDevCenter`

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

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


### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksListByProject`

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

// alternatively `client.AttachedNetworksListByProject(ctx, id, attachednetworkconnections.DefaultAttachedNetworksListByProjectOperationOptions())` can be used to do batched pagination
items, err := client.AttachedNetworksListByProjectComplete(ctx, id, attachednetworkconnections.DefaultAttachedNetworksListByProjectOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package attachednetworkconnections

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

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

return &AttachedNetworkConnectionsClient{
Client: client,
}, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
package attachednetworkconnections

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

const (
DomainJoinTypeAzureADJoin DomainJoinType = "AzureADJoin"
DomainJoinTypeHybridAzureADJoin DomainJoinType = "HybridAzureADJoin"
)

func PossibleValuesForDomainJoinType() []string {
return []string{
string(DomainJoinTypeAzureADJoin),
string(DomainJoinTypeHybridAzureADJoin),
}
}

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

func parseDomainJoinType(input string) (*DomainJoinType, error) {
vals := map[string]DomainJoinType{
"azureadjoin": DomainJoinTypeAzureADJoin,
"hybridazureadjoin": DomainJoinTypeHybridAzureADJoin,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

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

type HealthCheckStatus string

const (
HealthCheckStatusFailed HealthCheckStatus = "Failed"
HealthCheckStatusPassed HealthCheckStatus = "Passed"
HealthCheckStatusPending HealthCheckStatus = "Pending"
HealthCheckStatusRunning HealthCheckStatus = "Running"
HealthCheckStatusUnknown HealthCheckStatus = "Unknown"
HealthCheckStatusWarning HealthCheckStatus = "Warning"
)

func PossibleValuesForHealthCheckStatus() []string {
return []string{
string(HealthCheckStatusFailed),
string(HealthCheckStatusPassed),
string(HealthCheckStatusPending),
string(HealthCheckStatusRunning),
string(HealthCheckStatusUnknown),
string(HealthCheckStatusWarning),
}
}

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

func parseHealthCheckStatus(input string) (*HealthCheckStatus, error) {
vals := map[string]HealthCheckStatus{
"failed": HealthCheckStatusFailed,
"passed": HealthCheckStatusPassed,
"pending": HealthCheckStatusPending,
"running": HealthCheckStatusRunning,
"unknown": HealthCheckStatusUnknown,
"warning": HealthCheckStatusWarning,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

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

type ProvisioningState string

const (
ProvisioningStateAccepted ProvisioningState = "Accepted"
ProvisioningStateCanceled ProvisioningState = "Canceled"
ProvisioningStateCreated ProvisioningState = "Created"
ProvisioningStateCreating ProvisioningState = "Creating"
ProvisioningStateDeleted ProvisioningState = "Deleted"
ProvisioningStateDeleting ProvisioningState = "Deleting"
ProvisioningStateFailed ProvisioningState = "Failed"
ProvisioningStateMovingResources ProvisioningState = "MovingResources"
ProvisioningStateNotSpecified ProvisioningState = "NotSpecified"
ProvisioningStateRolloutInProgress ProvisioningState = "RolloutInProgress"
ProvisioningStateRunning ProvisioningState = "Running"
ProvisioningStateStorageProvisioningFailed ProvisioningState = "StorageProvisioningFailed"
ProvisioningStateSucceeded ProvisioningState = "Succeeded"
ProvisioningStateTransientFailure ProvisioningState = "TransientFailure"
ProvisioningStateUpdated ProvisioningState = "Updated"
ProvisioningStateUpdating ProvisioningState = "Updating"
)

func PossibleValuesForProvisioningState() []string {
return []string{
string(ProvisioningStateAccepted),
string(ProvisioningStateCanceled),
string(ProvisioningStateCreated),
string(ProvisioningStateCreating),
string(ProvisioningStateDeleted),
string(ProvisioningStateDeleting),
string(ProvisioningStateFailed),
string(ProvisioningStateMovingResources),
string(ProvisioningStateNotSpecified),
string(ProvisioningStateRolloutInProgress),
string(ProvisioningStateRunning),
string(ProvisioningStateStorageProvisioningFailed),
string(ProvisioningStateSucceeded),
string(ProvisioningStateTransientFailure),
string(ProvisioningStateUpdated),
string(ProvisioningStateUpdating),
}
}

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

func parseProvisioningState(input string) (*ProvisioningState, error) {
vals := map[string]ProvisioningState{
"accepted": ProvisioningStateAccepted,
"canceled": ProvisioningStateCanceled,
"created": ProvisioningStateCreated,
"creating": ProvisioningStateCreating,
"deleted": ProvisioningStateDeleted,
"deleting": ProvisioningStateDeleting,
"failed": ProvisioningStateFailed,
"movingresources": ProvisioningStateMovingResources,
"notspecified": ProvisioningStateNotSpecified,
"rolloutinprogress": ProvisioningStateRolloutInProgress,
"running": ProvisioningStateRunning,
"storageprovisioningfailed": ProvisioningStateStorageProvisioningFailed,
"succeeded": ProvisioningStateSucceeded,
"transientfailure": ProvisioningStateTransientFailure,
"updated": ProvisioningStateUpdated,
"updating": ProvisioningStateUpdating,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}

// otherwise presume it's an undefined value and best-effort it
out := ProvisioningState(input)
return &out, nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
package attachednetworkconnections

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 = &DevCenterId{}

// DevCenterId is a struct representing the Resource ID for a Dev Center
type DevCenterId struct {
SubscriptionId string
ResourceGroupName string
DevCenterName string
}

// NewDevCenterID returns a new DevCenterId struct
func NewDevCenterID(subscriptionId string, resourceGroupName string, devCenterName string) DevCenterId {
return DevCenterId{
SubscriptionId: subscriptionId,
ResourceGroupName: resourceGroupName,
DevCenterName: devCenterName,
}
}

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

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

return &id, nil
}

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

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

return &id, nil
}

func (id *DevCenterId) 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.DevCenterName, ok = input.Parsed["devCenterName"]; !ok {
return resourceids.NewSegmentNotSpecifiedError(id, "devCenterName", input)
}

return nil
}

// ValidateDevCenterID checks that 'input' can be parsed as a Dev Center ID
func ValidateDevCenterID(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 := ParseDevCenterID(v); err != nil {
errors = append(errors, err)
}

return
}

// ID returns the formatted Dev Center ID
func (id DevCenterId) ID() string {
fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DevCenter/devCenters/%s"
return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DevCenterName)
}

// Segments returns a slice of Resource ID Segments which comprise this Dev Center ID
func (id DevCenterId) 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("staticMicrosoftDevCenter", "Microsoft.DevCenter", "Microsoft.DevCenter"),
resourceids.StaticSegment("staticDevCenters", "devCenters", "devCenters"),
resourceids.UserSpecifiedSegment("devCenterName", "devCenterValue"),
}
}

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