-
Notifications
You must be signed in to change notification settings - Fork 50
/
lien.go
162 lines (149 loc) · 7.79 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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
// nolint: lll
package resourcemanager
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// A Lien represents an encumbrance on the actions that can be performed on a resource.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-google/blob/master/website/docs/r/resource_manager_lien.html.markdown.
type Lien struct {
pulumi.CustomResourceState
// Time of creation
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// A system-generated unique identifier for this Lien.
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.
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. Since a variety of objects can have Liens against them, you must provide the type prefix (e.g.
// "projects/my-project-name").
Parent pulumi.StringOutput `pulumi:"parent"`
// Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200
// characters.
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. e.g. ['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.Origin == nil {
return nil, errors.New("missing required argument 'Origin'")
}
if args == nil || args.Parent == nil {
return nil, errors.New("missing required argument 'Parent'")
}
if args == nil || args.Reason == nil {
return nil, errors.New("missing required argument 'Reason'")
}
if args == nil || args.Restrictions == nil {
return nil, errors.New("missing required argument 'Restrictions'")
}
if args == nil {
args = &LienArgs{}
}
var resource Lien
err := ctx.RegisterResource("gcp:resourcemanager/lien: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("gcp:resourcemanager/lien: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 {
// Time of creation
CreateTime *string `pulumi:"createTime"`
// A system-generated unique identifier for this Lien.
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.
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. Since a variety of objects can have Liens against them, you must provide the type prefix (e.g.
// "projects/my-project-name").
Parent *string `pulumi:"parent"`
// Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200
// characters.
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. e.g. ['resourcemanager.projects.delete']
Restrictions []string `pulumi:"restrictions"`
}
type LienState struct {
// Time of creation
CreateTime pulumi.StringPtrInput
// A system-generated unique identifier for this Lien.
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.
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. Since a variety of objects can have Liens against them, you must provide the type prefix (e.g.
// "projects/my-project-name").
Parent pulumi.StringPtrInput
// Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200
// characters.
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. e.g. ['resourcemanager.projects.delete']
Restrictions pulumi.StringArrayInput
}
func (LienState) ElementType() reflect.Type {
return reflect.TypeOf((*lienState)(nil)).Elem()
}
type lienArgs struct {
// A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically.
// Maximum length of 200 characters.
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. Since a variety of objects can have Liens against them, you must provide the type prefix (e.g.
// "projects/my-project-name").
Parent string `pulumi:"parent"`
// Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200
// characters.
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. e.g. ['resourcemanager.projects.delete']
Restrictions []string `pulumi:"restrictions"`
}
// The set of arguments for constructing a Lien resource.
type LienArgs struct {
// A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically.
// Maximum length of 200 characters.
Origin pulumi.StringInput
// A reference to the resource this Lien is attached to. The server will validate the parent against those for which Liens
// are supported. Since a variety of objects can have Liens against them, you must provide the type prefix (e.g.
// "projects/my-project-name").
Parent pulumi.StringInput
// Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200
// characters.
Reason pulumi.StringInput
// 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. e.g. ['resourcemanager.projects.delete']
Restrictions pulumi.StringArrayInput
}
func (LienArgs) ElementType() reflect.Type {
return reflect.TypeOf((*lienArgs)(nil)).Elem()
}