This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
export.go
202 lines (178 loc) · 7.19 KB
/
export.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20190901
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// A export resource.
type Export struct {
pulumi.CustomResourceState
// Has definition for the export.
Definition QueryDefinitionResponseOutput `pulumi:"definition"`
// Has delivery information for the export.
DeliveryInfo ExportDeliveryInfoResponseOutput `pulumi:"deliveryInfo"`
// The format of the export being delivered.
Format pulumi.StringPtrOutput `pulumi:"format"`
// Resource name.
Name pulumi.StringOutput `pulumi:"name"`
// Has schedule information for the export.
Schedule ExportScheduleResponsePtrOutput `pulumi:"schedule"`
// Resource tags.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Resource type.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewExport registers a new resource with the given unique name, arguments, and options.
func NewExport(ctx *pulumi.Context,
name string, args *ExportArgs, opts ...pulumi.ResourceOption) (*Export, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Definition == nil {
return nil, errors.New("invalid value for required argument 'Definition'")
}
if args.DeliveryInfo == nil {
return nil, errors.New("invalid value for required argument 'DeliveryInfo'")
}
if args.ExportName == nil {
return nil, errors.New("invalid value for required argument 'ExportName'")
}
if args.Scope == nil {
return nil, errors.New("invalid value for required argument 'Scope'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:costmanagement/latest:Export"),
},
{
Type: pulumi.String("azure-nextgen:costmanagement/v20190101:Export"),
},
{
Type: pulumi.String("azure-nextgen:costmanagement/v20191001:Export"),
},
{
Type: pulumi.String("azure-nextgen:costmanagement/v20191101:Export"),
},
{
Type: pulumi.String("azure-nextgen:costmanagement/v20200601:Export"),
},
})
opts = append(opts, aliases)
var resource Export
err := ctx.RegisterResource("azure-nextgen:costmanagement/v20190901:Export", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetExport gets an existing Export resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetExport(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ExportState, opts ...pulumi.ResourceOption) (*Export, error) {
var resource Export
err := ctx.ReadResource("azure-nextgen:costmanagement/v20190901:Export", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Export resources.
type exportState struct {
// Has definition for the export.
Definition *QueryDefinitionResponse `pulumi:"definition"`
// Has delivery information for the export.
DeliveryInfo *ExportDeliveryInfoResponse `pulumi:"deliveryInfo"`
// The format of the export being delivered.
Format *string `pulumi:"format"`
// Resource name.
Name *string `pulumi:"name"`
// Has schedule information for the export.
Schedule *ExportScheduleResponse `pulumi:"schedule"`
// Resource tags.
Tags map[string]string `pulumi:"tags"`
// Resource type.
Type *string `pulumi:"type"`
}
type ExportState struct {
// Has definition for the export.
Definition QueryDefinitionResponsePtrInput
// Has delivery information for the export.
DeliveryInfo ExportDeliveryInfoResponsePtrInput
// The format of the export being delivered.
Format pulumi.StringPtrInput
// Resource name.
Name pulumi.StringPtrInput
// Has schedule information for the export.
Schedule ExportScheduleResponsePtrInput
// Resource tags.
Tags pulumi.StringMapInput
// Resource type.
Type pulumi.StringPtrInput
}
func (ExportState) ElementType() reflect.Type {
return reflect.TypeOf((*exportState)(nil)).Elem()
}
type exportArgs struct {
// Has definition for the export.
Definition QueryDefinition `pulumi:"definition"`
// Has delivery information for the export.
DeliveryInfo ExportDeliveryInfo `pulumi:"deliveryInfo"`
// Export Name.
ExportName string `pulumi:"exportName"`
// The format of the export being delivered.
Format *string `pulumi:"format"`
// Has schedule information for the export.
Schedule *ExportSchedule `pulumi:"schedule"`
// The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope..
Scope string `pulumi:"scope"`
}
// The set of arguments for constructing a Export resource.
type ExportArgs struct {
// Has definition for the export.
Definition QueryDefinitionInput
// Has delivery information for the export.
DeliveryInfo ExportDeliveryInfoInput
// Export Name.
ExportName pulumi.StringInput
// The format of the export being delivered.
Format pulumi.StringPtrInput
// Has schedule information for the export.
Schedule ExportSchedulePtrInput
// The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope..
Scope pulumi.StringInput
}
func (ExportArgs) ElementType() reflect.Type {
return reflect.TypeOf((*exportArgs)(nil)).Elem()
}
type ExportInput interface {
pulumi.Input
ToExportOutput() ExportOutput
ToExportOutputWithContext(ctx context.Context) ExportOutput
}
func (*Export) ElementType() reflect.Type {
return reflect.TypeOf((*Export)(nil))
}
func (i *Export) ToExportOutput() ExportOutput {
return i.ToExportOutputWithContext(context.Background())
}
func (i *Export) ToExportOutputWithContext(ctx context.Context) ExportOutput {
return pulumi.ToOutputWithContext(ctx, i).(ExportOutput)
}
type ExportOutput struct {
*pulumi.OutputState
}
func (ExportOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Export)(nil))
}
func (o ExportOutput) ToExportOutput() ExportOutput {
return o
}
func (o ExportOutput) ToExportOutputWithContext(ctx context.Context) ExportOutput {
return o
}
func init() {
pulumi.RegisterOutputType(ExportOutput{})
}