Skip to content

Commit 0252bf6

Browse files
author
hc-github-team-tf-azure
committed
Updating based on db7e0f8b2
1 parent 2647ad1 commit 0252bf6

File tree

925 files changed

+78584
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

925 files changed

+78584
-0
lines changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
2+
## `github.com/hashicorp/go-azure-sdk/resource-manager/devcenter/2025-02-01/attachednetworkconnections` Documentation
3+
4+
The `attachednetworkconnections` SDK allows for interaction with Azure Resource Manager `devcenter` (API Version `2025-02-01`).
5+
6+
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).
7+
8+
### Import Path
9+
10+
```go
11+
import "github.com/hashicorp/go-azure-sdk/resource-manager/devcenter/2025-02-01/attachednetworkconnections"
12+
```
13+
14+
15+
### Client Initialization
16+
17+
```go
18+
client := attachednetworkconnections.NewAttachedNetworkConnectionsClientWithBaseURI("https://management.azure.com")
19+
client.Client.Authorizer = authorizer
20+
```
21+
22+
23+
### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksCreateOrUpdate`
24+
25+
```go
26+
ctx := context.TODO()
27+
id := attachednetworkconnections.NewDevCenterAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "devCenterName", "attachedNetworkName")
28+
29+
payload := attachednetworkconnections.AttachedNetworkConnection{
30+
// ...
31+
}
32+
33+
34+
if err := client.AttachedNetworksCreateOrUpdateThenPoll(ctx, id, payload); err != nil {
35+
// handle the error
36+
}
37+
```
38+
39+
40+
### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksDelete`
41+
42+
```go
43+
ctx := context.TODO()
44+
id := attachednetworkconnections.NewDevCenterAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "devCenterName", "attachedNetworkName")
45+
46+
if err := client.AttachedNetworksDeleteThenPoll(ctx, id); err != nil {
47+
// handle the error
48+
}
49+
```
50+
51+
52+
### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksGetByDevCenter`
53+
54+
```go
55+
ctx := context.TODO()
56+
id := attachednetworkconnections.NewDevCenterAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "devCenterName", "attachedNetworkName")
57+
58+
read, err := client.AttachedNetworksGetByDevCenter(ctx, id)
59+
if err != nil {
60+
// handle the error
61+
}
62+
if model := read.Model; model != nil {
63+
// do something with the model/response object
64+
}
65+
```
66+
67+
68+
### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksGetByProject`
69+
70+
```go
71+
ctx := context.TODO()
72+
id := attachednetworkconnections.NewAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "attachedNetworkName")
73+
74+
read, err := client.AttachedNetworksGetByProject(ctx, id)
75+
if err != nil {
76+
// handle the error
77+
}
78+
if model := read.Model; model != nil {
79+
// do something with the model/response object
80+
}
81+
```
82+
83+
84+
### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksListByDevCenter`
85+
86+
```go
87+
ctx := context.TODO()
88+
id := attachednetworkconnections.NewDevCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "devCenterName")
89+
90+
// alternatively `client.AttachedNetworksListByDevCenter(ctx, id, attachednetworkconnections.DefaultAttachedNetworksListByDevCenterOperationOptions())` can be used to do batched pagination
91+
items, err := client.AttachedNetworksListByDevCenterComplete(ctx, id, attachednetworkconnections.DefaultAttachedNetworksListByDevCenterOperationOptions())
92+
if err != nil {
93+
// handle the error
94+
}
95+
for _, item := range items {
96+
// do something
97+
}
98+
```
99+
100+
101+
### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksListByProject`
102+
103+
```go
104+
ctx := context.TODO()
105+
id := attachednetworkconnections.NewProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName")
106+
107+
// alternatively `client.AttachedNetworksListByProject(ctx, id, attachednetworkconnections.DefaultAttachedNetworksListByProjectOperationOptions())` can be used to do batched pagination
108+
items, err := client.AttachedNetworksListByProjectComplete(ctx, id, attachednetworkconnections.DefaultAttachedNetworksListByProjectOperationOptions())
109+
if err != nil {
110+
// handle the error
111+
}
112+
for _, item := range items {
113+
// do something
114+
}
115+
```
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package attachednetworkconnections
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
7+
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
8+
)
9+
10+
// Copyright (c) Microsoft Corporation. All rights reserved.
11+
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
12+
13+
type AttachedNetworkConnectionsClient struct {
14+
Client *resourcemanager.Client
15+
}
16+
17+
func NewAttachedNetworkConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*AttachedNetworkConnectionsClient, error) {
18+
client, err := resourcemanager.NewClient(sdkApi, "attachednetworkconnections", defaultApiVersion)
19+
if err != nil {
20+
return nil, fmt.Errorf("instantiating AttachedNetworkConnectionsClient: %+v", err)
21+
}
22+
23+
return &AttachedNetworkConnectionsClient{
24+
Client: client,
25+
}, nil
26+
}
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
package attachednetworkconnections
2+
3+
import (
4+
"encoding/json"
5+
"fmt"
6+
"strings"
7+
)
8+
9+
// Copyright (c) Microsoft Corporation. All rights reserved.
10+
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
11+
12+
type DomainJoinType string
13+
14+
const (
15+
DomainJoinTypeAzureADJoin DomainJoinType = "AzureADJoin"
16+
DomainJoinTypeHybridAzureADJoin DomainJoinType = "HybridAzureADJoin"
17+
DomainJoinTypeNone DomainJoinType = "None"
18+
)
19+
20+
func PossibleValuesForDomainJoinType() []string {
21+
return []string{
22+
string(DomainJoinTypeAzureADJoin),
23+
string(DomainJoinTypeHybridAzureADJoin),
24+
string(DomainJoinTypeNone),
25+
}
26+
}
27+
28+
func (s *DomainJoinType) UnmarshalJSON(bytes []byte) error {
29+
var decoded string
30+
if err := json.Unmarshal(bytes, &decoded); err != nil {
31+
return fmt.Errorf("unmarshaling: %+v", err)
32+
}
33+
out, err := parseDomainJoinType(decoded)
34+
if err != nil {
35+
return fmt.Errorf("parsing %q: %+v", decoded, err)
36+
}
37+
*s = *out
38+
return nil
39+
}
40+
41+
func parseDomainJoinType(input string) (*DomainJoinType, error) {
42+
vals := map[string]DomainJoinType{
43+
"azureadjoin": DomainJoinTypeAzureADJoin,
44+
"hybridazureadjoin": DomainJoinTypeHybridAzureADJoin,
45+
"none": DomainJoinTypeNone,
46+
}
47+
if v, ok := vals[strings.ToLower(input)]; ok {
48+
return &v, nil
49+
}
50+
51+
// otherwise presume it's an undefined value and best-effort it
52+
out := DomainJoinType(input)
53+
return &out, nil
54+
}
55+
56+
type HealthCheckStatus string
57+
58+
const (
59+
HealthCheckStatusFailed HealthCheckStatus = "Failed"
60+
HealthCheckStatusInformational HealthCheckStatus = "Informational"
61+
HealthCheckStatusPassed HealthCheckStatus = "Passed"
62+
HealthCheckStatusPending HealthCheckStatus = "Pending"
63+
HealthCheckStatusRunning HealthCheckStatus = "Running"
64+
HealthCheckStatusUnknown HealthCheckStatus = "Unknown"
65+
HealthCheckStatusWarning HealthCheckStatus = "Warning"
66+
)
67+
68+
func PossibleValuesForHealthCheckStatus() []string {
69+
return []string{
70+
string(HealthCheckStatusFailed),
71+
string(HealthCheckStatusInformational),
72+
string(HealthCheckStatusPassed),
73+
string(HealthCheckStatusPending),
74+
string(HealthCheckStatusRunning),
75+
string(HealthCheckStatusUnknown),
76+
string(HealthCheckStatusWarning),
77+
}
78+
}
79+
80+
func (s *HealthCheckStatus) UnmarshalJSON(bytes []byte) error {
81+
var decoded string
82+
if err := json.Unmarshal(bytes, &decoded); err != nil {
83+
return fmt.Errorf("unmarshaling: %+v", err)
84+
}
85+
out, err := parseHealthCheckStatus(decoded)
86+
if err != nil {
87+
return fmt.Errorf("parsing %q: %+v", decoded, err)
88+
}
89+
*s = *out
90+
return nil
91+
}
92+
93+
func parseHealthCheckStatus(input string) (*HealthCheckStatus, error) {
94+
vals := map[string]HealthCheckStatus{
95+
"failed": HealthCheckStatusFailed,
96+
"informational": HealthCheckStatusInformational,
97+
"passed": HealthCheckStatusPassed,
98+
"pending": HealthCheckStatusPending,
99+
"running": HealthCheckStatusRunning,
100+
"unknown": HealthCheckStatusUnknown,
101+
"warning": HealthCheckStatusWarning,
102+
}
103+
if v, ok := vals[strings.ToLower(input)]; ok {
104+
return &v, nil
105+
}
106+
107+
// otherwise presume it's an undefined value and best-effort it
108+
out := HealthCheckStatus(input)
109+
return &out, nil
110+
}
111+
112+
type ProvisioningState string
113+
114+
const (
115+
ProvisioningStateAccepted ProvisioningState = "Accepted"
116+
ProvisioningStateCanceled ProvisioningState = "Canceled"
117+
ProvisioningStateCreated ProvisioningState = "Created"
118+
ProvisioningStateCreating ProvisioningState = "Creating"
119+
ProvisioningStateDeleted ProvisioningState = "Deleted"
120+
ProvisioningStateDeleting ProvisioningState = "Deleting"
121+
ProvisioningStateFailed ProvisioningState = "Failed"
122+
ProvisioningStateMovingResources ProvisioningState = "MovingResources"
123+
ProvisioningStateNotSpecified ProvisioningState = "NotSpecified"
124+
ProvisioningStateRolloutInProgress ProvisioningState = "RolloutInProgress"
125+
ProvisioningStateRunning ProvisioningState = "Running"
126+
ProvisioningStateStorageProvisioningFailed ProvisioningState = "StorageProvisioningFailed"
127+
ProvisioningStateSucceeded ProvisioningState = "Succeeded"
128+
ProvisioningStateTransientFailure ProvisioningState = "TransientFailure"
129+
ProvisioningStateUpdated ProvisioningState = "Updated"
130+
ProvisioningStateUpdating ProvisioningState = "Updating"
131+
)
132+
133+
func PossibleValuesForProvisioningState() []string {
134+
return []string{
135+
string(ProvisioningStateAccepted),
136+
string(ProvisioningStateCanceled),
137+
string(ProvisioningStateCreated),
138+
string(ProvisioningStateCreating),
139+
string(ProvisioningStateDeleted),
140+
string(ProvisioningStateDeleting),
141+
string(ProvisioningStateFailed),
142+
string(ProvisioningStateMovingResources),
143+
string(ProvisioningStateNotSpecified),
144+
string(ProvisioningStateRolloutInProgress),
145+
string(ProvisioningStateRunning),
146+
string(ProvisioningStateStorageProvisioningFailed),
147+
string(ProvisioningStateSucceeded),
148+
string(ProvisioningStateTransientFailure),
149+
string(ProvisioningStateUpdated),
150+
string(ProvisioningStateUpdating),
151+
}
152+
}
153+
154+
func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error {
155+
var decoded string
156+
if err := json.Unmarshal(bytes, &decoded); err != nil {
157+
return fmt.Errorf("unmarshaling: %+v", err)
158+
}
159+
out, err := parseProvisioningState(decoded)
160+
if err != nil {
161+
return fmt.Errorf("parsing %q: %+v", decoded, err)
162+
}
163+
*s = *out
164+
return nil
165+
}
166+
167+
func parseProvisioningState(input string) (*ProvisioningState, error) {
168+
vals := map[string]ProvisioningState{
169+
"accepted": ProvisioningStateAccepted,
170+
"canceled": ProvisioningStateCanceled,
171+
"created": ProvisioningStateCreated,
172+
"creating": ProvisioningStateCreating,
173+
"deleted": ProvisioningStateDeleted,
174+
"deleting": ProvisioningStateDeleting,
175+
"failed": ProvisioningStateFailed,
176+
"movingresources": ProvisioningStateMovingResources,
177+
"notspecified": ProvisioningStateNotSpecified,
178+
"rolloutinprogress": ProvisioningStateRolloutInProgress,
179+
"running": ProvisioningStateRunning,
180+
"storageprovisioningfailed": ProvisioningStateStorageProvisioningFailed,
181+
"succeeded": ProvisioningStateSucceeded,
182+
"transientfailure": ProvisioningStateTransientFailure,
183+
"updated": ProvisioningStateUpdated,
184+
"updating": ProvisioningStateUpdating,
185+
}
186+
if v, ok := vals[strings.ToLower(input)]; ok {
187+
return &v, nil
188+
}
189+
190+
// otherwise presume it's an undefined value and best-effort it
191+
out := ProvisioningState(input)
192+
return &out, nil
193+
}

0 commit comments

Comments
 (0)