forked from mtusi2026/mtusi2026lab5
API принимает 202 после durable staging и TX intent (job+outbox); отдельные relay и worker публикуют/обрабатывают задания с publisher confirm, lease, retry/backoff, DLQ и replay. Добавлены версии pipeline, варианты thumbnail/crop/optimized, presign в verified staging, status-aware sweeper и admission control.
2177 lines
53 KiB
Go
2177 lines
53 KiB
Go
// Code generated by ogen, DO NOT EDIT.
|
|
|
|
package oas
|
|
|
|
import (
|
|
"io"
|
|
"time"
|
|
|
|
"github.com/go-faster/errors"
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
// Ref: #/components/schemas/Attachment
|
|
type Attachment struct {
|
|
ChatID uuid.UUID `json:"chat_id"`
|
|
ContentType AttachmentContentType `json:"content_type"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
ErrorCode NilString `json:"error_code"`
|
|
Filename string `json:"filename"`
|
|
ID uuid.UUID `json:"id"`
|
|
OwnerID uuid.UUID `json:"owner_id"`
|
|
SHA256 string `json:"sha256"`
|
|
SizeBytes int `json:"size_bytes"`
|
|
Status AttachmentStatus `json:"status"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
Variants []Variant `json:"variants"`
|
|
}
|
|
|
|
// GetChatID returns the value of ChatID.
|
|
func (s *Attachment) GetChatID() uuid.UUID {
|
|
return s.ChatID
|
|
}
|
|
|
|
// GetContentType returns the value of ContentType.
|
|
func (s *Attachment) GetContentType() AttachmentContentType {
|
|
return s.ContentType
|
|
}
|
|
|
|
// GetCreatedAt returns the value of CreatedAt.
|
|
func (s *Attachment) GetCreatedAt() time.Time {
|
|
return s.CreatedAt
|
|
}
|
|
|
|
// GetErrorCode returns the value of ErrorCode.
|
|
func (s *Attachment) GetErrorCode() NilString {
|
|
return s.ErrorCode
|
|
}
|
|
|
|
// GetFilename returns the value of Filename.
|
|
func (s *Attachment) GetFilename() string {
|
|
return s.Filename
|
|
}
|
|
|
|
// GetID returns the value of ID.
|
|
func (s *Attachment) GetID() uuid.UUID {
|
|
return s.ID
|
|
}
|
|
|
|
// GetOwnerID returns the value of OwnerID.
|
|
func (s *Attachment) GetOwnerID() uuid.UUID {
|
|
return s.OwnerID
|
|
}
|
|
|
|
// GetSHA256 returns the value of SHA256.
|
|
func (s *Attachment) GetSHA256() string {
|
|
return s.SHA256
|
|
}
|
|
|
|
// GetSizeBytes returns the value of SizeBytes.
|
|
func (s *Attachment) GetSizeBytes() int {
|
|
return s.SizeBytes
|
|
}
|
|
|
|
// GetStatus returns the value of Status.
|
|
func (s *Attachment) GetStatus() AttachmentStatus {
|
|
return s.Status
|
|
}
|
|
|
|
// GetUpdatedAt returns the value of UpdatedAt.
|
|
func (s *Attachment) GetUpdatedAt() time.Time {
|
|
return s.UpdatedAt
|
|
}
|
|
|
|
// GetVariants returns the value of Variants.
|
|
func (s *Attachment) GetVariants() []Variant {
|
|
return s.Variants
|
|
}
|
|
|
|
// SetChatID sets the value of ChatID.
|
|
func (s *Attachment) SetChatID(val uuid.UUID) {
|
|
s.ChatID = val
|
|
}
|
|
|
|
// SetContentType sets the value of ContentType.
|
|
func (s *Attachment) SetContentType(val AttachmentContentType) {
|
|
s.ContentType = val
|
|
}
|
|
|
|
// SetCreatedAt sets the value of CreatedAt.
|
|
func (s *Attachment) SetCreatedAt(val time.Time) {
|
|
s.CreatedAt = val
|
|
}
|
|
|
|
// SetErrorCode sets the value of ErrorCode.
|
|
func (s *Attachment) SetErrorCode(val NilString) {
|
|
s.ErrorCode = val
|
|
}
|
|
|
|
// SetFilename sets the value of Filename.
|
|
func (s *Attachment) SetFilename(val string) {
|
|
s.Filename = val
|
|
}
|
|
|
|
// SetID sets the value of ID.
|
|
func (s *Attachment) SetID(val uuid.UUID) {
|
|
s.ID = val
|
|
}
|
|
|
|
// SetOwnerID sets the value of OwnerID.
|
|
func (s *Attachment) SetOwnerID(val uuid.UUID) {
|
|
s.OwnerID = val
|
|
}
|
|
|
|
// SetSHA256 sets the value of SHA256.
|
|
func (s *Attachment) SetSHA256(val string) {
|
|
s.SHA256 = val
|
|
}
|
|
|
|
// SetSizeBytes sets the value of SizeBytes.
|
|
func (s *Attachment) SetSizeBytes(val int) {
|
|
s.SizeBytes = val
|
|
}
|
|
|
|
// SetStatus sets the value of Status.
|
|
func (s *Attachment) SetStatus(val AttachmentStatus) {
|
|
s.Status = val
|
|
}
|
|
|
|
// SetUpdatedAt sets the value of UpdatedAt.
|
|
func (s *Attachment) SetUpdatedAt(val time.Time) {
|
|
s.UpdatedAt = val
|
|
}
|
|
|
|
// SetVariants sets the value of Variants.
|
|
func (s *Attachment) SetVariants(val []Variant) {
|
|
s.Variants = val
|
|
}
|
|
|
|
type AttachmentContentType string
|
|
|
|
const (
|
|
AttachmentContentTypeImagePNG AttachmentContentType = "image/png"
|
|
AttachmentContentTypeImageJpeg AttachmentContentType = "image/jpeg"
|
|
)
|
|
|
|
// AllValues returns all AttachmentContentType values.
|
|
func (AttachmentContentType) AllValues() []AttachmentContentType {
|
|
return []AttachmentContentType{
|
|
AttachmentContentTypeImagePNG,
|
|
AttachmentContentTypeImageJpeg,
|
|
}
|
|
}
|
|
|
|
// MarshalText implements encoding.TextMarshaler.
|
|
func (s AttachmentContentType) MarshalText() ([]byte, error) {
|
|
switch s {
|
|
case AttachmentContentTypeImagePNG:
|
|
return []byte(s), nil
|
|
case AttachmentContentTypeImageJpeg:
|
|
return []byte(s), nil
|
|
default:
|
|
return nil, errors.Errorf("invalid value: %q", s)
|
|
}
|
|
}
|
|
|
|
// UnmarshalText implements encoding.TextUnmarshaler.
|
|
func (s *AttachmentContentType) UnmarshalText(data []byte) error {
|
|
switch AttachmentContentType(data) {
|
|
case AttachmentContentTypeImagePNG:
|
|
*s = AttachmentContentTypeImagePNG
|
|
return nil
|
|
case AttachmentContentTypeImageJpeg:
|
|
*s = AttachmentContentTypeImageJpeg
|
|
return nil
|
|
default:
|
|
return errors.Errorf("invalid value: %q", data)
|
|
}
|
|
}
|
|
|
|
// AttachmentHeaders wraps Attachment with response headers.
|
|
type AttachmentHeaders struct {
|
|
XInstanceID OptString
|
|
XRequestID OptString
|
|
Response Attachment
|
|
}
|
|
|
|
// GetXInstanceID returns the value of XInstanceID.
|
|
func (s *AttachmentHeaders) GetXInstanceID() OptString {
|
|
return s.XInstanceID
|
|
}
|
|
|
|
// GetXRequestID returns the value of XRequestID.
|
|
func (s *AttachmentHeaders) GetXRequestID() OptString {
|
|
return s.XRequestID
|
|
}
|
|
|
|
// GetResponse returns the value of Response.
|
|
func (s *AttachmentHeaders) GetResponse() Attachment {
|
|
return s.Response
|
|
}
|
|
|
|
// SetXInstanceID sets the value of XInstanceID.
|
|
func (s *AttachmentHeaders) SetXInstanceID(val OptString) {
|
|
s.XInstanceID = val
|
|
}
|
|
|
|
// SetXRequestID sets the value of XRequestID.
|
|
func (s *AttachmentHeaders) SetXRequestID(val OptString) {
|
|
s.XRequestID = val
|
|
}
|
|
|
|
// SetResponse sets the value of Response.
|
|
func (s *AttachmentHeaders) SetResponse(val Attachment) {
|
|
s.Response = val
|
|
}
|
|
|
|
func (*AttachmentHeaders) getAttachmentRes() {}
|
|
func (*AttachmentHeaders) uploadAttachmentRes() {}
|
|
|
|
type AttachmentStatus string
|
|
|
|
const (
|
|
AttachmentStatusQueued AttachmentStatus = "queued"
|
|
AttachmentStatusProcessing AttachmentStatus = "processing"
|
|
AttachmentStatusReady AttachmentStatus = "ready"
|
|
AttachmentStatusFailed AttachmentStatus = "failed"
|
|
)
|
|
|
|
// AllValues returns all AttachmentStatus values.
|
|
func (AttachmentStatus) AllValues() []AttachmentStatus {
|
|
return []AttachmentStatus{
|
|
AttachmentStatusQueued,
|
|
AttachmentStatusProcessing,
|
|
AttachmentStatusReady,
|
|
AttachmentStatusFailed,
|
|
}
|
|
}
|
|
|
|
// MarshalText implements encoding.TextMarshaler.
|
|
func (s AttachmentStatus) MarshalText() ([]byte, error) {
|
|
switch s {
|
|
case AttachmentStatusQueued:
|
|
return []byte(s), nil
|
|
case AttachmentStatusProcessing:
|
|
return []byte(s), nil
|
|
case AttachmentStatusReady:
|
|
return []byte(s), nil
|
|
case AttachmentStatusFailed:
|
|
return []byte(s), nil
|
|
default:
|
|
return nil, errors.Errorf("invalid value: %q", s)
|
|
}
|
|
}
|
|
|
|
// UnmarshalText implements encoding.TextUnmarshaler.
|
|
func (s *AttachmentStatus) UnmarshalText(data []byte) error {
|
|
switch AttachmentStatus(data) {
|
|
case AttachmentStatusQueued:
|
|
*s = AttachmentStatusQueued
|
|
return nil
|
|
case AttachmentStatusProcessing:
|
|
*s = AttachmentStatusProcessing
|
|
return nil
|
|
case AttachmentStatusReady:
|
|
*s = AttachmentStatusReady
|
|
return nil
|
|
case AttachmentStatusFailed:
|
|
*s = AttachmentStatusFailed
|
|
return nil
|
|
default:
|
|
return errors.Errorf("invalid value: %q", data)
|
|
}
|
|
}
|
|
|
|
type BasicAuth struct {
|
|
Username string
|
|
Password string
|
|
Roles []string
|
|
}
|
|
|
|
// GetUsername returns the value of Username.
|
|
func (s *BasicAuth) GetUsername() string {
|
|
return s.Username
|
|
}
|
|
|
|
// GetPassword returns the value of Password.
|
|
func (s *BasicAuth) GetPassword() string {
|
|
return s.Password
|
|
}
|
|
|
|
// GetRoles returns the value of Roles.
|
|
func (s *BasicAuth) GetRoles() []string {
|
|
return s.Roles
|
|
}
|
|
|
|
// SetUsername sets the value of Username.
|
|
func (s *BasicAuth) SetUsername(val string) {
|
|
s.Username = val
|
|
}
|
|
|
|
// SetPassword sets the value of Password.
|
|
func (s *BasicAuth) SetPassword(val string) {
|
|
s.Password = val
|
|
}
|
|
|
|
// SetRoles sets the value of Roles.
|
|
func (s *BasicAuth) SetRoles(val []string) {
|
|
s.Roles = val
|
|
}
|
|
|
|
type BearerAuth struct {
|
|
Token string
|
|
Roles []string
|
|
}
|
|
|
|
// GetToken returns the value of Token.
|
|
func (s *BearerAuth) GetToken() string {
|
|
return s.Token
|
|
}
|
|
|
|
// GetRoles returns the value of Roles.
|
|
func (s *BearerAuth) GetRoles() []string {
|
|
return s.Roles
|
|
}
|
|
|
|
// SetToken sets the value of Token.
|
|
func (s *BearerAuth) SetToken(val string) {
|
|
s.Token = val
|
|
}
|
|
|
|
// SetRoles sets the value of Roles.
|
|
func (s *BearerAuth) SetRoles(val []string) {
|
|
s.Roles = val
|
|
}
|
|
|
|
// Ref: #/components/schemas/Chat
|
|
type Chat struct {
|
|
CreatedAt time.Time `json:"created_at"`
|
|
ID uuid.UUID `json:"id"`
|
|
MemberIds []uuid.UUID `json:"member_ids"`
|
|
Title string `json:"title"`
|
|
}
|
|
|
|
// GetCreatedAt returns the value of CreatedAt.
|
|
func (s *Chat) GetCreatedAt() time.Time {
|
|
return s.CreatedAt
|
|
}
|
|
|
|
// GetID returns the value of ID.
|
|
func (s *Chat) GetID() uuid.UUID {
|
|
return s.ID
|
|
}
|
|
|
|
// GetMemberIds returns the value of MemberIds.
|
|
func (s *Chat) GetMemberIds() []uuid.UUID {
|
|
return s.MemberIds
|
|
}
|
|
|
|
// GetTitle returns the value of Title.
|
|
func (s *Chat) GetTitle() string {
|
|
return s.Title
|
|
}
|
|
|
|
// SetCreatedAt sets the value of CreatedAt.
|
|
func (s *Chat) SetCreatedAt(val time.Time) {
|
|
s.CreatedAt = val
|
|
}
|
|
|
|
// SetID sets the value of ID.
|
|
func (s *Chat) SetID(val uuid.UUID) {
|
|
s.ID = val
|
|
}
|
|
|
|
// SetMemberIds sets the value of MemberIds.
|
|
func (s *Chat) SetMemberIds(val []uuid.UUID) {
|
|
s.MemberIds = val
|
|
}
|
|
|
|
// SetTitle sets the value of Title.
|
|
func (s *Chat) SetTitle(val string) {
|
|
s.Title = val
|
|
}
|
|
|
|
// ChatHeaders wraps Chat with response headers.
|
|
type ChatHeaders struct {
|
|
XInstanceID OptString
|
|
XRequestID OptString
|
|
Response Chat
|
|
}
|
|
|
|
// GetXInstanceID returns the value of XInstanceID.
|
|
func (s *ChatHeaders) GetXInstanceID() OptString {
|
|
return s.XInstanceID
|
|
}
|
|
|
|
// GetXRequestID returns the value of XRequestID.
|
|
func (s *ChatHeaders) GetXRequestID() OptString {
|
|
return s.XRequestID
|
|
}
|
|
|
|
// GetResponse returns the value of Response.
|
|
func (s *ChatHeaders) GetResponse() Chat {
|
|
return s.Response
|
|
}
|
|
|
|
// SetXInstanceID sets the value of XInstanceID.
|
|
func (s *ChatHeaders) SetXInstanceID(val OptString) {
|
|
s.XInstanceID = val
|
|
}
|
|
|
|
// SetXRequestID sets the value of XRequestID.
|
|
func (s *ChatHeaders) SetXRequestID(val OptString) {
|
|
s.XRequestID = val
|
|
}
|
|
|
|
// SetResponse sets the value of Response.
|
|
func (s *ChatHeaders) SetResponse(val Chat) {
|
|
s.Response = val
|
|
}
|
|
|
|
func (*ChatHeaders) createChatRes() {}
|
|
func (*ChatHeaders) getChatRes() {}
|
|
|
|
// Ref: #/components/schemas/ChatPage
|
|
type ChatPage struct {
|
|
Items []Chat `json:"items"`
|
|
NextCursor NilString `json:"next_cursor"`
|
|
}
|
|
|
|
// GetItems returns the value of Items.
|
|
func (s *ChatPage) GetItems() []Chat {
|
|
return s.Items
|
|
}
|
|
|
|
// GetNextCursor returns the value of NextCursor.
|
|
func (s *ChatPage) GetNextCursor() NilString {
|
|
return s.NextCursor
|
|
}
|
|
|
|
// SetItems sets the value of Items.
|
|
func (s *ChatPage) SetItems(val []Chat) {
|
|
s.Items = val
|
|
}
|
|
|
|
// SetNextCursor sets the value of NextCursor.
|
|
func (s *ChatPage) SetNextCursor(val NilString) {
|
|
s.NextCursor = val
|
|
}
|
|
|
|
// ChatPageHeaders wraps ChatPage with response headers.
|
|
type ChatPageHeaders struct {
|
|
XInstanceID OptString
|
|
XRequestID OptString
|
|
Response ChatPage
|
|
}
|
|
|
|
// GetXInstanceID returns the value of XInstanceID.
|
|
func (s *ChatPageHeaders) GetXInstanceID() OptString {
|
|
return s.XInstanceID
|
|
}
|
|
|
|
// GetXRequestID returns the value of XRequestID.
|
|
func (s *ChatPageHeaders) GetXRequestID() OptString {
|
|
return s.XRequestID
|
|
}
|
|
|
|
// GetResponse returns the value of Response.
|
|
func (s *ChatPageHeaders) GetResponse() ChatPage {
|
|
return s.Response
|
|
}
|
|
|
|
// SetXInstanceID sets the value of XInstanceID.
|
|
func (s *ChatPageHeaders) SetXInstanceID(val OptString) {
|
|
s.XInstanceID = val
|
|
}
|
|
|
|
// SetXRequestID sets the value of XRequestID.
|
|
func (s *ChatPageHeaders) SetXRequestID(val OptString) {
|
|
s.XRequestID = val
|
|
}
|
|
|
|
// SetResponse sets the value of Response.
|
|
func (s *ChatPageHeaders) SetResponse(val ChatPage) {
|
|
s.Response = val
|
|
}
|
|
|
|
func (*ChatPageHeaders) listChatsRes() {}
|
|
|
|
// Ref: #/components/schemas/CreateChat
|
|
type CreateChat struct {
|
|
MemberIds []uuid.UUID `json:"member_ids"`
|
|
Title string `json:"title"`
|
|
}
|
|
|
|
// GetMemberIds returns the value of MemberIds.
|
|
func (s *CreateChat) GetMemberIds() []uuid.UUID {
|
|
return s.MemberIds
|
|
}
|
|
|
|
// GetTitle returns the value of Title.
|
|
func (s *CreateChat) GetTitle() string {
|
|
return s.Title
|
|
}
|
|
|
|
// SetMemberIds sets the value of MemberIds.
|
|
func (s *CreateChat) SetMemberIds(val []uuid.UUID) {
|
|
s.MemberIds = val
|
|
}
|
|
|
|
// SetTitle sets the value of Title.
|
|
func (s *CreateChat) SetTitle(val string) {
|
|
s.Title = val
|
|
}
|
|
|
|
type CreateChatBadRequest ErrorHeaders
|
|
|
|
func (*CreateChatBadRequest) createChatRes() {}
|
|
|
|
type CreateChatConflict ErrorHeaders
|
|
|
|
func (*CreateChatConflict) createChatRes() {}
|
|
|
|
type CreateChatInternalServerError ErrorHeaders
|
|
|
|
func (*CreateChatInternalServerError) createChatRes() {}
|
|
|
|
type CreateChatNotFound ErrorHeaders
|
|
|
|
func (*CreateChatNotFound) createChatRes() {}
|
|
|
|
type CreateChatServiceUnavailable ErrorHeaders
|
|
|
|
func (*CreateChatServiceUnavailable) createChatRes() {}
|
|
|
|
// Ref: #/components/schemas/CreateMessage
|
|
type CreateMessage struct {
|
|
AttachmentIds []uuid.UUID `json:"attachment_ids"`
|
|
Text string `json:"text"`
|
|
}
|
|
|
|
// GetAttachmentIds returns the value of AttachmentIds.
|
|
func (s *CreateMessage) GetAttachmentIds() []uuid.UUID {
|
|
return s.AttachmentIds
|
|
}
|
|
|
|
// GetText returns the value of Text.
|
|
func (s *CreateMessage) GetText() string {
|
|
return s.Text
|
|
}
|
|
|
|
// SetAttachmentIds sets the value of AttachmentIds.
|
|
func (s *CreateMessage) SetAttachmentIds(val []uuid.UUID) {
|
|
s.AttachmentIds = val
|
|
}
|
|
|
|
// SetText sets the value of Text.
|
|
func (s *CreateMessage) SetText(val string) {
|
|
s.Text = val
|
|
}
|
|
|
|
type CreateMessageBadRequest ErrorHeaders
|
|
|
|
func (*CreateMessageBadRequest) createMessageRes() {}
|
|
|
|
type CreateMessageConflict ErrorHeaders
|
|
|
|
func (*CreateMessageConflict) createMessageRes() {}
|
|
|
|
type CreateMessageInternalServerError ErrorHeaders
|
|
|
|
func (*CreateMessageInternalServerError) createMessageRes() {}
|
|
|
|
type CreateMessageNotFound ErrorHeaders
|
|
|
|
func (*CreateMessageNotFound) createMessageRes() {}
|
|
|
|
type CreateMessageServiceUnavailable ErrorHeaders
|
|
|
|
func (*CreateMessageServiceUnavailable) createMessageRes() {}
|
|
|
|
type CreateSessionBadRequest ErrorHeaders
|
|
|
|
func (*CreateSessionBadRequest) createSessionRes() {}
|
|
|
|
type CreateSessionInternalServerError ErrorHeaders
|
|
|
|
func (*CreateSessionInternalServerError) createSessionRes() {}
|
|
|
|
type CreateSessionServiceUnavailable ErrorHeaders
|
|
|
|
func (*CreateSessionServiceUnavailable) createSessionRes() {}
|
|
|
|
// Ref: #/components/schemas/CreateUser
|
|
type CreateUser struct {
|
|
DisplayName string `json:"display_name"`
|
|
Password string `json:"password"`
|
|
Username string `json:"username"`
|
|
}
|
|
|
|
// GetDisplayName returns the value of DisplayName.
|
|
func (s *CreateUser) GetDisplayName() string {
|
|
return s.DisplayName
|
|
}
|
|
|
|
// GetPassword returns the value of Password.
|
|
func (s *CreateUser) GetPassword() string {
|
|
return s.Password
|
|
}
|
|
|
|
// GetUsername returns the value of Username.
|
|
func (s *CreateUser) GetUsername() string {
|
|
return s.Username
|
|
}
|
|
|
|
// SetDisplayName sets the value of DisplayName.
|
|
func (s *CreateUser) SetDisplayName(val string) {
|
|
s.DisplayName = val
|
|
}
|
|
|
|
// SetPassword sets the value of Password.
|
|
func (s *CreateUser) SetPassword(val string) {
|
|
s.Password = val
|
|
}
|
|
|
|
// SetUsername sets the value of Username.
|
|
func (s *CreateUser) SetUsername(val string) {
|
|
s.Username = val
|
|
}
|
|
|
|
type CurrentUserBadRequest ErrorHeaders
|
|
|
|
func (*CurrentUserBadRequest) currentUserRes() {}
|
|
|
|
type CurrentUserConflict ErrorHeaders
|
|
|
|
func (*CurrentUserConflict) currentUserRes() {}
|
|
|
|
type CurrentUserInternalServerError ErrorHeaders
|
|
|
|
func (*CurrentUserInternalServerError) currentUserRes() {}
|
|
|
|
type CurrentUserNotFound ErrorHeaders
|
|
|
|
func (*CurrentUserNotFound) currentUserRes() {}
|
|
|
|
type CurrentUserServiceUnavailable ErrorHeaders
|
|
|
|
func (*CurrentUserServiceUnavailable) currentUserRes() {}
|
|
|
|
type DownloadAttachmentBadRequest ErrorHeaders
|
|
|
|
func (*DownloadAttachmentBadRequest) downloadAttachmentRes() {}
|
|
|
|
type DownloadAttachmentConflict ErrorHeaders
|
|
|
|
func (*DownloadAttachmentConflict) downloadAttachmentRes() {}
|
|
|
|
type DownloadAttachmentInternalServerError ErrorHeaders
|
|
|
|
func (*DownloadAttachmentInternalServerError) downloadAttachmentRes() {}
|
|
|
|
type DownloadAttachmentNotFound ErrorHeaders
|
|
|
|
func (*DownloadAttachmentNotFound) downloadAttachmentRes() {}
|
|
|
|
type DownloadAttachmentOKImageJpeg struct {
|
|
Data io.Reader
|
|
}
|
|
|
|
// Read reads data from the Data reader.
|
|
//
|
|
// Kept to satisfy the io.Reader interface.
|
|
func (s DownloadAttachmentOKImageJpeg) Read(p []byte) (n int, err error) {
|
|
if s.Data == nil {
|
|
return 0, io.EOF
|
|
}
|
|
return s.Data.Read(p)
|
|
}
|
|
|
|
// DownloadAttachmentOKImageJpegHeaders wraps DownloadAttachmentOKImageJpeg with response headers.
|
|
type DownloadAttachmentOKImageJpegHeaders struct {
|
|
XInstanceID OptString
|
|
XRequestID OptString
|
|
Response DownloadAttachmentOKImageJpeg
|
|
}
|
|
|
|
// GetXInstanceID returns the value of XInstanceID.
|
|
func (s *DownloadAttachmentOKImageJpegHeaders) GetXInstanceID() OptString {
|
|
return s.XInstanceID
|
|
}
|
|
|
|
// GetXRequestID returns the value of XRequestID.
|
|
func (s *DownloadAttachmentOKImageJpegHeaders) GetXRequestID() OptString {
|
|
return s.XRequestID
|
|
}
|
|
|
|
// GetResponse returns the value of Response.
|
|
func (s *DownloadAttachmentOKImageJpegHeaders) GetResponse() DownloadAttachmentOKImageJpeg {
|
|
return s.Response
|
|
}
|
|
|
|
// SetXInstanceID sets the value of XInstanceID.
|
|
func (s *DownloadAttachmentOKImageJpegHeaders) SetXInstanceID(val OptString) {
|
|
s.XInstanceID = val
|
|
}
|
|
|
|
// SetXRequestID sets the value of XRequestID.
|
|
func (s *DownloadAttachmentOKImageJpegHeaders) SetXRequestID(val OptString) {
|
|
s.XRequestID = val
|
|
}
|
|
|
|
// SetResponse sets the value of Response.
|
|
func (s *DownloadAttachmentOKImageJpegHeaders) SetResponse(val DownloadAttachmentOKImageJpeg) {
|
|
s.Response = val
|
|
}
|
|
|
|
func (*DownloadAttachmentOKImageJpegHeaders) downloadAttachmentRes() {}
|
|
|
|
type DownloadAttachmentOKImagePNG struct {
|
|
Data io.Reader
|
|
}
|
|
|
|
// Read reads data from the Data reader.
|
|
//
|
|
// Kept to satisfy the io.Reader interface.
|
|
func (s DownloadAttachmentOKImagePNG) Read(p []byte) (n int, err error) {
|
|
if s.Data == nil {
|
|
return 0, io.EOF
|
|
}
|
|
return s.Data.Read(p)
|
|
}
|
|
|
|
// DownloadAttachmentOKImagePNGHeaders wraps DownloadAttachmentOKImagePNG with response headers.
|
|
type DownloadAttachmentOKImagePNGHeaders struct {
|
|
XInstanceID OptString
|
|
XRequestID OptString
|
|
Response DownloadAttachmentOKImagePNG
|
|
}
|
|
|
|
// GetXInstanceID returns the value of XInstanceID.
|
|
func (s *DownloadAttachmentOKImagePNGHeaders) GetXInstanceID() OptString {
|
|
return s.XInstanceID
|
|
}
|
|
|
|
// GetXRequestID returns the value of XRequestID.
|
|
func (s *DownloadAttachmentOKImagePNGHeaders) GetXRequestID() OptString {
|
|
return s.XRequestID
|
|
}
|
|
|
|
// GetResponse returns the value of Response.
|
|
func (s *DownloadAttachmentOKImagePNGHeaders) GetResponse() DownloadAttachmentOKImagePNG {
|
|
return s.Response
|
|
}
|
|
|
|
// SetXInstanceID sets the value of XInstanceID.
|
|
func (s *DownloadAttachmentOKImagePNGHeaders) SetXInstanceID(val OptString) {
|
|
s.XInstanceID = val
|
|
}
|
|
|
|
// SetXRequestID sets the value of XRequestID.
|
|
func (s *DownloadAttachmentOKImagePNGHeaders) SetXRequestID(val OptString) {
|
|
s.XRequestID = val
|
|
}
|
|
|
|
// SetResponse sets the value of Response.
|
|
func (s *DownloadAttachmentOKImagePNGHeaders) SetResponse(val DownloadAttachmentOKImagePNG) {
|
|
s.Response = val
|
|
}
|
|
|
|
func (*DownloadAttachmentOKImagePNGHeaders) downloadAttachmentRes() {}
|
|
|
|
type DownloadAttachmentOKImageWEBP struct {
|
|
Data io.Reader
|
|
}
|
|
|
|
// Read reads data from the Data reader.
|
|
//
|
|
// Kept to satisfy the io.Reader interface.
|
|
func (s DownloadAttachmentOKImageWEBP) Read(p []byte) (n int, err error) {
|
|
if s.Data == nil {
|
|
return 0, io.EOF
|
|
}
|
|
return s.Data.Read(p)
|
|
}
|
|
|
|
// DownloadAttachmentOKImageWEBPHeaders wraps DownloadAttachmentOKImageWEBP with response headers.
|
|
type DownloadAttachmentOKImageWEBPHeaders struct {
|
|
XInstanceID OptString
|
|
XRequestID OptString
|
|
Response DownloadAttachmentOKImageWEBP
|
|
}
|
|
|
|
// GetXInstanceID returns the value of XInstanceID.
|
|
func (s *DownloadAttachmentOKImageWEBPHeaders) GetXInstanceID() OptString {
|
|
return s.XInstanceID
|
|
}
|
|
|
|
// GetXRequestID returns the value of XRequestID.
|
|
func (s *DownloadAttachmentOKImageWEBPHeaders) GetXRequestID() OptString {
|
|
return s.XRequestID
|
|
}
|
|
|
|
// GetResponse returns the value of Response.
|
|
func (s *DownloadAttachmentOKImageWEBPHeaders) GetResponse() DownloadAttachmentOKImageWEBP {
|
|
return s.Response
|
|
}
|
|
|
|
// SetXInstanceID sets the value of XInstanceID.
|
|
func (s *DownloadAttachmentOKImageWEBPHeaders) SetXInstanceID(val OptString) {
|
|
s.XInstanceID = val
|
|
}
|
|
|
|
// SetXRequestID sets the value of XRequestID.
|
|
func (s *DownloadAttachmentOKImageWEBPHeaders) SetXRequestID(val OptString) {
|
|
s.XRequestID = val
|
|
}
|
|
|
|
// SetResponse sets the value of Response.
|
|
func (s *DownloadAttachmentOKImageWEBPHeaders) SetResponse(val DownloadAttachmentOKImageWEBP) {
|
|
s.Response = val
|
|
}
|
|
|
|
func (*DownloadAttachmentOKImageWEBPHeaders) downloadAttachmentRes() {}
|
|
|
|
type DownloadAttachmentServiceUnavailable ErrorHeaders
|
|
|
|
func (*DownloadAttachmentServiceUnavailable) downloadAttachmentRes() {}
|
|
|
|
type DownloadAttachmentVariant string
|
|
|
|
const (
|
|
DownloadAttachmentVariantOriginal DownloadAttachmentVariant = "original"
|
|
DownloadAttachmentVariantThumbnail DownloadAttachmentVariant = "thumbnail"
|
|
DownloadAttachmentVariantCrop DownloadAttachmentVariant = "crop"
|
|
DownloadAttachmentVariantOptimized DownloadAttachmentVariant = "optimized"
|
|
)
|
|
|
|
// AllValues returns all DownloadAttachmentVariant values.
|
|
func (DownloadAttachmentVariant) AllValues() []DownloadAttachmentVariant {
|
|
return []DownloadAttachmentVariant{
|
|
DownloadAttachmentVariantOriginal,
|
|
DownloadAttachmentVariantThumbnail,
|
|
DownloadAttachmentVariantCrop,
|
|
DownloadAttachmentVariantOptimized,
|
|
}
|
|
}
|
|
|
|
// MarshalText implements encoding.TextMarshaler.
|
|
func (s DownloadAttachmentVariant) MarshalText() ([]byte, error) {
|
|
switch s {
|
|
case DownloadAttachmentVariantOriginal:
|
|
return []byte(s), nil
|
|
case DownloadAttachmentVariantThumbnail:
|
|
return []byte(s), nil
|
|
case DownloadAttachmentVariantCrop:
|
|
return []byte(s), nil
|
|
case DownloadAttachmentVariantOptimized:
|
|
return []byte(s), nil
|
|
default:
|
|
return nil, errors.Errorf("invalid value: %q", s)
|
|
}
|
|
}
|
|
|
|
// UnmarshalText implements encoding.TextUnmarshaler.
|
|
func (s *DownloadAttachmentVariant) UnmarshalText(data []byte) error {
|
|
switch DownloadAttachmentVariant(data) {
|
|
case DownloadAttachmentVariantOriginal:
|
|
*s = DownloadAttachmentVariantOriginal
|
|
return nil
|
|
case DownloadAttachmentVariantThumbnail:
|
|
*s = DownloadAttachmentVariantThumbnail
|
|
return nil
|
|
case DownloadAttachmentVariantCrop:
|
|
*s = DownloadAttachmentVariantCrop
|
|
return nil
|
|
case DownloadAttachmentVariantOptimized:
|
|
*s = DownloadAttachmentVariantOptimized
|
|
return nil
|
|
default:
|
|
return errors.Errorf("invalid value: %q", data)
|
|
}
|
|
}
|
|
|
|
// Ref: #/components/schemas/Error
|
|
type Error struct {
|
|
Error ErrorError `json:"error"`
|
|
}
|
|
|
|
// GetError returns the value of Error.
|
|
func (s *Error) GetError() ErrorError {
|
|
return s.Error
|
|
}
|
|
|
|
// SetError sets the value of Error.
|
|
func (s *Error) SetError(val ErrorError) {
|
|
s.Error = val
|
|
}
|
|
|
|
type ErrorError struct {
|
|
Code ErrorErrorCode `json:"code"`
|
|
Message string `json:"message"`
|
|
RequestID string `json:"request_id"`
|
|
}
|
|
|
|
// GetCode returns the value of Code.
|
|
func (s *ErrorError) GetCode() ErrorErrorCode {
|
|
return s.Code
|
|
}
|
|
|
|
// GetMessage returns the value of Message.
|
|
func (s *ErrorError) GetMessage() string {
|
|
return s.Message
|
|
}
|
|
|
|
// GetRequestID returns the value of RequestID.
|
|
func (s *ErrorError) GetRequestID() string {
|
|
return s.RequestID
|
|
}
|
|
|
|
// SetCode sets the value of Code.
|
|
func (s *ErrorError) SetCode(val ErrorErrorCode) {
|
|
s.Code = val
|
|
}
|
|
|
|
// SetMessage sets the value of Message.
|
|
func (s *ErrorError) SetMessage(val string) {
|
|
s.Message = val
|
|
}
|
|
|
|
// SetRequestID sets the value of RequestID.
|
|
func (s *ErrorError) SetRequestID(val string) {
|
|
s.RequestID = val
|
|
}
|
|
|
|
type ErrorErrorCode string
|
|
|
|
const (
|
|
ErrorErrorCodeInvalidRequest ErrorErrorCode = "invalid_request"
|
|
ErrorErrorCodeUnauthorized ErrorErrorCode = "unauthorized"
|
|
ErrorErrorCodeNotFound ErrorErrorCode = "not_found"
|
|
ErrorErrorCodeConflict ErrorErrorCode = "conflict"
|
|
ErrorErrorCodePayloadTooLarge ErrorErrorCode = "payload_too_large"
|
|
ErrorErrorCodeUnsupportedMediaType ErrorErrorCode = "unsupported_media_type"
|
|
ErrorErrorCodeRateLimited ErrorErrorCode = "rate_limited"
|
|
ErrorErrorCodeUnavailable ErrorErrorCode = "unavailable"
|
|
ErrorErrorCodeInternalError ErrorErrorCode = "internal_error"
|
|
)
|
|
|
|
// AllValues returns all ErrorErrorCode values.
|
|
func (ErrorErrorCode) AllValues() []ErrorErrorCode {
|
|
return []ErrorErrorCode{
|
|
ErrorErrorCodeInvalidRequest,
|
|
ErrorErrorCodeUnauthorized,
|
|
ErrorErrorCodeNotFound,
|
|
ErrorErrorCodeConflict,
|
|
ErrorErrorCodePayloadTooLarge,
|
|
ErrorErrorCodeUnsupportedMediaType,
|
|
ErrorErrorCodeRateLimited,
|
|
ErrorErrorCodeUnavailable,
|
|
ErrorErrorCodeInternalError,
|
|
}
|
|
}
|
|
|
|
// MarshalText implements encoding.TextMarshaler.
|
|
func (s ErrorErrorCode) MarshalText() ([]byte, error) {
|
|
switch s {
|
|
case ErrorErrorCodeInvalidRequest:
|
|
return []byte(s), nil
|
|
case ErrorErrorCodeUnauthorized:
|
|
return []byte(s), nil
|
|
case ErrorErrorCodeNotFound:
|
|
return []byte(s), nil
|
|
case ErrorErrorCodeConflict:
|
|
return []byte(s), nil
|
|
case ErrorErrorCodePayloadTooLarge:
|
|
return []byte(s), nil
|
|
case ErrorErrorCodeUnsupportedMediaType:
|
|
return []byte(s), nil
|
|
case ErrorErrorCodeRateLimited:
|
|
return []byte(s), nil
|
|
case ErrorErrorCodeUnavailable:
|
|
return []byte(s), nil
|
|
case ErrorErrorCodeInternalError:
|
|
return []byte(s), nil
|
|
default:
|
|
return nil, errors.Errorf("invalid value: %q", s)
|
|
}
|
|
}
|
|
|
|
// UnmarshalText implements encoding.TextUnmarshaler.
|
|
func (s *ErrorErrorCode) UnmarshalText(data []byte) error {
|
|
switch ErrorErrorCode(data) {
|
|
case ErrorErrorCodeInvalidRequest:
|
|
*s = ErrorErrorCodeInvalidRequest
|
|
return nil
|
|
case ErrorErrorCodeUnauthorized:
|
|
*s = ErrorErrorCodeUnauthorized
|
|
return nil
|
|
case ErrorErrorCodeNotFound:
|
|
*s = ErrorErrorCodeNotFound
|
|
return nil
|
|
case ErrorErrorCodeConflict:
|
|
*s = ErrorErrorCodeConflict
|
|
return nil
|
|
case ErrorErrorCodePayloadTooLarge:
|
|
*s = ErrorErrorCodePayloadTooLarge
|
|
return nil
|
|
case ErrorErrorCodeUnsupportedMediaType:
|
|
*s = ErrorErrorCodeUnsupportedMediaType
|
|
return nil
|
|
case ErrorErrorCodeRateLimited:
|
|
*s = ErrorErrorCodeRateLimited
|
|
return nil
|
|
case ErrorErrorCodeUnavailable:
|
|
*s = ErrorErrorCodeUnavailable
|
|
return nil
|
|
case ErrorErrorCodeInternalError:
|
|
*s = ErrorErrorCodeInternalError
|
|
return nil
|
|
default:
|
|
return errors.Errorf("invalid value: %q", data)
|
|
}
|
|
}
|
|
|
|
// ErrorHeaders wraps Error with response headers.
|
|
type ErrorHeaders struct {
|
|
XInstanceID OptString
|
|
XRequestID OptString
|
|
Response Error
|
|
}
|
|
|
|
// GetXInstanceID returns the value of XInstanceID.
|
|
func (s *ErrorHeaders) GetXInstanceID() OptString {
|
|
return s.XInstanceID
|
|
}
|
|
|
|
// GetXRequestID returns the value of XRequestID.
|
|
func (s *ErrorHeaders) GetXRequestID() OptString {
|
|
return s.XRequestID
|
|
}
|
|
|
|
// GetResponse returns the value of Response.
|
|
func (s *ErrorHeaders) GetResponse() Error {
|
|
return s.Response
|
|
}
|
|
|
|
// SetXInstanceID sets the value of XInstanceID.
|
|
func (s *ErrorHeaders) SetXInstanceID(val OptString) {
|
|
s.XInstanceID = val
|
|
}
|
|
|
|
// SetXRequestID sets the value of XRequestID.
|
|
func (s *ErrorHeaders) SetXRequestID(val OptString) {
|
|
s.XRequestID = val
|
|
}
|
|
|
|
// SetResponse sets the value of Response.
|
|
func (s *ErrorHeaders) SetResponse(val Error) {
|
|
s.Response = val
|
|
}
|
|
|
|
func (*ErrorHeaders) livenessRes() {}
|
|
|
|
type GetAttachmentBadRequest ErrorHeaders
|
|
|
|
func (*GetAttachmentBadRequest) getAttachmentRes() {}
|
|
|
|
type GetAttachmentConflict ErrorHeaders
|
|
|
|
func (*GetAttachmentConflict) getAttachmentRes() {}
|
|
|
|
type GetAttachmentInternalServerError ErrorHeaders
|
|
|
|
func (*GetAttachmentInternalServerError) getAttachmentRes() {}
|
|
|
|
type GetAttachmentNotFound ErrorHeaders
|
|
|
|
func (*GetAttachmentNotFound) getAttachmentRes() {}
|
|
|
|
type GetAttachmentServiceUnavailable ErrorHeaders
|
|
|
|
func (*GetAttachmentServiceUnavailable) getAttachmentRes() {}
|
|
|
|
// GetAttachmentTooManyRequestsHeaders wraps Error with response headers.
|
|
type GetAttachmentTooManyRequestsHeaders struct {
|
|
RetryAfter OptInt
|
|
XInstanceID OptString
|
|
XRequestID OptString
|
|
Response Error
|
|
}
|
|
|
|
// GetRetryAfter returns the value of RetryAfter.
|
|
func (s *GetAttachmentTooManyRequestsHeaders) GetRetryAfter() OptInt {
|
|
return s.RetryAfter
|
|
}
|
|
|
|
// GetXInstanceID returns the value of XInstanceID.
|
|
func (s *GetAttachmentTooManyRequestsHeaders) GetXInstanceID() OptString {
|
|
return s.XInstanceID
|
|
}
|
|
|
|
// GetXRequestID returns the value of XRequestID.
|
|
func (s *GetAttachmentTooManyRequestsHeaders) GetXRequestID() OptString {
|
|
return s.XRequestID
|
|
}
|
|
|
|
// GetResponse returns the value of Response.
|
|
func (s *GetAttachmentTooManyRequestsHeaders) GetResponse() Error {
|
|
return s.Response
|
|
}
|
|
|
|
// SetRetryAfter sets the value of RetryAfter.
|
|
func (s *GetAttachmentTooManyRequestsHeaders) SetRetryAfter(val OptInt) {
|
|
s.RetryAfter = val
|
|
}
|
|
|
|
// SetXInstanceID sets the value of XInstanceID.
|
|
func (s *GetAttachmentTooManyRequestsHeaders) SetXInstanceID(val OptString) {
|
|
s.XInstanceID = val
|
|
}
|
|
|
|
// SetXRequestID sets the value of XRequestID.
|
|
func (s *GetAttachmentTooManyRequestsHeaders) SetXRequestID(val OptString) {
|
|
s.XRequestID = val
|
|
}
|
|
|
|
// SetResponse sets the value of Response.
|
|
func (s *GetAttachmentTooManyRequestsHeaders) SetResponse(val Error) {
|
|
s.Response = val
|
|
}
|
|
|
|
func (*GetAttachmentTooManyRequestsHeaders) createChatRes() {}
|
|
func (*GetAttachmentTooManyRequestsHeaders) createMessageRes() {}
|
|
func (*GetAttachmentTooManyRequestsHeaders) createSessionRes() {}
|
|
func (*GetAttachmentTooManyRequestsHeaders) currentUserRes() {}
|
|
func (*GetAttachmentTooManyRequestsHeaders) downloadAttachmentRes() {}
|
|
func (*GetAttachmentTooManyRequestsHeaders) getAttachmentRes() {}
|
|
func (*GetAttachmentTooManyRequestsHeaders) getChatRes() {}
|
|
func (*GetAttachmentTooManyRequestsHeaders) listChatsRes() {}
|
|
func (*GetAttachmentTooManyRequestsHeaders) listMessagesRes() {}
|
|
func (*GetAttachmentTooManyRequestsHeaders) registerUserRes() {}
|
|
func (*GetAttachmentTooManyRequestsHeaders) revokeSessionRes() {}
|
|
func (*GetAttachmentTooManyRequestsHeaders) uploadAttachmentRes() {}
|
|
|
|
// GetAttachmentUnauthorizedHeaders wraps Error with response headers.
|
|
type GetAttachmentUnauthorizedHeaders struct {
|
|
WWWAuthenticate OptString
|
|
XInstanceID OptString
|
|
XRequestID OptString
|
|
Response Error
|
|
}
|
|
|
|
// GetWWWAuthenticate returns the value of WWWAuthenticate.
|
|
func (s *GetAttachmentUnauthorizedHeaders) GetWWWAuthenticate() OptString {
|
|
return s.WWWAuthenticate
|
|
}
|
|
|
|
// GetXInstanceID returns the value of XInstanceID.
|
|
func (s *GetAttachmentUnauthorizedHeaders) GetXInstanceID() OptString {
|
|
return s.XInstanceID
|
|
}
|
|
|
|
// GetXRequestID returns the value of XRequestID.
|
|
func (s *GetAttachmentUnauthorizedHeaders) GetXRequestID() OptString {
|
|
return s.XRequestID
|
|
}
|
|
|
|
// GetResponse returns the value of Response.
|
|
func (s *GetAttachmentUnauthorizedHeaders) GetResponse() Error {
|
|
return s.Response
|
|
}
|
|
|
|
// SetWWWAuthenticate sets the value of WWWAuthenticate.
|
|
func (s *GetAttachmentUnauthorizedHeaders) SetWWWAuthenticate(val OptString) {
|
|
s.WWWAuthenticate = val
|
|
}
|
|
|
|
// SetXInstanceID sets the value of XInstanceID.
|
|
func (s *GetAttachmentUnauthorizedHeaders) SetXInstanceID(val OptString) {
|
|
s.XInstanceID = val
|
|
}
|
|
|
|
// SetXRequestID sets the value of XRequestID.
|
|
func (s *GetAttachmentUnauthorizedHeaders) SetXRequestID(val OptString) {
|
|
s.XRequestID = val
|
|
}
|
|
|
|
// SetResponse sets the value of Response.
|
|
func (s *GetAttachmentUnauthorizedHeaders) SetResponse(val Error) {
|
|
s.Response = val
|
|
}
|
|
|
|
func (*GetAttachmentUnauthorizedHeaders) createChatRes() {}
|
|
func (*GetAttachmentUnauthorizedHeaders) createMessageRes() {}
|
|
func (*GetAttachmentUnauthorizedHeaders) createSessionRes() {}
|
|
func (*GetAttachmentUnauthorizedHeaders) currentUserRes() {}
|
|
func (*GetAttachmentUnauthorizedHeaders) downloadAttachmentRes() {}
|
|
func (*GetAttachmentUnauthorizedHeaders) getAttachmentRes() {}
|
|
func (*GetAttachmentUnauthorizedHeaders) getChatRes() {}
|
|
func (*GetAttachmentUnauthorizedHeaders) listChatsRes() {}
|
|
func (*GetAttachmentUnauthorizedHeaders) listMessagesRes() {}
|
|
func (*GetAttachmentUnauthorizedHeaders) revokeSessionRes() {}
|
|
func (*GetAttachmentUnauthorizedHeaders) uploadAttachmentRes() {}
|
|
|
|
type GetChatBadRequest ErrorHeaders
|
|
|
|
func (*GetChatBadRequest) getChatRes() {}
|
|
|
|
type GetChatConflict ErrorHeaders
|
|
|
|
func (*GetChatConflict) getChatRes() {}
|
|
|
|
type GetChatInternalServerError ErrorHeaders
|
|
|
|
func (*GetChatInternalServerError) getChatRes() {}
|
|
|
|
type GetChatNotFound ErrorHeaders
|
|
|
|
func (*GetChatNotFound) getChatRes() {}
|
|
|
|
type GetChatServiceUnavailable ErrorHeaders
|
|
|
|
func (*GetChatServiceUnavailable) getChatRes() {}
|
|
|
|
// Ref: #/components/schemas/Health
|
|
type Health struct {
|
|
Status HealthStatus `json:"status"`
|
|
}
|
|
|
|
// GetStatus returns the value of Status.
|
|
func (s *Health) GetStatus() HealthStatus {
|
|
return s.Status
|
|
}
|
|
|
|
// SetStatus sets the value of Status.
|
|
func (s *Health) SetStatus(val HealthStatus) {
|
|
s.Status = val
|
|
}
|
|
|
|
// HealthHeaders wraps Health with response headers.
|
|
type HealthHeaders struct {
|
|
XInstanceID OptString
|
|
XRequestID OptString
|
|
Response Health
|
|
}
|
|
|
|
// GetXInstanceID returns the value of XInstanceID.
|
|
func (s *HealthHeaders) GetXInstanceID() OptString {
|
|
return s.XInstanceID
|
|
}
|
|
|
|
// GetXRequestID returns the value of XRequestID.
|
|
func (s *HealthHeaders) GetXRequestID() OptString {
|
|
return s.XRequestID
|
|
}
|
|
|
|
// GetResponse returns the value of Response.
|
|
func (s *HealthHeaders) GetResponse() Health {
|
|
return s.Response
|
|
}
|
|
|
|
// SetXInstanceID sets the value of XInstanceID.
|
|
func (s *HealthHeaders) SetXInstanceID(val OptString) {
|
|
s.XInstanceID = val
|
|
}
|
|
|
|
// SetXRequestID sets the value of XRequestID.
|
|
func (s *HealthHeaders) SetXRequestID(val OptString) {
|
|
s.XRequestID = val
|
|
}
|
|
|
|
// SetResponse sets the value of Response.
|
|
func (s *HealthHeaders) SetResponse(val Health) {
|
|
s.Response = val
|
|
}
|
|
|
|
func (*HealthHeaders) livenessRes() {}
|
|
func (*HealthHeaders) readinessRes() {}
|
|
|
|
type HealthStatus string
|
|
|
|
const (
|
|
HealthStatusOk HealthStatus = "ok"
|
|
)
|
|
|
|
// AllValues returns all HealthStatus values.
|
|
func (HealthStatus) AllValues() []HealthStatus {
|
|
return []HealthStatus{
|
|
HealthStatusOk,
|
|
}
|
|
}
|
|
|
|
// MarshalText implements encoding.TextMarshaler.
|
|
func (s HealthStatus) MarshalText() ([]byte, error) {
|
|
switch s {
|
|
case HealthStatusOk:
|
|
return []byte(s), nil
|
|
default:
|
|
return nil, errors.Errorf("invalid value: %q", s)
|
|
}
|
|
}
|
|
|
|
// UnmarshalText implements encoding.TextUnmarshaler.
|
|
func (s *HealthStatus) UnmarshalText(data []byte) error {
|
|
switch HealthStatus(data) {
|
|
case HealthStatusOk:
|
|
*s = HealthStatusOk
|
|
return nil
|
|
default:
|
|
return errors.Errorf("invalid value: %q", data)
|
|
}
|
|
}
|
|
|
|
type ListChatsBadRequest ErrorHeaders
|
|
|
|
func (*ListChatsBadRequest) listChatsRes() {}
|
|
|
|
type ListChatsConflict ErrorHeaders
|
|
|
|
func (*ListChatsConflict) listChatsRes() {}
|
|
|
|
type ListChatsInternalServerError ErrorHeaders
|
|
|
|
func (*ListChatsInternalServerError) listChatsRes() {}
|
|
|
|
type ListChatsNotFound ErrorHeaders
|
|
|
|
func (*ListChatsNotFound) listChatsRes() {}
|
|
|
|
type ListChatsServiceUnavailable ErrorHeaders
|
|
|
|
func (*ListChatsServiceUnavailable) listChatsRes() {}
|
|
|
|
type ListMessagesBadRequest ErrorHeaders
|
|
|
|
func (*ListMessagesBadRequest) listMessagesRes() {}
|
|
|
|
type ListMessagesConflict ErrorHeaders
|
|
|
|
func (*ListMessagesConflict) listMessagesRes() {}
|
|
|
|
type ListMessagesInternalServerError ErrorHeaders
|
|
|
|
func (*ListMessagesInternalServerError) listMessagesRes() {}
|
|
|
|
type ListMessagesNotFound ErrorHeaders
|
|
|
|
func (*ListMessagesNotFound) listMessagesRes() {}
|
|
|
|
type ListMessagesServiceUnavailable ErrorHeaders
|
|
|
|
func (*ListMessagesServiceUnavailable) listMessagesRes() {}
|
|
|
|
// Ref: #/components/schemas/Message
|
|
type Message struct {
|
|
AttachmentIds []uuid.UUID `json:"attachment_ids"`
|
|
ChatID uuid.UUID `json:"chat_id"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
ID uuid.UUID `json:"id"`
|
|
SenderID uuid.UUID `json:"sender_id"`
|
|
Text string `json:"text"`
|
|
}
|
|
|
|
// GetAttachmentIds returns the value of AttachmentIds.
|
|
func (s *Message) GetAttachmentIds() []uuid.UUID {
|
|
return s.AttachmentIds
|
|
}
|
|
|
|
// GetChatID returns the value of ChatID.
|
|
func (s *Message) GetChatID() uuid.UUID {
|
|
return s.ChatID
|
|
}
|
|
|
|
// GetCreatedAt returns the value of CreatedAt.
|
|
func (s *Message) GetCreatedAt() time.Time {
|
|
return s.CreatedAt
|
|
}
|
|
|
|
// GetID returns the value of ID.
|
|
func (s *Message) GetID() uuid.UUID {
|
|
return s.ID
|
|
}
|
|
|
|
// GetSenderID returns the value of SenderID.
|
|
func (s *Message) GetSenderID() uuid.UUID {
|
|
return s.SenderID
|
|
}
|
|
|
|
// GetText returns the value of Text.
|
|
func (s *Message) GetText() string {
|
|
return s.Text
|
|
}
|
|
|
|
// SetAttachmentIds sets the value of AttachmentIds.
|
|
func (s *Message) SetAttachmentIds(val []uuid.UUID) {
|
|
s.AttachmentIds = val
|
|
}
|
|
|
|
// SetChatID sets the value of ChatID.
|
|
func (s *Message) SetChatID(val uuid.UUID) {
|
|
s.ChatID = val
|
|
}
|
|
|
|
// SetCreatedAt sets the value of CreatedAt.
|
|
func (s *Message) SetCreatedAt(val time.Time) {
|
|
s.CreatedAt = val
|
|
}
|
|
|
|
// SetID sets the value of ID.
|
|
func (s *Message) SetID(val uuid.UUID) {
|
|
s.ID = val
|
|
}
|
|
|
|
// SetSenderID sets the value of SenderID.
|
|
func (s *Message) SetSenderID(val uuid.UUID) {
|
|
s.SenderID = val
|
|
}
|
|
|
|
// SetText sets the value of Text.
|
|
func (s *Message) SetText(val string) {
|
|
s.Text = val
|
|
}
|
|
|
|
// MessageHeaders wraps Message with response headers.
|
|
type MessageHeaders struct {
|
|
XInstanceID OptString
|
|
XRequestID OptString
|
|
Response Message
|
|
}
|
|
|
|
// GetXInstanceID returns the value of XInstanceID.
|
|
func (s *MessageHeaders) GetXInstanceID() OptString {
|
|
return s.XInstanceID
|
|
}
|
|
|
|
// GetXRequestID returns the value of XRequestID.
|
|
func (s *MessageHeaders) GetXRequestID() OptString {
|
|
return s.XRequestID
|
|
}
|
|
|
|
// GetResponse returns the value of Response.
|
|
func (s *MessageHeaders) GetResponse() Message {
|
|
return s.Response
|
|
}
|
|
|
|
// SetXInstanceID sets the value of XInstanceID.
|
|
func (s *MessageHeaders) SetXInstanceID(val OptString) {
|
|
s.XInstanceID = val
|
|
}
|
|
|
|
// SetXRequestID sets the value of XRequestID.
|
|
func (s *MessageHeaders) SetXRequestID(val OptString) {
|
|
s.XRequestID = val
|
|
}
|
|
|
|
// SetResponse sets the value of Response.
|
|
func (s *MessageHeaders) SetResponse(val Message) {
|
|
s.Response = val
|
|
}
|
|
|
|
func (*MessageHeaders) createMessageRes() {}
|
|
|
|
// Ref: #/components/schemas/MessagePage
|
|
type MessagePage struct {
|
|
Items []Message `json:"items"`
|
|
NextCursor NilString `json:"next_cursor"`
|
|
}
|
|
|
|
// GetItems returns the value of Items.
|
|
func (s *MessagePage) GetItems() []Message {
|
|
return s.Items
|
|
}
|
|
|
|
// GetNextCursor returns the value of NextCursor.
|
|
func (s *MessagePage) GetNextCursor() NilString {
|
|
return s.NextCursor
|
|
}
|
|
|
|
// SetItems sets the value of Items.
|
|
func (s *MessagePage) SetItems(val []Message) {
|
|
s.Items = val
|
|
}
|
|
|
|
// SetNextCursor sets the value of NextCursor.
|
|
func (s *MessagePage) SetNextCursor(val NilString) {
|
|
s.NextCursor = val
|
|
}
|
|
|
|
// MessagePageHeaders wraps MessagePage with response headers.
|
|
type MessagePageHeaders struct {
|
|
XInstanceID OptString
|
|
XRequestID OptString
|
|
Response MessagePage
|
|
}
|
|
|
|
// GetXInstanceID returns the value of XInstanceID.
|
|
func (s *MessagePageHeaders) GetXInstanceID() OptString {
|
|
return s.XInstanceID
|
|
}
|
|
|
|
// GetXRequestID returns the value of XRequestID.
|
|
func (s *MessagePageHeaders) GetXRequestID() OptString {
|
|
return s.XRequestID
|
|
}
|
|
|
|
// GetResponse returns the value of Response.
|
|
func (s *MessagePageHeaders) GetResponse() MessagePage {
|
|
return s.Response
|
|
}
|
|
|
|
// SetXInstanceID sets the value of XInstanceID.
|
|
func (s *MessagePageHeaders) SetXInstanceID(val OptString) {
|
|
s.XInstanceID = val
|
|
}
|
|
|
|
// SetXRequestID sets the value of XRequestID.
|
|
func (s *MessagePageHeaders) SetXRequestID(val OptString) {
|
|
s.XRequestID = val
|
|
}
|
|
|
|
// SetResponse sets the value of Response.
|
|
func (s *MessagePageHeaders) SetResponse(val MessagePage) {
|
|
s.Response = val
|
|
}
|
|
|
|
func (*MessagePageHeaders) listMessagesRes() {}
|
|
|
|
// NewNilString returns new NilString with value set to v.
|
|
func NewNilString(v string) NilString {
|
|
return NilString{
|
|
Value: v,
|
|
}
|
|
}
|
|
|
|
// NilString is nullable string.
|
|
type NilString struct {
|
|
Value string
|
|
Null bool
|
|
}
|
|
|
|
// SetTo sets value to v.
|
|
func (o *NilString) SetTo(v string) {
|
|
o.Null = false
|
|
o.Value = v
|
|
}
|
|
|
|
// IsNull returns true if value is Null.
|
|
func (o NilString) IsNull() bool { return o.Null }
|
|
|
|
// SetToNull sets value to null.
|
|
func (o *NilString) SetToNull() {
|
|
o.Null = true
|
|
var v string
|
|
o.Value = v
|
|
}
|
|
|
|
// Get returns value and boolean that denotes whether value was set.
|
|
func (o NilString) Get() (v string, ok bool) {
|
|
if o.Null {
|
|
return v, false
|
|
}
|
|
return o.Value, true
|
|
}
|
|
|
|
// Or returns value if set, or given parameter if does not.
|
|
func (o NilString) Or(d string) string {
|
|
if v, ok := o.Get(); ok {
|
|
return v
|
|
}
|
|
return d
|
|
}
|
|
|
|
// NewOptDownloadAttachmentVariant returns new OptDownloadAttachmentVariant with value set to v.
|
|
func NewOptDownloadAttachmentVariant(v DownloadAttachmentVariant) OptDownloadAttachmentVariant {
|
|
return OptDownloadAttachmentVariant{
|
|
Value: v,
|
|
Set: true,
|
|
}
|
|
}
|
|
|
|
// OptDownloadAttachmentVariant is optional DownloadAttachmentVariant.
|
|
type OptDownloadAttachmentVariant struct {
|
|
Value DownloadAttachmentVariant
|
|
Set bool
|
|
}
|
|
|
|
// IsSet returns true if OptDownloadAttachmentVariant was set.
|
|
func (o OptDownloadAttachmentVariant) IsSet() bool { return o.Set }
|
|
|
|
// Reset unsets value.
|
|
func (o *OptDownloadAttachmentVariant) Reset() {
|
|
var v DownloadAttachmentVariant
|
|
o.Value = v
|
|
o.Set = false
|
|
}
|
|
|
|
// SetTo sets value to v.
|
|
func (o *OptDownloadAttachmentVariant) SetTo(v DownloadAttachmentVariant) {
|
|
o.Set = true
|
|
o.Value = v
|
|
}
|
|
|
|
// Get returns value and boolean that denotes whether value was set.
|
|
func (o OptDownloadAttachmentVariant) Get() (v DownloadAttachmentVariant, ok bool) {
|
|
if !o.Set {
|
|
return v, false
|
|
}
|
|
return o.Value, true
|
|
}
|
|
|
|
// Or returns value if set, or given parameter if does not.
|
|
func (o OptDownloadAttachmentVariant) Or(d DownloadAttachmentVariant) DownloadAttachmentVariant {
|
|
if v, ok := o.Get(); ok {
|
|
return v
|
|
}
|
|
return d
|
|
}
|
|
|
|
// NewOptInt returns new OptInt with value set to v.
|
|
func NewOptInt(v int) OptInt {
|
|
return OptInt{
|
|
Value: v,
|
|
Set: true,
|
|
}
|
|
}
|
|
|
|
// OptInt is optional int.
|
|
type OptInt struct {
|
|
Value int
|
|
Set bool
|
|
}
|
|
|
|
// IsSet returns true if OptInt was set.
|
|
func (o OptInt) IsSet() bool { return o.Set }
|
|
|
|
// Reset unsets value.
|
|
func (o *OptInt) Reset() {
|
|
var v int
|
|
o.Value = v
|
|
o.Set = false
|
|
}
|
|
|
|
// SetTo sets value to v.
|
|
func (o *OptInt) SetTo(v int) {
|
|
o.Set = true
|
|
o.Value = v
|
|
}
|
|
|
|
// Get returns value and boolean that denotes whether value was set.
|
|
func (o OptInt) Get() (v int, ok bool) {
|
|
if !o.Set {
|
|
return v, false
|
|
}
|
|
return o.Value, true
|
|
}
|
|
|
|
// Or returns value if set, or given parameter if does not.
|
|
func (o OptInt) Or(d int) int {
|
|
if v, ok := o.Get(); ok {
|
|
return v
|
|
}
|
|
return d
|
|
}
|
|
|
|
// NewOptString returns new OptString with value set to v.
|
|
func NewOptString(v string) OptString {
|
|
return OptString{
|
|
Value: v,
|
|
Set: true,
|
|
}
|
|
}
|
|
|
|
// OptString is optional string.
|
|
type OptString struct {
|
|
Value string
|
|
Set bool
|
|
}
|
|
|
|
// IsSet returns true if OptString was set.
|
|
func (o OptString) IsSet() bool { return o.Set }
|
|
|
|
// Reset unsets value.
|
|
func (o *OptString) Reset() {
|
|
var v string
|
|
o.Value = v
|
|
o.Set = false
|
|
}
|
|
|
|
// SetTo sets value to v.
|
|
func (o *OptString) SetTo(v string) {
|
|
o.Set = true
|
|
o.Value = v
|
|
}
|
|
|
|
// Get returns value and boolean that denotes whether value was set.
|
|
func (o OptString) Get() (v string, ok bool) {
|
|
if !o.Set {
|
|
return v, false
|
|
}
|
|
return o.Value, true
|
|
}
|
|
|
|
// Or returns value if set, or given parameter if does not.
|
|
func (o OptString) Or(d string) string {
|
|
if v, ok := o.Get(); ok {
|
|
return v
|
|
}
|
|
return d
|
|
}
|
|
|
|
type ReadinessInternalServerError ErrorHeaders
|
|
|
|
func (*ReadinessInternalServerError) readinessRes() {}
|
|
|
|
type ReadinessServiceUnavailable ErrorHeaders
|
|
|
|
func (*ReadinessServiceUnavailable) readinessRes() {}
|
|
|
|
type RegisterUserBadRequest ErrorHeaders
|
|
|
|
func (*RegisterUserBadRequest) registerUserRes() {}
|
|
|
|
type RegisterUserConflict ErrorHeaders
|
|
|
|
func (*RegisterUserConflict) registerUserRes() {}
|
|
|
|
type RegisterUserInternalServerError ErrorHeaders
|
|
|
|
func (*RegisterUserInternalServerError) registerUserRes() {}
|
|
|
|
type RegisterUserServiceUnavailable ErrorHeaders
|
|
|
|
func (*RegisterUserServiceUnavailable) registerUserRes() {}
|
|
|
|
type RevokeSessionInternalServerError ErrorHeaders
|
|
|
|
func (*RevokeSessionInternalServerError) revokeSessionRes() {}
|
|
|
|
// RevokeSessionNoContent is response for RevokeSession operation.
|
|
type RevokeSessionNoContent struct {
|
|
XInstanceID OptString
|
|
XRequestID OptString
|
|
}
|
|
|
|
// GetXInstanceID returns the value of XInstanceID.
|
|
func (s *RevokeSessionNoContent) GetXInstanceID() OptString {
|
|
return s.XInstanceID
|
|
}
|
|
|
|
// GetXRequestID returns the value of XRequestID.
|
|
func (s *RevokeSessionNoContent) GetXRequestID() OptString {
|
|
return s.XRequestID
|
|
}
|
|
|
|
// SetXInstanceID sets the value of XInstanceID.
|
|
func (s *RevokeSessionNoContent) SetXInstanceID(val OptString) {
|
|
s.XInstanceID = val
|
|
}
|
|
|
|
// SetXRequestID sets the value of XRequestID.
|
|
func (s *RevokeSessionNoContent) SetXRequestID(val OptString) {
|
|
s.XRequestID = val
|
|
}
|
|
|
|
func (*RevokeSessionNoContent) revokeSessionRes() {}
|
|
|
|
type RevokeSessionServiceUnavailable ErrorHeaders
|
|
|
|
func (*RevokeSessionServiceUnavailable) revokeSessionRes() {}
|
|
|
|
// Ref: #/components/schemas/Session
|
|
type Session struct {
|
|
ExpiresAt time.Time `json:"expires_at"`
|
|
Token string `json:"token"`
|
|
TokenType string `json:"token_type"`
|
|
User User `json:"user"`
|
|
}
|
|
|
|
// GetExpiresAt returns the value of ExpiresAt.
|
|
func (s *Session) GetExpiresAt() time.Time {
|
|
return s.ExpiresAt
|
|
}
|
|
|
|
// GetToken returns the value of Token.
|
|
func (s *Session) GetToken() string {
|
|
return s.Token
|
|
}
|
|
|
|
// GetTokenType returns the value of TokenType.
|
|
func (s *Session) GetTokenType() string {
|
|
return s.TokenType
|
|
}
|
|
|
|
// GetUser returns the value of User.
|
|
func (s *Session) GetUser() User {
|
|
return s.User
|
|
}
|
|
|
|
// SetExpiresAt sets the value of ExpiresAt.
|
|
func (s *Session) SetExpiresAt(val time.Time) {
|
|
s.ExpiresAt = val
|
|
}
|
|
|
|
// SetToken sets the value of Token.
|
|
func (s *Session) SetToken(val string) {
|
|
s.Token = val
|
|
}
|
|
|
|
// SetTokenType sets the value of TokenType.
|
|
func (s *Session) SetTokenType(val string) {
|
|
s.TokenType = val
|
|
}
|
|
|
|
// SetUser sets the value of User.
|
|
func (s *Session) SetUser(val User) {
|
|
s.User = val
|
|
}
|
|
|
|
// SessionHeaders wraps Session with response headers.
|
|
type SessionHeaders struct {
|
|
XInstanceID OptString
|
|
XRequestID OptString
|
|
Response Session
|
|
}
|
|
|
|
// GetXInstanceID returns the value of XInstanceID.
|
|
func (s *SessionHeaders) GetXInstanceID() OptString {
|
|
return s.XInstanceID
|
|
}
|
|
|
|
// GetXRequestID returns the value of XRequestID.
|
|
func (s *SessionHeaders) GetXRequestID() OptString {
|
|
return s.XRequestID
|
|
}
|
|
|
|
// GetResponse returns the value of Response.
|
|
func (s *SessionHeaders) GetResponse() Session {
|
|
return s.Response
|
|
}
|
|
|
|
// SetXInstanceID sets the value of XInstanceID.
|
|
func (s *SessionHeaders) SetXInstanceID(val OptString) {
|
|
s.XInstanceID = val
|
|
}
|
|
|
|
// SetXRequestID sets the value of XRequestID.
|
|
func (s *SessionHeaders) SetXRequestID(val OptString) {
|
|
s.XRequestID = val
|
|
}
|
|
|
|
// SetResponse sets the value of Response.
|
|
func (s *SessionHeaders) SetResponse(val Session) {
|
|
s.Response = val
|
|
}
|
|
|
|
func (*SessionHeaders) createSessionRes() {}
|
|
|
|
type UploadAttachmentBadRequest ErrorHeaders
|
|
|
|
func (*UploadAttachmentBadRequest) uploadAttachmentRes() {}
|
|
|
|
type UploadAttachmentInternalServerError ErrorHeaders
|
|
|
|
func (*UploadAttachmentInternalServerError) uploadAttachmentRes() {}
|
|
|
|
type UploadAttachmentNotFound ErrorHeaders
|
|
|
|
func (*UploadAttachmentNotFound) uploadAttachmentRes() {}
|
|
|
|
type UploadAttachmentReqImageJpeg struct {
|
|
Data io.Reader
|
|
}
|
|
|
|
// Read reads data from the Data reader.
|
|
//
|
|
// Kept to satisfy the io.Reader interface.
|
|
func (s UploadAttachmentReqImageJpeg) Read(p []byte) (n int, err error) {
|
|
if s.Data == nil {
|
|
return 0, io.EOF
|
|
}
|
|
return s.Data.Read(p)
|
|
}
|
|
|
|
func (*UploadAttachmentReqImageJpeg) uploadAttachmentReq() {}
|
|
|
|
type UploadAttachmentReqImagePNG struct {
|
|
Data io.Reader
|
|
}
|
|
|
|
// Read reads data from the Data reader.
|
|
//
|
|
// Kept to satisfy the io.Reader interface.
|
|
func (s UploadAttachmentReqImagePNG) Read(p []byte) (n int, err error) {
|
|
if s.Data == nil {
|
|
return 0, io.EOF
|
|
}
|
|
return s.Data.Read(p)
|
|
}
|
|
|
|
func (*UploadAttachmentReqImagePNG) uploadAttachmentReq() {}
|
|
|
|
type UploadAttachmentRequestEntityTooLarge ErrorHeaders
|
|
|
|
func (*UploadAttachmentRequestEntityTooLarge) uploadAttachmentRes() {}
|
|
|
|
type UploadAttachmentServiceUnavailable ErrorHeaders
|
|
|
|
func (*UploadAttachmentServiceUnavailable) uploadAttachmentRes() {}
|
|
|
|
type UploadAttachmentUnsupportedMediaType ErrorHeaders
|
|
|
|
func (*UploadAttachmentUnsupportedMediaType) uploadAttachmentRes() {}
|
|
|
|
// Ref: #/components/schemas/User
|
|
type User struct {
|
|
CreatedAt time.Time `json:"created_at"`
|
|
DisplayName string `json:"display_name"`
|
|
ID uuid.UUID `json:"id"`
|
|
Username string `json:"username"`
|
|
}
|
|
|
|
// GetCreatedAt returns the value of CreatedAt.
|
|
func (s *User) GetCreatedAt() time.Time {
|
|
return s.CreatedAt
|
|
}
|
|
|
|
// GetDisplayName returns the value of DisplayName.
|
|
func (s *User) GetDisplayName() string {
|
|
return s.DisplayName
|
|
}
|
|
|
|
// GetID returns the value of ID.
|
|
func (s *User) GetID() uuid.UUID {
|
|
return s.ID
|
|
}
|
|
|
|
// GetUsername returns the value of Username.
|
|
func (s *User) GetUsername() string {
|
|
return s.Username
|
|
}
|
|
|
|
// SetCreatedAt sets the value of CreatedAt.
|
|
func (s *User) SetCreatedAt(val time.Time) {
|
|
s.CreatedAt = val
|
|
}
|
|
|
|
// SetDisplayName sets the value of DisplayName.
|
|
func (s *User) SetDisplayName(val string) {
|
|
s.DisplayName = val
|
|
}
|
|
|
|
// SetID sets the value of ID.
|
|
func (s *User) SetID(val uuid.UUID) {
|
|
s.ID = val
|
|
}
|
|
|
|
// SetUsername sets the value of Username.
|
|
func (s *User) SetUsername(val string) {
|
|
s.Username = val
|
|
}
|
|
|
|
// UserHeaders wraps User with response headers.
|
|
type UserHeaders struct {
|
|
XInstanceID OptString
|
|
XRequestID OptString
|
|
Response User
|
|
}
|
|
|
|
// GetXInstanceID returns the value of XInstanceID.
|
|
func (s *UserHeaders) GetXInstanceID() OptString {
|
|
return s.XInstanceID
|
|
}
|
|
|
|
// GetXRequestID returns the value of XRequestID.
|
|
func (s *UserHeaders) GetXRequestID() OptString {
|
|
return s.XRequestID
|
|
}
|
|
|
|
// GetResponse returns the value of Response.
|
|
func (s *UserHeaders) GetResponse() User {
|
|
return s.Response
|
|
}
|
|
|
|
// SetXInstanceID sets the value of XInstanceID.
|
|
func (s *UserHeaders) SetXInstanceID(val OptString) {
|
|
s.XInstanceID = val
|
|
}
|
|
|
|
// SetXRequestID sets the value of XRequestID.
|
|
func (s *UserHeaders) SetXRequestID(val OptString) {
|
|
s.XRequestID = val
|
|
}
|
|
|
|
// SetResponse sets the value of Response.
|
|
func (s *UserHeaders) SetResponse(val User) {
|
|
s.Response = val
|
|
}
|
|
|
|
func (*UserHeaders) currentUserRes() {}
|
|
func (*UserHeaders) registerUserRes() {}
|
|
|
|
// Ref: #/components/schemas/Variant
|
|
type Variant struct {
|
|
ContentType VariantContentType `json:"content_type"`
|
|
Height int `json:"height"`
|
|
Name VariantName `json:"name"`
|
|
SHA256 string `json:"sha256"`
|
|
SizeBytes int `json:"size_bytes"`
|
|
Width int `json:"width"`
|
|
}
|
|
|
|
// GetContentType returns the value of ContentType.
|
|
func (s *Variant) GetContentType() VariantContentType {
|
|
return s.ContentType
|
|
}
|
|
|
|
// GetHeight returns the value of Height.
|
|
func (s *Variant) GetHeight() int {
|
|
return s.Height
|
|
}
|
|
|
|
// GetName returns the value of Name.
|
|
func (s *Variant) GetName() VariantName {
|
|
return s.Name
|
|
}
|
|
|
|
// GetSHA256 returns the value of SHA256.
|
|
func (s *Variant) GetSHA256() string {
|
|
return s.SHA256
|
|
}
|
|
|
|
// GetSizeBytes returns the value of SizeBytes.
|
|
func (s *Variant) GetSizeBytes() int {
|
|
return s.SizeBytes
|
|
}
|
|
|
|
// GetWidth returns the value of Width.
|
|
func (s *Variant) GetWidth() int {
|
|
return s.Width
|
|
}
|
|
|
|
// SetContentType sets the value of ContentType.
|
|
func (s *Variant) SetContentType(val VariantContentType) {
|
|
s.ContentType = val
|
|
}
|
|
|
|
// SetHeight sets the value of Height.
|
|
func (s *Variant) SetHeight(val int) {
|
|
s.Height = val
|
|
}
|
|
|
|
// SetName sets the value of Name.
|
|
func (s *Variant) SetName(val VariantName) {
|
|
s.Name = val
|
|
}
|
|
|
|
// SetSHA256 sets the value of SHA256.
|
|
func (s *Variant) SetSHA256(val string) {
|
|
s.SHA256 = val
|
|
}
|
|
|
|
// SetSizeBytes sets the value of SizeBytes.
|
|
func (s *Variant) SetSizeBytes(val int) {
|
|
s.SizeBytes = val
|
|
}
|
|
|
|
// SetWidth sets the value of Width.
|
|
func (s *Variant) SetWidth(val int) {
|
|
s.Width = val
|
|
}
|
|
|
|
type VariantContentType string
|
|
|
|
const (
|
|
VariantContentTypeImageJpeg VariantContentType = "image/jpeg"
|
|
VariantContentTypeImagePNG VariantContentType = "image/png"
|
|
VariantContentTypeImageWEBP VariantContentType = "image/webp"
|
|
)
|
|
|
|
// AllValues returns all VariantContentType values.
|
|
func (VariantContentType) AllValues() []VariantContentType {
|
|
return []VariantContentType{
|
|
VariantContentTypeImageJpeg,
|
|
VariantContentTypeImagePNG,
|
|
VariantContentTypeImageWEBP,
|
|
}
|
|
}
|
|
|
|
// MarshalText implements encoding.TextMarshaler.
|
|
func (s VariantContentType) MarshalText() ([]byte, error) {
|
|
switch s {
|
|
case VariantContentTypeImageJpeg:
|
|
return []byte(s), nil
|
|
case VariantContentTypeImagePNG:
|
|
return []byte(s), nil
|
|
case VariantContentTypeImageWEBP:
|
|
return []byte(s), nil
|
|
default:
|
|
return nil, errors.Errorf("invalid value: %q", s)
|
|
}
|
|
}
|
|
|
|
// UnmarshalText implements encoding.TextUnmarshaler.
|
|
func (s *VariantContentType) UnmarshalText(data []byte) error {
|
|
switch VariantContentType(data) {
|
|
case VariantContentTypeImageJpeg:
|
|
*s = VariantContentTypeImageJpeg
|
|
return nil
|
|
case VariantContentTypeImagePNG:
|
|
*s = VariantContentTypeImagePNG
|
|
return nil
|
|
case VariantContentTypeImageWEBP:
|
|
*s = VariantContentTypeImageWEBP
|
|
return nil
|
|
default:
|
|
return errors.Errorf("invalid value: %q", data)
|
|
}
|
|
}
|
|
|
|
type VariantName string
|
|
|
|
const (
|
|
VariantNameThumbnail VariantName = "thumbnail"
|
|
VariantNameCrop VariantName = "crop"
|
|
VariantNameOptimized VariantName = "optimized"
|
|
)
|
|
|
|
// AllValues returns all VariantName values.
|
|
func (VariantName) AllValues() []VariantName {
|
|
return []VariantName{
|
|
VariantNameThumbnail,
|
|
VariantNameCrop,
|
|
VariantNameOptimized,
|
|
}
|
|
}
|
|
|
|
// MarshalText implements encoding.TextMarshaler.
|
|
func (s VariantName) MarshalText() ([]byte, error) {
|
|
switch s {
|
|
case VariantNameThumbnail:
|
|
return []byte(s), nil
|
|
case VariantNameCrop:
|
|
return []byte(s), nil
|
|
case VariantNameOptimized:
|
|
return []byte(s), nil
|
|
default:
|
|
return nil, errors.Errorf("invalid value: %q", s)
|
|
}
|
|
}
|
|
|
|
// UnmarshalText implements encoding.TextUnmarshaler.
|
|
func (s *VariantName) UnmarshalText(data []byte) error {
|
|
switch VariantName(data) {
|
|
case VariantNameThumbnail:
|
|
*s = VariantNameThumbnail
|
|
return nil
|
|
case VariantNameCrop:
|
|
*s = VariantNameCrop
|
|
return nil
|
|
case VariantNameOptimized:
|
|
*s = VariantNameOptimized
|
|
return nil
|
|
default:
|
|
return errors.Errorf("invalid value: %q", data)
|
|
}
|
|
}
|