-
Notifications
You must be signed in to change notification settings - Fork 2
/
projectUser.go
113 lines (100 loc) · 3.52 KB
/
projectUser.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package aiven
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
type ProjectUser struct {
s *pulumi.ResourceState
}
// NewProjectUser registers a new resource with the given unique name, arguments, and options.
func NewProjectUser(ctx *pulumi.Context,
name string, args *ProjectUserArgs, opts ...pulumi.ResourceOpt) (*ProjectUser, error) {
if args == nil || args.Email == nil {
return nil, errors.New("missing required argument 'Email'")
}
if args == nil || args.MemberType == nil {
return nil, errors.New("missing required argument 'MemberType'")
}
if args == nil || args.Project == nil {
return nil, errors.New("missing required argument 'Project'")
}
inputs := make(map[string]interface{})
if args == nil {
inputs["email"] = nil
inputs["memberType"] = nil
inputs["project"] = nil
} else {
inputs["email"] = args.Email
inputs["memberType"] = args.MemberType
inputs["project"] = args.Project
}
inputs["accepted"] = nil
s, err := ctx.RegisterResource("aiven:index/projectUser:ProjectUser", name, true, inputs, opts...)
if err != nil {
return nil, err
}
return &ProjectUser{s: s}, nil
}
// GetProjectUser gets an existing ProjectUser resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetProjectUser(ctx *pulumi.Context,
name string, id pulumi.ID, state *ProjectUserState, opts ...pulumi.ResourceOpt) (*ProjectUser, error) {
inputs := make(map[string]interface{})
if state != nil {
inputs["accepted"] = state.Accepted
inputs["email"] = state.Email
inputs["memberType"] = state.MemberType
inputs["project"] = state.Project
}
s, err := ctx.ReadResource("aiven:index/projectUser:ProjectUser", name, id, inputs, opts...)
if err != nil {
return nil, err
}
return &ProjectUser{s: s}, nil
}
// URN is this resource's unique name assigned by Pulumi.
func (r *ProjectUser) URN() pulumi.URNOutput {
return r.s.URN()
}
// ID is this resource's unique identifier assigned by its provider.
func (r *ProjectUser) ID() pulumi.IDOutput {
return r.s.ID()
}
// Whether the user has accepted project membership or not
func (r *ProjectUser) Accepted() pulumi.BoolOutput {
return (pulumi.BoolOutput)(r.s.State["accepted"])
}
// Email address of the user
func (r *ProjectUser) Email() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["email"])
}
// Project membership type. One of: admin, developer, operator
func (r *ProjectUser) MemberType() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["memberType"])
}
// The project the user belongs to
func (r *ProjectUser) Project() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["project"])
}
// Input properties used for looking up and filtering ProjectUser resources.
type ProjectUserState struct {
// Whether the user has accepted project membership or not
Accepted interface{}
// Email address of the user
Email interface{}
// Project membership type. One of: admin, developer, operator
MemberType interface{}
// The project the user belongs to
Project interface{}
}
// The set of arguments for constructing a ProjectUser resource.
type ProjectUserArgs struct {
// Email address of the user
Email interface{}
// Project membership type. One of: admin, developer, operator
MemberType interface{}
// The project the user belongs to
Project interface{}
}