generated from pulumi/pulumi-tf-provider-boilerplate
/
getTwingateServiceAccounts.go
181 lines (159 loc) · 7.53 KB
/
getTwingateServiceAccounts.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
// 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 twingate
import (
"context"
"reflect"
"github.com/emailbob/pulumi-twingate/sdk/go/twingate/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Service Accounts offer a way to provide programmatic, centrally-controlled, and consistent access controls.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/emailbob/pulumi-twingate/sdk/go/twingate"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := twingate.GetTwingateServiceAccounts(ctx, &twingate.GetTwingateServiceAccountsArgs{
// Name: pulumi.StringRef("<your service account's name>"),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
func GetTwingateServiceAccounts(ctx *pulumi.Context, args *GetTwingateServiceAccountsArgs, opts ...pulumi.InvokeOption) (*GetTwingateServiceAccountsResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetTwingateServiceAccountsResult
err := ctx.Invoke("twingate:index/getTwingateServiceAccounts:getTwingateServiceAccounts", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getTwingateServiceAccounts.
type GetTwingateServiceAccountsArgs struct {
// Name of the Service Account
Name *string `pulumi:"name"`
// Match when the value exist in the name of the service account.
NameContains *string `pulumi:"nameContains"`
// Match when the exact value does not exist in the name of the service account.
NameExclude *string `pulumi:"nameExclude"`
// The name of the service account must start with the value.
NamePrefix *string `pulumi:"namePrefix"`
// The regular expression match of the name of the service account.
NameRegexp *string `pulumi:"nameRegexp"`
// The name of the service account must end with the value.
NameSuffix *string `pulumi:"nameSuffix"`
}
// A collection of values returned by getTwingateServiceAccounts.
type GetTwingateServiceAccountsResult struct {
// The ID of this resource.
Id string `pulumi:"id"`
// Returns only service accounts that exactly match this name. If no options are passed it will return all service accounts. Only one option can be used at a time.
Name *string `pulumi:"name"`
// Match when the value exist in the name of the service account.
NameContains *string `pulumi:"nameContains"`
// Match when the exact value does not exist in the name of the service account.
NameExclude *string `pulumi:"nameExclude"`
// The name of the service account must start with the value.
NamePrefix *string `pulumi:"namePrefix"`
// The regular expression match of the name of the service account.
NameRegexp *string `pulumi:"nameRegexp"`
// The name of the service account must end with the value.
NameSuffix *string `pulumi:"nameSuffix"`
// List of Service Accounts
ServiceAccounts []GetTwingateServiceAccountsServiceAccount `pulumi:"serviceAccounts"`
}
func GetTwingateServiceAccountsOutput(ctx *pulumi.Context, args GetTwingateServiceAccountsOutputArgs, opts ...pulumi.InvokeOption) GetTwingateServiceAccountsResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetTwingateServiceAccountsResult, error) {
args := v.(GetTwingateServiceAccountsArgs)
r, err := GetTwingateServiceAccounts(ctx, &args, opts...)
var s GetTwingateServiceAccountsResult
if r != nil {
s = *r
}
return s, err
}).(GetTwingateServiceAccountsResultOutput)
}
// A collection of arguments for invoking getTwingateServiceAccounts.
type GetTwingateServiceAccountsOutputArgs struct {
// Name of the Service Account
Name pulumi.StringPtrInput `pulumi:"name"`
// Match when the value exist in the name of the service account.
NameContains pulumi.StringPtrInput `pulumi:"nameContains"`
// Match when the exact value does not exist in the name of the service account.
NameExclude pulumi.StringPtrInput `pulumi:"nameExclude"`
// The name of the service account must start with the value.
NamePrefix pulumi.StringPtrInput `pulumi:"namePrefix"`
// The regular expression match of the name of the service account.
NameRegexp pulumi.StringPtrInput `pulumi:"nameRegexp"`
// The name of the service account must end with the value.
NameSuffix pulumi.StringPtrInput `pulumi:"nameSuffix"`
}
func (GetTwingateServiceAccountsOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetTwingateServiceAccountsArgs)(nil)).Elem()
}
// A collection of values returned by getTwingateServiceAccounts.
type GetTwingateServiceAccountsResultOutput struct{ *pulumi.OutputState }
func (GetTwingateServiceAccountsResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetTwingateServiceAccountsResult)(nil)).Elem()
}
func (o GetTwingateServiceAccountsResultOutput) ToGetTwingateServiceAccountsResultOutput() GetTwingateServiceAccountsResultOutput {
return o
}
func (o GetTwingateServiceAccountsResultOutput) ToGetTwingateServiceAccountsResultOutputWithContext(ctx context.Context) GetTwingateServiceAccountsResultOutput {
return o
}
// The ID of this resource.
func (o GetTwingateServiceAccountsResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetTwingateServiceAccountsResult) string { return v.Id }).(pulumi.StringOutput)
}
// Returns only service accounts that exactly match this name. If no options are passed it will return all service accounts. Only one option can be used at a time.
func (o GetTwingateServiceAccountsResultOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateServiceAccountsResult) *string { return v.Name }).(pulumi.StringPtrOutput)
}
// Match when the value exist in the name of the service account.
func (o GetTwingateServiceAccountsResultOutput) NameContains() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateServiceAccountsResult) *string { return v.NameContains }).(pulumi.StringPtrOutput)
}
// Match when the exact value does not exist in the name of the service account.
func (o GetTwingateServiceAccountsResultOutput) NameExclude() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateServiceAccountsResult) *string { return v.NameExclude }).(pulumi.StringPtrOutput)
}
// The name of the service account must start with the value.
func (o GetTwingateServiceAccountsResultOutput) NamePrefix() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateServiceAccountsResult) *string { return v.NamePrefix }).(pulumi.StringPtrOutput)
}
// The regular expression match of the name of the service account.
func (o GetTwingateServiceAccountsResultOutput) NameRegexp() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateServiceAccountsResult) *string { return v.NameRegexp }).(pulumi.StringPtrOutput)
}
// The name of the service account must end with the value.
func (o GetTwingateServiceAccountsResultOutput) NameSuffix() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateServiceAccountsResult) *string { return v.NameSuffix }).(pulumi.StringPtrOutput)
}
// List of Service Accounts
func (o GetTwingateServiceAccountsResultOutput) ServiceAccounts() GetTwingateServiceAccountsServiceAccountArrayOutput {
return o.ApplyT(func(v GetTwingateServiceAccountsResult) []GetTwingateServiceAccountsServiceAccount {
return v.ServiceAccounts
}).(GetTwingateServiceAccountsServiceAccountArrayOutput)
}
func init() {
pulumi.RegisterOutputType(GetTwingateServiceAccountsResultOutput{})
}