-
Notifications
You must be signed in to change notification settings - Fork 40
/
client.go
89 lines (72 loc) · 4.55 KB
/
client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package v2022_05_15
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
import (
"github.com/Azure/go-autorest/autorest"
"github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/cosmosdb"
"github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/datatransfer"
"github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/graphapicompute"
"github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/managedcassandras"
"github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/materializedviewsbuilder"
"github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/notebookworkspacesresource"
"github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/privateendpointconnections"
"github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/privatelinkresources"
"github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/rbacs"
"github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/restorables"
"github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/services"
"github.com/hashicorp/go-azure-sdk/resource-manager/cosmosdb/2022-05-15/sqldedicatedgateway"
)
type Client struct {
CosmosDB *cosmosdb.CosmosDBClient
DataTransfer *datatransfer.DataTransferClient
GraphAPICompute *graphapicompute.GraphAPIComputeClient
ManagedCassandras *managedcassandras.ManagedCassandrasClient
MaterializedViewsBuilder *materializedviewsbuilder.MaterializedViewsBuilderClient
NotebookWorkspacesResource *notebookworkspacesresource.NotebookWorkspacesResourceClient
PrivateEndpointConnections *privateendpointconnections.PrivateEndpointConnectionsClient
PrivateLinkResources *privatelinkresources.PrivateLinkResourcesClient
Rbacs *rbacs.RbacsClient
Restorables *restorables.RestorablesClient
Services *services.ServicesClient
SqlDedicatedGateway *sqldedicatedgateway.SqlDedicatedGatewayClient
}
func NewClientWithBaseURI(endpoint string, configureAuthFunc func(c *autorest.Client)) Client {
cosmosDBClient := cosmosdb.NewCosmosDBClientWithBaseURI(endpoint)
configureAuthFunc(&cosmosDBClient.Client)
dataTransferClient := datatransfer.NewDataTransferClientWithBaseURI(endpoint)
configureAuthFunc(&dataTransferClient.Client)
graphAPIComputeClient := graphapicompute.NewGraphAPIComputeClientWithBaseURI(endpoint)
configureAuthFunc(&graphAPIComputeClient.Client)
managedCassandrasClient := managedcassandras.NewManagedCassandrasClientWithBaseURI(endpoint)
configureAuthFunc(&managedCassandrasClient.Client)
materializedViewsBuilderClient := materializedviewsbuilder.NewMaterializedViewsBuilderClientWithBaseURI(endpoint)
configureAuthFunc(&materializedViewsBuilderClient.Client)
notebookWorkspacesResourceClient := notebookworkspacesresource.NewNotebookWorkspacesResourceClientWithBaseURI(endpoint)
configureAuthFunc(¬ebookWorkspacesResourceClient.Client)
privateEndpointConnectionsClient := privateendpointconnections.NewPrivateEndpointConnectionsClientWithBaseURI(endpoint)
configureAuthFunc(&privateEndpointConnectionsClient.Client)
privateLinkResourcesClient := privatelinkresources.NewPrivateLinkResourcesClientWithBaseURI(endpoint)
configureAuthFunc(&privateLinkResourcesClient.Client)
rbacsClient := rbacs.NewRbacsClientWithBaseURI(endpoint)
configureAuthFunc(&rbacsClient.Client)
restorablesClient := restorables.NewRestorablesClientWithBaseURI(endpoint)
configureAuthFunc(&restorablesClient.Client)
servicesClient := services.NewServicesClientWithBaseURI(endpoint)
configureAuthFunc(&servicesClient.Client)
sqlDedicatedGatewayClient := sqldedicatedgateway.NewSqlDedicatedGatewayClientWithBaseURI(endpoint)
configureAuthFunc(&sqlDedicatedGatewayClient.Client)
return Client{
CosmosDB: &cosmosDBClient,
DataTransfer: &dataTransferClient,
GraphAPICompute: &graphAPIComputeClient,
ManagedCassandras: &managedCassandrasClient,
MaterializedViewsBuilder: &materializedViewsBuilderClient,
NotebookWorkspacesResource: ¬ebookWorkspacesResourceClient,
PrivateEndpointConnections: &privateEndpointConnectionsClient,
PrivateLinkResources: &privateLinkResourcesClient,
Rbacs: &rbacsClient,
Restorables: &restorablesClient,
Services: &servicesClient,
SqlDedicatedGateway: &sqlDedicatedGatewayClient,
}
}