Skip to content

Commit 586bdab

Browse files
authored
Merge pull request #1206 from hashicorp/auto-pr/95808d094
Auto PR: Regenerating the Go SDK (c34f46c)
2 parents e699697 + c34f46c commit 586bdab

File tree

712 files changed

+48919
-43
lines changed

Some content is hidden

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

712 files changed

+48919
-43
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package v2025_05_01
2+
3+
// Copyright (c) Microsoft Corporation. All rights reserved.
4+
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
5+
6+
import (
7+
"fmt"
8+
9+
"github.com/hashicorp/go-azure-sdk/resource-manager/aad/2025-05-01/domainservices"
10+
"github.com/hashicorp/go-azure-sdk/resource-manager/aad/2025-05-01/oucontainer"
11+
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
12+
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
13+
)
14+
15+
type Client struct {
16+
DomainServices *domainservices.DomainServicesClient
17+
OuContainer *oucontainer.OuContainerClient
18+
}
19+
20+
func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) {
21+
domainServicesClient, err := domainservices.NewDomainServicesClientWithBaseURI(sdkApi)
22+
if err != nil {
23+
return nil, fmt.Errorf("building DomainServices client: %+v", err)
24+
}
25+
configureFunc(domainServicesClient.Client)
26+
27+
ouContainerClient, err := oucontainer.NewOuContainerClientWithBaseURI(sdkApi)
28+
if err != nil {
29+
return nil, fmt.Errorf("building OuContainer client: %+v", err)
30+
}
31+
configureFunc(ouContainerClient.Client)
32+
33+
return &Client{
34+
DomainServices: domainServicesClient,
35+
OuContainer: ouContainerClient,
36+
}, nil
37+
}
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
2+
## `github.com/hashicorp/go-azure-sdk/resource-manager/aad/2025-05-01/domainservices` Documentation
3+
4+
The `domainservices` SDK allows for interaction with Azure Resource Manager `aad` (API Version `2025-05-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-helpers/resourcemanager/commonids"
12+
import "github.com/hashicorp/go-azure-sdk/resource-manager/aad/2025-05-01/domainservices"
13+
```
14+
15+
16+
### Client Initialization
17+
18+
```go
19+
client := domainservices.NewDomainServicesClientWithBaseURI("https://management.azure.com")
20+
client.Client.Authorizer = authorizer
21+
```
22+
23+
24+
### Example Usage: `DomainServicesClient.CreateOrUpdate`
25+
26+
```go
27+
ctx := context.TODO()
28+
id := domainservices.NewDomainServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainServiceName")
29+
30+
payload := domainservices.DomainService{
31+
// ...
32+
}
33+
34+
35+
if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil {
36+
// handle the error
37+
}
38+
```
39+
40+
41+
### Example Usage: `DomainServicesClient.Delete`
42+
43+
```go
44+
ctx := context.TODO()
45+
id := domainservices.NewDomainServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainServiceName")
46+
47+
if err := client.DeleteThenPoll(ctx, id); err != nil {
48+
// handle the error
49+
}
50+
```
51+
52+
53+
### Example Usage: `DomainServicesClient.Get`
54+
55+
```go
56+
ctx := context.TODO()
57+
id := domainservices.NewDomainServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainServiceName")
58+
59+
read, err := client.Get(ctx, id)
60+
if err != nil {
61+
// handle the error
62+
}
63+
if model := read.Model; model != nil {
64+
// do something with the model/response object
65+
}
66+
```
67+
68+
69+
### Example Usage: `DomainServicesClient.List`
70+
71+
```go
72+
ctx := context.TODO()
73+
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")
74+
75+
// alternatively `client.List(ctx, id)` can be used to do batched pagination
76+
items, err := client.ListComplete(ctx, id)
77+
if err != nil {
78+
// handle the error
79+
}
80+
for _, item := range items {
81+
// do something
82+
}
83+
```
84+
85+
86+
### Example Usage: `DomainServicesClient.ListByResourceGroup`
87+
88+
```go
89+
ctx := context.TODO()
90+
id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group")
91+
92+
// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination
93+
items, err := client.ListByResourceGroupComplete(ctx, id)
94+
if err != nil {
95+
// handle the error
96+
}
97+
for _, item := range items {
98+
// do something
99+
}
100+
```
101+
102+
103+
### Example Usage: `DomainServicesClient.Unsuspend`
104+
105+
```go
106+
ctx := context.TODO()
107+
id := domainservices.NewDomainServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainServiceName")
108+
109+
read, err := client.Unsuspend(ctx, id)
110+
if err != nil {
111+
// handle the error
112+
}
113+
if model := read.Model; model != nil {
114+
// do something with the model/response object
115+
}
116+
```
117+
118+
119+
### Example Usage: `DomainServicesClient.Update`
120+
121+
```go
122+
ctx := context.TODO()
123+
id := domainservices.NewDomainServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainServiceName")
124+
125+
payload := domainservices.DomainService{
126+
// ...
127+
}
128+
129+
130+
if err := client.UpdateThenPoll(ctx, id, payload); err != nil {
131+
// handle the error
132+
}
133+
```
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package domainservices
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 DomainServicesClient struct {
14+
Client *resourcemanager.Client
15+
}
16+
17+
func NewDomainServicesClientWithBaseURI(sdkApi sdkEnv.Api) (*DomainServicesClient, error) {
18+
client, err := resourcemanager.NewClient(sdkApi, "domainservices", defaultApiVersion)
19+
if err != nil {
20+
return nil, fmt.Errorf("instantiating DomainServicesClient: %+v", err)
21+
}
22+
23+
return &DomainServicesClient{
24+
Client: client,
25+
}, nil
26+
}

0 commit comments

Comments
 (0)