admin.go (7681B)
1 // GoToSocial 2 // Copyright (C) GoToSocial Authors admin@gotosocial.org 3 // SPDX-License-Identifier: AGPL-3.0-or-later 4 // 5 // This program is free software: you can redistribute it and/or modify 6 // it under the terms of the GNU Affero General Public License as published by 7 // the Free Software Foundation, either version 3 of the License, or 8 // (at your option) any later version. 9 // 10 // This program is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU Affero General Public License for more details. 14 // 15 // You should have received a copy of the GNU Affero General Public License 16 // along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18 package model 19 20 // AdminAccountInfo models the admin view of an account's details. 21 // 22 // swagger:model adminAccountInfo 23 type AdminAccountInfo struct { 24 // The ID of the account in the database. 25 // example: 01GQ4PHNT622DQ9X95XQX4KKNR 26 ID string `json:"id"` 27 // The username of the account. 28 // example: dril 29 Username string `json:"username"` 30 // The domain of the account. 31 // Null for local accounts. 32 // example: example.org 33 Domain *string `json:"domain"` 34 // When the account was first discovered. (ISO 8601 Datetime) 35 // example: 2021-07-30T09:20:25+00:00 36 CreatedAt string `json:"created_at"` 37 // The email address associated with the account. 38 // Empty string for remote accounts or accounts with 39 // no known email address. 40 // example: someone@somewhere.com 41 Email string `json:"email"` 42 // The IP address last used to login to this account. 43 // Null if not known. 44 // example: 192.0.2.1 45 IP *string `json:"ip"` 46 // All known IP addresses associated with this account. 47 // NOT IMPLEMENTED (will always be empty array). 48 // example: [] 49 IPs []interface{} `json:"ips"` 50 // The locale of the account. (ISO 639 Part 1 two-letter language code) 51 // example: en 52 Locale string `json:"locale"` 53 // The reason given when requesting an invite. 54 // Null if not known / remote account. 55 // example: Pleaaaaaaaaaaaaaaase!! 56 InviteRequest *string `json:"invite_request"` 57 // The current role of the account. 58 Role AccountRole `json:"role"` 59 // Whether the account has confirmed their email address. 60 Confirmed bool `json:"confirmed"` 61 // Whether the account is currently approved. 62 Approved bool `json:"approved"` 63 // Whether the account is currently disabled. 64 Disabled bool `json:"disabled"` 65 // Whether the account is currently silenced 66 Silenced bool `json:"silenced"` 67 // Whether the account is currently suspended. 68 Suspended bool `json:"suspended"` 69 // User-level information about the account. 70 Account *Account `json:"account"` 71 // The ID of the application that created this account. 72 CreatedByApplicationID string `json:"created_by_application_id,omitempty"` 73 // The ID of the account that invited this user 74 InvitedByAccountID string `json:"invited_by_account_id,omitempty"` 75 } 76 77 // AdminReport models the admin view of a report. 78 // 79 // swagger:model adminReport 80 type AdminReport struct { 81 // ID of the report. 82 // example: 01FBVD42CQ3ZEEVMW180SBX03B 83 ID string `json:"id"` 84 // Whether an action has been taken by an admin in response to this report. 85 // example: false 86 ActionTaken bool `json:"action_taken"` 87 // If an action was taken, at what time was this done? (ISO 8601 Datetime) 88 // Will be null if not set / no action yet taken. 89 // example: 2021-07-30T09:20:25+00:00 90 ActionTakenAt *string `json:"action_taken_at"` 91 // Under what category was this report created? 92 // example: spam 93 Category string `json:"category"` 94 // Comment submitted when the report was created. 95 // Will be empty if no comment was submitted. 96 // example: This person has been harassing me. 97 Comment string `json:"comment"` 98 // Bool to indicate that report should be federated to remote instance. 99 // example: true 100 Forwarded bool `json:"forwarded"` 101 // The date when this report was created (ISO 8601 Datetime). 102 // example: 2021-07-30T09:20:25+00:00 103 CreatedAt string `json:"created_at"` 104 // Time of last action on this report (ISO 8601 Datetime). 105 // example: 2021-07-30T09:20:25+00:00 106 UpdatedAt string `json:"updated_at"` 107 // The account that created the report. 108 Account *AdminAccountInfo `json:"account"` 109 // Account that was reported. 110 TargetAccount *AdminAccountInfo `json:"target_account"` 111 // The account assigned to handle the report. 112 // Null if no account assigned. 113 AssignedAccount *AdminAccountInfo `json:"assigned_account"` 114 // Account that took admin action (if any). 115 // Null if no action (yet) taken. 116 ActionTakenByAccount *AdminAccountInfo `json:"action_taken_by_account"` 117 // Array of statuses that were submitted along with this report. 118 // Will be empty if no status IDs were submitted with the report. 119 Statuses []*Status `json:"statuses"` 120 // Array of rule IDs that were submitted along with this report. 121 // NOT IMPLEMENTED, will always be empty array. 122 Rules []interface{} `json:"rule_ids"` 123 // If an action was taken, what comment was made by the admin on the taken action? 124 // Will be null if not set / no action yet taken. 125 // example: Account was suspended. 126 ActionTakenComment *string `json:"action_taken_comment"` 127 } 128 129 // AdminReportResolveRequest can be submitted along with a POST to /api/v1/admin/reports/{id}/resolve 130 // 131 // swagger:ignore 132 type AdminReportResolveRequest struct { 133 // Comment to show to the creator of the report when an admin marks it as resolved. 134 ActionTakenComment *string `form:"action_taken_comment" json:"action_taken_comment" xml:"action_taken_comment"` 135 } 136 137 // AdminEmoji models the admin view of a custom emoji. 138 // 139 // swagger:model adminEmoji 140 type AdminEmoji struct { 141 Emoji 142 // The ID of the emoji. 143 // example: 01GEM7SFDZ7GZNRXFVZ3X4E4N1 144 ID string `json:"id"` 145 // True if this emoji has been disabled by an admin action. 146 // example: false 147 Disabled bool `json:"disabled"` 148 // The domain from which the emoji originated. Only defined for remote domains, otherwise key will not be set. 149 // 150 // example: example.org 151 Domain string `json:"domain,omitempty"` 152 // Time when the emoji image was last updated. 153 // example: 2022-10-05T09:21:26.419Z 154 UpdatedAt string `json:"updated_at"` 155 // The total file size taken up by the emoji in bytes, including static and animated versions. 156 // example: 69420 157 TotalFileSize int `json:"total_file_size"` 158 // The MIME content type of the emoji. 159 // example: image/png 160 ContentType string `json:"content_type"` 161 // The ActivityPub URI of the emoji. 162 // example: https://example.org/emojis/016T5Q3SQKBT337DAKVSKNXXW1 163 URI string `json:"uri"` 164 } 165 166 // AdminAccountActionRequest models the admin view of an account's details. 167 // 168 // swagger:ignore 169 type AdminAccountActionRequest struct { 170 // Type of the account action. One of disable, silence, suspend. 171 Type string `form:"type" json:"type" xml:"type"` 172 // Text describing why an action was taken. 173 Text string `form:"text" json:"text" xml:"text"` 174 // ID of the account to be acted on. 175 TargetAccountID string `form:"-" json:"-" xml:"-"` 176 } 177 178 // MediaCleanupRequest models admin media cleanup parameters 179 // 180 // swagger:parameters mediaCleanup 181 type MediaCleanupRequest struct { 182 // Number of days of remote media to keep. Native values will be treated as 0. 183 // If value is not specified, the value of media-remote-cache-days in the server config will be used. 184 RemoteCacheDays *int `form:"remote_cache_days" json:"remote_cache_days" xml:"remote_cache_days"` 185 } 186 187 // AdminSendTestEmailRequest models a test email send request (woah). 188 type AdminSendTestEmailRequest struct { 189 // Email address to send the test email to. 190 Email string `form:"email" json:"email" xml:"email"` 191 }