-
Notifications
You must be signed in to change notification settings - Fork 0
/
adminStructures.go
185 lines (148 loc) · 5.59 KB
/
adminStructures.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
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
package connect
// Type of authorization
type UserAuthType string
const (
UInternalAuth UserAuthType = "UInternalAuth" // Internal authorization
UWindowsNTAuth UserAuthType = "UWindowsNTAuth" // Windows NT domain authorization
UPamAuth UserAuthType = "UPamAuth" // Authorization for linux
UKerberosAuth UserAuthType = "UKerberosAuth" // Kerberos authorization
UAppleAuth UserAuthType = "UAppleAuth" // Apple authorization
ULDAPAuth UserAuthType = "ULDAPAuth" // LDAP authorization
)
// Type for returning authorization type supported by server
type AuthTypeList []UserAuthType
// Type of deleting a user
type DirectoryServiceDeleteMode string
const (
DSModeDeactivate DirectoryServiceDeleteMode = "DSModeDeactivate" // User is deactivated but not deleted
DSModeDelete DirectoryServiceDeleteMode = "DSModeDelete" // User is deleted
)
// Enum type for determine which web component is in use in session
type WebComponent string
const (
WebComponentWEBMAIL WebComponent = "WebComponentWEBMAIL" // WebMail
WebComponentADMIN WebComponent = "WebComponentADMIN" // Web Administration
WebComponentMINI WebComponent = "WebComponentMINI" // WebMail mini
)
// Message clean out setting
// Note: all fields must be assigned if used in set methods
type ActionAfterDays struct {
IsEnabled bool `json:"isEnabled"` // is action on/off?
Days int `json:"days"` // after how many days is an action performed?
}
// Note: all fields must be assigned if used in set methods
type Distance struct {
Days int `json:"days"`
Hours int `json:"hours"`
Minutes int `json:"minutes"`
}
type DistanceType string
const (
dtNull DistanceType = "dtNull"
dtTimeSpan DistanceType = "dtTimeSpan"
)
type DistanceOrNull struct {
Type DistanceType `json:"type"`
TimeSpan Distance `json:"timeSpan"`
}
type Directories struct {
StorePath string `json:"storePath"` // Path to the store directory
ArchivePath string `json:"archivePath"` // Path to the archive directory
BackupPath string `json:"backupPath"` // Path to the backup directory
}
// source of user data
type DataSource string
const (
DSInternalSource DataSource = "DSInternalSource" // internal source of user data
DSLDAPSource DataSource = "DSLDAPSource" // LDAP source of user data
)
//
// Note: all fields must be assigned if used in set methods
type TimeHMS struct {
Hours int `json:"hours"`
Minutes int `json:"minutes"`
Seconds int `json:"seconds"`
}
type TimeUnit string
const (
Minutes TimeUnit = "Minutes"
Hours TimeUnit = "Hours"
Days TimeUnit = "Days"
Weeks TimeUnit = "Weeks"
)
//
// Note: all fields must be assigned if used in set methods
type TimeLimit struct {
Value int `json:"value"` // how many
Units TimeUnit `json:"units"` // in which units
}
// A way how to say client that the server has a constant
type NamedConstant struct {
Name string `json:"name"` // constant name
Value string `json:"value"` // a value of constant
}
type NamedConstantList []NamedConstant
// Except getAboutInfo() all methods are available for non-authenticated users
type DirectoryAccessResult string
const (
directoryExists DirectoryAccessResult = "directoryExists" // Directory exist, read/write allowed
directoryDoesNotExist DirectoryAccessResult = "directoryDoesNotExist" // Directory does not exist (or unable to create)
directoryExistAccessDenied DirectoryAccessResult = "directoryExistAccessDenied" // Directory exist, read or write permission not granted
directoryUnaccessible DirectoryAccessResult = "directoryUnaccessible" // Unable to connect network device
)
// Information about directory
type Directory struct {
Name string `json:"name"`
HasSubdirectory bool `json:"hasSubdirectory"`
}
// List of restrictions
type DirectoryList []Directory
type DeployedType string
const (
DeployedStandalone DeployedType = "DeployedStandalone" // Normal installation
DeployedCloud DeployedType = "DeployedCloud" // Kerio Connect is running in a cloud
DeployedKerioVA DeployedType = "DeployedKerioVA" // Kerio Connect VMWare Virtual Appliance
)
// Operating System Family
type ServerOs string
const (
Windows ServerOs = "Windows"
MacOs ServerOs = "MacOs"
Linux ServerOs = "Linux"
)
type UpdateCheckerStatus string
const (
updNoUpdate UpdateCheckerStatus = "updNoUpdate" // Update status: No update
updNewVersion UpdateCheckerStatus = "updNewVersion" // Update status: New version
updError UpdateCheckerStatus = "updError" // Update status: Error
)
type UpdateInfo struct {
Result UpdateCheckerStatus `json:"result"`
Description string `json:"description"`
DownloadUrl string `json:"downloadUrl"`
InfoUrl string `json:"infoUrl"`
}
type ProductInfo struct {
ProductName string `json:"productName"`
Version string `json:"version"`
BuildNumber string `json:"buildNumber"`
OsName string `json:"osName"`
Os ServerOs `json:"os"`
ReleaseType BuildType `json:"releaseType"`
DeployedType DeployedType `json:"deployedType"`
UpdateInfo UpdateInfo `json:"updateInfo"`
}
type CustomImage struct {
IsEnabled bool `json:"isEnabled"` // Is used
Url string `json:"url"` // [READ ONLY]
Id string `json:"id"` // [WRITE ONCE] Id of uploaded image.
}
type NotificationType string
const (
notifyOnce NotificationType = "notifyOnce"
notifyEvery NotificationType = "notifyEvery"
)
type QuotaNotification struct {
Type NotificationType `json:"type"`
Period TimeLimit `json:"period"`
}