model

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	// The account id.
	// example: 01FBVD42CQ3ZEEVMW180SBX03B
	ID string `json:"id"`
	// The username of the account, not including domain.
	// example: some_user
	Username string `json:"username"`
	// The account URI as discovered via webfinger.
	// Equal to username for local users, or username@domain for remote users.
	// example: some_user@example.org
	Acct string `json:"acct"`
	// The account's display name.
	// example: big jeff (he/him)
	DisplayName string `json:"display_name"`
	// Account manually approves follow requests.
	Locked bool `json:"locked"`
	// Account has opted into discovery features.
	Discoverable bool `json:"discoverable"`
	// Account identifies as a bot.
	Bot bool `json:"bot"`
	// When the account was created (ISO 8601 Datetime).
	// example: 2021-07-30T09:20:25+00:00
	CreatedAt string `json:"created_at"`
	// Bio/description of this account.
	Note string `json:"note"`
	// Web location of the account's profile page.
	// example: https://example.org/@some_user
	URL string `json:"url"`
	// Web location of the account's avatar.
	// example: https://example.org/media/some_user/avatar/original/avatar.jpeg
	Avatar string `json:"avatar"`
	// Web location of a static version of the account's avatar.
	// Only relevant when the account's main avatar is a video or a gif.
	// example: https://example.org/media/some_user/avatar/static/avatar.png
	AvatarStatic string `json:"avatar_static"`
	// Web location of the account's header image.
	// example: https://example.org/media/some_user/header/original/header.jpeg
	Header string `json:"header"`
	// Web location of a static version of the account's header.
	// Only relevant when the account's main header is a video or a gif.
	// example: https://example.org/media/some_user/header/static/header.png
	HeaderStatic string `json:"header_static"`
	// Number of accounts following this account, according to our instance.
	FollowersCount int `json:"followers_count"`
	// Number of account's followed by this account, according to our instance.
	FollowingCount int `json:"following_count"`
	// Number of statuses posted by this account, according to our instance.
	StatusesCount int `json:"statuses_count"`
	// When the account's most recent status was posted (ISO 8601 Datetime).
	// example: 2021-07-30T09:20:25+00:00
	LastStatusAt *string `json:"last_status_at"`
	// Array of custom emojis used in this account's note or display name.
	Emojis []Emoji `json:"emojis"`
	// Additional metadata attached to this account's profile.
	Fields []Field `json:"fields"`
	// Account has been suspended by our instance.
	Suspended bool `json:"suspended,omitempty"`
	// If this account has been muted, when will the mute expire (ISO 8601 Datetime).
	// example: 2021-07-30T09:20:25+00:00
	MuteExpiresAt string `json:"mute_expires_at,omitempty"`
	// Extra profile information. Shown only if the requester owns the account being requested.
	Source *Source `json:"source,omitempty"`
	// CustomCSS to include when rendering this account's profile or statuses.
	CustomCSS string `json:"custom_css,omitempty"`
	// Account has enabled RSS feed.
	EnableRSS bool `json:"enable_rss,omitempty"`
	// Role of the account on this instance.
	// Omitted for remote accounts.
	Role *AccountRole `json:"role,omitempty"`
}

Account models a fediverse account.

The modelled account can be either a remote account, or one on this instance.

swagger:model account

type AccountCreateRequest

type AccountCreateRequest struct {
	// Text that will be reviewed by moderators if registrations require manual approval.
	Reason string `form:"reason" json:"reason" xml:"reason"`
	// The desired username for the account.
	// swagger:parameters
	// pattern: [a-z0-9_]{2,64}
	// example: a_valid_username
	// required: true
	Username string `form:"username" json:"username" xml:"username" binding:"required"`
	// The email address to be used for login.
	// swagger:parameters
	// example: someone@wherever.com
	// required: true
	Email string `form:"email" json:"email" xml:"email" binding:"required"`
	// The password to be used for login. This will be hashed before storage.
	// swagger:parameters
	// example: some_really_really_really_strong_password
	// required: true
	Password string `form:"password" json:"password" xml:"password" binding:"required"`
	// The user agrees to the terms, conditions, and policies of the instance.
	// swagger:parameters
	// required: true
	Agreement bool `form:"agreement"  json:"agreement" xml:"agreement" binding:"required"`
	// The language of the confirmation email that will be sent.
	// swagger:parameters
	// example: en
	// Required: true
	Locale string `form:"locale" json:"locale" xml:"locale" binding:"required"`
	// The IP of the sign up request, will not be parsed from the form.
	// swagger:parameters
	// swagger:ignore
	IP net.IP `form:"-"`
}

AccountCreateRequest models account creation parameters.

swagger:parameters accountCreate

type AccountDeleteRequest added in v0.2.2

type AccountDeleteRequest struct {
	// Password of the account's user, for confirmation.
	Password string `form:"password" json:"password" xml:"password"`
}

AccountDeleteRequest models a request to delete an account.

swagger:ignore

type AccountFollowRequest

type AccountFollowRequest struct {
	// The id of the account to follow.
	ID string `form:"-" json:"-" xml:"-"`
	// Show reblogs from this account.
	Reblogs *bool `form:"reblogs" json:"reblogs" xml:"reblogs"`
	// Notify when this account posts.
	Notify *bool `form:"notify" json:"notify" xml:"notify"`
}

AccountFollowRequest models a request to follow an account.

swagger:ignore

type AccountNoteRequest added in v0.11.0

type AccountNoteRequest struct {
	// Comment to use for the note text.
	Comment string `form:"comment" json:"comment" xml:"comment"`
}

AccountNoteRequest models a request to update the private note for an account.

swagger:ignore

type AccountRole added in v0.6.0

type AccountRole struct {
	Name AccountRoleName `json:"name"`
}

AccountRole models the role of an account.

swagger:model accountRole

type AccountRoleName added in v0.7.1

type AccountRoleName string

AccountRoleName represent the name of the role of an account.

swagger:type string

const (
	AccountRoleUser      AccountRoleName = "user"      // Standard user
	AccountRoleModerator AccountRoleName = "moderator" // Moderator privileges
	AccountRoleAdmin     AccountRoleName = "admin"     // Instance admin
	AccountRoleUnknown   AccountRoleName = ""          // We don't know / remote account
)

type AdminAccountActionRequest added in v0.2.2

type AdminAccountActionRequest struct {
	// Type of the account action. One of disable, silence, suspend.
	Type string `form:"type" json:"type" xml:"type"`
	// Text describing why an action was taken.
	Text string `form:"text" json:"text" xml:"text"`
	// ID of the account to be acted on.
	TargetAccountID string `form:"-" json:"-" xml:"-"`
}

AdminAccountActionRequest models the admin view of an account's details.

swagger:ignore

type AdminAccountInfo

type AdminAccountInfo struct {
	// The ID of the account in the database.
	// example: 01GQ4PHNT622DQ9X95XQX4KKNR
	ID string `json:"id"`
	// The username of the account.
	// example: dril
	Username string `json:"username"`
	// The domain of the account.
	// Null for local accounts.
	// example: example.org
	Domain *string `json:"domain"`
	// When the account was first discovered. (ISO 8601 Datetime)
	// example: 2021-07-30T09:20:25+00:00
	CreatedAt string `json:"created_at"`
	// The email address associated with the account.
	// Empty string for remote accounts or accounts with
	// no known email address.
	// example: someone@somewhere.com
	Email string `json:"email"`
	// The IP address last used to login to this account.
	// Null if not known.
	// example: 192.0.2.1
	IP *string `json:"ip"`
	// All known IP addresses associated with this account.
	// NOT IMPLEMENTED (will always be empty array).
	// example: []
	IPs []interface{} `json:"ips"`
	// The locale of the account. (ISO 639 Part 1 two-letter language code)
	// example: en
	Locale string `json:"locale"`
	// The reason given when requesting an invite.
	// Null if not known / remote account.
	// example: Pleaaaaaaaaaaaaaaase!!
	InviteRequest *string `json:"invite_request"`
	// The current role of the account.
	Role AccountRole `json:"role"`
	// Whether the account has confirmed their email address.
	Confirmed bool `json:"confirmed"`
	// Whether the account is currently approved.
	Approved bool `json:"approved"`
	// Whether the account is currently disabled.
	Disabled bool `json:"disabled"`
	// Whether the account is currently silenced
	Silenced bool `json:"silenced"`
	// Whether the account is currently suspended.
	Suspended bool `json:"suspended"`
	// User-level information about the account.
	Account *Account `json:"account"`
	// The ID of the application that created this account.
	CreatedByApplicationID string `json:"created_by_application_id,omitempty"`
	// The ID of the account that invited this user
	InvitedByAccountID string `json:"invited_by_account_id,omitempty"`
}

AdminAccountInfo models the admin view of an account's details.

swagger:model adminAccountInfo

type AdminEmoji added in v0.6.0

type AdminEmoji struct {
	Emoji
	// The ID of the emoji.
	// example: 01GEM7SFDZ7GZNRXFVZ3X4E4N1
	ID string `json:"id"`
	// True if this emoji has been disabled by an admin action.
	// example: false
	Disabled bool `json:"disabled"`
	// The domain from which the emoji originated. Only defined for remote domains, otherwise key will not be set.
	//
	// example: example.org
	Domain string `json:"domain,omitempty"`
	// Time when the emoji image was last updated.
	// example: 2022-10-05T09:21:26.419Z
	UpdatedAt string `json:"updated_at"`
	// The total file size taken up by the emoji in bytes, including static and animated versions.
	// example: 69420
	TotalFileSize int `json:"total_file_size"`
	// The MIME content type of the emoji.
	// example: image/png
	ContentType string `json:"content_type"`
	// The ActivityPub URI of the emoji.
	// example: https://example.org/emojis/016T5Q3SQKBT337DAKVSKNXXW1
	URI string `json:"uri"`
}

AdminEmoji models the admin view of a custom emoji.

swagger:model adminEmoji

type AdminReport added in v0.7.0

type AdminReport struct {
	// ID of the report.
	// example: 01FBVD42CQ3ZEEVMW180SBX03B
	ID string `json:"id"`
	// Whether an action has been taken by an admin in response to this report.
	// example: false
	ActionTaken bool `json:"action_taken"`
	// If an action was taken, at what time was this done? (ISO 8601 Datetime)
	// Will be null if not set / no action yet taken.
	// example: 2021-07-30T09:20:25+00:00
	ActionTakenAt *string `json:"action_taken_at"`
	// Under what category was this report created?
	// example: spam
	Category string `json:"category"`
	// Comment submitted when the report was created.
	// Will be empty if no comment was submitted.
	// example: This person has been harassing me.
	Comment string `json:"comment"`
	// Bool to indicate that report should be federated to remote instance.
	// example: true
	Forwarded bool `json:"forwarded"`
	// The date when this report was created (ISO 8601 Datetime).
	// example: 2021-07-30T09:20:25+00:00
	CreatedAt string `json:"created_at"`
	// Time of last action on this report (ISO 8601 Datetime).
	// example: 2021-07-30T09:20:25+00:00
	UpdatedAt string `json:"updated_at"`
	// The account that created the report.
	Account *AdminAccountInfo `json:"account"`
	// Account that was reported.
	TargetAccount *AdminAccountInfo `json:"target_account"`
	// The account assigned to handle the report.
	// Null if no account assigned.
	AssignedAccount *AdminAccountInfo `json:"assigned_account"`
	// Account that took admin action (if any).
	// Null if no action (yet) taken.
	ActionTakenByAccount *AdminAccountInfo `json:"action_taken_by_account"`
	// Array of  statuses that were submitted along with this report.
	// Will be empty if no status IDs were submitted with the report.
	Statuses []*Status `json:"statuses"`
	// Array of rule IDs that were submitted along with this report.
	// NOT IMPLEMENTED, will always be empty array.
	Rules []interface{} `json:"rule_ids"`
	// If an action was taken, what comment was made by the admin on the taken action?
	// Will be null if not set / no action yet taken.
	// example: Account was suspended.
	ActionTakenComment *string `json:"action_taken_comment"`
}

AdminReport models the admin view of a report.

swagger:model adminReport

type AdminReportResolveRequest added in v0.7.0

type AdminReportResolveRequest struct {
	// Comment to show to the creator of the report when an admin marks it as resolved.
	ActionTakenComment *string `form:"action_taken_comment" json:"action_taken_comment" xml:"action_taken_comment"`
}

AdminReportResolveRequest can be submitted along with a POST to /api/v1/admin/reports/{id}/resolve

swagger:ignore

type AdminSendTestEmailRequest added in v0.8.0

type AdminSendTestEmailRequest struct {
	// Email address to send the test email to.
	Email string `form:"email" json:"email" xml:"email"`
}

AdminSendTestEmailRequest models a test email send request (woah).

type AdvancedStatusCreateForm

type AdvancedStatusCreateForm struct {
	StatusCreateRequest
	AdvancedVisibilityFlagsForm
}

AdvancedStatusCreateForm wraps the mastodon-compatible status create form along with the GTS advanced visibility settings.

swagger:parameters statusCreate

type AdvancedVisibilityFlagsForm

type AdvancedVisibilityFlagsForm struct {
	// This status will be federated beyond the local timeline(s).
	Federated *bool `form:"federated" json:"federated" xml:"federated"`
	// This status can be boosted/reblogged.
	Boostable *bool `form:"boostable" json:"boostable" xml:"boostable"`
	// This status can be replied to.
	Replyable *bool `form:"replyable" json:"replyable" xml:"replyable"`
	// This status can be liked/faved.
	Likeable *bool `form:"likeable" json:"likeable" xml:"likeable"`
}

AdvancedVisibilityFlagsForm allows a few more advanced flags to be set on new statuses, in addition to the standard mastodon-compatible ones.

swagger:model advancedVisibilityFlagsForm

type Announcement

type Announcement struct {
	// The ID of the announcement.
	// example: 01FC30T7X4TNCZK0TH90QYF3M4
	ID string `json:"id"`
	// The body of the announcement.
	// Should be HTML formatted.
	// example: <p>This is an announcement. No malarky.</p>
	Content string `json:"content"`
	// When the announcement should begin to be displayed (ISO 8601 Datetime).
	// If the announcement has no start time, this will be omitted or empty.
	// example: 2021-07-30T09:20:25+00:00
	StartsAt string `json:"starts_at"`
	// When the announcement should stop being displayed (ISO 8601 Datetime).
	// If the announcement has no end time, this will be omitted or empty.
	// example: 2021-07-30T09:20:25+00:00
	EndsAt string `json:"ends_at"`
	// Announcement doesn't have begin time and end time, but begin day and end day.
	AllDay bool `json:"all_day"`
	// When the announcement was first published (ISO 8601 Datetime).
	// example: 2021-07-30T09:20:25+00:00
	PublishedAt string `json:"published_at"`
	// When the announcement was last updated (ISO 8601 Datetime).
	// example: 2021-07-30T09:20:25+00:00
	UpdatedAt string `json:"updated_at"`
	// Announcement is 'published', ie., visible to users.
	// Announcements that are not published should be shown only to admins.
	Published bool `json:"published"`
	// Requesting account has seen this announcement.
	Read bool `json:"read"`
	// Mentions this announcement contains.
	Mentions []Mention `json:"mentions"`
	// Statuses contained in this announcement.
	Statuses []Status `json:"statuses"`
	// Tags used in this announcement.
	Tags []Tag `json:"tags"`
	// Emojis used in this announcement.
	Emojis []Emoji `json:"emoji"`
	// Reactions to this announcement.
	Reactions []AnnouncementReaction `json:"reactions"`
}

Announcement models an admin announcement for the instance.

swagger:model announcement

type AnnouncementReaction

type AnnouncementReaction struct {
	// The emoji used for the reaction. Either a unicode emoji, or a custom emoji's shortcode.
	// example: blobcat_uwu
	Name string `json:"name"`
	// The total number of users who have added this reaction.
	// example: 5
	Count int `json:"count"`
	// This reaction belongs to the account viewing it.
	Me bool `json:"me"`
	// Web link to the image of the custom emoji.
	// Empty for unicode emojis.
	// example: https://example.org/custom_emojis/original/blobcat_uwu.png
	URL string `json:"url,omitempty"`
	// Web link to a non-animated image of the custom emoji.
	// Empty for unicode emojis.
	// example: https://example.org/custom_emojis/statuc/blobcat_uwu.png
	StaticURL string `json:"static_url,omitempty"`
}

AnnouncementReaction models a user reaction to an announcement.

swagger:model announcementReaction

type Application

type Application struct {
	// The ID of the application.
	// example: 01FBVD42CQ3ZEEVMW180SBX03B
	ID string `json:"id,omitempty"`
	// The name of the application.
	// example: Tusky
	Name string `json:"name"`
	// The website associated with the application (url)
	// example: https://tusky.app
	Website string `json:"website,omitempty"`
	// Post-authorization redirect URI for the application (OAuth2).
	// example: https://example.org/callback?some=query
	RedirectURI string `json:"redirect_uri,omitempty"`
	// Client ID associated with this application.
	ClientID string `json:"client_id,omitempty"`
	// Client secret associated with this application.
	ClientSecret string `json:"client_secret,omitempty"`
	// Push API key for this application.
	VapidKey string `json:"vapid_key,omitempty"`
}

Application models an api application.

swagger:model application

type ApplicationCreateRequest

type ApplicationCreateRequest struct {
	// The name of the application.
	//
	// in: formData
	// required: true
	ClientName string `form:"client_name" json:"client_name" xml:"client_name" binding:"required"`
	// Where the user should be redirected after authorization.
	//
	// To display the authorization code to the user instead of redirecting to a web page, use `urn:ietf:wg:oauth:2.0:oob` in this parameter.
	//
	// in: formData
	// required: true
	RedirectURIs string `form:"redirect_uris" json:"redirect_uris" xml:"redirect_uris" binding:"required"`
	// Space separated list of scopes.
	//
	// If no scopes are provided, defaults to `read`.
	//
	// in: formData
	Scopes string `form:"scopes" json:"scopes" xml:"scopes"`
	// A URL to the web page of the app (optional).
	//
	// in: formData
	Website string `form:"website" json:"website" xml:"website"`
}

ApplicationCreateRequest models app create parameters.

swagger:parameters appCreate

type Attachment

type Attachment struct {
	// The ID of the attachment.
	// example: 01FC31DZT1AYWDZ8XTCRWRBYRK
	ID string `json:"id"`
	// The type of the attachment.
	// enum:
	//   - unknown
	//   - image
	//   - gifv
	//   - video
	//   - audio
	// example: image
	Type string `json:"type"`
	// The location of the original full-size attachment.
	// example: https://example.org/fileserver/some_id/attachments/some_id/original/attachment.jpeg
	URL *string `json:"url"`
	// A shorter URL for the attachment.
	// In our case, we just give the URL again since we don't create smaller URLs.
	TextURL string `json:"text_url"`
	// The location of a scaled-down preview of the attachment.
	// example: https://example.org/fileserver/some_id/attachments/some_id/small/attachment.jpeg
	PreviewURL string `json:"preview_url"`
	// The location of the full-size original attachment on the remote server.
	// Only defined for instances other than our own.
	// example: https://some-other-server.org/attachments/original/ahhhhh.jpeg
	RemoteURL *string `json:"remote_url"`
	// The location of a scaled-down preview of the attachment on the remote server.
	// Only defined for instances other than our own.
	// example: https://some-other-server.org/attachments/small/ahhhhh.jpeg
	PreviewRemoteURL *string `json:"preview_remote_url"`
	// Metadata for this attachment.
	Meta MediaMeta `json:"meta,omitempty"`
	// Alt text that describes what is in the media attachment.
	// example: This is a picture of a kitten.
	Description *string `json:"description"`
	// A hash computed by the BlurHash algorithm, for generating colorful preview thumbnails when media has not been downloaded yet.
	// See https://github.com/woltapp/blurhash
	Blurhash string `json:"blurhash,omitempty"`
}

Attachment models a media attachment.

swagger:model attachment

type AttachmentRequest

type AttachmentRequest struct {
	// Media file.
	File *multipart.FileHeader `form:"file" binding:"required"`
	// Description of the media file. Optional.
	// This will be used as alt-text for users of screenreaders etc.
	// example: This is an image of some kittens, they are very cute and fluffy.
	Description string `form:"description"`
	// Focus of the media file. Optional.
	// If present, it should be in the form of two comma-separated floats between -1 and 1.
	// example: -0.5,0.565
	Focus string `form:"focus"`
}

AttachmentRequest models media attachment creation parameters.

swagger: ignore

type AttachmentUpdateRequest

type AttachmentUpdateRequest struct {
	// Description of the media file.
	// This will be used as alt-text for users of screenreaders etc.
	// allowEmptyValue: true
	Description *string `form:"description" json:"description" xml:"description"`
	// Focus of the media file.
	// If present, it should be in the form of two comma-separated floats between -1 and 1.
	// allowEmptyValue: true
	Focus *string `form:"focus" json:"focus" xml:"focus"`
}

AttachmentUpdateRequest models an update request for an attachment.

swagger:ignore

type BlocksResponse

type BlocksResponse struct {
	Accounts   []*Account
	LinkHeader string
}

BlocksResponse wraps a slice of accounts, ready to be serialized, along with the Link header for the previous and next queries, to be returned to the client.

type Card

type Card struct {
	// Location of linked resource.
	// example: https://buzzfeed.com/some/fuckin/buzzfeed/article
	URL string `json:"url"`
	// Title of linked resource.
	// example: Buzzfeed - Is Water Wet?
	Title string `json:"title"`
	// Description of preview.
	// example: Is water wet? We're not sure. In this article, we ask an expert...
	Description string `json:"description"`
	// The type of the preview card.
	// enum:
	// - link
	// - photo
	// - video
	// - rich
	// example: link
	Type string `json:"type"`
	// The author of the original resource.
	// example: weewee@buzzfeed.com
	AuthorName string `json:"author_name"`
	// A link to the author of the original resource.
	// example: https://buzzfeed.com/authors/weewee
	AuthorURL string `json:"author_url"`
	// The provider of the original resource.
	// example: Buzzfeed
	ProviderName string `json:"provider_name"`
	// A link to the provider of the original resource.
	// example: https://buzzfeed.com
	ProviderURL string `json:"provider_url"`
	// HTML to be used for generating the preview card.
	HTML string `json:"html"`
	// Width of preview, in pixels.
	Width int `json:"width"`
	// Height of preview, in pixels.
	Height int `json:"height"`
	// Preview thumbnail.
	// example: https://example.org/fileserver/preview/thumb.jpg
	Image string `json:"image"`
	// Used for photo embeds, instead of custom html.
	EmbedURL string `json:"embed_url"`
	// A hash computed by the BlurHash algorithm, for generating colorful preview thumbnails when media has not been downloaded yet.
	Blurhash string `json:"blurhash"`
}

Card represents a rich preview card that is generated using OpenGraph tags from a URL.

swagger:model card

type Content

type Content struct {
	// MIME content type
	ContentType string
	// ContentLength in bytes
	ContentLength int64
	// Time when the content was last updated.
	ContentUpdated time.Time
	// Actual content
	Content io.ReadCloser
	// Resource URL to forward to if the file can be fetched from the storage directly (e.g signed S3 URL)
	URL *storage.PresignedURL
}

Content wraps everything needed to serve a blob of content (some kind of media) through the API.

type Context

type Context struct {
	// Parents in the thread.
	Ancestors []Status `json:"ancestors"`
	// Children in the thread.
	Descendants []Status `json:"descendants"`
}

Context models the tree around a given status.

swagger:model statusContext

type Conversation

type Conversation struct {

	// Local database ID of the conversation.
	ID string `json:"id"`
	// Participants in the conversation.
	Accounts []Account `json:"accounts"`
	// Is the conversation currently marked as unread?
	Unread bool `json:"unread"`

	// The last status in the conversation, to be used for optional display.
	LastStatus *Status `json:"last_status"`
}

Conversation represents a conversation with "direct message" visibility.

type Domain added in v0.3.7

type Domain struct {
	// The hostname of the domain.
	// example: example.org
	Domain string `form:"domain" json:"domain" validate:"required"`
	// Time at which this domain was suspended. Key will not be present on open domains.
	// example: 2021-07-30T09:20:25+00:00
	SuspendedAt string `json:"suspended_at,omitempty"`
	// Time at which this domain was silenced. Key will not be present on open domains.
	// example: 2021-07-30T09:20:25+00:00
	SilencedAt string `json:"silenced_at,omitempty"`
	// If the domain is blocked, what's the publicly-stated reason for the block.
	// example: they smell
	PublicComment string `form:"public_comment" json:"public_comment,omitempty"`
}

Domain represents a remote domain

swagger:model domain

type DomainBlock

type DomainBlock struct {
	Domain
	// The ID of the domain block.
	// example: 01FBW21XJA09XYX51KV5JVBW0F
	// readonly: true
	ID string `json:"id,omitempty"`
	// Obfuscate the domain name when serving this domain block publicly.
	// A useful anti-harassment tool.
	// example: false
	Obfuscate bool `json:"obfuscate,omitempty"`
	// Private comment for this block, visible to our instance admins only.
	// example: they are poopoo
	PrivateComment string `json:"private_comment,omitempty"`
	// The ID of the subscription that created/caused this domain block.
	// example: 01FBW25TF5J67JW3HFHZCSD23K
	SubscriptionID string `json:"subscription_id,omitempty"`
	// ID of the account that created this domain block.
	// example: 01FBW2758ZB6PBR200YPDDJK4C
	CreatedBy string `json:"created_by,omitempty"`
	// Time at which this block was created (ISO 8601 Datetime).
	// example: 2021-07-30T09:20:25+00:00
	CreatedAt string `json:"created_at,omitempty"`
}

DomainBlock represents a block on one domain

swagger:model domainBlock

type DomainBlockCreateRequest

type DomainBlockCreateRequest struct {
	// A list of domains to block. Only used if import=true is specified.
	Domains *multipart.FileHeader `form:"domains" json:"domains" xml:"domains"`
	// hostname/domain to block
	Domain string `form:"domain" json:"domain" xml:"domain"`
	// whether the domain should be obfuscated when being displayed publicly
	Obfuscate bool `form:"obfuscate" json:"obfuscate" xml:"obfuscate"`
	// private comment for other admins on why the domain was blocked
	PrivateComment string `form:"private_comment" json:"private_comment" xml:"private_comment"`
	// public comment on the reason for the domain block
	PublicComment string `form:"public_comment" json:"public_comment" xml:"public_comment"`
}

DomainBlockCreateRequest is the form submitted as a POST to /api/v1/admin/domain_blocks to create a new block.

swagger:model domainBlockCreateRequest

type Emoji

type Emoji struct {
	// The name of the custom emoji.
	// example: blobcat_uwu
	Shortcode string `json:"shortcode"`
	// Web URL of the custom emoji.
	// example: https://example.org/fileserver/emojis/blogcat_uwu.gif
	URL string `json:"url"`
	// A link to a static copy of the custom emoji.
	// example: https://example.org/fileserver/emojis/blogcat_uwu.png
	StaticURL string `json:"static_url"`
	// Emoji is visible in the emoji picker of the instance.
	// example: true
	VisibleInPicker bool `json:"visible_in_picker"`
	// Used for sorting custom emoji in the picker.
	// example: blobcats
	Category string `json:"category,omitempty"`
}

Emoji represents a custom emoji.

swagger:model emoji

type EmojiCategory added in v0.6.0

type EmojiCategory struct {
	// The ID of the custom emoji category.
	ID string `json:"id"`
	// The name of the custom emoji category.
	Name string `json:"name"`
}

EmojiCategory represents a custom emoji category.

swagger:model emojiCategory

type EmojiCreateRequest

type EmojiCreateRequest struct {
	// Desired shortcode for the emoji, without surrounding colons. This must be unique for the domain.
	// example: blobcat_uwu
	Shortcode string `form:"shortcode" validation:"required"`
	// Image file to use for the emoji. Must be png or gif and no larger than 50kb.
	Image *multipart.FileHeader `form:"image" validation:"required"`
	// Category in which to place the new emoji. Will be uncategorized by default.
	// CategoryName length should not exceed 64 characters.
	CategoryName string `form:"category"`
}

EmojiCreateRequest represents a request to create a custom emoji made through the admin API.

swagger:model emojiCreateRequest

type EmojiUpdateRequest added in v0.6.0

type EmojiUpdateRequest struct {
	// Type of action. One of disable, modify, copy.
	Type EmojiUpdateType `form:"type" json:"type" xml:"type"`
	// Desired shortcode for the emoji, without surrounding colons. This must be unique for the domain.
	// example: blobcat_uwu
	Shortcode *string `form:"shortcode"`
	// Image file to use for the emoji.
	// Must be png or gif and no larger than 50kb.
	Image *multipart.FileHeader `form:"image"`
	// Category in which to place the emoji.
	CategoryName *string `form:"category"`
}

EmojiUpdateRequest represents a request to update a custom emoji, made through the admin API.

swagger:model emojiUpdateRequest

type EmojiUpdateType added in v0.6.0

type EmojiUpdateType string

EmojiUpdateType models an admin update action to take on a custom emoji.

const (
	EmojiUpdateModify  EmojiUpdateType = "modify"  // modify local emoji
	EmojiUpdateDisable EmojiUpdateType = "disable" // disable remote emoji
	EmojiUpdateCopy    EmojiUpdateType = "copy"    // copy remote emoji -> local
)

type FeaturedTag

type FeaturedTag struct {
	// The internal ID of the featured tag in the database.
	ID string `json:"id"`
	// The name of the hashtag being featured.
	Name string `json:"name"`
	// A link to all statuses by a user that contain this hashtag.
	URL string `json:"url"`
	// The number of authored statuses containing this hashtag.
	StatusesCount int `json:"statuses_count"`
	// The timestamp of the last authored status containing this hashtag. (ISO 8601 Datetime)
	LastStatusAt string `json:"last_status_at"`
}

FeaturedTag represents a hashtag that is featured on a profile.

type Field

type Field struct {
	// The key/name of this field.
	// example: pronouns
	Name string `json:"name"`
	// The value of this field.
	// example: they/them
	Value string `json:"value"`
	// If this field has been verified, when did this occur? (ISO 8601 Datetime).
	// example: 2021-07-30T09:20:25+00:00
	VerifiedAt *string `json:"verified_at"`
}

Field represents a name/value pair to display on an account's profile.

swagger:model field

type Filter

type Filter struct {
	// The ID of the filter in the database.
	ID string `json:"id"`
	// The text to be filtered.
	Phrase string `json:"text"`
	// The contexts in which the filter should be applied.
	// Array of String (Enumerable anyOf)
	// 	home = home timeline and lists
	// 	notifications = notifications timeline
	// 	public = public timelines
	// 	thread = expanded thread of a detailed status
	Context []string `json:"context"`
	// Should the filter consider word boundaries?
	WholeWord bool `json:"whole_word"`
	// When the filter should no longer be applied (ISO 8601 Datetime), or null if the filter does not expire
	ExpiresAt string `json:"expires_at,omitempty"`
	// Should matching entities in home and notifications be dropped by the server?
	Irreversible bool `json:"irreversible"`
}

Filter represents a user-defined filter for determining which statuses should not be shown to the user. If whole_word is true , client app should do: Define ‘word constituent character’ for your app. In the official implementation, it’s [A-Za-z0-9_] in JavaScript, and [[:word:]] in Ruby. Ruby uses the POSIX character class (Letter | Mark | Decimal_Number | Connector_Punctuation). If the phrase starts with a word character, and if the previous character before matched range is a word character, its matched range should be treated to not match. If the phrase ends with a word character, and if the next character after matched range is a word character, its matched range should be treated to not match. Please check app/javascript/mastodon/selectors/index.js and app/lib/feed_manager.rb in the Mastodon source code for more details.

type GetContentRequestForm

type GetContentRequestForm struct {
	// AccountID of the content owner
	AccountID string
	// MediaType of the content (should be convertible to a media.MediaType)
	MediaType string
	// MediaSize of the content (should be convertible to a media.MediaSize)
	MediaSize string
	// Filename of the content
	FileName string
}

GetContentRequestForm describes a piece of content desired by the caller of the fileserver API.

type History

type History struct {
	// UNIX timestamp on midnight of the given day (string cast from integer).
	Day string `json:"day"`
	// The counted usage of the tag within that day (string cast from integer).
	Uses string `json:"uses"`
	// The total of accounts using the tag within that day (string cast from integer).
	Accounts string `json:"accounts"`
}

History represents daily usage history of a hashtag.

type HostMeta added in v0.8.0

type HostMeta struct {
	XMLName xml.Name `xml:"XRD"`
	XMLNS   string   `xml:"xmlns,attr"`
	Link    []Link   `xml:"Link"`
}

HostMeta represents a hostmeta document. See: https://www.rfc-editor.org/rfc/rfc6415.html#section-3

swagger:model hostmeta

type InstanceConfigurationAccounts added in v0.5.0

type InstanceConfigurationAccounts struct {
	// Whether or not accounts on this instance are allowed to upload custom CSS for profiles and statuses.
	//
	// example: false
	AllowCustomCSS bool `json:"allow_custom_css"`
	// The maximum number of featured tags allowed for each account.
	// Currently not implemented, so this is hardcoded to 10.
	MaxFeaturedTags int `json:"max_featured_tags"`
	// The maximum number of profile fields allowed for each account.
	// Currently not configurable, so this is hardcoded to 6. (https://github.com/superseriousbusiness/gotosocial/issues/1876)
	MaxProfileFields int `json:"max_profile_fields"`
}

InstanceConfigurationAccounts models instance account config parameters.

swagger:model instanceConfigurationAccounts

type InstanceConfigurationEmojis added in v0.6.0

type InstanceConfigurationEmojis struct {
	// Max allowed emoji image size in bytes.
	//
	// example: 51200
	EmojiSizeLimit int `json:"emoji_size_limit"`
}

InstanceConfigurationEmojis models instance emoji config parameters.

type InstanceConfigurationMediaAttachments added in v0.3.7

type InstanceConfigurationMediaAttachments struct {
	// List of mime types that it's possible to upload to this instance.
	//
	// example: ["image/jpeg","image/gif"]
	SupportedMimeTypes []string `json:"supported_mime_types"`
	// Max allowed image size in bytes
	//
	// example: 2097152
	ImageSizeLimit int `json:"image_size_limit"`
	// Max allowed image size in pixels as height*width.
	//
	// GtS doesn't set a limit on this, but for compatibility
	// we give Mastodon's 4096x4096px value here.
	//
	// example: 16777216
	ImageMatrixLimit int `json:"image_matrix_limit"`
	// Max allowed video size in bytes
	//
	// example: 10485760
	VideoSizeLimit int `json:"video_size_limit"`
	// Max allowed video frame rate.
	//
	// example: 60
	VideoFrameRateLimit int `json:"video_frame_rate_limit"`
	// Max allowed video size in pixels as height*width.
	//
	// GtS doesn't set a limit on this, but for compatibility
	// we give Mastodon's 4096x4096px value here.
	//
	// example: 16777216
	VideoMatrixLimit int `json:"video_matrix_limit"`
}

InstanceConfigurationMediaAttachments models instance media attachment config parameters.

swagger:model instanceConfigurationMediaAttachments

type InstanceConfigurationPolls added in v0.3.7

type InstanceConfigurationPolls struct {
	// Number of options permitted in a poll on this instance.
	//
	// example: 4
	MaxOptions int `json:"max_options"`
	// Number of characters allowed per option in the poll.
	//
	// example: 50
	MaxCharactersPerOption int `json:"max_characters_per_option"`
	// Minimum expiration time of the poll in seconds.
	//
	// example: 300
	MinExpiration int `json:"min_expiration"`
	// Maximum expiration time of the poll in seconds.
	//
	// example: 2629746
	MaxExpiration int `json:"max_expiration"`
}

InstanceConfigurationPolls models instance poll config parameters.

swagger:model instanceConfigurationPolls

type InstanceConfigurationStatuses added in v0.3.7

type InstanceConfigurationStatuses struct {
	// Maximum allowed length of a post on this instance, in characters.
	//
	// example: 5000
	MaxCharacters int `json:"max_characters"`
	// Max number of attachments allowed on a status.
	//
	// example: 4
	MaxMediaAttachments int `json:"max_media_attachments"`
	// Amount of characters clients should assume a url takes up.
	//
	// example: 25
	CharactersReservedPerURL int `json:"characters_reserved_per_url"`
	// List of mime types that it's possible to use for statuses on this instance.
	//
	// example: ["text/plain","text/markdown"]
	SupportedMimeTypes []string `json:"supported_mime_types,omitempty"`
}

InstanceConfigurationStatuses models instance status config parameters.

swagger:model instanceConfigurationStatuses

type InstanceSettingsUpdateRequest

type InstanceSettingsUpdateRequest struct {
	// 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:"thumbnail" json:"thumbnail" xml:"thumbnail"`
	// Image description for the instance avatar.
	AvatarDescription *string `form:"thumbnail_description" json:"thumbnail_description" xml:"thumbnail_description"`
	// Image to use as the instance header.
	Header *multipart.FileHeader `form:"header" json:"header" xml:"header"`
}

InstanceSettingsUpdateRequest models an instance update request.

swagger:ignore

type InstanceV1 added in v0.7.0

type InstanceV1 struct {
	// The URI of the instance.
	// example: https://gts.example.org
	URI string `json:"uri,omitempty"`
	// The domain of accounts on this instance.
	// This will not necessarily be the same as
	// simply the Host part of the URI.
	// example: example.org
	AccountDomain string `json:"account_domain,omitempty"`
	// The title of the instance.
	// example: GoToSocial Example Instance
	Title string `json:"title,omitempty"`
	// Description of the instance.
	//
	// Should be HTML formatted, but might be plaintext.
	//
	// This should be displayed on the 'about' page for an instance.
	Description string `json:"description"`
	// A shorter description of the instance.
	//
	// Should be HTML formatted, but might be plaintext.
	//
	// This should be displayed on the instance splash/landing page.
	ShortDescription string `json:"short_description"`
	// An email address that may be used for inquiries.
	// example: admin@example.org
	Email string `json:"email"`
	// 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
	Version string `json:"version"`
	// Primary language of the instance.
	// example: en
	Languages []string `json:"languages"`
	// New account registrations are enabled on this instance.
	Registrations bool `json:"registrations"`
	// New account registrations require admin approval.
	ApprovalRequired bool `json:"approval_required"`
	// Invites are enabled on this instance.
	InvitesEnabled bool `json:"invites_enabled"`
	// Configuration object containing values about status limits etc.
	// This key/value will be omitted for remote instances.
	Configuration InstanceV1Configuration `json:"configuration,omitempty"`
	// URLs of interest for client applications.
	URLs InstanceV1URLs `json:"urls,omitempty"`
	// Statistics about the instance: number of posts, accounts, etc.
	Stats map[string]int `json:"stats,omitempty"`
	// URL of the instance avatar/banner image.
	// example: https://example.org/files/instance/thumbnail.jpeg
	Thumbnail string `json:"thumbnail"`
	// MIME type of the instance thumbnail.
	// example: image/png
	ThumbnailType string `json:"thumbnail_type,omitempty"`
	// Description of the instance thumbnail.
	// example: picture of a cute lil' friendly sloth
	ThumbnailDescription string `json:"thumbnail_description,omitempty"`
	// Contact account for the instance.
	ContactAccount *Account `json:"contact_account,omitempty"`
	// Maximum allowed length of a post on this instance, in characters.
	//
	// This is provided for compatibility with Tusky and other apps.
	//
	// example: 5000
	MaxTootChars uint `json:"max_toot_chars"`
}

InstanceV1 models information about this instance.

swagger:model instanceV1

type InstanceV1Configuration added in v0.7.0

type InstanceV1Configuration struct {
	// Instance configuration pertaining to status limits.
	Statuses InstanceConfigurationStatuses `json:"statuses"`
	// Instance configuration pertaining to media attachment types + size limits.
	MediaAttachments InstanceConfigurationMediaAttachments `json:"media_attachments"`
	// Instance configuration pertaining to poll limits.
	Polls InstanceConfigurationPolls `json:"polls"`
	// Instance configuration pertaining to accounts.
	Accounts InstanceConfigurationAccounts `json:"accounts"`
	// Instance configuration pertaining to emojis.
	Emojis InstanceConfigurationEmojis `json:"emojis"`
}

InstanceV1Configuration models instance configuration parameters.

swagger:model instanceV1Configuration

type InstanceV1URLs added in v0.7.0

type InstanceV1URLs struct {
	// Websockets address for status and notification streaming.
	// example: wss://example.org
	StreamingAPI string `json:"streaming_api"`
}

InstanceV1URLs models instance-relevant URLs for client application consumption.

swagger:model instanceV1URLs

type InstanceV2 added in v0.7.0

type InstanceV2 struct {
	// The domain of the instance.
	// example: gts.example.org
	Domain string `json:"domain"`
	// The domain of accounts on this instance.
	// This will not necessarily be the same as
	// domain.
	// example: example.org
	AccountDomain string `json:"account_domain"`
	// The title of the instance.
	// example: GoToSocial Example Instance
	Title string `json:"title"`
	// 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
	Version string `json:"version"`
	// The URL for the source code of the software running on this instance, in keeping with AGPL license requirements.
	// example: https://github.com/superseriousbusiness/gotosocial
	SourceURL string `json:"source_url"`
	// Description of the instance.
	//
	// Should be HTML formatted, but might be plaintext.
	//
	// This should be displayed on the 'about' page for an instance.
	Description string `json:"description"`
	// Basic anonymous usage data for this instance.
	Usage InstanceV2Usage `json:"usage"`
	// An image used to represent this instance.
	Thumbnail InstanceV2Thumbnail `json:"thumbnail"`
	// Primary languages of the instance + moderators/admins.
	// example: ["en"]
	Languages []string `json:"languages"`
	// Configured values and limits for this instance.
	Configuration InstanceV2Configuration `json:"configuration"`
	// Information about registering for this instance.
	Registrations InstanceV2Registrations `json:"registrations"`
	//  Hints related to contacting a representative of the instance.
	Contact InstanceV2Contact `json:"contact"`
	// An itemized list of rules for this website.
	// Currently not implemented (will always be empty array).
	Rules []interface{} `json:"rules"`
}

InstanceV2 models information about this instance.

swagger:model instanceV2

type InstanceV2Configuration added in v0.7.0

type InstanceV2Configuration struct {
	// URLs of interest for clients apps.
	URLs InstanceV2URLs `json:"urls"`
	// Limits related to accounts.
	Accounts InstanceConfigurationAccounts `json:"accounts"`
	// Limits related to authoring statuses.
	Statuses InstanceConfigurationStatuses `json:"statuses"`
	// Hints for which attachments will be accepted.
	MediaAttachments InstanceConfigurationMediaAttachments `json:"media_attachments"`
	// Limits related to polls.
	Polls InstanceConfigurationPolls `json:"polls"`
	// Hints related to translation.
	Translation InstanceV2ConfigurationTranslation `json:"translation"`
	// Instance configuration pertaining to emojis.
	Emojis InstanceConfigurationEmojis `json:"emojis"`
}

Configured values and limits for this instance.

swagger:model instanceV2Configuration

type InstanceV2ConfigurationTranslation added in v0.7.0

type InstanceV2ConfigurationTranslation struct {
	// Whether the Translations API is available on this instance.
	// Not implemented so this value is always false.
	Enabled bool `json:"enabled"`
}

Hints related to translation.

swagger:model instanceV2ConfigurationTranslation

type InstanceV2Contact added in v0.7.0

type InstanceV2Contact struct {
	// An email address that can be messaged regarding inquiries or issues.
	// Empty string if no email address set.
	// example: someone@example.org
	Email string `json:"email"`
	// An account that can be contacted regarding inquiries or issues.
	// Key/value not present if no contact account set.
	Account *Account `json:"account,omitempty"`
}

Hints related to contacting a representative of the instance.

swagger:model instanceV2Contact

type InstanceV2Registrations added in v0.7.0

type InstanceV2Registrations struct {
	// Whether registrations are enabled.
	// example: false
	Enabled bool `json:"enabled"`
	// Whether registrations require moderator approval.
	// example: true
	ApprovalRequired bool `json:"approval_required"`
	// A custom message (html string) to be shown when registrations are closed.
	// Value will be null if no message is set.
	// example: <p>Registrations are currently closed on example.org because of spam bots!</p>
	Message *string `json:"message"`
}

Information about registering for this instance.

swagger:model instanceV2Registrations

type InstanceV2Thumbnail added in v0.7.0

type InstanceV2Thumbnail struct {
	// The URL for the thumbnail image.
	// example: https://example.org/fileserver/01BPSX2MKCRVMD4YN4D71G9CP5/attachment/original/01H88X0KQ2DFYYDSWYP93VDJZA.png
	URL string `json:"url"`
	// MIME type of the instance thumbnail.
	// Key/value not set if thumbnail image type unknown.
	// example: image/png
	Type string `json:"thumbnail_type,omitempty"`
	// Description of the instance thumbnail.
	// Key/value not set if no description available.
	// example: picture of a cute lil' friendly sloth
	Description string `json:"thumbnail_description,omitempty"`
	// A hash computed by the BlurHash algorithm, for generating colorful preview thumbnails when media has not been downloaded yet.
	// Key/value not set if no blurhash available.
	// example: UeKUpFxuo~R%0nW;WCnhF6RjaJt757oJodS$
	Blurhash string `json:"blurhash,omitempty"`
	// Links to scaled resolution images, for high DPI screens.
	// Key/value not set if no extra versions available.
	Versions *InstanceV2ThumbnailVersions `json:"versions,omitempty"`
}

An image used to represent this instance.

swagger:model instanceV2Thumbnail

type InstanceV2ThumbnailVersions added in v0.7.0

type InstanceV2ThumbnailVersions struct {
	// The URL for the thumbnail image at 1x resolution.
	// Key/value not set if scaled versions not available.
	Size1URL string `json:"@1x,omitempty"`
	// The URL for the thumbnail image at 2x resolution.
	// Key/value not set if scaled versions not available.
	Size2URL string `json:"@2x,omitempty"`
}

Links to scaled resolution images, for high DPI screens.

swagger:model instanceV2ThumbnailVersions

type InstanceV2URLs added in v0.7.0

type InstanceV2URLs struct {
	// Websockets address for status and notification streaming.
	// example: wss://example.org
	Streaming string `json:"streaming"`
}

InstanceV2URLs models instance-relevant URLs for client application consumption.

swagger:model instanceV2URLs

type InstanceV2Usage added in v0.7.0

type InstanceV2Usage struct {
	Users InstanceV2Users `json:"users"`
}

Usage data for this instance.

swagger:model instanceV2Usage

type InstanceV2Users added in v0.7.0

type InstanceV2Users struct {
	// The number of active users in the past 4 weeks.
	// Currently not implemented: will always be 0.
	// example: 0
	ActiveMonth int `json:"active_month"`
}

Usage data related to users on this instance.

swagger:model instanceV2Users

type Link struct {
	Rel      string `json:"rel" xml:"rel,attr"`
	Type     string `json:"type,omitempty" xml:"type,attr,omitempty"`
	Href     string `json:"href,omitempty" xml:"href,attr,omitempty"`
	Template string `json:"template,omitempty" xml:"template,attr,omitempty"`
}

Link represents one 'link' in a slice of links returned from a lookup request.

See https://webfinger.net/ and https://www.rfc-editor.org/rfc/rfc6415.html#section-3.1

type List

type List struct {
	// The ID of the list.
	ID string `json:"id"`
	// The user-defined title of the list.
	Title string `json:"title"`
	// RepliesPolicy for this list.
	//	followed = Show replies to any followed user
	//	list = Show replies to members of the list
	//	none = Show replies to no one
	RepliesPolicy string `json:"replies_policy"`
}

List represents a user-created list of accounts that the user follows.

swagger:model list

type ListAccountsChangeRequest added in v0.10.0

type ListAccountsChangeRequest struct {
	AccountIDs []string `form:"account_ids[]" json:"account_ids" xml:"account_ids"`
}

swagger:ignore

type ListCreateRequest added in v0.10.0

type ListCreateRequest struct {
	// Title of this list.
	// example: Cool People
	// in: formData
	// required: true
	Title string `form:"title" json:"title" xml:"title"`
	// RepliesPolicy for this list.
	//	followed = Show replies to any followed user
	//	list = Show replies to members of the list
	//	none = Show replies to no one
	// example: list
	// default: list
	// in: formData
	RepliesPolicy string `form:"replies_policy" json:"replies_policy" xml:"replies_policy"`
}

ListCreateRequest models list creation parameters.

swagger:parameters listCreate

type ListUpdateRequest added in v0.10.0

type ListUpdateRequest struct {
	// Title of this list.
	// example: Cool People
	// in: formData
	Title *string `form:"title" json:"title" xml:"title"`
	// RepliesPolicy for this list.
	//	followed = Show replies to any followed user
	//	list = Show replies to members of the list
	//	none = Show replies to no one
	// in: formData
	RepliesPolicy *string `form:"replies_policy" json:"replies_policy" xml:"replies_policy"`
}

ListUpdateRequest models list update parameters.

swagger:parameters listUpdate

type Marker

type Marker struct {
	// Information about the user's position in the home timeline.
	Home *TimelineMarker `json:"home,omitempty"`
	// Information about the user's position in their notifications.
	Notifications *TimelineMarker `json:"notifications,omitempty"`
}

Marker represents the last read position within a user's timelines.

type MarkerName added in v0.11.0

type MarkerName string

MarkerName is the name of one of the timelines we can store markers for.

const (
	MarkerNameHome          MarkerName = "home"
	MarkerNameNotifications MarkerName = "notifications"
	MarkerNameNumValues                = 2
)

type MarkerPostRequest added in v0.11.0

type MarkerPostRequest struct {
	Home                        *MarkerPostRequestMarker `json:"home"`
	FormHomeLastReadID          string                   `form:"home[last_read_id]"`
	Notifications               *MarkerPostRequestMarker `json:"notifications"`
	FormNotificationsLastReadID string                   `form:"notifications[last_read_id]"`
}

MarkerPostRequest models a request to update one or more markers. This has two sets of fields to support a goofy nested map structure in both form data and JSON bodies.

swagger:ignore

func (*MarkerPostRequest) HomeLastReadID added in v0.11.0

func (r *MarkerPostRequest) HomeLastReadID() string

HomeLastReadID should be used instead of Home or FormHomeLastReadID.

func (*MarkerPostRequest) NotificationsLastReadID added in v0.11.0

func (r *MarkerPostRequest) NotificationsLastReadID() string

NotificationsLastReadID should be used instead of Notifications or FormNotificationsLastReadID.

type MarkerPostRequestMarker added in v0.11.0

type MarkerPostRequestMarker struct {
	// The ID of the most recently viewed entity.
	LastReadID string `json:"last_read_id"`
}

type MediaCleanupRequest added in v0.3.4

type MediaCleanupRequest struct {
	// Number of days of remote media to keep. Native values will be treated as 0.
	// If value is not specified, the value of media-remote-cache-days in the server config will be used.
	RemoteCacheDays *int `form:"remote_cache_days" json:"remote_cache_days" xml:"remote_cache_days"`
}

MediaCleanupRequest models admin media cleanup parameters

swagger:parameters mediaCleanup

type MediaDimensions

type MediaDimensions struct {
	// Width of the media in pixels.
	// Not set for audio.
	// example: 1920
	Width int `json:"width,omitempty"`
	// Height of the media in pixels.
	// Not set for audio.
	// example: 1080
	Height int `json:"height,omitempty"`
	// Framerate of the media.
	// Only set for video and gifs.
	// example: 30
	FrameRate string `json:"frame_rate,omitempty"`
	// Duration of the media in seconds.
	// Only set for video and audio.
	// example: 5.43
	Duration float32 `json:"duration,omitempty"`
	// Bitrate of the media in bits per second.
	// example: 1000000
	Bitrate int `json:"bitrate,omitempty"`
	// Size of the media, in the format `[width]x[height]`.
	// Not set for audio.
	// example: 1920x1080
	Size string `json:"size,omitempty"`
	// Aspect ratio of the media.
	// Equal to width / height.
	// example: 1.777777778
	Aspect float32 `json:"aspect,omitempty"`
}

MediaDimensions models detailed properties of a piece of media.

swagger:model mediaDimensions

type MediaFocus

type MediaFocus struct {
	// x position of the focus
	// should be between -1 and 1
	X float32 `json:"x"`
	// y position of the focus
	// should be between -1 and 1
	Y float32 `json:"y"`
}

MediaFocus models the focal point of a piece of media.

swagger:model mediaFocus

type MediaMeta

type MediaMeta struct {
	// Dimensions of the original media.
	Original MediaDimensions `json:"original"`
	// Dimensions of the thumbnail/small version of the media.
	Small MediaDimensions `json:"small,omitempty"`
	// Focus data for the media.
	Focus *MediaFocus `json:"focus,omitempty"`
}

MediaMeta models media metadata. This can be metadata about an image, an audio file, video, etc.

swagger:model mediaMeta

type Mention

type Mention struct {
	// The ID of the mentioned account.
	// example: 01FBYJHQWQZAVWFRK9PDYTKGMB
	ID string `json:"id"`
	// The username of the mentioned account.
	// example: some_user
	Username string `json:"username"`
	// The web URL of the mentioned account's profile.
	// example: https://example.org/@some_user
	URL string `json:"url"`
	// The account URI as discovered via webfinger.
	// Equal to username for local users, or username@domain for remote users.
	// example: some_user@example.org
	Acct string `json:"acct"`
}

Mention represents a mention of another account.

type MultiStatus added in v0.10.0

type MultiStatus struct {
	Data     []MultiStatusEntry  `json:"data"`
	Metadata MultiStatusMetadata `json:"metadata"`
}

MultiStatus models a multistatus HTTP response body. This model should be transmitted along with http code 207 MULTI-STATUS to indicate a mixture of responses. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/207

swagger:model multiStatus

func NewMultiStatus added in v0.10.0

func NewMultiStatus(entries []MultiStatusEntry) *MultiStatus

NewMultiStatus returns a new MultiStatus API model with the provided entries, which will be iterated through to look for 2xx and non 2xx status codes, in order to count successes and failures.

type MultiStatusEntry added in v0.10.0

type MultiStatusEntry struct {
	// The resource/result for this entry.
	// Value may be any type, check the docs
	// per endpoint to see which to expect.
	Resource any `json:"resource"`
	// Message/error message for this entry.
	Message string `json:"message"`
	// HTTP status code of this entry.
	Status int `json:"status"`
}

MultiStatusEntry models one entry in multistatus data. It can model either a success or a failure. The type and value of `Resource` is left to the discretion of the caller, but at minimum it should be expected to be JSON-serializable.

swagger:model multiStatusEntry

type MultiStatusMetadata added in v0.10.0

type MultiStatusMetadata struct {
	// Success count + failure count.
	Total int `json:"total"`
	// Count of successful results (2xx).
	Success int `json:"success"`
	// Count of unsuccessful results (!2xx).
	Failure int `json:"failure"`
}

MultiStatusMetadata models an at-a-glance summary of the data contained in the MultiStatus.

swagger:model multiStatusMetadata

type NodeInfoServices

type NodeInfoServices struct {
	Inbound  []string `json:"inbound"`
	Outbound []string `json:"outbound"`
}

NodeInfoServices represents inbound and outbound services that this node offers connections to.

type NodeInfoSoftware

type NodeInfoSoftware struct {
	// example: gotosocial
	Name string `json:"name"`
	// example: 0.1.2 1234567
	Version string `json:"version"`
}

NodeInfoSoftware represents the name and version number of the software of this node.

type NodeInfoUsage

type NodeInfoUsage struct {
	Users      NodeInfoUsers `json:"users"`
	LocalPosts int           `json:"localPosts"`
}

NodeInfoUsage represents usage information about this server, such as number of users.

type NodeInfoUsers

type NodeInfoUsers struct {
	Total int `json:"total"`
}

NodeInfoUsers represents aggregate information about the users on the server.

type Nodeinfo

type Nodeinfo struct {
	// The schema version
	// example: 2.0
	Version string `json:"version"`
	// Metadata about server software in use.
	Software NodeInfoSoftware `json:"software"`
	// The protocols supported on this server.
	Protocols []string `json:"protocols"`
	// The third party sites this server can connect to via their application API.
	Services NodeInfoServices `json:"services"`
	// Whether this server allows open self-registration.
	// example: false
	OpenRegistrations bool `json:"openRegistrations"`
	// Usage statistics for this server.
	Usage NodeInfoUsage `json:"usage"`
	// Free form key value pairs for software specific values. Clients should not rely on any specific key present.
	Metadata map[string]interface{} `json:"metadata"`
}

Nodeinfo represents a version 2.1 or version 2.0 nodeinfo schema. See: https://nodeinfo.diaspora.software/schema.html

swagger:model nodeinfo

type Notification

type Notification struct {

	// The id of the notification in the database.
	ID string `json:"id"`
	// The type of event that resulted in the notification.
	// 	follow = Someone followed you
	// 	follow_request = Someone requested to follow you
	// 	mention = Someone mentioned you in their status
	// 	reblog = Someone boosted one of your statuses
	// 	favourite = Someone favourited one of your statuses
	// 	poll = A poll you have voted in or created has ended
	// 	status = Someone you enabled notifications for has posted a status
	Type string `json:"type"`
	// The timestamp of the notification (ISO 8601 Datetime)
	CreatedAt string `json:"created_at"`
	// The account that performed the action that generated the notification.
	Account *Account `json:"account"`

	// Status that was the object of the notification, e.g. in mentions, reblogs, favourites, or polls.
	Status *Status `json:"status,omitempty"`
}

Notification represents a notification of an event relevant to the user.

swagger:model notification

func (*Notification) GetAccountID added in v0.3.5

func (n *Notification) GetAccountID() string

func (*Notification) GetBoostOfAccountID added in v0.3.5

func (n *Notification) GetBoostOfAccountID() string

func (*Notification) GetBoostOfID added in v0.3.5

func (n *Notification) GetBoostOfID() string

func (*Notification) GetID added in v0.3.5

func (n *Notification) GetID() string

type OAuthAuthorize

type OAuthAuthorize struct {
	// Forces the user to re-login, which is necessary for authorizing with multiple accounts from the same instance.
	ForceLogin string `form:"force_login" json:"force_login"`
	// Should be set equal to `code`.
	ResponseType string `form:"response_type" json:"response_type"`
	// Client ID, obtained during app registration.
	ClientID string `form:"client_id" json:"client_id"`
	// Set a URI to redirect the user to.
	// If this parameter is set to urn:ietf:wg:oauth:2.0:oob then the authorization code will be shown instead.
	// Must match one of the redirect URIs declared during app registration.
	RedirectURI string `form:"redirect_uri" json:"redirect_uri"`
	// List of requested OAuth scopes, separated by spaces (or by pluses, if using query parameters).
	// Must be a subset of scopes declared during app registration. If not provided, defaults to read.
	Scope string `form:"scope" json:"scope"`
	// State is used by the application to store request-specific data and/or prevent CSRF attacks.
	// The authorization server must return the unmodified state value back to the application.
	// See https://www.oauth.com/oauth2-servers/authorization/the-authorization-request/
	State string `form:"state" json:"state"`
}

OAuthAuthorize represents a request sent to https://example.org/oauth/authorize

type PageableResponse added in v0.6.0

type PageableResponse struct {
	Items      []interface{}
	LinkHeader string
	NextLink   string
	PrevLink   string
}

PageableResponse wraps a slice of items, ready to be serialized, along with the Link header for the previous and next queries / pages, to be returned to the client.

type PasswordChangeRequest

type PasswordChangeRequest struct {
	// User's previous password.
	//
	// in: formData
	// required: true
	OldPassword string `form:"old_password" json:"old_password" xml:"old_password" validation:"required"`
	// Desired new password.
	// If the password does not have high enough entropy, it will be rejected.
	// See https://github.com/wagslane/go-password-validator
	//
	// in: formData
	// required: true
	NewPassword string `form:"new_password" json:"new_password" xml:"new_password" validation:"required"`
}

PasswordChangeRequest models user password change parameters.

swagger:parameters userPasswordChange

type Poll

type Poll struct {
	// The ID of the poll in the database.
	// example: 01FBYKMD1KBMJ0W6JF1YZ3VY5D
	ID string `json:"id"`
	// When the poll ends. (ISO 8601 Datetime), or null if the poll does not end
	ExpiresAt string `json:"expires_at,omitempty"`
	// Is the poll currently expired?
	Expired bool `json:"expired"`
	// Does the poll allow multiple-choice answers?
	Multiple bool `json:"multiple"`
	// How many votes have been received.
	VotesCount int `json:"votes_count"`
	// How many unique accounts have voted on a multiple-choice poll. Null if multiple is false.
	VotersCount int `json:"voters_count,omitempty"`
	// When called with a user token, has the authorized user voted?
	Voted bool `json:"voted,omitempty"`
	// When called with a user token, which options has the authorized user chosen? Contains an array of index values for options.
	OwnVotes []int `json:"own_votes,omitempty"`
	// Possible answers for the poll.
	Options []PollOptions `json:"options"`
	// Custom emoji to be used for rendering poll options.
	Emojis []Emoji `json:"emojis"`
}

Poll represents a poll attached to a status.

swagger:model poll

type PollOptions

type PollOptions struct {
	// The text value of the poll option. String.
	Title string `json:"title"`
	// The number of received votes for this option.
	// Number, or null if results are not published yet.
	VotesCount int `json:"votes_count,omitempty"`
}

PollOptions represents the current vote counts for different poll options.

swagger:model pollOptions

type PollRequest

type PollRequest struct {
	// Array of possible answers.
	// If provided, media_ids cannot be used, and poll[expires_in] must be provided.
	// name: poll[options]
	Options []string `form:"options" json:"options" xml:"options"`
	// Duration the poll should be open, in seconds.
	// If provided, media_ids cannot be used, and poll[options] must be provided.
	ExpiresIn int `form:"expires_in" json:"expires_in" xml:"expires_in"`
	// Allow multiple choices on this poll.
	Multiple bool `form:"multiple" json:"multiple" xml:"multiple"`
	// Hide vote counts until the poll ends.
	HideTotals bool `form:"hide_totals" json:"hide_totals" xml:"hide_totals"`
}

PollRequest models a request to create a poll.

swagger:parameters createStatus

type Preferences

type Preferences struct {
	// Default visibility for new posts.
	// 	public = Public post
	// 	unlisted = Unlisted post
	// 	private = Followers-only post
	// 	direct = Direct post
	PostingDefaultVisibility string `json:"posting:default:visibility"`
	// Default sensitivity flag for new posts.
	PostingDefaultSensitive bool `json:"posting:default:sensitive"`
	// Default language for new posts. (ISO 639-1 language two-letter code), or null
	PostingDefaultLanguage string `json:"posting:default:language,omitempty"`
	// Whether media attachments should be automatically displayed or blurred/hidden.
	// 	default = Hide media marked as sensitive
	// 	show_all = Always show all media by default, regardless of sensitivity
	// 	hide_all = Always hide all media by default, regardless of sensitivity
	ReadingExpandMedia string `json:"reading:expand:media"`
	// Whether CWs should be expanded by default.
	ReadingExpandSpoilers bool `json:"reading:expand:spoilers"`
	// Whether gifs should automatically play.
	ReadingAutoPlayGifs bool `json:"reading:autoplay:gifs"`
}

Preferences represents a user's preferences.

type PushSubscription

type PushSubscription struct {
	// The id of the push subscription in the database.
	ID string `json:"id"`
	// Where push alerts will be sent to.
	Endpoint string `json:"endpoint"`
	// The streaming server's VAPID key.
	ServerKey string `json:"server_key"`
	// Which alerts should be delivered to the endpoint.
	Alerts *PushSubscriptionAlerts `json:"alerts"`
}

PushSubscription represents a subscription to the push streaming server.

type PushSubscriptionAlerts

type PushSubscriptionAlerts struct {
	// Receive a push notification when someone has followed you?
	Follow bool `json:"follow"`
	// Receive a push notification when a status you created has been favourited by someone else?
	Favourite bool `json:"favourite"`
	// Receive a push notification when someone else has mentioned you in a status?
	Mention bool `json:"mention"`
	// Receive a push notification when a status you created has been boosted by someone else?
	Reblog bool `json:"reblog"`
	// Receive a push notification when a poll you voted in or created has ended?
	Poll bool `json:"poll"`
}

PushSubscriptionAlerts represents the specific alerts that this push subscription will give.

type Relationship

type Relationship struct {
	// The account id.
	// example: 01FBW9XGEP7G6K88VY4S9MPE1R
	ID string `json:"id"`
	// You are following this account.
	Following bool `json:"following"`
	// You are seeing reblogs/boosts from this account in your home timeline.
	ShowingReblogs bool `json:"showing_reblogs"`
	// You are seeing notifications when this account posts.
	Notifying bool `json:"notifying"`
	// This account follows you.
	FollowedBy bool `json:"followed_by"`
	// You are blocking this account.
	Blocking bool `json:"blocking"`
	// This account is blocking you.
	BlockedBy bool `json:"blocked_by"`
	// You are muting this account.
	Muting bool `json:"muting"`
	// You are muting notifications from this account.
	MutingNotifications bool `json:"muting_notifications"`
	// You have requested to follow this account, and the request is pending.
	Requested bool `json:"requested"`
	// You are blocking this account's domain.
	DomainBlocking bool `json:"domain_blocking"`
	// You are featuring this account on your profile.
	Endorsed bool `json:"endorsed"`
	// Your note on this account.
	Note string `json:"note"`
}

Relationship represents a relationship between accounts.

swagger:model accountRelationship

type Report added in v0.7.0

type Report struct {
	// ID of the report.
	// example: 01FBVD42CQ3ZEEVMW180SBX03B
	ID string `json:"id"`
	// The date when this report was created (ISO 8601 Datetime).
	// example: 2021-07-30T09:20:25+00:00
	CreatedAt string `json:"created_at"`
	// Whether an action has been taken by an admin in response to this report.
	// example: false
	ActionTaken bool `json:"action_taken"`
	// If an action was taken, at what time was this done? (ISO 8601 Datetime)
	// Will be null if not set / no action yet taken.
	// example: 2021-07-30T09:20:25+00:00
	ActionTakenAt *string `json:"action_taken_at"`
	// If an action was taken, what comment was made by the admin on the taken action?
	// Will be null if not set / no action yet taken.
	// example: Account was suspended.
	ActionTakenComment *string `json:"action_taken_comment"`
	// Under what category was this report created?
	// example: spam
	Category string `json:"category"`
	// Comment submitted when the report was created.
	// Will be empty if no comment was submitted.
	// example: This person has been harassing me.
	Comment string `json:"comment"`
	// Bool to indicate that report should be federated to remote instance.
	// example: true
	Forwarded bool `json:"forwarded"`
	// Array of IDs of statuses that were submitted along with this report.
	// Will be empty if no status IDs were submitted.
	// example: ["01GPBN5YDY6JKBWE44H7YQBDCQ","01GPBN65PDWSBPWVDD0SQCFFY3"]
	StatusIDs []string `json:"status_ids"`
	// Array of rule IDs that were submitted along with this report.
	// Will be empty if no rule IDs were submitted.
	// example: [1, 2]
	RuleIDs []int `json:"rule_ids"`
	// Account that was reported.
	TargetAccount *Account `json:"target_account"`
}

Report models a moderation report submitted to the instance, either via the client API or via the federated API.

swagger:model report

type ReportCreateRequest added in v0.7.0

type ReportCreateRequest struct {
	// ID of the account to report.
	// example: 01GPE75FXSH2EGFBF85NXPH3KP
	// in: formData
	// required: true
	AccountID string `form:"account_id" json:"account_id" xml:"account_id"`
	// IDs of statuses to attach to the report to provide additional context.
	// example: ["01GPE76N4SBVRZ8K24TW51ZZQ4","01GPE76WN9JZE62EPT3Q9FRRD4"]
	// in: formData
	StatusIDs []string `form:"status_ids[]" json:"status_ids" xml:"status_ids"`
	// The reason for the report. Default maximum of 1000 characters.
	// example: Anti-Blackness, transphobia.
	// in: formData
	Comment string `form:"comment" json:"comment" xml:"comment"`
	// If the account is remote, should the report be forwarded to the remote admin?
	// example: true
	// default: false
	// in: formData
	Forward bool `form:"forward" json:"forward" xml:"forward"`
	// Specify if the report is due to spam, violation of enumerated instance rules, or some other reason.
	// Currently only 'other' is supported.
	// example: other
	// default: other
	// in: formData
	Category string `form:"category" json:"category" xml:"category"`
	// IDs of rules on this instance which have been broken according to the reporter.
	// This is currently not supported, provided only for API compatibility.
	// example: [1, 2, 3]
	// in: formData
	RuleIDs []int `form:"rule_ids[]" json:"rule_ids" xml:"rule_ids"`
}

ReportCreateRequest models user report creation parameters.

swagger:parameters reportCreate

type Results

type Results struct {
	// Accounts which match the given query
	Accounts []Account `json:"accounts"`
	// Statuses which match the given query
	Statuses []Status `json:"statuses"`
	// Hashtags which match the given query
	Hashtags []Tag `json:"hashtags"`
}

Results represents the results of a search.

type ScheduledStatus

type ScheduledStatus struct {
	ID               string        `json:"id"`
	ScheduledAt      string        `json:"scheduled_at"`
	Params           *StatusParams `json:"params"`
	MediaAttachments []Attachment  `json:"media_attachments"`
}

ScheduledStatus represents a status that will be published at a future scheduled date.

type SearchRequest added in v0.10.0

type SearchRequest struct {
	MaxID             string
	MinID             string
	Limit             int
	Offset            int
	Query             string
	QueryType         string
	Resolve           bool
	Following         bool
	ExcludeUnreviewed bool
	APIv1             bool // Set to 'true' if using version 1 of the search API.
}

SearchRequest models a search request.

type SearchResult

type SearchResult struct {
	Accounts []*Account `json:"accounts"`
	Statuses []*Status  `json:"statuses"`
	// Slice of strings if api v1, slice of tags if api v2.
	Hashtags []any `json:"hashtags"`
}

SearchResult models a search result.

swagger:model searchResult

type Source

type Source struct {
	// The default post privacy to be used for new statuses.
	//    public = Public post
	//    unlisted = Unlisted post
	//    private = Followers-only post
	//    direct = Direct post
	Privacy Visibility `json:"privacy"`
	// Whether new statuses should be marked sensitive by default.
	Sensitive bool `json:"sensitive"`
	// The default posting language for new statuses.
	Language string `json:"language"`
	// The default posting content type for new statuses.
	StatusContentType string `json:"status_content_type"`
	// Profile bio.
	Note string `json:"note"`
	// Metadata about the account.
	Fields []Field `json:"fields"`
	// The number of pending follow requests.
	FollowRequestsCount int `json:"follow_requests_count"`
}

Source represents display or publishing preferences of user's own account. Returned as an additional entity when verifying and updated credentials, as an attribute of Account.

type Status

type Status struct {
	// ID of the status.
	// example: 01FBVD42CQ3ZEEVMW180SBX03B
	ID string `json:"id"`
	// The date when this status was created (ISO 8601 Datetime).
	// example: 2021-07-30T09:20:25+00:00
	CreatedAt string `json:"created_at"`
	// ID of the status being replied to.
	// example: 01FBVD42CQ3ZEEVMW180SBX03B
	// nullable: true
	InReplyToID *string `json:"in_reply_to_id"`
	// ID of the account being replied to.
	// example: 01FBVD42CQ3ZEEVMW180SBX03B
	// nullable: true
	InReplyToAccountID *string `json:"in_reply_to_account_id"`
	// Status contains sensitive content.
	// example: false
	Sensitive bool `json:"sensitive"`
	// Subject, summary, or content warning for the status.
	// example: warning nsfw
	SpoilerText string `json:"spoiler_text"`
	// Visibility of this status.
	// example: unlisted
	Visibility Visibility `json:"visibility"`
	// Primary language of this status (ISO 639 Part 1 two-letter language code).
	// Will be null if language is not known.
	// example: en
	Language *string `json:"language"`
	// ActivityPub URI of the status. Equivalent to the status's activitypub ID.
	// example: https://example.org/users/some_user/statuses/01FBVD42CQ3ZEEVMW180SBX03B
	URI string `json:"uri"`
	// The status's publicly available web URL. This link will only work if the visibility of the status is 'public'.
	// example: https://example.org/@some_user/statuses/01FBVD42CQ3ZEEVMW180SBX03B
	URL string `json:"url"`
	// Number of replies to this status, according to our instance.
	RepliesCount int `json:"replies_count"`
	// Number of times this status has been boosted/reblogged, according to our instance.
	ReblogsCount int `json:"reblogs_count"`
	// Number of favourites/likes this status has received, according to our instance.
	FavouritesCount int `json:"favourites_count"`
	// This status has been favourited by the account viewing it.
	Favourited bool `json:"favourited"`
	// This status has been boosted/reblogged by the account viewing it.
	Reblogged bool `json:"reblogged"`
	// Replies to this status have been muted by the account viewing it.
	Muted bool `json:"muted"`
	// This status has been bookmarked by the account viewing it.
	Bookmarked bool `json:"bookmarked"`
	// This status has been pinned by the account viewing it (only relevant for your own statuses).
	Pinned bool `json:"pinned"`
	// The content of this status. Should be HTML, but might also be plaintext in some cases.
	// example: <p>Hey this is a status!</p>
	Content string `json:"content"`
	// The status that this status reblogs/boosts.
	// nullable: true
	Reblog *StatusReblogged `json:"reblog"`
	// The application used to post this status, if visible.
	Application *Application `json:"application,omitempty"`
	// The account that authored this status.
	Account *Account `json:"account"`
	// Media that is attached to this status.
	MediaAttachments []Attachment `json:"media_attachments"`
	// Mentions of users within the status content.
	Mentions []Mention `json:"mentions"`
	// Hashtags used within the status content.
	Tags []Tag `json:"tags"`
	// Custom emoji to be used when rendering status content.
	Emojis []Emoji `json:"emojis"`
	// Preview card for links included within status content.
	// nullable: true
	Card *Card `json:"card"`
	// The poll attached to the status.
	// nullable: true
	Poll *Poll `json:"poll"`
	// Plain-text source of a status. Returned instead of content when status is deleted,
	// so the user may redraft from the source text without the client having to reverse-engineer
	// the original text from the HTML content.
	Text string `json:"text,omitempty"`
}

Status models a status or post.

swagger:model status

func (*Status) GetAccountID added in v0.2.0

func (s *Status) GetAccountID() string

func (*Status) GetBoostOfAccountID added in v0.2.0

func (s *Status) GetBoostOfAccountID() string

func (*Status) GetBoostOfID added in v0.2.0

func (s *Status) GetBoostOfID() string

func (*Status) GetID added in v0.2.0

func (s *Status) GetID() string

type StatusContentType added in v0.8.0

type StatusContentType string

StatusContentType is the content type with which to parse the submitted status. Can be either text/plain or text/markdown. Empty will default to text/plain.

swagger:enum statusContentType swagger:type string

const (
	StatusContentTypePlain    StatusContentType = "text/plain"
	StatusContentTypeMarkdown StatusContentType = "text/markdown"
	StatusContentTypeDefault                    = StatusContentTypePlain
)

Content type to use when parsing submitted status into an html-formatted status

type StatusCreateRequest

type StatusCreateRequest struct {
	// Text content of the status.
	// If media_ids is provided, this becomes optional.
	// Attaching a poll is optional while status is provided.
	// in: formData
	Status string `form:"status" json:"status" xml:"status"`
	// Array of Attachment ids to be attached as media.
	// If provided, status becomes optional, and poll cannot be used.
	//
	// If the status is being submitted as a form, the key is 'media_ids[]',
	// but if it's json or xml, the key is 'media_ids'.
	//
	// in: formData
	MediaIDs []string `form:"media_ids[]" json:"media_ids" xml:"media_ids"`
	// Poll to include with this status.
	// swagger:ignore
	Poll *PollRequest `form:"poll" json:"poll" xml:"poll"`
	// ID of the status being replied to, if status is a reply.
	// in: formData
	InReplyToID string `form:"in_reply_to_id" json:"in_reply_to_id" xml:"in_reply_to_id"`
	// Status and attached media should be marked as sensitive.
	// in: formData
	Sensitive bool `form:"sensitive" json:"sensitive" xml:"sensitive"`
	// Text to be shown as a warning or subject before the actual content.
	// Statuses are generally collapsed behind this field.
	// in: formData
	SpoilerText string `form:"spoiler_text" json:"spoiler_text" xml:"spoiler_text"`
	// Visibility of the posted status.
	// in: formData
	Visibility Visibility `form:"visibility" json:"visibility" xml:"visibility"`
	// ISO 8601 Datetime at which to schedule a status.
	// Providing this parameter will cause ScheduledStatus to be returned instead of Status.
	// Must be at least 5 minutes in the future.
	// in: formData
	ScheduledAt string `form:"scheduled_at" json:"scheduled_at" xml:"scheduled_at"`
	// ISO 639 language code for this status.
	// in: formData
	Language string `form:"language" json:"language" xml:"language"`
	// Content type to use when parsing this status.
	// in: formData
	ContentType StatusContentType `form:"content_type" json:"content_type" xml:"content_type"`
}

StatusCreateRequest models status creation parameters.

swagger:model statusCreateRequest

type StatusParams

type StatusParams struct {
	Text          string   `json:"text"`
	InReplyToID   string   `json:"in_reply_to_id,omitempty"`
	MediaIDs      []string `json:"media_ids,omitempty"`
	Sensitive     bool     `json:"sensitive,omitempty"`
	SpoilerText   string   `json:"spoiler_text,omitempty"`
	Visibility    string   `json:"visibility"`
	ScheduledAt   string   `json:"scheduled_at,omitempty"`
	ApplicationID string   `json:"application_id"`
}

StatusParams represents parameters for a scheduled status.

type StatusReblogged

type StatusReblogged struct {
	*Status
}

StatusReblogged represents a reblogged status.

swagger:model statusReblogged

type Tag

type Tag struct {
	// The value of the hashtag after the # sign.
	// example: helloworld
	Name string `json:"name"`
	// Web link to the hashtag.
	// example: https://example.org/tags/helloworld
	URL string `json:"url"`
	// History of this hashtag's usage.
	// Currently just a stub, if provided will always be an empty array.
	// example: []
	History *[]any `json:"history,omitempty"`
}

Tag represents a hashtag used within the content of a status.

swagger:model tag

type TimelineMarker

type TimelineMarker struct {
	// The ID of the most recently viewed entity.
	LastReadID string `json:"last_read_id"`
	// The timestamp of when the marker was set (ISO 8601 Datetime)
	UpdatedAt string `json:"updated_at"`
	// Used for locking to prevent write conflicts.
	Version int `json:"version"`
}

TimelineMarker contains information about a user's progress through a specific timeline.

type Token

type Token struct {
	// Access token used for authorization.
	AccessToken string `json:"access_token"`
	// OAuth token type. Will always be 'Bearer'.
	// example: bearer
	TokenType string `json:"token_type"`
	// OAuth scopes granted by this token, space-separated.
	// example: read write admin
	Scope string `json:"scope"`
	// When the OAuth token was generated (UNIX timestamp seconds).
	// example: 1627644520
	CreatedAt int64 `json:"created_at"`
}

Token represents an OAuth token used for authenticating with the GoToSocial API and performing actions.

swagger:model oauthToken

type UpdateCredentialsRequest

type UpdateCredentialsRequest struct {
	// Account should be made discoverable and shown in the profile directory (if enabled).
	Discoverable *bool `form:"discoverable" json:"discoverable"`
	// Account is flagged as a bot.
	Bot *bool `form:"bot" json:"bot"`
	// The display name to use for the account.
	DisplayName *string `form:"display_name" json:"display_name"`
	// Bio/description of this account.
	Note *string `form:"note" json:"note"`
	// Avatar image encoded using multipart/form-data.
	Avatar *multipart.FileHeader `form:"avatar" json:"-"`
	// Header image encoded using multipart/form-data
	Header *multipart.FileHeader `form:"header" json:"-"`
	// Require manual approval of follow requests.
	Locked *bool `form:"locked" json:"locked"`
	// New Source values for this account.
	Source *UpdateSource `form:"source" json:"source"`
	// Profile metadata names and values.
	FieldsAttributes *[]UpdateField `form:"fields_attributes" json:"-"`
	// Profile metadata names and values, parsed from JSON.
	JSONFieldsAttributes *map[string]UpdateField `form:"-" json:"fields_attributes"`
	// Custom CSS to be included when rendering this account's profile or statuses.
	CustomCSS *string `form:"custom_css" json:"custom_css"`
	// Enable RSS feed of public toots for this account at /@[username]/feed.rss
	EnableRSS *bool `form:"enable_rss" json:"enable_rss"`
}

UpdateCredentialsRequest models an update to an account, by the account owner.

swagger:ignore

type UpdateField

type UpdateField struct {
	// Key this form field was submitted with;
	// only set if it was submitted as JSON.
	Key int `form:"-" json:"-"`
	// Name of the field
	Name *string `form:"name" json:"name"`
	// Value of the field
	Value *string `form:"value" json:"value"`
}

UpdateField is to be used specifically in an UpdateCredentialsRequest. By default, max 6 fields and 255 characters per property/value.

swagger:model updateField

type UpdateSource

type UpdateSource struct {
	// Default post privacy for authored statuses.
	Privacy *string `form:"privacy" json:"privacy"`
	// Mark authored statuses as sensitive by default.
	Sensitive *bool `form:"sensitive" json:"sensitive"`
	// Default language to use for authored statuses. (ISO 6391)
	Language *string `form:"language" json:"language"`
	// Default format for authored statuses (text/plain or text/markdown).
	StatusContentType *string `form:"status_content_type" json:"status_content_type"`
}

UpdateSource is to be used specifically in an UpdateCredentialsRequest.

swagger:model updateSource

type Visibility

type Visibility string

Visibility models the visibility of a status.

swagger:enum statusVisibility swagger:type string

const (
	// VisibilityPublic is visible to everyone, and will be available via the web even for nonauthenticated users.
	VisibilityPublic Visibility = "public"
	// VisibilityUnlisted is visible to everyone, but only on home timelines, lists, etc.
	VisibilityUnlisted Visibility = "unlisted"
	// VisibilityPrivate is visible only to followers of the account that posted the status.
	VisibilityPrivate Visibility = "private"
	// VisibilityMutualsOnly is visible only to mutual followers of the account that posted the status.
	VisibilityMutualsOnly Visibility = "mutuals_only"
	// VisibilityDirect is visible only to accounts tagged in the status. It is equivalent to a direct message.
	VisibilityDirect Visibility = "direct"
)

type WellKnownResponse

type WellKnownResponse struct {
	Subject string   `json:"subject,omitempty"`
	Aliases []string `json:"aliases,omitempty"`
	Links   []Link   `json:"links,omitempty"`
}

WellKnownResponse represents the response to either a webfinger request for an 'acct' resource, or a request to nodeinfo. For example, it would be returned from https://example.org/.well-known/webfinger?resource=acct:some_username@example.org

See https://webfinger.net/

swagger:model wellKnownResponse

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL