github.com/haalcala/mattermost-server-change-repo@v0.0.0-20210713015153-16753fbeee5f/app/import_types.go (about) 1 // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. 2 // See LICENSE.txt for license information. 3 4 package app 5 6 import ( 7 "github.com/mattermost/mattermost-server/v5/model" 8 ) 9 10 // Import Data Models 11 12 type LineImportData struct { 13 Type string `json:"type"` 14 Scheme *SchemeImportData `json:"scheme,omitempty"` 15 Team *TeamImportData `json:"team,omitempty"` 16 Channel *ChannelImportData `json:"channel,omitempty"` 17 User *UserImportData `json:"user,omitempty"` 18 Post *PostImportData `json:"post,omitempty"` 19 DirectChannel *DirectChannelImportData `json:"direct_channel,omitempty"` 20 DirectPost *DirectPostImportData `json:"direct_post,omitempty"` 21 Emoji *EmojiImportData `json:"emoji,omitempty"` 22 Version *int `json:"version,omitempty"` 23 } 24 25 type TeamImportData struct { 26 Name *string `json:"name"` 27 DisplayName *string `json:"display_name"` 28 Type *string `json:"type"` 29 Description *string `json:"description,omitempty"` 30 AllowOpenInvite *bool `json:"allow_open_invite,omitempty"` 31 Scheme *string `json:"scheme,omitempty"` 32 } 33 34 type ChannelImportData struct { 35 Team *string `json:"team"` 36 Name *string `json:"name"` 37 DisplayName *string `json:"display_name"` 38 Type *string `json:"type"` 39 Header *string `json:"header,omitempty"` 40 Purpose *string `json:"purpose,omitempty"` 41 Scheme *string `json:"scheme,omitempty"` 42 } 43 44 type UserImportData struct { 45 ProfileImage *string `json:"profile_image,omitempty"` 46 Username *string `json:"username"` 47 Email *string `json:"email"` 48 AuthService *string `json:"auth_service"` 49 AuthData *string `json:"auth_data,omitempty"` 50 Password *string `json:"password,omitempty"` 51 Nickname *string `json:"nickname"` 52 FirstName *string `json:"first_name"` 53 LastName *string `json:"last_name"` 54 Position *string `json:"position"` 55 Roles *string `json:"roles"` 56 Locale *string `json:"locale"` 57 UseMarkdownPreview *string `json:"feature_enabled_markdown_preview,omitempty"` 58 UseFormatting *string `json:"formatting,omitempty"` 59 ShowUnreadSection *string `json:"show_unread_section,omitempty"` 60 DeleteAt *int64 `json:"delete_at,omitempty"` 61 62 Teams *[]UserTeamImportData `json:"teams,omitempty"` 63 64 Theme *string `json:"theme,omitempty"` 65 UseMilitaryTime *string `json:"military_time,omitempty"` 66 CollapsePreviews *string `json:"link_previews,omitempty"` 67 MessageDisplay *string `json:"message_display,omitempty"` 68 ChannelDisplayMode *string `json:"channel_display_mode,omitempty"` 69 TutorialStep *string `json:"tutorial_step,omitempty"` 70 EmailInterval *string `json:"email_interval,omitempty"` 71 72 NotifyProps *UserNotifyPropsImportData `json:"notify_props,omitempty"` 73 } 74 75 type UserNotifyPropsImportData struct { 76 Desktop *string `json:"desktop"` 77 DesktopSound *string `json:"desktop_sound"` 78 79 Email *string `json:"email"` 80 81 Mobile *string `json:"mobile"` 82 MobilePushStatus *string `json:"mobile_push_status"` 83 84 ChannelTrigger *string `json:"channel"` 85 CommentsTrigger *string `json:"comments"` 86 MentionKeys *string `json:"mention_keys"` 87 } 88 89 type UserTeamImportData struct { 90 Name *string `json:"name"` 91 Roles *string `json:"roles"` 92 Theme *string `json:"theme,omitempty"` 93 Channels *[]UserChannelImportData `json:"channels,omitempty"` 94 } 95 96 type UserChannelImportData struct { 97 Name *string `json:"name"` 98 Roles *string `json:"roles"` 99 NotifyProps *UserChannelNotifyPropsImportData `json:"notify_props,omitempty"` 100 Favorite *bool `json:"favorite,omitempty"` 101 } 102 103 type UserChannelNotifyPropsImportData struct { 104 Desktop *string `json:"desktop"` 105 Mobile *string `json:"mobile"` 106 MarkUnread *string `json:"mark_unread"` 107 } 108 109 type EmojiImportData struct { 110 Name *string `json:"name"` 111 Image *string `json:"image"` 112 } 113 114 type ReactionImportData struct { 115 User *string `json:"user"` 116 CreateAt *int64 `json:"create_at"` 117 EmojiName *string `json:"emoji_name"` 118 } 119 120 type ReplyImportData struct { 121 User *string `json:"user"` 122 123 Message *string `json:"message"` 124 CreateAt *int64 `json:"create_at"` 125 126 FlaggedBy *[]string `json:"flagged_by,omitempty"` 127 Reactions *[]ReactionImportData `json:"reactions,omitempty"` 128 Attachments *[]AttachmentImportData `json:"attachments,omitempty"` 129 } 130 131 type PostImportData struct { 132 Team *string `json:"team"` 133 Channel *string `json:"channel"` 134 User *string `json:"user"` 135 136 Message *string `json:"message"` 137 Props *model.StringInterface `json:"props"` 138 CreateAt *int64 `json:"create_at"` 139 140 FlaggedBy *[]string `json:"flagged_by,omitempty"` 141 Reactions *[]ReactionImportData `json:"reactions,omitempty"` 142 Replies *[]ReplyImportData `json:"replies,omitempty"` 143 Attachments *[]AttachmentImportData `json:"attachments,omitempty"` 144 } 145 146 type DirectChannelImportData struct { 147 Members *[]string `json:"members"` 148 FavoritedBy *[]string `json:"favorited_by"` 149 150 Header *string `json:"header"` 151 } 152 153 type DirectPostImportData struct { 154 ChannelMembers *[]string `json:"channel_members"` 155 User *string `json:"user"` 156 157 Message *string `json:"message"` 158 Props *model.StringInterface `json:"props"` 159 CreateAt *int64 `json:"create_at"` 160 161 FlaggedBy *[]string `json:"flagged_by"` 162 Reactions *[]ReactionImportData `json:"reactions"` 163 Replies *[]ReplyImportData `json:"replies"` 164 Attachments *[]AttachmentImportData `json:"attachments"` 165 } 166 167 type SchemeImportData struct { 168 Name *string `json:"name"` 169 DisplayName *string `json:"display_name"` 170 Description *string `json:"description"` 171 Scope *string `json:"scope"` 172 DefaultTeamAdminRole *RoleImportData `json:"default_team_admin_role"` 173 DefaultTeamUserRole *RoleImportData `json:"default_team_user_role"` 174 DefaultChannelAdminRole *RoleImportData `json:"default_channel_admin_role"` 175 DefaultChannelUserRole *RoleImportData `json:"default_channel_user_role"` 176 DefaultTeamGuestRole *RoleImportData `json:"default_team_guest_role"` 177 DefaultChannelGuestRole *RoleImportData `json:"default_channel_guest_role"` 178 } 179 180 type RoleImportData struct { 181 Name *string `json:"name"` 182 DisplayName *string `json:"display_name"` 183 Description *string `json:"description"` 184 Permissions *[]string `json:"permissions"` 185 } 186 187 type LineImportWorkerData struct { 188 LineImportData 189 LineNumber int 190 } 191 192 type LineImportWorkerError struct { 193 Error *model.AppError 194 LineNumber int 195 } 196 197 type AttachmentImportData struct { 198 Path *string `json:"path"` 199 } 200 201 type ComparablePreference struct { 202 Category string 203 Name string 204 }