/
identityItem.go
302 lines (248 loc) · 10.9 KB
/
identityItem.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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
// Code generated by Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package onepassword
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/Sacro/pulumi-onepassword/sdk/go/onepassword/identity"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type IdentityItem struct {
pulumi.CustomResourceState
Address identity.AddressSectionPtrOutput `pulumi:"address"`
Attachments OutFieldMapOutput `pulumi:"attachments"`
Category pulumi.StringOutput `pulumi:"category"`
Fields OutFieldMapOutput `pulumi:"fields"`
Identification identity.IdentificationSectionPtrOutput `pulumi:"identification"`
InternetDetails identity.InternetDetailsSectionPtrOutput `pulumi:"internetDetails"`
Notes pulumi.StringPtrOutput `pulumi:"notes"`
References OutFieldMapOutput `pulumi:"references"`
Sections OutSectionMapOutput `pulumi:"sections"`
// An array of strings of the tags assigned to the item.
Tags pulumi.StringArrayOutput `pulumi:"tags"`
// The title of the item.
Title pulumi.StringOutput `pulumi:"title"`
// The UUID of the item to retrieve. This field will be populated with the UUID of the item if the item it looked up by its title.
Uuid pulumi.StringOutput `pulumi:"uuid"`
// The UUID of the vault the item is in.
Vault pulumi.StringOutput `pulumi:"vault"`
}
// NewIdentityItem registers a new resource with the given unique name, arguments, and options.
func NewIdentityItem(ctx *pulumi.Context,
name string, args *IdentityItemArgs, opts ...pulumi.ResourceOption) (*IdentityItem, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Vault == nil {
return nil, errors.New("invalid value for required argument 'Vault'")
}
args.Category = pulumi.StringPtr("Identity")
secrets := pulumi.AdditionalSecretOutputs([]string{
"attachments",
"fields",
"references",
"sections",
})
opts = append(opts, secrets)
var resource IdentityItem
err := ctx.RegisterResource("one-password-native:index:IdentityItem", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetIdentityItem gets an existing IdentityItem 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 GetIdentityItem(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *IdentityItemState, opts ...pulumi.ResourceOption) (*IdentityItem, error) {
var resource IdentityItem
err := ctx.ReadResource("one-password-native:index:IdentityItem", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering IdentityItem resources.
type identityItemState struct {
// The UUID of the vault the item is in.
Vault *string `pulumi:"vault"`
}
type IdentityItemState struct {
// The UUID of the vault the item is in.
Vault pulumi.StringInput
}
func (IdentityItemState) ElementType() reflect.Type {
return reflect.TypeOf((*identityItemState)(nil)).Elem()
}
type identityItemArgs struct {
Address *identity.AddressSection `pulumi:"address"`
Attachments map[string]pulumi.AssetOrArchive `pulumi:"attachments"`
// The category of the vault the item is in.
Category *string `pulumi:"category"`
Fields map[string]Field `pulumi:"fields"`
Identification *identity.IdentificationSection `pulumi:"identification"`
InternetDetails *identity.InternetDetailsSection `pulumi:"internetDetails"`
Notes *string `pulumi:"notes"`
Sections map[string]Section `pulumi:"sections"`
// An array of strings of the tags assigned to the item.
Tags []string `pulumi:"tags"`
// The title of the item to retrieve. This field will be populated with the title of the item if the item it looked up by its UUID.
Title *string `pulumi:"title"`
// The UUID of the vault the item is in.
Vault string `pulumi:"vault"`
}
// The set of arguments for constructing a IdentityItem resource.
type IdentityItemArgs struct {
Address identity.AddressSectionPtrInput
Attachments pulumi.AssetOrArchiveMapInput
// The category of the vault the item is in.
Category pulumi.StringPtrInput
Fields FieldMapInput
Identification identity.IdentificationSectionPtrInput
InternetDetails identity.InternetDetailsSectionPtrInput
Notes pulumi.StringPtrInput
Sections SectionMapInput
// An array of strings of the tags assigned to the item.
Tags pulumi.StringArrayInput
// The title of the item to retrieve. This field will be populated with the title of the item if the item it looked up by its UUID.
Title pulumi.StringPtrInput
// The UUID of the vault the item is in.
Vault pulumi.StringInput
}
func (IdentityItemArgs) ElementType() reflect.Type {
return reflect.TypeOf((*identityItemArgs)(nil)).Elem()
}
func (r *IdentityItem) GetAttachment(ctx *pulumi.Context, args *IdentityItemGetAttachmentArgs) (IdentityItemGetAttachmentResultOutput, error) {
out, err := ctx.Call("one-password-native:index:IdentityItem/attachment", args, IdentityItemGetAttachmentResultOutput{}, r)
if err != nil {
return IdentityItemGetAttachmentResultOutput{}, err
}
return out.(IdentityItemGetAttachmentResultOutput), nil
}
type identityItemGetAttachmentArgs struct {
// The name or uuid of the attachment to get
Name string `pulumi:"name"`
}
// The set of arguments for the GetAttachment method of the IdentityItem resource.
type IdentityItemGetAttachmentArgs struct {
// The name or uuid of the attachment to get
Name pulumi.StringInput
}
func (IdentityItemGetAttachmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*identityItemGetAttachmentArgs)(nil)).Elem()
}
// The resolved reference value
type IdentityItemGetAttachmentResult struct {
// the value of the attachment
Value string `pulumi:"value"`
}
type IdentityItemGetAttachmentResultOutput struct{ *pulumi.OutputState }
func (IdentityItemGetAttachmentResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*IdentityItemGetAttachmentResult)(nil)).Elem()
}
// the value of the attachment
func (o IdentityItemGetAttachmentResultOutput) Value() pulumi.StringOutput {
return o.ApplyT(func(v IdentityItemGetAttachmentResult) string { return v.Value }).(pulumi.StringOutput)
}
type IdentityItemInput interface {
pulumi.Input
ToIdentityItemOutput() IdentityItemOutput
ToIdentityItemOutputWithContext(ctx context.Context) IdentityItemOutput
}
func (*IdentityItem) ElementType() reflect.Type {
return reflect.TypeOf((**IdentityItem)(nil)).Elem()
}
func (i *IdentityItem) ToIdentityItemOutput() IdentityItemOutput {
return i.ToIdentityItemOutputWithContext(context.Background())
}
func (i *IdentityItem) ToIdentityItemOutputWithContext(ctx context.Context) IdentityItemOutput {
return pulumi.ToOutputWithContext(ctx, i).(IdentityItemOutput)
}
// IdentityItemArrayInput is an input type that accepts IdentityItemArray and IdentityItemArrayOutput values.
// You can construct a concrete instance of `IdentityItemArrayInput` via:
//
// IdentityItemArray{ IdentityItemArgs{...} }
type IdentityItemArrayInput interface {
pulumi.Input
ToIdentityItemArrayOutput() IdentityItemArrayOutput
ToIdentityItemArrayOutputWithContext(context.Context) IdentityItemArrayOutput
}
type IdentityItemArray []IdentityItemInput
func (IdentityItemArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*IdentityItem)(nil)).Elem()
}
func (i IdentityItemArray) ToIdentityItemArrayOutput() IdentityItemArrayOutput {
return i.ToIdentityItemArrayOutputWithContext(context.Background())
}
func (i IdentityItemArray) ToIdentityItemArrayOutputWithContext(ctx context.Context) IdentityItemArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(IdentityItemArrayOutput)
}
// IdentityItemMapInput is an input type that accepts IdentityItemMap and IdentityItemMapOutput values.
// You can construct a concrete instance of `IdentityItemMapInput` via:
//
// IdentityItemMap{ "key": IdentityItemArgs{...} }
type IdentityItemMapInput interface {
pulumi.Input
ToIdentityItemMapOutput() IdentityItemMapOutput
ToIdentityItemMapOutputWithContext(context.Context) IdentityItemMapOutput
}
type IdentityItemMap map[string]IdentityItemInput
func (IdentityItemMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*IdentityItem)(nil)).Elem()
}
func (i IdentityItemMap) ToIdentityItemMapOutput() IdentityItemMapOutput {
return i.ToIdentityItemMapOutputWithContext(context.Background())
}
func (i IdentityItemMap) ToIdentityItemMapOutputWithContext(ctx context.Context) IdentityItemMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(IdentityItemMapOutput)
}
type IdentityItemOutput struct{ *pulumi.OutputState }
func (IdentityItemOutput) ElementType() reflect.Type {
return reflect.TypeOf((**IdentityItem)(nil)).Elem()
}
func (o IdentityItemOutput) ToIdentityItemOutput() IdentityItemOutput {
return o
}
func (o IdentityItemOutput) ToIdentityItemOutputWithContext(ctx context.Context) IdentityItemOutput {
return o
}
type IdentityItemArrayOutput struct{ *pulumi.OutputState }
func (IdentityItemArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*IdentityItem)(nil)).Elem()
}
func (o IdentityItemArrayOutput) ToIdentityItemArrayOutput() IdentityItemArrayOutput {
return o
}
func (o IdentityItemArrayOutput) ToIdentityItemArrayOutputWithContext(ctx context.Context) IdentityItemArrayOutput {
return o
}
func (o IdentityItemArrayOutput) Index(i pulumi.IntInput) IdentityItemOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *IdentityItem {
return vs[0].([]*IdentityItem)[vs[1].(int)]
}).(IdentityItemOutput)
}
type IdentityItemMapOutput struct{ *pulumi.OutputState }
func (IdentityItemMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*IdentityItem)(nil)).Elem()
}
func (o IdentityItemMapOutput) ToIdentityItemMapOutput() IdentityItemMapOutput {
return o
}
func (o IdentityItemMapOutput) ToIdentityItemMapOutputWithContext(ctx context.Context) IdentityItemMapOutput {
return o
}
func (o IdentityItemMapOutput) MapIndex(k pulumi.StringInput) IdentityItemOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *IdentityItem {
return vs[0].(map[string]*IdentityItem)[vs[1].(string)]
}).(IdentityItemOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*IdentityItemInput)(nil)).Elem(), &IdentityItem{})
pulumi.RegisterInputType(reflect.TypeOf((*IdentityItemArrayInput)(nil)).Elem(), IdentityItemArray{})
pulumi.RegisterInputType(reflect.TypeOf((*IdentityItemMapInput)(nil)).Elem(), IdentityItemMap{})
pulumi.RegisterOutputType(IdentityItemOutput{})
pulumi.RegisterOutputType(IdentityItemGetAttachmentResultOutput{})
pulumi.RegisterOutputType(IdentityItemArrayOutput{})
pulumi.RegisterOutputType(IdentityItemMapOutput{})
}