-
Notifications
You must be signed in to change notification settings - Fork 228
Expand file tree
/
Copy pathUser.java
More file actions
199 lines (176 loc) · 4.75 KB
/
User.java
File metadata and controls
199 lines (176 loc) · 4.75 KB
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
package com.slack.api.scim.model;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Arrays;
import java.util.List;
@Data
public class User {
private List<String> schemas = Arrays.asList(
Schemas.SCHEMA_CORE,
Schemas.SCHEMA_EXTENSION_ENTERPRISE,
Schemas.SCHEMA_EXTENSION_SLACK_GUEST,
Schemas.SCHEMA_EXTENSION_SLACK_PROFILE
);
private String id;
private String externalId;
private Meta meta;
private String userName;
private String nickName;
private Name name;
private String displayName;
private String profileUrl;
private List<Email> emails;
private List<Address> addresses;
private List<PhoneNumber> phoneNumbers;
private List<Photo> photos;
private List<Role> roles;
private String userType;
private String title;
private String preferredLanguage;
private String locale;
private String timezone;
private Boolean active;
// The password attribute is never returned
// but can be used to set the initial password for a user
// if the team is not using an identity manager.
private String password;
@SerializedName(Schemas.SCHEMA_EXTENSION_ENTERPRISE)
private Extension extension;
@SerializedName(Schemas.SCHEMA_EXTENSION_SLACK_GUEST)
private SlackGuest slackGuest;
@SerializedName(Schemas.SCHEMA_EXTENSION_SLACK_PROFILE)
private SlackProfile slackProfile;
private List<Group> groups;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class Meta {
private String created;
private String location;
}
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class Name {
private String givenName;
private String familyName;
private String honorificPrefix;
}
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class Email {
private String value;
private String type;
private Boolean primary;
}
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class Address {
private String streetAddress;
private String locality;
private String region;
private String postalCode;
private String country;
private Boolean primary;
}
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class PhoneNumber {
private String value;
private String type;
private Boolean primary;
}
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class Photo {
private String value;
private String type;
}
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class Role {
private String value;
private String type;
private Boolean primary;
}
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class Extension {
private String employeeNumber;
private String costCenter;
private String organization;
private String division;
private String department;
private Manager manager;
@Data
public static class Manager {
private String managerId;
}
}
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class Group {
private String value;
private String display;
}
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class SlackGuest {
public static class Types {
private Types() {
}
public static final String MULTI = "multi";
}
/**
* This value is mandatory.
* possible values: "multi"
*/
private String type;
/**
* This value is optional.
* possible values: ISO 8601 date time string (e.g., "2020-11-30T23:59:59Z")
*/
private String expiration;
private List<Channel> channels;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class Channel {
private String value;
private String display;
}
}
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class SlackProfile {
/**
* Identifies date and time the user started within the organization. Used to create and display profile Celebrations.
* The accepted format is ISO 8601. (e.g., "2020-10-31T23:59:59Z")
*/
private String startDate;
}
}