Skip to content

Commit 5de6316

Browse files
authored
Merge pull request #1195 from hashicorp/auto-pr/084809de0
Auto PR: Regenerating the Go SDK (729f855)
2 parents a9fd6b8 + 729f855 commit 5de6316

File tree

5,335 files changed

+409424
-12
lines changed

Some content is hidden

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

5,335 files changed

+409424
-12
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
package v2024_06_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/appconfiguration/2024-06-01/configurationstores"
10+
"github.com/hashicorp/go-azure-sdk/resource-manager/appconfiguration/2024-06-01/deletedconfigurationstores"
11+
"github.com/hashicorp/go-azure-sdk/resource-manager/appconfiguration/2024-06-01/keyvalues"
12+
"github.com/hashicorp/go-azure-sdk/resource-manager/appconfiguration/2024-06-01/operations"
13+
"github.com/hashicorp/go-azure-sdk/resource-manager/appconfiguration/2024-06-01/privateendpointconnections"
14+
"github.com/hashicorp/go-azure-sdk/resource-manager/appconfiguration/2024-06-01/privatelinkresources"
15+
"github.com/hashicorp/go-azure-sdk/resource-manager/appconfiguration/2024-06-01/replicas"
16+
"github.com/hashicorp/go-azure-sdk/resource-manager/appconfiguration/2024-06-01/snapshots"
17+
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
18+
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
19+
)
20+
21+
type Client struct {
22+
ConfigurationStores *configurationstores.ConfigurationStoresClient
23+
DeletedConfigurationStores *deletedconfigurationstores.DeletedConfigurationStoresClient
24+
KeyValues *keyvalues.KeyValuesClient
25+
Operations *operations.OperationsClient
26+
PrivateEndpointConnections *privateendpointconnections.PrivateEndpointConnectionsClient
27+
PrivateLinkResources *privatelinkresources.PrivateLinkResourcesClient
28+
Replicas *replicas.ReplicasClient
29+
Snapshots *snapshots.SnapshotsClient
30+
}
31+
32+
func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) {
33+
configurationStoresClient, err := configurationstores.NewConfigurationStoresClientWithBaseURI(sdkApi)
34+
if err != nil {
35+
return nil, fmt.Errorf("building ConfigurationStores client: %+v", err)
36+
}
37+
configureFunc(configurationStoresClient.Client)
38+
39+
deletedConfigurationStoresClient, err := deletedconfigurationstores.NewDeletedConfigurationStoresClientWithBaseURI(sdkApi)
40+
if err != nil {
41+
return nil, fmt.Errorf("building DeletedConfigurationStores client: %+v", err)
42+
}
43+
configureFunc(deletedConfigurationStoresClient.Client)
44+
45+
keyValuesClient, err := keyvalues.NewKeyValuesClientWithBaseURI(sdkApi)
46+
if err != nil {
47+
return nil, fmt.Errorf("building KeyValues client: %+v", err)
48+
}
49+
configureFunc(keyValuesClient.Client)
50+
51+
operationsClient, err := operations.NewOperationsClientWithBaseURI(sdkApi)
52+
if err != nil {
53+
return nil, fmt.Errorf("building Operations client: %+v", err)
54+
}
55+
configureFunc(operationsClient.Client)
56+
57+
privateEndpointConnectionsClient, err := privateendpointconnections.NewPrivateEndpointConnectionsClientWithBaseURI(sdkApi)
58+
if err != nil {
59+
return nil, fmt.Errorf("building PrivateEndpointConnections client: %+v", err)
60+
}
61+
configureFunc(privateEndpointConnectionsClient.Client)
62+
63+
privateLinkResourcesClient, err := privatelinkresources.NewPrivateLinkResourcesClientWithBaseURI(sdkApi)
64+
if err != nil {
65+
return nil, fmt.Errorf("building PrivateLinkResources client: %+v", err)
66+
}
67+
configureFunc(privateLinkResourcesClient.Client)
68+
69+
replicasClient, err := replicas.NewReplicasClientWithBaseURI(sdkApi)
70+
if err != nil {
71+
return nil, fmt.Errorf("building Replicas client: %+v", err)
72+
}
73+
configureFunc(replicasClient.Client)
74+
75+
snapshotsClient, err := snapshots.NewSnapshotsClientWithBaseURI(sdkApi)
76+
if err != nil {
77+
return nil, fmt.Errorf("building Snapshots client: %+v", err)
78+
}
79+
configureFunc(snapshotsClient.Client)
80+
81+
return &Client{
82+
ConfigurationStores: configurationStoresClient,
83+
DeletedConfigurationStores: deletedConfigurationStoresClient,
84+
KeyValues: keyValuesClient,
85+
Operations: operationsClient,
86+
PrivateEndpointConnections: privateEndpointConnectionsClient,
87+
PrivateLinkResources: privateLinkResourcesClient,
88+
Replicas: replicasClient,
89+
Snapshots: snapshotsClient,
90+
}, nil
91+
}
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
2+
## `github.com/hashicorp/go-azure-sdk/resource-manager/appconfiguration/2024-06-01/configurationstores` Documentation
3+
4+
The `configurationstores` SDK allows for interaction with Azure Resource Manager `appconfiguration` (API Version `2024-06-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/appconfiguration/2024-06-01/configurationstores"
13+
```
14+
15+
16+
### Client Initialization
17+
18+
```go
19+
client := configurationstores.NewConfigurationStoresClientWithBaseURI("https://management.azure.com")
20+
client.Client.Authorizer = authorizer
21+
```
22+
23+
24+
### Example Usage: `ConfigurationStoresClient.Create`
25+
26+
```go
27+
ctx := context.TODO()
28+
id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName")
29+
30+
payload := configurationstores.ConfigurationStore{
31+
// ...
32+
}
33+
34+
35+
if err := client.CreateThenPoll(ctx, id, payload); err != nil {
36+
// handle the error
37+
}
38+
```
39+
40+
41+
### Example Usage: `ConfigurationStoresClient.Delete`
42+
43+
```go
44+
ctx := context.TODO()
45+
id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName")
46+
47+
if err := client.DeleteThenPoll(ctx, id); err != nil {
48+
// handle the error
49+
}
50+
```
51+
52+
53+
### Example Usage: `ConfigurationStoresClient.Get`
54+
55+
```go
56+
ctx := context.TODO()
57+
id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName")
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: `ConfigurationStoresClient.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: `ConfigurationStoresClient.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: `ConfigurationStoresClient.ListKeys`
104+
105+
```go
106+
ctx := context.TODO()
107+
id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName")
108+
109+
// alternatively `client.ListKeys(ctx, id)` can be used to do batched pagination
110+
items, err := client.ListKeysComplete(ctx, id)
111+
if err != nil {
112+
// handle the error
113+
}
114+
for _, item := range items {
115+
// do something
116+
}
117+
```
118+
119+
120+
### Example Usage: `ConfigurationStoresClient.RegenerateKey`
121+
122+
```go
123+
ctx := context.TODO()
124+
id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName")
125+
126+
payload := configurationstores.RegenerateKeyParameters{
127+
// ...
128+
}
129+
130+
131+
read, err := client.RegenerateKey(ctx, id, payload)
132+
if err != nil {
133+
// handle the error
134+
}
135+
if model := read.Model; model != nil {
136+
// do something with the model/response object
137+
}
138+
```
139+
140+
141+
### Example Usage: `ConfigurationStoresClient.Update`
142+
143+
```go
144+
ctx := context.TODO()
145+
id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName")
146+
147+
payload := configurationstores.ConfigurationStoreUpdateParameters{
148+
// ...
149+
}
150+
151+
152+
if err := client.UpdateThenPoll(ctx, id, payload); err != nil {
153+
// handle the error
154+
}
155+
```
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package configurationstores
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 ConfigurationStoresClient struct {
14+
Client *resourcemanager.Client
15+
}
16+
17+
func NewConfigurationStoresClientWithBaseURI(sdkApi sdkEnv.Api) (*ConfigurationStoresClient, error) {
18+
client, err := resourcemanager.NewClient(sdkApi, "configurationstores", defaultApiVersion)
19+
if err != nil {
20+
return nil, fmt.Errorf("instantiating ConfigurationStoresClient: %+v", err)
21+
}
22+
23+
return &ConfigurationStoresClient{
24+
Client: client,
25+
}, nil
26+
}

0 commit comments

Comments
 (0)