summaryrefslogtreecommitdiff
path: root/internal/api/model
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/model')
-rw-r--r--internal/api/model/application.go8
-rw-r--r--internal/api/model/attachment.go12
-rw-r--r--internal/api/model/status.go4
3 files changed, 14 insertions, 10 deletions
diff --git a/internal/api/model/application.go b/internal/api/model/application.go
index a796c88ea..fe9fada03 100644
--- a/internal/api/model/application.go
+++ b/internal/api/model/application.go
@@ -43,13 +43,13 @@ type Application struct {
// And here: https://docs.joinmastodon.org/client/token/
type ApplicationCreateRequest struct {
// A name for your application
- ClientName string `form:"client_name" binding:"required"`
+ 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.
- RedirectURIs string `form:"redirect_uris" binding:"required"`
+ RedirectURIs string `form:"redirect_uris" json:"redirect_uris" xml:"redirect_uris" binding:"required"`
// Space separated list of scopes. If none is provided, defaults to read.
- Scopes string `form:"scopes"`
+ Scopes string `form:"scopes" json:"scopes" xml:"scopes"`
// A URL to the homepage of your app
- Website string `form:"website"`
+ Website string `form:"website" json:"website" xml:"website"`
}
diff --git a/internal/api/model/attachment.go b/internal/api/model/attachment.go
index c5dbb0cba..ed53757eb 100644
--- a/internal/api/model/attachment.go
+++ b/internal/api/model/attachment.go
@@ -24,15 +24,15 @@ import "mime/multipart"
// See: https://docs.joinmastodon.org/methods/statuses/media/
type AttachmentRequest struct {
File *multipart.FileHeader `form:"file" binding:"required"`
- Description string `form:"description" json:"description" xml:"description"`
- Focus string `form:"focus" json:"focus" xml:"focus"`
+ Description string `form:"description"`
+ Focus string `form:"focus"`
}
-// AttachmentRequest represents the form data parameters submitted by a client during a media update/PUT request.
+// AttachmentUpdateRequest represents the form data parameters submitted by a client during a media update/PUT request.
// See: https://docs.joinmastodon.org/methods/statuses/media/
type AttachmentUpdateRequest struct {
- Description *string `form:"description" json:"description" xml:"description"`
- Focus *string `form:"focus" json:"focus" xml:"focus"`
+ Description *string `form:"description" json:"description" xml:"description"`
+ Focus *string `form:"focus" json:"focus" xml:"focus"`
}
// Attachment represents the object returned to a client after a successful media upload request.
@@ -63,7 +63,7 @@ type Attachment struct {
// See https://docs.joinmastodon.org/methods/statuses/media/#focal-points points for more.
Meta MediaMeta `json:"meta,omitempty"`
// Alternate text that describes what is in the media attachment, to be used for the visually impaired or when media attachments do not load.
- Description string `json:"description"`
+ Description string `json:"description,omitempty"`
// 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"`
diff --git a/internal/api/model/status.go b/internal/api/model/status.go
index 54d021e29..2cb22aa0d 100644
--- a/internal/api/model/status.go
+++ b/internal/api/model/status.go
@@ -119,11 +119,15 @@ const (
VisibilityDirect Visibility = "direct"
)
+// AdvancedStatusCreateForm wraps the mastodon status create form along with the GTS advanced
+// visibility settings.
type AdvancedStatusCreateForm struct {
StatusCreateRequest
AdvancedVisibilityFlagsForm
}
+// AdvancedVisibilityFlagsForm allows a few more advanced flags to be set on new statuses, in addition
+// to the standard mastodon-compatible ones.
type AdvancedVisibilityFlagsForm struct {
// The gotosocial visibility model
VisibilityAdvanced *string `form:"visibility_advanced"`