gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

report.go (4140B)


      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 // Report models a moderation report submitted to the instance, either via the client API or via the federated API.
     21 //
     22 // swagger:model report
     23 type Report struct {
     24 	// ID of the report.
     25 	// example: 01FBVD42CQ3ZEEVMW180SBX03B
     26 	ID string `json:"id"`
     27 	// The date when this report was created (ISO 8601 Datetime).
     28 	// example: 2021-07-30T09:20:25+00:00
     29 	CreatedAt string `json:"created_at"`
     30 	// Whether an action has been taken by an admin in response to this report.
     31 	// example: false
     32 	ActionTaken bool `json:"action_taken"`
     33 	// If an action was taken, at what time was this done? (ISO 8601 Datetime)
     34 	// Will be null if not set / no action yet taken.
     35 	// example: 2021-07-30T09:20:25+00:00
     36 	ActionTakenAt *string `json:"action_taken_at"`
     37 	// If an action was taken, what comment was made by the admin on the taken action?
     38 	// Will be null if not set / no action yet taken.
     39 	// example: Account was suspended.
     40 	ActionTakenComment *string `json:"action_taken_comment"`
     41 	// Under what category was this report created?
     42 	// example: spam
     43 	Category string `json:"category"`
     44 	// Comment submitted when the report was created.
     45 	// Will be empty if no comment was submitted.
     46 	// example: This person has been harassing me.
     47 	Comment string `json:"comment"`
     48 	// Bool to indicate that report should be federated to remote instance.
     49 	// example: true
     50 	Forwarded bool `json:"forwarded"`
     51 	// Array of IDs of statuses that were submitted along with this report.
     52 	// Will be empty if no status IDs were submitted.
     53 	// example: ["01GPBN5YDY6JKBWE44H7YQBDCQ","01GPBN65PDWSBPWVDD0SQCFFY3"]
     54 	StatusIDs []string `json:"status_ids"`
     55 	// Array of rule IDs that were submitted along with this report.
     56 	// Will be empty if no rule IDs were submitted.
     57 	// example: [1, 2]
     58 	RuleIDs []int `json:"rule_ids"`
     59 	// Account that was reported.
     60 	TargetAccount *Account `json:"target_account"`
     61 }
     62 
     63 // ReportCreateRequest models user report creation parameters.
     64 //
     65 // swagger:parameters reportCreate
     66 type ReportCreateRequest struct {
     67 	// ID of the account to report.
     68 	// example: 01GPE75FXSH2EGFBF85NXPH3KP
     69 	// in: formData
     70 	// required: true
     71 	AccountID string `form:"account_id" json:"account_id" xml:"account_id"`
     72 	// IDs of statuses to attach to the report to provide additional context.
     73 	// example: ["01GPE76N4SBVRZ8K24TW51ZZQ4","01GPE76WN9JZE62EPT3Q9FRRD4"]
     74 	// in: formData
     75 	StatusIDs []string `form:"status_ids[]" json:"status_ids" xml:"status_ids"`
     76 	// The reason for the report. Default maximum of 1000 characters.
     77 	// example: Anti-Blackness, transphobia.
     78 	// in: formData
     79 	Comment string `form:"comment" json:"comment" xml:"comment"`
     80 	// If the account is remote, should the report be forwarded to the remote admin?
     81 	// example: true
     82 	// default: false
     83 	// in: formData
     84 	Forward bool `form:"forward" json:"forward" xml:"forward"`
     85 	// Specify if the report is due to spam, violation of enumerated instance rules, or some other reason.
     86 	// Currently only 'other' is supported.
     87 	// example: other
     88 	// default: other
     89 	// in: formData
     90 	Category string `form:"category" json:"category" xml:"category"`
     91 	// IDs of rules on this instance which have been broken according to the reporter.
     92 	// This is currently not supported, provided only for API compatibility.
     93 	// example: [1, 2, 3]
     94 	// in: formData
     95 	RuleIDs []int `form:"rule_ids[]" json:"rule_ids" xml:"rule_ids"`
     96 }