/
getOrgInvitation.go
140 lines (117 loc) · 6.58 KB
/
getOrgInvitation.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
// 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 mongodbatlas
import (
"context"
"reflect"
"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// `OrgInvitation` describes an invitation for a user to join an Atlas organization.
func LookupOrgInvitation(ctx *pulumi.Context, args *LookupOrgInvitationArgs, opts ...pulumi.InvokeOption) (*LookupOrgInvitationResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupOrgInvitationResult
err := ctx.Invoke("mongodbatlas:index/getOrgInvitation:getOrgInvitation", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getOrgInvitation.
type LookupOrgInvitationArgs struct {
// Unique 24-hexadecimal digit string that identifies the invitation in Atlas.
InvitationId string `pulumi:"invitationId"`
// Unique 24-hexadecimal digit string that identifies the organization to which you invited the user.
OrgId string `pulumi:"orgId"`
// Email address of the invited user. This is the address to which Atlas sends the invite. If the user accepts the invitation, they log in to Atlas with this username.
Username string `pulumi:"username"`
}
// A collection of values returned by getOrgInvitation.
type LookupOrgInvitationResult struct {
// Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.
CreatedAt string `pulumi:"createdAt"`
// Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.
ExpiresAt string `pulumi:"expiresAt"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
InvitationId string `pulumi:"invitationId"`
// Atlas user who invited `username` to the organization.
InviterUsername string `pulumi:"inviterUsername"`
OrgId string `pulumi:"orgId"`
// Atlas roles to assign to the invited user. If the user accepts the invitation, Atlas assigns these roles to them. The [MongoDB Documentation](https://www.mongodb.com/docs/atlas/reference/user-roles/#organization-roles) describes the roles a user can have.
Roles []string `pulumi:"roles"`
// An array of unique 24-hexadecimal digit strings that identify the teams that the user was invited to join.
TeamsIds []string `pulumi:"teamsIds"`
Username string `pulumi:"username"`
}
func LookupOrgInvitationOutput(ctx *pulumi.Context, args LookupOrgInvitationOutputArgs, opts ...pulumi.InvokeOption) LookupOrgInvitationResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupOrgInvitationResult, error) {
args := v.(LookupOrgInvitationArgs)
r, err := LookupOrgInvitation(ctx, &args, opts...)
var s LookupOrgInvitationResult
if r != nil {
s = *r
}
return s, err
}).(LookupOrgInvitationResultOutput)
}
// A collection of arguments for invoking getOrgInvitation.
type LookupOrgInvitationOutputArgs struct {
// Unique 24-hexadecimal digit string that identifies the invitation in Atlas.
InvitationId pulumi.StringInput `pulumi:"invitationId"`
// Unique 24-hexadecimal digit string that identifies the organization to which you invited the user.
OrgId pulumi.StringInput `pulumi:"orgId"`
// Email address of the invited user. This is the address to which Atlas sends the invite. If the user accepts the invitation, they log in to Atlas with this username.
Username pulumi.StringInput `pulumi:"username"`
}
func (LookupOrgInvitationOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupOrgInvitationArgs)(nil)).Elem()
}
// A collection of values returned by getOrgInvitation.
type LookupOrgInvitationResultOutput struct{ *pulumi.OutputState }
func (LookupOrgInvitationResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupOrgInvitationResult)(nil)).Elem()
}
func (o LookupOrgInvitationResultOutput) ToLookupOrgInvitationResultOutput() LookupOrgInvitationResultOutput {
return o
}
func (o LookupOrgInvitationResultOutput) ToLookupOrgInvitationResultOutputWithContext(ctx context.Context) LookupOrgInvitationResultOutput {
return o
}
// Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.
func (o LookupOrgInvitationResultOutput) CreatedAt() pulumi.StringOutput {
return o.ApplyT(func(v LookupOrgInvitationResult) string { return v.CreatedAt }).(pulumi.StringOutput)
}
// Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.
func (o LookupOrgInvitationResultOutput) ExpiresAt() pulumi.StringOutput {
return o.ApplyT(func(v LookupOrgInvitationResult) string { return v.ExpiresAt }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupOrgInvitationResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupOrgInvitationResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupOrgInvitationResultOutput) InvitationId() pulumi.StringOutput {
return o.ApplyT(func(v LookupOrgInvitationResult) string { return v.InvitationId }).(pulumi.StringOutput)
}
// Atlas user who invited `username` to the organization.
func (o LookupOrgInvitationResultOutput) InviterUsername() pulumi.StringOutput {
return o.ApplyT(func(v LookupOrgInvitationResult) string { return v.InviterUsername }).(pulumi.StringOutput)
}
func (o LookupOrgInvitationResultOutput) OrgId() pulumi.StringOutput {
return o.ApplyT(func(v LookupOrgInvitationResult) string { return v.OrgId }).(pulumi.StringOutput)
}
// Atlas roles to assign to the invited user. If the user accepts the invitation, Atlas assigns these roles to them. The [MongoDB Documentation](https://www.mongodb.com/docs/atlas/reference/user-roles/#organization-roles) describes the roles a user can have.
func (o LookupOrgInvitationResultOutput) Roles() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupOrgInvitationResult) []string { return v.Roles }).(pulumi.StringArrayOutput)
}
// An array of unique 24-hexadecimal digit strings that identify the teams that the user was invited to join.
func (o LookupOrgInvitationResultOutput) TeamsIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupOrgInvitationResult) []string { return v.TeamsIds }).(pulumi.StringArrayOutput)
}
func (o LookupOrgInvitationResultOutput) Username() pulumi.StringOutput {
return o.ApplyT(func(v LookupOrgInvitationResult) string { return v.Username }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupOrgInvitationResultOutput{})
}