forked from pulumi/pulumi-azure-native-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getSetting.go
123 lines (102 loc) · 4.3 KB
/
getSetting.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
// 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"
)
// Retrieves the current value for a specific setting.
// Azure REST API version: 2019-11-01.
func LookupSetting(ctx *pulumi.Context, args *LookupSettingArgs, opts ...pulumi.InvokeOption) (*LookupSettingResult, error) {
opts = utilities.PkgInvokeDefaultOpts(opts)
var rv LookupSettingResult
err := ctx.Invoke("azure-native:costmanagement:getSetting", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupSettingArgs struct {
// Name of the setting. Allowed values: myscope
SettingName string `pulumi:"settingName"`
}
// State of the myscope setting.
type LookupSettingResult struct {
// Array of scopes with additional details used by Cost Management in the Azure portal.
Cache []SettingsPropertiesResponseCache `pulumi:"cache"`
// Resource Id.
Id string `pulumi:"id"`
// Resource kind.
Kind string `pulumi:"kind"`
// Resource name.
Name string `pulumi:"name"`
// Sets the default scope the current user will see when they sign into Azure Cost Management in the Azure portal.
Scope string `pulumi:"scope"`
// Indicates what scope Cost Management in the Azure portal should default to. Allowed values: LastUsed.
StartOn *string `pulumi:"startOn"`
// Resource type.
Type string `pulumi:"type"`
}
func LookupSettingOutput(ctx *pulumi.Context, args LookupSettingOutputArgs, opts ...pulumi.InvokeOption) LookupSettingResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupSettingResult, error) {
args := v.(LookupSettingArgs)
r, err := LookupSetting(ctx, &args, opts...)
var s LookupSettingResult
if r != nil {
s = *r
}
return s, err
}).(LookupSettingResultOutput)
}
type LookupSettingOutputArgs struct {
// Name of the setting. Allowed values: myscope
SettingName pulumi.StringInput `pulumi:"settingName"`
}
func (LookupSettingOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSettingArgs)(nil)).Elem()
}
// State of the myscope setting.
type LookupSettingResultOutput struct{ *pulumi.OutputState }
func (LookupSettingResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSettingResult)(nil)).Elem()
}
func (o LookupSettingResultOutput) ToLookupSettingResultOutput() LookupSettingResultOutput {
return o
}
func (o LookupSettingResultOutput) ToLookupSettingResultOutputWithContext(ctx context.Context) LookupSettingResultOutput {
return o
}
// Array of scopes with additional details used by Cost Management in the Azure portal.
func (o LookupSettingResultOutput) Cache() SettingsPropertiesResponseCacheArrayOutput {
return o.ApplyT(func(v LookupSettingResult) []SettingsPropertiesResponseCache { return v.Cache }).(SettingsPropertiesResponseCacheArrayOutput)
}
// Resource Id.
func (o LookupSettingResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupSettingResult) string { return v.Id }).(pulumi.StringOutput)
}
// Resource kind.
func (o LookupSettingResultOutput) Kind() pulumi.StringOutput {
return o.ApplyT(func(v LookupSettingResult) string { return v.Kind }).(pulumi.StringOutput)
}
// Resource name.
func (o LookupSettingResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupSettingResult) string { return v.Name }).(pulumi.StringOutput)
}
// Sets the default scope the current user will see when they sign into Azure Cost Management in the Azure portal.
func (o LookupSettingResultOutput) Scope() pulumi.StringOutput {
return o.ApplyT(func(v LookupSettingResult) string { return v.Scope }).(pulumi.StringOutput)
}
// Indicates what scope Cost Management in the Azure portal should default to. Allowed values: LastUsed.
func (o LookupSettingResultOutput) StartOn() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupSettingResult) *string { return v.StartOn }).(pulumi.StringPtrOutput)
}
// Resource type.
func (o LookupSettingResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v LookupSettingResult) string { return v.Type }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupSettingResultOutput{})
}