@@ -7,34 +7,47 @@ import (
7
7
)
8
8
9
9
type AppSettings struct {
10
- DisableAuth * bool `json:"disable_auth_checks,omitempty"`
11
- DisablePermissions * bool `json:"disable_permissions_checks,omitempty"`
12
- APNConfig * APNConfig `json:"apn_config,omitempty"`
13
- FirebaseConfig * FirebaseConfigRequest `json:"firebase_config,omitempty"`
14
- XiaomiConfig * XiaomiConfigRequest `json:"xiaomi_config,omitempty"`
15
- HuaweiConfig * HuaweiConfigRequest `json:"huawei_config,omitempty"`
16
- PushConfig * PushConfigRequest `json:"push_config,omitempty"`
17
- WebhookURL * string `json:"webhook_url,omitempty"`
18
- MultiTenantEnabled * bool `json:"multi_tenant_enabled,omitempty"`
19
- AsyncURLEnrichEnabled * bool `json:"async_url_enrich_enabled,omitempty"`
20
- AutoTranslationEnabled * bool `json:"auto_translation_enabled,omitempty"`
21
- Grants map [string ][]string `json:"grants,omitempty"`
22
- MigratePermissionsToV2 * bool `json:"migrate_permissions_to_v2,omitempty"`
23
- PermissionVersion * string `json:"permission_version,omitempty"`
24
- FileUploadConfig * FileUploadConfig `json:"file_upload_config,omitempty"`
25
- ImageUploadConfig * FileUploadConfig `json:"image_upload_config,omitempty"`
26
- ImageModerationLabels []string `json:"image_moderation_labels,omitempty"`
27
- ImageModerationEnabled * bool `json:"image_moderation_enabled,omitempty"`
28
- RemindersInterval int `json:"reminders_interval,omitempty"`
29
- BeforeMessageSendHookURL * string `json:"before_message_send_hook_url,omitempty"`
30
- CustomActionHandlerURL * string `json:"custom_action_handler_url,omitempty"`
31
- UserSearchDisallowedRoles []string `json:"user_search_disallowed_roles,omitempty"`
32
- EnforceUniqueUsernames * string `json:"enforce_unique_usernames,omitempty"`
33
- SqsURL * string `json:"sqs_url,omitempty"`
34
- SqsKey * string `json:"sqs_key,omitempty"`
35
- SqsSecret * string `json:"sqs_secret,omitempty"`
36
- WebhookEvents []string `json:"webhook_events,omitempty"`
37
- ChannelHideMembersOnly * bool `json:"channel_hide_members_only,omitempty"`
10
+ Name string `json:"name"`
11
+ OrganizationName string `json:"organization"`
12
+ Suspended bool `json:"suspended"`
13
+ SuspendedExplanation string `json:"suspended_explanation"`
14
+ ConfigNameMap map [string ]* ChannelConfig `json:"channel_configs"`
15
+ RevokeTokensIssuedBefore * time.Time `json:"revoke_tokens_issued_before"`
16
+
17
+ DisableAuth * bool `json:"disable_auth_checks,omitempty"`
18
+ DisablePermissions * bool `json:"disable_permissions_checks,omitempty"`
19
+
20
+ PushNotifications PushNotificationFields `json:"push_notifications"`
21
+ PushConfig * PushConfigRequest `json:"push_config,omitempty"`
22
+ APNConfig * APNConfig `json:"apn_config,omitempty"`
23
+ FirebaseConfig * FirebaseConfigRequest `json:"firebase_config,omitempty"`
24
+ XiaomiConfig * XiaomiConfigRequest `json:"xiaomi_config,omitempty"`
25
+ HuaweiConfig * HuaweiConfigRequest `json:"huawei_config,omitempty"`
26
+ WebhookURL * string `json:"webhook_url,omitempty"`
27
+ WebhookEvents []string `json:"webhook_events,omitempty"`
28
+ SqsURL * string `json:"sqs_url,omitempty"`
29
+ SqsKey * string `json:"sqs_key,omitempty"`
30
+ SqsSecret * string `json:"sqs_secret,omitempty"`
31
+ BeforeMessageSendHookURL * string `json:"before_message_send_hook_url,omitempty"`
32
+ CustomActionHandlerURL * string `json:"custom_action_handler_url,omitempty"`
33
+
34
+ FileUploadConfig * FileUploadConfig `json:"file_upload_config,omitempty"`
35
+ ImageUploadConfig * FileUploadConfig `json:"image_upload_config,omitempty"`
36
+ ImageModerationLabels []string `json:"image_moderation_labels,omitempty"`
37
+ ImageModerationEnabled * bool `json:"image_moderation_enabled,omitempty"`
38
+
39
+ PermissionVersion * string `json:"permission_version,omitempty"`
40
+ MigratePermissionsToV2 * bool `json:"migrate_permissions_to_v2,omitempty"`
41
+ Policies map [string ][]Policy `json:"policies"`
42
+ Grants map [string ][]string `json:"grants,omitempty"`
43
+
44
+ MultiTenantEnabled * bool `json:"multi_tenant_enabled,omitempty"`
45
+ AsyncURLEnrichEnabled * bool `json:"async_url_enrich_enabled,omitempty"`
46
+ AutoTranslationEnabled * bool `json:"auto_translation_enabled,omitempty"`
47
+ RemindersInterval int `json:"reminders_interval,omitempty"`
48
+ UserSearchDisallowedRoles []string `json:"user_search_disallowed_roles,omitempty"`
49
+ EnforceUniqueUsernames * string `json:"enforce_unique_usernames,omitempty"`
50
+ ChannelHideMembersOnly * bool `json:"channel_hide_members_only,omitempty"`
38
51
}
39
52
40
53
func (a * AppSettings ) SetDisableAuth (b bool ) * AppSettings {
@@ -152,42 +165,13 @@ type Policy struct {
152
165
UpdatedAt time.Time `json:"updated_at"`
153
166
}
154
167
155
- type AppConfig struct {
156
- Name string `json:"name"`
157
- OrganizationName string `json:"organization"`
158
- WebhookURL string `json:"webhook_url"`
159
- SuspendedExplanation string `json:"suspended_explanation"`
160
- PushNotifications PushNotificationFields `json:"push_notifications"`
161
- ConfigNameMap map [string ]* ChannelConfig `json:"channel_configs"`
162
- Policies map [string ][]Policy `json:"policies"`
163
- Suspended bool `json:"suspended"`
164
- DisableAuth bool `json:"disable_auth_checks"`
165
- DisablePermissions bool `json:"disable_permissions_checks"`
166
- MultiTenantEnabled bool `json:"multi_tenant_enabled"`
167
- RevokeTokensIssuedBefore * time.Time `json:"revoke_tokens_issued_before"`
168
- RemindersInterval int `json:"reminders_interval"`
169
- AsyncURLEnrichEnabled bool `json:"async_url_enrich_enabled"`
170
- Grants map [string ][]string `json:"grants"`
171
- PermissionVersion string `json:"permission_version"`
172
- ImageModerationLabels []string `json:"image_moderation_labels"`
173
- ImageModerationEnabled * bool `json:"image_moderation_enabled"`
174
- BeforeMessageSendHookURL string `json:"before_message_send_hook_url"`
175
- CustomActionHandlerURL string `json:"custom_action_handler_url"`
176
- UserSearchDisallowedRoles []string `json:"user_search_disallowed_roles"`
177
- EnforceUniqueUsernames string `json:"enforce_unique_usernames"`
178
- SqsURL string `json:"sqs_url"`
179
- SqsKey string `json:"sqs_key"`
180
- SqsSecret string `json:"sqs_secret"`
181
- WebhookEvents []string `json:"webhook_events"`
182
- }
183
-
184
168
type AppResponse struct {
185
- App * AppConfig `json:"app"`
169
+ App * AppSettings `json:"app"`
186
170
Response
187
171
}
188
172
189
- // GetAppConfig returns app settings.
190
- func (c * Client ) GetAppConfig (ctx context.Context ) (* AppResponse , error ) {
173
+ // GetAppSettings returns app settings.
174
+ func (c * Client ) GetAppSettings (ctx context.Context ) (* AppResponse , error ) {
191
175
var resp AppResponse
192
176
193
177
err := c .makeRequest (ctx , http .MethodGet , "app" , nil , nil , & resp )
0 commit comments