| 
									
										
										
										
											2021-03-13 17:07:05 +01:00
										 |  |  | /* | 
					
						
							|  |  |  |    GoToSocial | 
					
						
							|  |  |  |    Copyright (C) 2021 GoToSocial Authors admin@gotosocial.org | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    This program is free software: you can redistribute it and/or modify | 
					
						
							|  |  |  |    it under the terms of the GNU Affero General Public License as published by | 
					
						
							|  |  |  |    the Free Software Foundation, either version 3 of the License, or | 
					
						
							|  |  |  |    (at your option) any later version. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |    GNU Affero General Public License for more details. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    You should have received a copy of the GNU Affero General Public License | 
					
						
							|  |  |  |    along with this program.  If not, see <http://www.gnu.org/licenses/>. | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-08 14:25:55 +02:00
										 |  |  | package model | 
					
						
							| 
									
										
										
										
											2021-03-13 17:07:05 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-23 16:35:57 +02:00
										 |  |  | import "mime/multipart" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | // Instance models information about this or another instance. | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | // swagger:model instance | 
					
						
							| 
									
										
										
										
											2021-03-13 17:07:05 +01:00
										 |  |  | type Instance struct { | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | 	// The URI of the instance. | 
					
						
							|  |  |  | 	// example: https://example.org | 
					
						
							| 
									
										
										
										
											2021-05-09 14:06:06 +02:00
										 |  |  | 	URI string `json:"uri,omitempty"` | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | 	// The title of the instance. | 
					
						
							|  |  |  | 	// example: GoToSocial Example Instance | 
					
						
							| 
									
										
										
										
											2021-05-09 14:06:06 +02:00
										 |  |  | 	Title string `json:"title,omitempty"` | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | 	// Description of the instance. | 
					
						
							|  |  |  | 	// | 
					
						
							|  |  |  | 	// Should be HTML formatted, but might be plaintext. | 
					
						
							|  |  |  | 	// | 
					
						
							|  |  |  | 	// This should be displayed on the 'about' page for an instance. | 
					
						
							| 
									
										
										
										
											2021-03-13 17:07:05 +01:00
										 |  |  | 	Description string `json:"description"` | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | 	// A shorter description of the instance. | 
					
						
							|  |  |  | 	// | 
					
						
							|  |  |  | 	// Should be HTML formatted, but might be plaintext. | 
					
						
							|  |  |  | 	// | 
					
						
							|  |  |  | 	// This should be displayed on the instance splash/landing page. | 
					
						
							| 
									
										
										
										
											2021-03-13 17:07:05 +01:00
										 |  |  | 	ShortDescription string `json:"short_description"` | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | 	// An email address that may be used for inquiries. | 
					
						
							|  |  |  | 	// example: admin@example.org | 
					
						
							| 
									
										
										
										
											2021-03-13 17:07:05 +01:00
										 |  |  | 	Email string `json:"email"` | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | 	// The version of GoToSocial installed on the instance. | 
					
						
							|  |  |  | 	// | 
					
						
							|  |  |  | 	// This will contain at least a semantic version number. | 
					
						
							|  |  |  | 	// | 
					
						
							|  |  |  | 	// It may also contain, after a space, the short git commit ID of the running software. | 
					
						
							|  |  |  | 	// | 
					
						
							|  |  |  | 	// example: 0.1.1 cb85f65 | 
					
						
							| 
									
										
										
										
											2021-05-22 15:51:20 +02:00
										 |  |  | 	Version string `json:"version"` | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | 	// Primary language of the instance. | 
					
						
							|  |  |  | 	// example: en | 
					
						
							| 
									
										
										
										
											2021-05-09 14:06:06 +02:00
										 |  |  | 	Languages []string `json:"languages,omitempty"` | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | 	// New account registrations are enabled on this instance. | 
					
						
							| 
									
										
										
										
											2021-03-13 17:07:05 +01:00
										 |  |  | 	Registrations bool `json:"registrations"` | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | 	// New account registrations require admin approval. | 
					
						
							| 
									
										
										
										
											2021-03-13 17:07:05 +01:00
										 |  |  | 	ApprovalRequired bool `json:"approval_required"` | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | 	// Invites are enabled on this instance. | 
					
						
							| 
									
										
										
										
											2021-03-13 17:07:05 +01:00
										 |  |  | 	InvitesEnabled bool `json:"invites_enabled"` | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | 	// URLs of interest for client applications. | 
					
						
							| 
									
										
										
										
											2021-05-09 14:06:06 +02:00
										 |  |  | 	URLS *InstanceURLs `json:"urls,omitempty"` | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | 	// Statistics about the instance: number of posts, accounts, etc. | 
					
						
							| 
									
										
										
										
											2021-06-23 16:35:57 +02:00
										 |  |  | 	Stats map[string]int `json:"stats,omitempty"` | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | 	// URL of the instance avatar/banner image. | 
					
						
							|  |  |  | 	// example: https://example.org/files/instance/thumbnail.jpeg | 
					
						
							| 
									
										
										
										
											2021-05-09 14:06:06 +02:00
										 |  |  | 	Thumbnail string `json:"thumbnail"` | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | 	// Contact account for the instance. | 
					
						
							| 
									
										
										
										
											2021-03-13 17:07:05 +01:00
										 |  |  | 	ContactAccount *Account `json:"contact_account,omitempty"` | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | 	// Maximum allowed length of a post on this instance, in characters. | 
					
						
							|  |  |  | 	// | 
					
						
							|  |  |  | 	// This is provided for compatibility with Tusky and other apps. | 
					
						
							|  |  |  | 	// | 
					
						
							|  |  |  | 	// example: 5000 | 
					
						
							| 
									
										
										
										
											2021-05-09 14:06:06 +02:00
										 |  |  | 	MaxTootChars uint `json:"max_toot_chars"` | 
					
						
							| 
									
										
										
										
											2021-03-13 17:07:05 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | // InstanceURLs models instance-relevant URLs for client application consumption. | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | // swagger:model instanceURLs | 
					
						
							| 
									
										
										
										
											2021-03-13 17:07:05 +01:00
										 |  |  | type InstanceURLs struct { | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | 	// Websockets address for status and notification streaming. | 
					
						
							|  |  |  | 	// example: wss://example.org | 
					
						
							| 
									
										
										
										
											2021-03-13 17:07:05 +01:00
										 |  |  | 	StreamingAPI string `json:"streaming_api"` | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-02 19:06:44 +02:00
										 |  |  | // InstanceSettingsUpdateRequest models an instance update request. | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | // swagger:ignore | 
					
						
							| 
									
										
										
										
											2021-06-23 16:35:57 +02:00
										 |  |  | type InstanceSettingsUpdateRequest struct { | 
					
						
							| 
									
										
										
										
											2021-07-08 15:05:19 +02:00
										 |  |  | 	// Title to use for the instance. Max 40 characters. | 
					
						
							|  |  |  | 	Title *string `form:"title" json:"title" xml:"title"` | 
					
						
							|  |  |  | 	// Username for the instance contact account. Must be the username of an existing admin. | 
					
						
							|  |  |  | 	ContactUsername *string `form:"contact_username" json:"contact_username" xml:"contact_username"` | 
					
						
							|  |  |  | 	// Email for reaching the instance administrator(s). | 
					
						
							|  |  |  | 	ContactEmail *string `form:"contact_email" json:"contact_email" xml:"contact_email"` | 
					
						
							|  |  |  | 	// Short description of the instance, max 500 chars. HTML formatting accepted. | 
					
						
							|  |  |  | 	ShortDescription *string `form:"short_description" json:"short_description" xml:"short_description"` | 
					
						
							|  |  |  | 	// Longer description of the instance, max 5,000 chars. HTML formatting accepted. | 
					
						
							|  |  |  | 	Description *string `form:"description" json:"description" xml:"description"` | 
					
						
							|  |  |  | 	// Terms and conditions of the instance, max 5,000 chars. HTML formatting accepted. | 
					
						
							|  |  |  | 	Terms *string `form:"terms" json:"terms" xml:"terms"` | 
					
						
							|  |  |  | 	// Image to use as the instance thumbnail. | 
					
						
							|  |  |  | 	Avatar *multipart.FileHeader `form:"avatar" json:"avatar" xml:"avatar"` | 
					
						
							|  |  |  | 	// Image to use as the instance header. | 
					
						
							|  |  |  | 	Header *multipart.FileHeader `form:"header" json:"header" xml:"header"` | 
					
						
							| 
									
										
										
										
											2021-06-23 16:35:57 +02:00
										 |  |  | } |