/
getItem.go
129 lines (106 loc) · 4.77 KB
/
getItem.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
// 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/pulumi/pulumi/sdk/v3/go/pulumi"
)
func LookupItem(ctx *pulumi.Context, args *LookupItemArgs, opts ...pulumi.InvokeOption) (*LookupItemResult, error) {
var rv LookupItemResult
err := ctx.Invoke("one-password-native:index:GetItem", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupItemArgs struct {
// 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 item to retrieve. This field will be populated with the UUID of the item if the item it looked up by its title.
Uuid *string `pulumi:"uuid"`
// The UUID of the vault the item is in.
Vault string `pulumi:"vault"`
}
type LookupItemResult struct {
Attachments map[string]OutField `pulumi:"attachments"`
Category string `pulumi:"category"`
Fields map[string]OutField `pulumi:"fields"`
References map[string]OutField `pulumi:"references"`
Sections map[string]OutSection `pulumi:"sections"`
// An array of strings of the tags assigned to the item.
Tags []string `pulumi:"tags"`
// The title of the item.
Title string `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 string `pulumi:"uuid"`
// The UUID of the vault the item is in.
Vault string `pulumi:"vault"`
}
func LookupItemOutput(ctx *pulumi.Context, args LookupItemOutputArgs, opts ...pulumi.InvokeOption) LookupItemResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupItemResult, error) {
args := v.(LookupItemArgs)
r, err := LookupItem(ctx, &args, opts...)
var s LookupItemResult
if r != nil {
s = *r
}
return s, err
}).(LookupItemResultOutput)
}
type LookupItemOutputArgs struct {
// 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 `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.StringPtrInput `pulumi:"uuid"`
// The UUID of the vault the item is in.
Vault pulumi.StringInput `pulumi:"vault"`
}
func (LookupItemOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupItemArgs)(nil)).Elem()
}
type LookupItemResultOutput struct{ *pulumi.OutputState }
func (LookupItemResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupItemResult)(nil)).Elem()
}
func (o LookupItemResultOutput) ToLookupItemResultOutput() LookupItemResultOutput {
return o
}
func (o LookupItemResultOutput) ToLookupItemResultOutputWithContext(ctx context.Context) LookupItemResultOutput {
return o
}
func (o LookupItemResultOutput) Attachments() OutFieldMapOutput {
return o.ApplyT(func(v LookupItemResult) map[string]OutField { return v.Attachments }).(OutFieldMapOutput)
}
func (o LookupItemResultOutput) Category() pulumi.StringOutput {
return o.ApplyT(func(v LookupItemResult) string { return v.Category }).(pulumi.StringOutput)
}
func (o LookupItemResultOutput) Fields() OutFieldMapOutput {
return o.ApplyT(func(v LookupItemResult) map[string]OutField { return v.Fields }).(OutFieldMapOutput)
}
func (o LookupItemResultOutput) References() OutFieldMapOutput {
return o.ApplyT(func(v LookupItemResult) map[string]OutField { return v.References }).(OutFieldMapOutput)
}
func (o LookupItemResultOutput) Sections() OutSectionMapOutput {
return o.ApplyT(func(v LookupItemResult) map[string]OutSection { return v.Sections }).(OutSectionMapOutput)
}
// An array of strings of the tags assigned to the item.
func (o LookupItemResultOutput) Tags() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupItemResult) []string { return v.Tags }).(pulumi.StringArrayOutput)
}
// The title of the item.
func (o LookupItemResultOutput) Title() pulumi.StringOutput {
return o.ApplyT(func(v LookupItemResult) string { return v.Title }).(pulumi.StringOutput)
}
// 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.
func (o LookupItemResultOutput) Uuid() pulumi.StringOutput {
return o.ApplyT(func(v LookupItemResult) string { return v.Uuid }).(pulumi.StringOutput)
}
// The UUID of the vault the item is in.
func (o LookupItemResultOutput) Vault() pulumi.StringOutput {
return o.ApplyT(func(v LookupItemResult) string { return v.Vault }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupItemResultOutput{})
}