/
user_schema.go
35 lines (33 loc) · 1.34 KB
/
user_schema.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
package resources
import (
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
)
func UserSchema() schema.Schema {
return schema.Schema{
Attributes: map[string]schema.Attribute{
"id": stringAttribute([]string{computed}),
"name": stringAttribute([]string{optional, computed}),
"status": stringAttribute([]string{computed}),
"inactive": boolAttribute(computed),
"email": stringAttribute([]string{required, requiresReplace}),
"organization_id": stringAttribute([]string{required, requiresReplace}),
"organization_roles": stringListAttribute(required),
"last_login": stringAttribute([]string{computed}),
"region": stringAttribute([]string{computed}),
"time_zone": stringAttribute([]string{computed}),
"enable_notifications": boolAttribute(computed),
"expires_at": stringAttribute([]string{computed}),
"resources": schema.SetNestedAttribute{
Optional: true,
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"type": stringDefaultAttribute("project", optional, computed),
"id": stringAttribute([]string{required}),
"roles": stringSetAttribute(required),
},
},
},
"audit": computedAuditAttribute(),
},
}
}