common.go (3273B)
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 users 19 20 // SwaggerCollection represents an ActivityPub Collection. 21 // swagger:model swaggerCollection 22 type SwaggerCollection struct { 23 // ActivityStreams JSON-LD context. 24 // A string or an array of strings, or more 25 // complex nested items. 26 // example: https://www.w3.org/ns/activitystreams 27 Context interface{} `json:"@context"` 28 // ActivityStreams ID. 29 // example: https://example.org/users/some_user/statuses/106717595988259568/replies 30 ID string `json:"id"` 31 // ActivityStreams type. 32 // example: Collection 33 Type string `json:"type"` 34 // ActivityStreams first property. 35 First SwaggerCollectionPage `json:"first"` 36 // ActivityStreams last property. 37 Last SwaggerCollectionPage `json:"last,omitempty"` 38 } 39 40 // SwaggerCollectionPage represents one page of a collection. 41 // swagger:model swaggerCollectionPage 42 type SwaggerCollectionPage struct { 43 // ActivityStreams ID. 44 // example: https://example.org/users/some_user/statuses/106717595988259568/replies?page=true 45 ID string `json:"id"` 46 // ActivityStreams type. 47 // example: CollectionPage 48 Type string `json:"type"` 49 // Link to the next page. 50 // example: https://example.org/users/some_user/statuses/106717595988259568/replies?only_other_accounts=true&page=true 51 Next string `json:"next"` 52 // Collection this page belongs to. 53 // example: https://example.org/users/some_user/statuses/106717595988259568/replies 54 PartOf string `json:"partOf"` 55 // Items on this page. 56 // example: ["https://example.org/users/some_other_user/statuses/086417595981111564", "https://another.example.com/users/another_user/statuses/01FCN8XDV3YG7B4R42QA6YQZ9R"] 57 Items []string `json:"items"` 58 } 59 60 // SwaggerFeaturedCollection represents an ActivityPub OrderedCollection. 61 // swagger:model swaggerFeaturedCollection 62 type SwaggerFeaturedCollection struct { 63 // ActivityStreams JSON-LD context. 64 // A string or an array of strings, or more 65 // complex nested items. 66 // example: https://www.w3.org/ns/activitystreams 67 Context interface{} `json:"@context"` 68 // ActivityStreams ID. 69 // example: https://example.org/users/some_user/collections/featured 70 ID string `json:"id"` 71 // ActivityStreams type. 72 // example: OrderedCollection 73 Type string `json:"type"` 74 // List of status URIs. 75 // example: ['https://example.org/users/some_user/statuses/01GSZ0F7Q8SJKNRF777GJD271R', 'https://example.org/users/some_user/statuses/01GSZ0G012CBQ7TEKX689S3QRE'] 76 Items []string `json:"items"` 77 // Number of items in this collection. 78 // example: 2 79 TotalItems int 80 }