forked from pulumi/pulumi-azure-native-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getViewByScope.go
213 lines (180 loc) · 13 KB
/
getViewByScope.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
203
204
205
206
207
208
209
210
211
212
213
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package costmanagement
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure-native-sdk/v2/utilities"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Gets the view for the defined scope by view name.
// Azure REST API version: 2023-03-01.
//
// Other available API versions: 2019-11-01, 2020-06-01, 2022-10-01, 2022-10-05-preview, 2023-04-01-preview, 2023-07-01-preview, 2023-08-01, 2023-09-01, 2023-11-01.
func LookupViewByScope(ctx *pulumi.Context, args *LookupViewByScopeArgs, opts ...pulumi.InvokeOption) (*LookupViewByScopeResult, error) {
opts = utilities.PkgInvokeDefaultOpts(opts)
var rv LookupViewByScopeResult
err := ctx.Invoke("azure-native:costmanagement:getViewByScope", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupViewByScopeArgs struct {
// The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope.
Scope string `pulumi:"scope"`
// View name
ViewName string `pulumi:"viewName"`
}
// States and configurations of Cost Analysis.
type LookupViewByScopeResult struct {
// Show costs accumulated over time.
Accumulated *string `pulumi:"accumulated"`
// Chart type of the main view in Cost Analysis. Required.
Chart *string `pulumi:"chart"`
// Date the user created this view.
CreatedOn string `pulumi:"createdOn"`
// Currency of the current view.
Currency string `pulumi:"currency"`
// Has definition for data in this report config.
DataSet *ReportConfigDatasetResponse `pulumi:"dataSet"`
// Date range of the current view.
DateRange *string `pulumi:"dateRange"`
// User input name of the view. Required.
DisplayName *string `pulumi:"displayName"`
// eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.
ETag *string `pulumi:"eTag"`
// Resource Id.
Id string `pulumi:"id"`
// If true, report includes monetary commitment.
IncludeMonetaryCommitment *bool `pulumi:"includeMonetaryCommitment"`
// List of KPIs to show in Cost Analysis UI.
Kpis []KpiPropertiesResponse `pulumi:"kpis"`
// Metric to use when displaying costs.
Metric *string `pulumi:"metric"`
// Date when the user last modified this view.
ModifiedOn *string `pulumi:"modifiedOn"`
// Resource name.
Name string `pulumi:"name"`
// Configuration of 3 sub-views in the Cost Analysis UI.
Pivots []PivotPropertiesResponse `pulumi:"pivots"`
// Cost Management scope to save the view on. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope.
Scope *string `pulumi:"scope"`
// Has time period for pulling data for the report.
TimePeriod *ReportConfigTimePeriodResponse `pulumi:"timePeriod"`
// The time frame for pulling data for the report. If custom, then a specific time period must be provided.
Timeframe string `pulumi:"timeframe"`
// Resource type.
Type string `pulumi:"type"`
}
func LookupViewByScopeOutput(ctx *pulumi.Context, args LookupViewByScopeOutputArgs, opts ...pulumi.InvokeOption) LookupViewByScopeResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupViewByScopeResult, error) {
args := v.(LookupViewByScopeArgs)
r, err := LookupViewByScope(ctx, &args, opts...)
var s LookupViewByScopeResult
if r != nil {
s = *r
}
return s, err
}).(LookupViewByScopeResultOutput)
}
type LookupViewByScopeOutputArgs struct {
// The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope.
Scope pulumi.StringInput `pulumi:"scope"`
// View name
ViewName pulumi.StringInput `pulumi:"viewName"`
}
func (LookupViewByScopeOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupViewByScopeArgs)(nil)).Elem()
}
// States and configurations of Cost Analysis.
type LookupViewByScopeResultOutput struct{ *pulumi.OutputState }
func (LookupViewByScopeResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupViewByScopeResult)(nil)).Elem()
}
func (o LookupViewByScopeResultOutput) ToLookupViewByScopeResultOutput() LookupViewByScopeResultOutput {
return o
}
func (o LookupViewByScopeResultOutput) ToLookupViewByScopeResultOutputWithContext(ctx context.Context) LookupViewByScopeResultOutput {
return o
}
// Show costs accumulated over time.
func (o LookupViewByScopeResultOutput) Accumulated() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupViewByScopeResult) *string { return v.Accumulated }).(pulumi.StringPtrOutput)
}
// Chart type of the main view in Cost Analysis. Required.
func (o LookupViewByScopeResultOutput) Chart() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupViewByScopeResult) *string { return v.Chart }).(pulumi.StringPtrOutput)
}
// Date the user created this view.
func (o LookupViewByScopeResultOutput) CreatedOn() pulumi.StringOutput {
return o.ApplyT(func(v LookupViewByScopeResult) string { return v.CreatedOn }).(pulumi.StringOutput)
}
// Currency of the current view.
func (o LookupViewByScopeResultOutput) Currency() pulumi.StringOutput {
return o.ApplyT(func(v LookupViewByScopeResult) string { return v.Currency }).(pulumi.StringOutput)
}
// Has definition for data in this report config.
func (o LookupViewByScopeResultOutput) DataSet() ReportConfigDatasetResponsePtrOutput {
return o.ApplyT(func(v LookupViewByScopeResult) *ReportConfigDatasetResponse { return v.DataSet }).(ReportConfigDatasetResponsePtrOutput)
}
// Date range of the current view.
func (o LookupViewByScopeResultOutput) DateRange() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupViewByScopeResult) *string { return v.DateRange }).(pulumi.StringPtrOutput)
}
// User input name of the view. Required.
func (o LookupViewByScopeResultOutput) DisplayName() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupViewByScopeResult) *string { return v.DisplayName }).(pulumi.StringPtrOutput)
}
// eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.
func (o LookupViewByScopeResultOutput) ETag() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupViewByScopeResult) *string { return v.ETag }).(pulumi.StringPtrOutput)
}
// Resource Id.
func (o LookupViewByScopeResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupViewByScopeResult) string { return v.Id }).(pulumi.StringOutput)
}
// If true, report includes monetary commitment.
func (o LookupViewByScopeResultOutput) IncludeMonetaryCommitment() pulumi.BoolPtrOutput {
return o.ApplyT(func(v LookupViewByScopeResult) *bool { return v.IncludeMonetaryCommitment }).(pulumi.BoolPtrOutput)
}
// List of KPIs to show in Cost Analysis UI.
func (o LookupViewByScopeResultOutput) Kpis() KpiPropertiesResponseArrayOutput {
return o.ApplyT(func(v LookupViewByScopeResult) []KpiPropertiesResponse { return v.Kpis }).(KpiPropertiesResponseArrayOutput)
}
// Metric to use when displaying costs.
func (o LookupViewByScopeResultOutput) Metric() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupViewByScopeResult) *string { return v.Metric }).(pulumi.StringPtrOutput)
}
// Date when the user last modified this view.
func (o LookupViewByScopeResultOutput) ModifiedOn() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupViewByScopeResult) *string { return v.ModifiedOn }).(pulumi.StringPtrOutput)
}
// Resource name.
func (o LookupViewByScopeResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupViewByScopeResult) string { return v.Name }).(pulumi.StringOutput)
}
// Configuration of 3 sub-views in the Cost Analysis UI.
func (o LookupViewByScopeResultOutput) Pivots() PivotPropertiesResponseArrayOutput {
return o.ApplyT(func(v LookupViewByScopeResult) []PivotPropertiesResponse { return v.Pivots }).(PivotPropertiesResponseArrayOutput)
}
// Cost Management scope to save the view on. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope.
func (o LookupViewByScopeResultOutput) Scope() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupViewByScopeResult) *string { return v.Scope }).(pulumi.StringPtrOutput)
}
// Has time period for pulling data for the report.
func (o LookupViewByScopeResultOutput) TimePeriod() ReportConfigTimePeriodResponsePtrOutput {
return o.ApplyT(func(v LookupViewByScopeResult) *ReportConfigTimePeriodResponse { return v.TimePeriod }).(ReportConfigTimePeriodResponsePtrOutput)
}
// The time frame for pulling data for the report. If custom, then a specific time period must be provided.
func (o LookupViewByScopeResultOutput) Timeframe() pulumi.StringOutput {
return o.ApplyT(func(v LookupViewByScopeResult) string { return v.Timeframe }).(pulumi.StringOutput)
}
// Resource type.
func (o LookupViewByScopeResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v LookupViewByScopeResult) string { return v.Type }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupViewByScopeResultOutput{})
}