/
lien.go
172 lines (142 loc) · 8.19 KB
/
lien.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
// 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 v1
import (
"context"
"reflect"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Create a Lien which applies to the resource denoted by the `parent` field. Callers of this method will require permission on the `parent` resource. For example, applying to `projects/1234` requires permission `resourcemanager.projects.updateLiens`. NOTE: Some resources may limit the number of Liens which may be applied.
type Lien struct {
pulumi.CustomResourceState
// The creation time of this Lien.
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// A system-generated unique identifier for this Lien. Example: `liens/1234abcd`
Name pulumi.StringOutput `pulumi:"name"`
// A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically. Maximum length of 200 characters. Example: 'compute.googleapis.com'
Origin pulumi.StringOutput `pulumi:"origin"`
// A reference to the resource this Lien is attached to. The server will validate the parent against those for which Liens are supported. Example: `projects/1234`
Parent pulumi.StringOutput `pulumi:"parent"`
// Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200 characters. Example: 'Holds production API key'
Reason pulumi.StringOutput `pulumi:"reason"`
// The types of operations which should be blocked as a result of this Lien. Each value should correspond to an IAM permission. The server will validate the permissions against those for which Liens are supported. An empty list is meaningless and will be rejected. Example: ['resourcemanager.projects.delete']
Restrictions pulumi.StringArrayOutput `pulumi:"restrictions"`
}
// NewLien registers a new resource with the given unique name, arguments, and options.
func NewLien(ctx *pulumi.Context,
name string, args *LienArgs, opts ...pulumi.ResourceOption) (*Lien, error) {
if args == nil {
args = &LienArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Lien
err := ctx.RegisterResource("google-native:cloudresourcemanager/v1:Lien", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetLien gets an existing Lien 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 GetLien(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *LienState, opts ...pulumi.ResourceOption) (*Lien, error) {
var resource Lien
err := ctx.ReadResource("google-native:cloudresourcemanager/v1:Lien", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Lien resources.
type lienState struct {
}
type LienState struct {
}
func (LienState) ElementType() reflect.Type {
return reflect.TypeOf((*lienState)(nil)).Elem()
}
type lienArgs struct {
// The creation time of this Lien.
CreateTime *string `pulumi:"createTime"`
// A system-generated unique identifier for this Lien. Example: `liens/1234abcd`
Name *string `pulumi:"name"`
// A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically. Maximum length of 200 characters. Example: 'compute.googleapis.com'
Origin *string `pulumi:"origin"`
// A reference to the resource this Lien is attached to. The server will validate the parent against those for which Liens are supported. Example: `projects/1234`
Parent *string `pulumi:"parent"`
// Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200 characters. Example: 'Holds production API key'
Reason *string `pulumi:"reason"`
// The types of operations which should be blocked as a result of this Lien. Each value should correspond to an IAM permission. The server will validate the permissions against those for which Liens are supported. An empty list is meaningless and will be rejected. Example: ['resourcemanager.projects.delete']
Restrictions []string `pulumi:"restrictions"`
}
// The set of arguments for constructing a Lien resource.
type LienArgs struct {
// The creation time of this Lien.
CreateTime pulumi.StringPtrInput
// A system-generated unique identifier for this Lien. Example: `liens/1234abcd`
Name pulumi.StringPtrInput
// A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically. Maximum length of 200 characters. Example: 'compute.googleapis.com'
Origin pulumi.StringPtrInput
// A reference to the resource this Lien is attached to. The server will validate the parent against those for which Liens are supported. Example: `projects/1234`
Parent pulumi.StringPtrInput
// Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200 characters. Example: 'Holds production API key'
Reason pulumi.StringPtrInput
// The types of operations which should be blocked as a result of this Lien. Each value should correspond to an IAM permission. The server will validate the permissions against those for which Liens are supported. An empty list is meaningless and will be rejected. Example: ['resourcemanager.projects.delete']
Restrictions pulumi.StringArrayInput
}
func (LienArgs) ElementType() reflect.Type {
return reflect.TypeOf((*lienArgs)(nil)).Elem()
}
type LienInput interface {
pulumi.Input
ToLienOutput() LienOutput
ToLienOutputWithContext(ctx context.Context) LienOutput
}
func (*Lien) ElementType() reflect.Type {
return reflect.TypeOf((**Lien)(nil)).Elem()
}
func (i *Lien) ToLienOutput() LienOutput {
return i.ToLienOutputWithContext(context.Background())
}
func (i *Lien) ToLienOutputWithContext(ctx context.Context) LienOutput {
return pulumi.ToOutputWithContext(ctx, i).(LienOutput)
}
type LienOutput struct{ *pulumi.OutputState }
func (LienOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Lien)(nil)).Elem()
}
func (o LienOutput) ToLienOutput() LienOutput {
return o
}
func (o LienOutput) ToLienOutputWithContext(ctx context.Context) LienOutput {
return o
}
// The creation time of this Lien.
func (o LienOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Lien) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// A system-generated unique identifier for this Lien. Example: `liens/1234abcd`
func (o LienOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Lien) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically. Maximum length of 200 characters. Example: 'compute.googleapis.com'
func (o LienOutput) Origin() pulumi.StringOutput {
return o.ApplyT(func(v *Lien) pulumi.StringOutput { return v.Origin }).(pulumi.StringOutput)
}
// A reference to the resource this Lien is attached to. The server will validate the parent against those for which Liens are supported. Example: `projects/1234`
func (o LienOutput) Parent() pulumi.StringOutput {
return o.ApplyT(func(v *Lien) pulumi.StringOutput { return v.Parent }).(pulumi.StringOutput)
}
// Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200 characters. Example: 'Holds production API key'
func (o LienOutput) Reason() pulumi.StringOutput {
return o.ApplyT(func(v *Lien) pulumi.StringOutput { return v.Reason }).(pulumi.StringOutput)
}
// The types of operations which should be blocked as a result of this Lien. Each value should correspond to an IAM permission. The server will validate the permissions against those for which Liens are supported. An empty list is meaningless and will be rejected. Example: ['resourcemanager.projects.delete']
func (o LienOutput) Restrictions() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Lien) pulumi.StringArrayOutput { return v.Restrictions }).(pulumi.StringArrayOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*LienInput)(nil)).Elem(), &Lien{})
pulumi.RegisterOutputType(LienOutput{})
}