generated from pulumi/pulumi-tf-provider-boilerplate
/
itemEntitlement.go
285 lines (236 loc) · 9.83 KB
/
itemEntitlement.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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package catalog
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This resource provides a way to create a catalog item entitlement in VMware vRealize Automation.
//
// ## Example Usage
// ### S
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/pulumiverse/pulumi-vra/sdk/go/vra/catalog"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := catalog.NewItemEntitlement(ctx, "this", &catalog.ItemEntitlementArgs{
// CatalogItemId: pulumi.Any(_var.Catalog_item_id),
// ProjectId: pulumi.Any(_var.Project_id),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Catalog item entitlement can be imported using the id, e.g.
//
// ```sh
//
// $ pulumi import vra:catalog/itemEntitlement:ItemEntitlement this 05956583-6488-4e7d-84c9-92a7b7219a15`
//
// ```
type ItemEntitlement struct {
pulumi.CustomResourceState
// The id of the catalog item to create the entitlement.
CatalogItemId pulumi.StringOutput `pulumi:"catalogItemId"`
// Represents a catalog item that is linked to a project via an entitlement.
Definitions ItemEntitlementDefinitionArrayOutput `pulumi:"definitions"`
// The id of the project this entity belongs to.
ProjectId pulumi.StringOutput `pulumi:"projectId"`
}
// NewItemEntitlement registers a new resource with the given unique name, arguments, and options.
func NewItemEntitlement(ctx *pulumi.Context,
name string, args *ItemEntitlementArgs, opts ...pulumi.ResourceOption) (*ItemEntitlement, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.CatalogItemId == nil {
return nil, errors.New("invalid value for required argument 'CatalogItemId'")
}
if args.ProjectId == nil {
return nil, errors.New("invalid value for required argument 'ProjectId'")
}
opts = pkgResourceDefaultOpts(opts)
var resource ItemEntitlement
err := ctx.RegisterResource("vra:catalog/itemEntitlement:ItemEntitlement", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetItemEntitlement gets an existing ItemEntitlement 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 GetItemEntitlement(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ItemEntitlementState, opts ...pulumi.ResourceOption) (*ItemEntitlement, error) {
var resource ItemEntitlement
err := ctx.ReadResource("vra:catalog/itemEntitlement:ItemEntitlement", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ItemEntitlement resources.
type itemEntitlementState struct {
// The id of the catalog item to create the entitlement.
CatalogItemId *string `pulumi:"catalogItemId"`
// Represents a catalog item that is linked to a project via an entitlement.
Definitions []ItemEntitlementDefinition `pulumi:"definitions"`
// The id of the project this entity belongs to.
ProjectId *string `pulumi:"projectId"`
}
type ItemEntitlementState struct {
// The id of the catalog item to create the entitlement.
CatalogItemId pulumi.StringPtrInput
// Represents a catalog item that is linked to a project via an entitlement.
Definitions ItemEntitlementDefinitionArrayInput
// The id of the project this entity belongs to.
ProjectId pulumi.StringPtrInput
}
func (ItemEntitlementState) ElementType() reflect.Type {
return reflect.TypeOf((*itemEntitlementState)(nil)).Elem()
}
type itemEntitlementArgs struct {
// The id of the catalog item to create the entitlement.
CatalogItemId string `pulumi:"catalogItemId"`
// The id of the project this entity belongs to.
ProjectId string `pulumi:"projectId"`
}
// The set of arguments for constructing a ItemEntitlement resource.
type ItemEntitlementArgs struct {
// The id of the catalog item to create the entitlement.
CatalogItemId pulumi.StringInput
// The id of the project this entity belongs to.
ProjectId pulumi.StringInput
}
func (ItemEntitlementArgs) ElementType() reflect.Type {
return reflect.TypeOf((*itemEntitlementArgs)(nil)).Elem()
}
type ItemEntitlementInput interface {
pulumi.Input
ToItemEntitlementOutput() ItemEntitlementOutput
ToItemEntitlementOutputWithContext(ctx context.Context) ItemEntitlementOutput
}
func (*ItemEntitlement) ElementType() reflect.Type {
return reflect.TypeOf((**ItemEntitlement)(nil)).Elem()
}
func (i *ItemEntitlement) ToItemEntitlementOutput() ItemEntitlementOutput {
return i.ToItemEntitlementOutputWithContext(context.Background())
}
func (i *ItemEntitlement) ToItemEntitlementOutputWithContext(ctx context.Context) ItemEntitlementOutput {
return pulumi.ToOutputWithContext(ctx, i).(ItemEntitlementOutput)
}
// ItemEntitlementArrayInput is an input type that accepts ItemEntitlementArray and ItemEntitlementArrayOutput values.
// You can construct a concrete instance of `ItemEntitlementArrayInput` via:
//
// ItemEntitlementArray{ ItemEntitlementArgs{...} }
type ItemEntitlementArrayInput interface {
pulumi.Input
ToItemEntitlementArrayOutput() ItemEntitlementArrayOutput
ToItemEntitlementArrayOutputWithContext(context.Context) ItemEntitlementArrayOutput
}
type ItemEntitlementArray []ItemEntitlementInput
func (ItemEntitlementArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ItemEntitlement)(nil)).Elem()
}
func (i ItemEntitlementArray) ToItemEntitlementArrayOutput() ItemEntitlementArrayOutput {
return i.ToItemEntitlementArrayOutputWithContext(context.Background())
}
func (i ItemEntitlementArray) ToItemEntitlementArrayOutputWithContext(ctx context.Context) ItemEntitlementArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ItemEntitlementArrayOutput)
}
// ItemEntitlementMapInput is an input type that accepts ItemEntitlementMap and ItemEntitlementMapOutput values.
// You can construct a concrete instance of `ItemEntitlementMapInput` via:
//
// ItemEntitlementMap{ "key": ItemEntitlementArgs{...} }
type ItemEntitlementMapInput interface {
pulumi.Input
ToItemEntitlementMapOutput() ItemEntitlementMapOutput
ToItemEntitlementMapOutputWithContext(context.Context) ItemEntitlementMapOutput
}
type ItemEntitlementMap map[string]ItemEntitlementInput
func (ItemEntitlementMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ItemEntitlement)(nil)).Elem()
}
func (i ItemEntitlementMap) ToItemEntitlementMapOutput() ItemEntitlementMapOutput {
return i.ToItemEntitlementMapOutputWithContext(context.Background())
}
func (i ItemEntitlementMap) ToItemEntitlementMapOutputWithContext(ctx context.Context) ItemEntitlementMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ItemEntitlementMapOutput)
}
type ItemEntitlementOutput struct{ *pulumi.OutputState }
func (ItemEntitlementOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ItemEntitlement)(nil)).Elem()
}
func (o ItemEntitlementOutput) ToItemEntitlementOutput() ItemEntitlementOutput {
return o
}
func (o ItemEntitlementOutput) ToItemEntitlementOutputWithContext(ctx context.Context) ItemEntitlementOutput {
return o
}
// The id of the catalog item to create the entitlement.
func (o ItemEntitlementOutput) CatalogItemId() pulumi.StringOutput {
return o.ApplyT(func(v *ItemEntitlement) pulumi.StringOutput { return v.CatalogItemId }).(pulumi.StringOutput)
}
// Represents a catalog item that is linked to a project via an entitlement.
func (o ItemEntitlementOutput) Definitions() ItemEntitlementDefinitionArrayOutput {
return o.ApplyT(func(v *ItemEntitlement) ItemEntitlementDefinitionArrayOutput { return v.Definitions }).(ItemEntitlementDefinitionArrayOutput)
}
// The id of the project this entity belongs to.
func (o ItemEntitlementOutput) ProjectId() pulumi.StringOutput {
return o.ApplyT(func(v *ItemEntitlement) pulumi.StringOutput { return v.ProjectId }).(pulumi.StringOutput)
}
type ItemEntitlementArrayOutput struct{ *pulumi.OutputState }
func (ItemEntitlementArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ItemEntitlement)(nil)).Elem()
}
func (o ItemEntitlementArrayOutput) ToItemEntitlementArrayOutput() ItemEntitlementArrayOutput {
return o
}
func (o ItemEntitlementArrayOutput) ToItemEntitlementArrayOutputWithContext(ctx context.Context) ItemEntitlementArrayOutput {
return o
}
func (o ItemEntitlementArrayOutput) Index(i pulumi.IntInput) ItemEntitlementOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ItemEntitlement {
return vs[0].([]*ItemEntitlement)[vs[1].(int)]
}).(ItemEntitlementOutput)
}
type ItemEntitlementMapOutput struct{ *pulumi.OutputState }
func (ItemEntitlementMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ItemEntitlement)(nil)).Elem()
}
func (o ItemEntitlementMapOutput) ToItemEntitlementMapOutput() ItemEntitlementMapOutput {
return o
}
func (o ItemEntitlementMapOutput) ToItemEntitlementMapOutputWithContext(ctx context.Context) ItemEntitlementMapOutput {
return o
}
func (o ItemEntitlementMapOutput) MapIndex(k pulumi.StringInput) ItemEntitlementOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ItemEntitlement {
return vs[0].(map[string]*ItemEntitlement)[vs[1].(string)]
}).(ItemEntitlementOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ItemEntitlementInput)(nil)).Elem(), &ItemEntitlement{})
pulumi.RegisterInputType(reflect.TypeOf((*ItemEntitlementArrayInput)(nil)).Elem(), ItemEntitlementArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ItemEntitlementMapInput)(nil)).Elem(), ItemEntitlementMap{})
pulumi.RegisterOutputType(ItemEntitlementOutput{})
pulumi.RegisterOutputType(ItemEntitlementArrayOutput{})
pulumi.RegisterOutputType(ItemEntitlementMapOutput{})
}