-
Notifications
You must be signed in to change notification settings - Fork 46
/
client.go
71 lines (57 loc) · 3.48 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
package v2022_05_01
// 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/dataprotection/2022-05-01/azurebackupjob"
"github.com/hashicorp/go-azure-sdk/resource-manager/dataprotection/2022-05-01/azurebackupjobs"
"github.com/hashicorp/go-azure-sdk/resource-manager/dataprotection/2022-05-01/backupinstances"
"github.com/hashicorp/go-azure-sdk/resource-manager/dataprotection/2022-05-01/backuppolicies"
"github.com/hashicorp/go-azure-sdk/resource-manager/dataprotection/2022-05-01/backupvaults"
"github.com/hashicorp/go-azure-sdk/resource-manager/dataprotection/2022-05-01/dppfeaturesupport"
"github.com/hashicorp/go-azure-sdk/resource-manager/dataprotection/2022-05-01/findrestorabletimeranges"
"github.com/hashicorp/go-azure-sdk/resource-manager/dataprotection/2022-05-01/recoverypoint"
"github.com/hashicorp/go-azure-sdk/resource-manager/dataprotection/2022-05-01/resourceguards"
)
type Client struct {
AzureBackupJob *azurebackupjob.AzureBackupJobClient
AzureBackupJobs *azurebackupjobs.AzureBackupJobsClient
BackupInstances *backupinstances.BackupInstancesClient
BackupPolicies *backuppolicies.BackupPoliciesClient
BackupVaults *backupvaults.BackupVaultsClient
DppFeatureSupport *dppfeaturesupport.DppFeatureSupportClient
FindRestorableTimeRanges *findrestorabletimeranges.FindRestorableTimeRangesClient
RecoveryPoint *recoverypoint.RecoveryPointClient
ResourceGuards *resourceguards.ResourceGuardsClient
}
func NewClientWithBaseURI(endpoint string, configureAuthFunc func(c *autorest.Client)) Client {
azureBackupJobClient := azurebackupjob.NewAzureBackupJobClientWithBaseURI(endpoint)
configureAuthFunc(&azureBackupJobClient.Client)
azureBackupJobsClient := azurebackupjobs.NewAzureBackupJobsClientWithBaseURI(endpoint)
configureAuthFunc(&azureBackupJobsClient.Client)
backupInstancesClient := backupinstances.NewBackupInstancesClientWithBaseURI(endpoint)
configureAuthFunc(&backupInstancesClient.Client)
backupPoliciesClient := backuppolicies.NewBackupPoliciesClientWithBaseURI(endpoint)
configureAuthFunc(&backupPoliciesClient.Client)
backupVaultsClient := backupvaults.NewBackupVaultsClientWithBaseURI(endpoint)
configureAuthFunc(&backupVaultsClient.Client)
dppFeatureSupportClient := dppfeaturesupport.NewDppFeatureSupportClientWithBaseURI(endpoint)
configureAuthFunc(&dppFeatureSupportClient.Client)
findRestorableTimeRangesClient := findrestorabletimeranges.NewFindRestorableTimeRangesClientWithBaseURI(endpoint)
configureAuthFunc(&findRestorableTimeRangesClient.Client)
recoveryPointClient := recoverypoint.NewRecoveryPointClientWithBaseURI(endpoint)
configureAuthFunc(&recoveryPointClient.Client)
resourceGuardsClient := resourceguards.NewResourceGuardsClientWithBaseURI(endpoint)
configureAuthFunc(&resourceGuardsClient.Client)
return Client{
AzureBackupJob: &azureBackupJobClient,
AzureBackupJobs: &azureBackupJobsClient,
BackupInstances: &backupInstancesClient,
BackupPolicies: &backupPoliciesClient,
BackupVaults: &backupVaultsClient,
DppFeatureSupport: &dppFeatureSupportClient,
FindRestorableTimeRanges: &findRestorableTimeRangesClient,
RecoveryPoint: &recoveryPointClient,
ResourceGuards: &resourceGuardsClient,
}
}