/
element.go
76 lines (61 loc) · 1.98 KB
/
element.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
// Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package std
import (
"context"
"reflect"
"github.com/pulumi/pulumi-std/sdk/go/std/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Returns the element at the specified index.
func Element(ctx *pulumi.Context, args *ElementArgs, opts ...pulumi.InvokeOption) (*ElementResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv ElementResult
err := ctx.Invoke("std:index:element", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type ElementArgs struct {
Index int `pulumi:"index"`
Input []interface{} `pulumi:"input"`
}
type ElementResult struct {
Result interface{} `pulumi:"result"`
}
func ElementOutput(ctx *pulumi.Context, args ElementOutputArgs, opts ...pulumi.InvokeOption) ElementResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (ElementResult, error) {
args := v.(ElementArgs)
r, err := Element(ctx, &args, opts...)
var s ElementResult
if r != nil {
s = *r
}
return s, err
}).(ElementResultOutput)
}
type ElementOutputArgs struct {
Index pulumi.IntInput `pulumi:"index"`
Input pulumi.ArrayInput `pulumi:"input"`
}
func (ElementOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*ElementArgs)(nil)).Elem()
}
type ElementResultOutput struct{ *pulumi.OutputState }
func (ElementResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*ElementResult)(nil)).Elem()
}
func (o ElementResultOutput) ToElementResultOutput() ElementResultOutput {
return o
}
func (o ElementResultOutput) ToElementResultOutputWithContext(ctx context.Context) ElementResultOutput {
return o
}
func (o ElementResultOutput) Result() pulumi.AnyOutput {
return o.ApplyT(func(v ElementResult) interface{} { return v.Result }).(pulumi.AnyOutput)
}
func init() {
pulumi.RegisterOutputType(ElementResultOutput{})
}