/
alltrue.go
75 lines (60 loc) · 1.97 KB
/
alltrue.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
// 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 true if all elements in a given collection are true or \"true\".
// It also returns true if the collection is empty.
func Alltrue(ctx *pulumi.Context, args *AlltrueArgs, opts ...pulumi.InvokeOption) (*AlltrueResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv AlltrueResult
err := ctx.Invoke("std:index:alltrue", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type AlltrueArgs struct {
Input []interface{} `pulumi:"input"`
}
type AlltrueResult struct {
Result bool `pulumi:"result"`
}
func AlltrueOutput(ctx *pulumi.Context, args AlltrueOutputArgs, opts ...pulumi.InvokeOption) AlltrueResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (AlltrueResult, error) {
args := v.(AlltrueArgs)
r, err := Alltrue(ctx, &args, opts...)
var s AlltrueResult
if r != nil {
s = *r
}
return s, err
}).(AlltrueResultOutput)
}
type AlltrueOutputArgs struct {
Input pulumi.ArrayInput `pulumi:"input"`
}
func (AlltrueOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*AlltrueArgs)(nil)).Elem()
}
type AlltrueResultOutput struct{ *pulumi.OutputState }
func (AlltrueResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*AlltrueResult)(nil)).Elem()
}
func (o AlltrueResultOutput) ToAlltrueResultOutput() AlltrueResultOutput {
return o
}
func (o AlltrueResultOutput) ToAlltrueResultOutputWithContext(ctx context.Context) AlltrueResultOutput {
return o
}
func (o AlltrueResultOutput) Result() pulumi.BoolOutput {
return o.ApplyT(func(v AlltrueResult) bool { return v.Result }).(pulumi.BoolOutput)
}
func init() {
pulumi.RegisterOutputType(AlltrueResultOutput{})
}