forked from pulumi/pulumi-azure-native-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getMarkupRule.go
145 lines (122 loc) · 5.13 KB
/
getMarkupRule.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
// 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"
)
// Get a markup rule by its rule name.
// Azure REST API version: 2022-10-05-preview.
func LookupMarkupRule(ctx *pulumi.Context, args *LookupMarkupRuleArgs, opts ...pulumi.InvokeOption) (*LookupMarkupRuleResult, error) {
opts = utilities.PkgInvokeDefaultOpts(opts)
var rv LookupMarkupRuleResult
err := ctx.Invoke("azure-native:costmanagement:getMarkupRule", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupMarkupRuleArgs struct {
// BillingAccount ID
BillingAccountId string `pulumi:"billingAccountId"`
// BillingProfile ID
BillingProfileId string `pulumi:"billingProfileId"`
// Markup rule name.
Name string `pulumi:"name"`
}
// Markup rule
type LookupMarkupRuleResult struct {
// Customer information for the markup rule.
CustomerDetails CustomerMetadataResponse `pulumi:"customerDetails"`
// The description of the markup rule.
Description *string `pulumi:"description"`
// 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"`
// Ending date of the markup rule.
EndDate *string `pulumi:"endDate"`
// Resource Id.
Id string `pulumi:"id"`
// Resource name.
Name string `pulumi:"name"`
// The markup percentage of the rule.
Percentage float64 `pulumi:"percentage"`
// Starting date of the markup rule.
StartDate string `pulumi:"startDate"`
// Resource type.
Type string `pulumi:"type"`
}
func LookupMarkupRuleOutput(ctx *pulumi.Context, args LookupMarkupRuleOutputArgs, opts ...pulumi.InvokeOption) LookupMarkupRuleResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupMarkupRuleResult, error) {
args := v.(LookupMarkupRuleArgs)
r, err := LookupMarkupRule(ctx, &args, opts...)
var s LookupMarkupRuleResult
if r != nil {
s = *r
}
return s, err
}).(LookupMarkupRuleResultOutput)
}
type LookupMarkupRuleOutputArgs struct {
// BillingAccount ID
BillingAccountId pulumi.StringInput `pulumi:"billingAccountId"`
// BillingProfile ID
BillingProfileId pulumi.StringInput `pulumi:"billingProfileId"`
// Markup rule name.
Name pulumi.StringInput `pulumi:"name"`
}
func (LookupMarkupRuleOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupMarkupRuleArgs)(nil)).Elem()
}
// Markup rule
type LookupMarkupRuleResultOutput struct{ *pulumi.OutputState }
func (LookupMarkupRuleResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupMarkupRuleResult)(nil)).Elem()
}
func (o LookupMarkupRuleResultOutput) ToLookupMarkupRuleResultOutput() LookupMarkupRuleResultOutput {
return o
}
func (o LookupMarkupRuleResultOutput) ToLookupMarkupRuleResultOutputWithContext(ctx context.Context) LookupMarkupRuleResultOutput {
return o
}
// Customer information for the markup rule.
func (o LookupMarkupRuleResultOutput) CustomerDetails() CustomerMetadataResponseOutput {
return o.ApplyT(func(v LookupMarkupRuleResult) CustomerMetadataResponse { return v.CustomerDetails }).(CustomerMetadataResponseOutput)
}
// The description of the markup rule.
func (o LookupMarkupRuleResultOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupMarkupRuleResult) *string { return v.Description }).(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 LookupMarkupRuleResultOutput) ETag() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupMarkupRuleResult) *string { return v.ETag }).(pulumi.StringPtrOutput)
}
// Ending date of the markup rule.
func (o LookupMarkupRuleResultOutput) EndDate() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupMarkupRuleResult) *string { return v.EndDate }).(pulumi.StringPtrOutput)
}
// Resource Id.
func (o LookupMarkupRuleResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupMarkupRuleResult) string { return v.Id }).(pulumi.StringOutput)
}
// Resource name.
func (o LookupMarkupRuleResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupMarkupRuleResult) string { return v.Name }).(pulumi.StringOutput)
}
// The markup percentage of the rule.
func (o LookupMarkupRuleResultOutput) Percentage() pulumi.Float64Output {
return o.ApplyT(func(v LookupMarkupRuleResult) float64 { return v.Percentage }).(pulumi.Float64Output)
}
// Starting date of the markup rule.
func (o LookupMarkupRuleResultOutput) StartDate() pulumi.StringOutput {
return o.ApplyT(func(v LookupMarkupRuleResult) string { return v.StartDate }).(pulumi.StringOutput)
}
// Resource type.
func (o LookupMarkupRuleResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v LookupMarkupRuleResult) string { return v.Type }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupMarkupRuleResultOutput{})
}