gtsocial-umbx

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

interfaces.go (10662B)


      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 ap
     19 
     20 import "github.com/superseriousbusiness/activity/streams/vocab"
     21 
     22 // Accountable represents the minimum activitypub interface for representing an 'account'.
     23 // This interface is fulfilled by: Person, Application, Organization, Service, and Group
     24 type Accountable interface {
     25 	WithJSONLDId
     26 	WithTypeName
     27 
     28 	WithPreferredUsername
     29 	WithIcon
     30 	WithName
     31 	WithImage
     32 	WithSummary
     33 	WithAttachment
     34 	WithSetSummary
     35 	WithDiscoverable
     36 	WithURL
     37 	WithPublicKey
     38 	WithInbox
     39 	WithOutbox
     40 	WithFollowing
     41 	WithFollowers
     42 	WithFeatured
     43 	WithManuallyApprovesFollowers
     44 	WithEndpoints
     45 	WithTag
     46 }
     47 
     48 // Statusable represents the minimum activitypub interface for representing a 'status'.
     49 // This interface is fulfilled by: Article, Document, Image, Video, Note, Page, Event, Place, Mention, Profile
     50 type Statusable interface {
     51 	WithJSONLDId
     52 	WithTypeName
     53 
     54 	WithSummary
     55 	WithSetSummary
     56 	WithName
     57 	WithSetName
     58 	WithInReplyTo
     59 	WithPublished
     60 	WithURL
     61 	WithAttributedTo
     62 	WithTo
     63 	WithCC
     64 	WithSensitive
     65 	WithConversation
     66 	WithContent
     67 	WithSetContent
     68 	WithAttachment
     69 	WithTag
     70 	WithReplies
     71 }
     72 
     73 // Attachmentable represents the minimum activitypub interface for representing a 'mediaAttachment'.
     74 // This interface is fulfilled by: Audio, Document, Image, Video
     75 type Attachmentable interface {
     76 	WithTypeName
     77 	WithMediaType
     78 	WithURL
     79 	WithName
     80 	WithSetName
     81 	WithBlurhash
     82 }
     83 
     84 // Hashtaggable represents the minimum activitypub interface for representing a 'hashtag' tag.
     85 type Hashtaggable interface {
     86 	WithTypeName
     87 	WithHref
     88 	WithName
     89 }
     90 
     91 // Emojiable represents the minimum interface for an 'emoji' tag.
     92 type Emojiable interface {
     93 	WithJSONLDId
     94 	WithTypeName
     95 	WithName
     96 	WithUpdated
     97 	WithIcon
     98 }
     99 
    100 // Mentionable represents the minimum interface for a 'mention' tag.
    101 type Mentionable interface {
    102 	WithName
    103 	WithHref
    104 }
    105 
    106 // Followable represents the minimum interface for an activitystreams 'follow' activity.
    107 type Followable interface {
    108 	WithJSONLDId
    109 	WithTypeName
    110 
    111 	WithActor
    112 	WithObject
    113 }
    114 
    115 // Likeable represents the minimum interface for an activitystreams 'like' activity.
    116 type Likeable interface {
    117 	WithJSONLDId
    118 	WithTypeName
    119 
    120 	WithActor
    121 	WithObject
    122 }
    123 
    124 // Blockable represents the minimum interface for an activitystreams 'block' activity.
    125 type Blockable interface {
    126 	WithJSONLDId
    127 	WithTypeName
    128 
    129 	WithActor
    130 	WithObject
    131 }
    132 
    133 // Announceable represents the minimum interface for an activitystreams 'announce' activity.
    134 type Announceable interface {
    135 	WithJSONLDId
    136 	WithTypeName
    137 
    138 	WithActor
    139 	WithObject
    140 	WithPublished
    141 	WithTo
    142 	WithCC
    143 }
    144 
    145 // Addressable represents the minimum interface for an addressed activity.
    146 type Addressable interface {
    147 	WithTo
    148 	WithCC
    149 }
    150 
    151 // ReplyToable represents the minimum interface for an Activity that can be InReplyTo another activity.
    152 type ReplyToable interface {
    153 	WithInReplyTo
    154 }
    155 
    156 // CollectionPageable represents the minimum interface for an activitystreams 'CollectionPage' object.
    157 type CollectionPageable interface {
    158 	WithJSONLDId
    159 	WithTypeName
    160 
    161 	WithNext
    162 	WithPartOf
    163 	WithItems
    164 }
    165 
    166 // Flaggable represents the minimum interface for an activitystreams 'Flag' activity.
    167 type Flaggable interface {
    168 	WithJSONLDId
    169 	WithTypeName
    170 
    171 	WithActor
    172 	WithContent
    173 	WithObject
    174 }
    175 
    176 // WithJSONLDId represents an activity with JSONLDIdProperty
    177 type WithJSONLDId interface {
    178 	GetJSONLDId() vocab.JSONLDIdProperty
    179 }
    180 
    181 // WithTypeName represents an activity with a type name
    182 type WithTypeName interface {
    183 	GetTypeName() string
    184 }
    185 
    186 // WithPreferredUsername represents an activity with ActivityStreamsPreferredUsernameProperty
    187 type WithPreferredUsername interface {
    188 	GetActivityStreamsPreferredUsername() vocab.ActivityStreamsPreferredUsernameProperty
    189 }
    190 
    191 // WithIcon represents an activity with ActivityStreamsIconProperty
    192 type WithIcon interface {
    193 	GetActivityStreamsIcon() vocab.ActivityStreamsIconProperty
    194 }
    195 
    196 // WithName represents an activity with ActivityStreamsNameProperty
    197 type WithName interface {
    198 	GetActivityStreamsName() vocab.ActivityStreamsNameProperty
    199 }
    200 
    201 // WithSetName represents an activity with a settable ActivityStreamsNameProperty
    202 type WithSetName interface {
    203 	SetActivityStreamsName(vocab.ActivityStreamsNameProperty)
    204 }
    205 
    206 // WithImage represents an activity with ActivityStreamsImageProperty
    207 type WithImage interface {
    208 	GetActivityStreamsImage() vocab.ActivityStreamsImageProperty
    209 }
    210 
    211 // WithSummary represents an activity with ActivityStreamsSummaryProperty
    212 type WithSummary interface {
    213 	GetActivityStreamsSummary() vocab.ActivityStreamsSummaryProperty
    214 }
    215 
    216 // WithSetSummary represents an activity that can have summary set on it.
    217 type WithSetSummary interface {
    218 	SetActivityStreamsSummary(vocab.ActivityStreamsSummaryProperty)
    219 }
    220 
    221 // WithDiscoverable represents an activity with TootDiscoverableProperty
    222 type WithDiscoverable interface {
    223 	GetTootDiscoverable() vocab.TootDiscoverableProperty
    224 }
    225 
    226 // WithURL represents an activity with ActivityStreamsUrlProperty
    227 type WithURL interface {
    228 	GetActivityStreamsUrl() vocab.ActivityStreamsUrlProperty
    229 }
    230 
    231 // WithPublicKey represents an activity with W3IDSecurityV1PublicKeyProperty
    232 type WithPublicKey interface {
    233 	GetW3IDSecurityV1PublicKey() vocab.W3IDSecurityV1PublicKeyProperty
    234 }
    235 
    236 // WithInbox represents an activity with ActivityStreamsInboxProperty
    237 type WithInbox interface {
    238 	GetActivityStreamsInbox() vocab.ActivityStreamsInboxProperty
    239 }
    240 
    241 // WithOutbox represents an activity with ActivityStreamsOutboxProperty
    242 type WithOutbox interface {
    243 	GetActivityStreamsOutbox() vocab.ActivityStreamsOutboxProperty
    244 }
    245 
    246 // WithFollowing represents an activity with ActivityStreamsFollowingProperty
    247 type WithFollowing interface {
    248 	GetActivityStreamsFollowing() vocab.ActivityStreamsFollowingProperty
    249 }
    250 
    251 // WithFollowers represents an activity with ActivityStreamsFollowersProperty
    252 type WithFollowers interface {
    253 	GetActivityStreamsFollowers() vocab.ActivityStreamsFollowersProperty
    254 }
    255 
    256 // WithFeatured represents an activity with TootFeaturedProperty
    257 type WithFeatured interface {
    258 	GetTootFeatured() vocab.TootFeaturedProperty
    259 }
    260 
    261 // WithAttributedTo represents an activity with ActivityStreamsAttributedToProperty
    262 type WithAttributedTo interface {
    263 	GetActivityStreamsAttributedTo() vocab.ActivityStreamsAttributedToProperty
    264 }
    265 
    266 // WithAttachment represents an activity with ActivityStreamsAttachmentProperty
    267 type WithAttachment interface {
    268 	GetActivityStreamsAttachment() vocab.ActivityStreamsAttachmentProperty
    269 }
    270 
    271 // WithTo represents an activity with ActivityStreamsToProperty
    272 type WithTo interface {
    273 	GetActivityStreamsTo() vocab.ActivityStreamsToProperty
    274 }
    275 
    276 // WithInReplyTo represents an activity with ActivityStreamsInReplyToProperty
    277 type WithInReplyTo interface {
    278 	GetActivityStreamsInReplyTo() vocab.ActivityStreamsInReplyToProperty
    279 }
    280 
    281 // WithCC represents an activity with ActivityStreamsCcProperty
    282 type WithCC interface {
    283 	GetActivityStreamsCc() vocab.ActivityStreamsCcProperty
    284 }
    285 
    286 // WithSensitive represents an activity with ActivityStreamsSensitiveProperty
    287 type WithSensitive interface {
    288 	GetActivityStreamsSensitive() vocab.ActivityStreamsSensitiveProperty
    289 }
    290 
    291 // WithConversation ...
    292 type WithConversation interface { // TODO
    293 }
    294 
    295 // WithContent represents an activity with ActivityStreamsContentProperty
    296 type WithContent interface {
    297 	GetActivityStreamsContent() vocab.ActivityStreamsContentProperty
    298 }
    299 
    300 // WithSetContent represents an activity that can have content set on it.
    301 type WithSetContent interface {
    302 	SetActivityStreamsContent(vocab.ActivityStreamsContentProperty)
    303 }
    304 
    305 // WithPublished represents an activity with ActivityStreamsPublishedProperty
    306 type WithPublished interface {
    307 	GetActivityStreamsPublished() vocab.ActivityStreamsPublishedProperty
    308 }
    309 
    310 // WithTag represents an activity with ActivityStreamsTagProperty
    311 type WithTag interface {
    312 	GetActivityStreamsTag() vocab.ActivityStreamsTagProperty
    313 }
    314 
    315 // WithReplies represents an activity with ActivityStreamsRepliesProperty
    316 type WithReplies interface {
    317 	GetActivityStreamsReplies() vocab.ActivityStreamsRepliesProperty
    318 }
    319 
    320 // WithMediaType represents an activity with ActivityStreamsMediaTypeProperty
    321 type WithMediaType interface {
    322 	GetActivityStreamsMediaType() vocab.ActivityStreamsMediaTypeProperty
    323 }
    324 
    325 // WithBlurhash represents an activity with TootBlurhashProperty
    326 type WithBlurhash interface {
    327 	GetTootBlurhash() vocab.TootBlurhashProperty
    328 }
    329 
    330 // type withFocalPoint interface {
    331 // 	// TODO
    332 // }
    333 
    334 // WithHref represents an activity with ActivityStreamsHrefProperty
    335 type WithHref interface {
    336 	GetActivityStreamsHref() vocab.ActivityStreamsHrefProperty
    337 }
    338 
    339 // WithUpdated represents an activity with ActivityStreamsUpdatedProperty
    340 type WithUpdated interface {
    341 	GetActivityStreamsUpdated() vocab.ActivityStreamsUpdatedProperty
    342 }
    343 
    344 // WithActor represents an activity with ActivityStreamsActorProperty
    345 type WithActor interface {
    346 	GetActivityStreamsActor() vocab.ActivityStreamsActorProperty
    347 }
    348 
    349 // WithObject represents an activity with ActivityStreamsObjectProperty
    350 type WithObject interface {
    351 	GetActivityStreamsObject() vocab.ActivityStreamsObjectProperty
    352 }
    353 
    354 // WithNext represents an activity with ActivityStreamsNextProperty
    355 type WithNext interface {
    356 	GetActivityStreamsNext() vocab.ActivityStreamsNextProperty
    357 }
    358 
    359 // WithPartOf represents an activity with ActivityStreamsPartOfProperty
    360 type WithPartOf interface {
    361 	GetActivityStreamsPartOf() vocab.ActivityStreamsPartOfProperty
    362 }
    363 
    364 // WithItems represents an activity with ActivityStreamsItemsProperty
    365 type WithItems interface {
    366 	GetActivityStreamsItems() vocab.ActivityStreamsItemsProperty
    367 }
    368 
    369 // WithManuallyApprovesFollowers represents a Person or profile with the ManuallyApprovesFollowers property.
    370 type WithManuallyApprovesFollowers interface {
    371 	GetActivityStreamsManuallyApprovesFollowers() vocab.ActivityStreamsManuallyApprovesFollowersProperty
    372 }
    373 
    374 // WithEndpoints represents a Person or profile with the endpoints property
    375 type WithEndpoints interface {
    376 	GetActivityStreamsEndpoints() vocab.ActivityStreamsEndpointsProperty
    377 }