-
Notifications
You must be signed in to change notification settings - Fork 353
/
user.go
63 lines (54 loc) · 2.48 KB
/
user.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
package model
// Entitlement is a custom type that contains a set of entitlements for a user/group
type Entitlement string
// List of possible entitlement constants on Databricks
const (
AllowClusterCreateEntitlement Entitlement = "allow-cluster-create"
AllowInstancePoolCreateEntitlement Entitlement = "allow-instance-pool-create"
)
// GroupsListItem is a struct that contains a value of group id
type GroupsListItem struct {
Value string `json:"value,omitempty"`
}
// EntitlementsListItem is a struct that contains a value of entitlement
type EntitlementsListItem struct {
Value Entitlement `json:"value,omitempty"`
}
// RoleListItem is a struct that contains a value of role
type RoleListItem struct {
Value string `json:"value,omitempty"`
}
// Email is a struct that contains information about a user's email
type Email struct {
Type interface{} `json:"type,omitempty"`
Value string `json:"value,omitempty"`
Primary interface{} `json:"primary,omitempty"`
}
// User is a struct that contains all the information about a SCIM user
type User struct {
ID string `json:"id,omitempty"`
Emails []Email `json:"emails,omitempty"`
DisplayName string `json:"displayName,omitempty"`
Active bool `json:"active,omitempty"`
Schemas []URN `json:"schemas,omitempty"`
UserName string `json:"userName,omitempty"`
Groups []GroupsListItem `json:"groups,omitempty"`
Name map[string]string `json:"name,omitempty"`
Roles []RoleListItem `json:"roles,omitempty"`
Entitlements []EntitlementsListItem `json:"entitlements,omitempty"`
UnInheritedRoles []RoleListItem `json:"uninherited_roles,omitempty"`
InheritedRoles []RoleListItem `json:"inherited_roles,omitempty"`
}
// UserList contains a list of Users fetched from a list api call from SCIM api
type UserList struct {
TotalResults int32 `json:"totalResults,omitempty"`
StartIndex int32 `json:"startIndex,omitempty"`
ItemsPerPage int32 `json:"itemsPerPage,omitempty"`
Schemas []URN `json:"schemas,omitempty"`
Resources []User `json:"resources,omitempty"`
}
// UserPatchRequest is a struct that contains all the information for a PATCH request to the SCIM users api
type UserPatchRequest struct {
Schemas []URN `json:"schemas,omitempty"`
Operations []UserPatchOperations `json:"Operations,omitempty"`
}