1069 lines
24 KiB
Go
1069 lines
24 KiB
Go
// Code generated by ogen, DO NOT EDIT.
|
|
|
|
package oas
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/go-faster/errors"
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
// Ref: #/components/schemas/Chat
|
|
type Chat struct {
|
|
ID uuid.UUID `json:"id"`
|
|
Title string `json:"title"`
|
|
MemberIds []uuid.UUID `json:"member_ids"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
// GetID returns the value of ID.
|
|
func (s *Chat) GetID() uuid.UUID {
|
|
return s.ID
|
|
}
|
|
|
|
// GetTitle returns the value of Title.
|
|
func (s *Chat) GetTitle() string {
|
|
return s.Title
|
|
}
|
|
|
|
// GetMemberIds returns the value of MemberIds.
|
|
func (s *Chat) GetMemberIds() []uuid.UUID {
|
|
return s.MemberIds
|
|
}
|
|
|
|
// GetCreatedAt returns the value of CreatedAt.
|
|
func (s *Chat) GetCreatedAt() time.Time {
|
|
return s.CreatedAt
|
|
}
|
|
|
|
// SetID sets the value of ID.
|
|
func (s *Chat) SetID(val uuid.UUID) {
|
|
s.ID = val
|
|
}
|
|
|
|
// SetTitle sets the value of Title.
|
|
func (s *Chat) SetTitle(val string) {
|
|
s.Title = val
|
|
}
|
|
|
|
// SetMemberIds sets the value of MemberIds.
|
|
func (s *Chat) SetMemberIds(val []uuid.UUID) {
|
|
s.MemberIds = val
|
|
}
|
|
|
|
// SetCreatedAt sets the value of CreatedAt.
|
|
func (s *Chat) SetCreatedAt(val time.Time) {
|
|
s.CreatedAt = val
|
|
}
|
|
|
|
// ChatHeaders wraps Chat with response headers.
|
|
type ChatHeaders struct {
|
|
XRequestID OptString
|
|
Response Chat
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// 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 {
|
|
XRequestID OptString
|
|
Response ChatPage
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// 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 {
|
|
Title string `json:"title"`
|
|
MemberIds []uuid.UUID `json:"member_ids"`
|
|
}
|
|
|
|
// GetTitle returns the value of Title.
|
|
func (s *CreateChat) GetTitle() string {
|
|
return s.Title
|
|
}
|
|
|
|
// GetMemberIds returns the value of MemberIds.
|
|
func (s *CreateChat) GetMemberIds() []uuid.UUID {
|
|
return s.MemberIds
|
|
}
|
|
|
|
// SetTitle sets the value of Title.
|
|
func (s *CreateChat) SetTitle(val string) {
|
|
s.Title = val
|
|
}
|
|
|
|
// SetMemberIds sets the value of MemberIds.
|
|
func (s *CreateChat) SetMemberIds(val []uuid.UUID) {
|
|
s.MemberIds = 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 {
|
|
Text string `json:"text"`
|
|
}
|
|
|
|
// GetText returns the value of Text.
|
|
func (s *CreateMessage) GetText() string {
|
|
return s.Text
|
|
}
|
|
|
|
// 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() {}
|
|
|
|
// Ref: #/components/schemas/CreateUser
|
|
type CreateUser struct {
|
|
Username string `json:"username"`
|
|
DisplayName string `json:"display_name"`
|
|
}
|
|
|
|
// GetUsername returns the value of Username.
|
|
func (s *CreateUser) GetUsername() string {
|
|
return s.Username
|
|
}
|
|
|
|
// GetDisplayName returns the value of DisplayName.
|
|
func (s *CreateUser) GetDisplayName() string {
|
|
return s.DisplayName
|
|
}
|
|
|
|
// SetUsername sets the value of Username.
|
|
func (s *CreateUser) SetUsername(val string) {
|
|
s.Username = val
|
|
}
|
|
|
|
// SetDisplayName sets the value of DisplayName.
|
|
func (s *CreateUser) SetDisplayName(val string) {
|
|
s.DisplayName = 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 DevUser struct {
|
|
APIKey string
|
|
Roles []string
|
|
}
|
|
|
|
// GetAPIKey returns the value of APIKey.
|
|
func (s *DevUser) GetAPIKey() string {
|
|
return s.APIKey
|
|
}
|
|
|
|
// GetRoles returns the value of Roles.
|
|
func (s *DevUser) GetRoles() []string {
|
|
return s.Roles
|
|
}
|
|
|
|
// SetAPIKey sets the value of APIKey.
|
|
func (s *DevUser) SetAPIKey(val string) {
|
|
s.APIKey = val
|
|
}
|
|
|
|
// SetRoles sets the value of Roles.
|
|
func (s *DevUser) SetRoles(val []string) {
|
|
s.Roles = val
|
|
}
|
|
|
|
// 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 {
|
|
XRequestID OptString
|
|
Response Error
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// 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 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 {
|
|
XRequestID OptString
|
|
Response Health
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// 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() {}
|
|
|
|
// ListChatsTooManyRequestsHeaders wraps Error with response headers.
|
|
type ListChatsTooManyRequestsHeaders struct {
|
|
RetryAfter OptInt
|
|
XRequestID OptString
|
|
Response Error
|
|
}
|
|
|
|
// GetRetryAfter returns the value of RetryAfter.
|
|
func (s *ListChatsTooManyRequestsHeaders) GetRetryAfter() OptInt {
|
|
return s.RetryAfter
|
|
}
|
|
|
|
// GetXRequestID returns the value of XRequestID.
|
|
func (s *ListChatsTooManyRequestsHeaders) GetXRequestID() OptString {
|
|
return s.XRequestID
|
|
}
|
|
|
|
// GetResponse returns the value of Response.
|
|
func (s *ListChatsTooManyRequestsHeaders) GetResponse() Error {
|
|
return s.Response
|
|
}
|
|
|
|
// SetRetryAfter sets the value of RetryAfter.
|
|
func (s *ListChatsTooManyRequestsHeaders) SetRetryAfter(val OptInt) {
|
|
s.RetryAfter = val
|
|
}
|
|
|
|
// SetXRequestID sets the value of XRequestID.
|
|
func (s *ListChatsTooManyRequestsHeaders) SetXRequestID(val OptString) {
|
|
s.XRequestID = val
|
|
}
|
|
|
|
// SetResponse sets the value of Response.
|
|
func (s *ListChatsTooManyRequestsHeaders) SetResponse(val Error) {
|
|
s.Response = val
|
|
}
|
|
|
|
func (*ListChatsTooManyRequestsHeaders) createChatRes() {}
|
|
func (*ListChatsTooManyRequestsHeaders) createMessageRes() {}
|
|
func (*ListChatsTooManyRequestsHeaders) currentUserRes() {}
|
|
func (*ListChatsTooManyRequestsHeaders) getChatRes() {}
|
|
func (*ListChatsTooManyRequestsHeaders) listChatsRes() {}
|
|
func (*ListChatsTooManyRequestsHeaders) listMessagesRes() {}
|
|
func (*ListChatsTooManyRequestsHeaders) registerUserRes() {}
|
|
|
|
// ListChatsUnauthorizedHeaders wraps Error with response headers.
|
|
type ListChatsUnauthorizedHeaders struct {
|
|
WWWAuthenticate OptString
|
|
XRequestID OptString
|
|
Response Error
|
|
}
|
|
|
|
// GetWWWAuthenticate returns the value of WWWAuthenticate.
|
|
func (s *ListChatsUnauthorizedHeaders) GetWWWAuthenticate() OptString {
|
|
return s.WWWAuthenticate
|
|
}
|
|
|
|
// GetXRequestID returns the value of XRequestID.
|
|
func (s *ListChatsUnauthorizedHeaders) GetXRequestID() OptString {
|
|
return s.XRequestID
|
|
}
|
|
|
|
// GetResponse returns the value of Response.
|
|
func (s *ListChatsUnauthorizedHeaders) GetResponse() Error {
|
|
return s.Response
|
|
}
|
|
|
|
// SetWWWAuthenticate sets the value of WWWAuthenticate.
|
|
func (s *ListChatsUnauthorizedHeaders) SetWWWAuthenticate(val OptString) {
|
|
s.WWWAuthenticate = val
|
|
}
|
|
|
|
// SetXRequestID sets the value of XRequestID.
|
|
func (s *ListChatsUnauthorizedHeaders) SetXRequestID(val OptString) {
|
|
s.XRequestID = val
|
|
}
|
|
|
|
// SetResponse sets the value of Response.
|
|
func (s *ListChatsUnauthorizedHeaders) SetResponse(val Error) {
|
|
s.Response = val
|
|
}
|
|
|
|
func (*ListChatsUnauthorizedHeaders) createChatRes() {}
|
|
func (*ListChatsUnauthorizedHeaders) createMessageRes() {}
|
|
func (*ListChatsUnauthorizedHeaders) currentUserRes() {}
|
|
func (*ListChatsUnauthorizedHeaders) getChatRes() {}
|
|
func (*ListChatsUnauthorizedHeaders) listChatsRes() {}
|
|
func (*ListChatsUnauthorizedHeaders) listMessagesRes() {}
|
|
|
|
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 {
|
|
ID uuid.UUID `json:"id"`
|
|
ChatID uuid.UUID `json:"chat_id"`
|
|
SenderID uuid.UUID `json:"sender_id"`
|
|
Text string `json:"text"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
// GetID returns the value of ID.
|
|
func (s *Message) GetID() uuid.UUID {
|
|
return s.ID
|
|
}
|
|
|
|
// GetChatID returns the value of ChatID.
|
|
func (s *Message) GetChatID() uuid.UUID {
|
|
return s.ChatID
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// GetCreatedAt returns the value of CreatedAt.
|
|
func (s *Message) GetCreatedAt() time.Time {
|
|
return s.CreatedAt
|
|
}
|
|
|
|
// SetID sets the value of ID.
|
|
func (s *Message) SetID(val uuid.UUID) {
|
|
s.ID = val
|
|
}
|
|
|
|
// SetChatID sets the value of ChatID.
|
|
func (s *Message) SetChatID(val uuid.UUID) {
|
|
s.ChatID = 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
|
|
}
|
|
|
|
// SetCreatedAt sets the value of CreatedAt.
|
|
func (s *Message) SetCreatedAt(val time.Time) {
|
|
s.CreatedAt = val
|
|
}
|
|
|
|
// MessageHeaders wraps Message with response headers.
|
|
type MessageHeaders struct {
|
|
XRequestID OptString
|
|
Response Message
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// 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 {
|
|
XRequestID OptString
|
|
Response MessagePage
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// 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() {}
|
|
|
|
// Ref: #/components/schemas/User
|
|
type User struct {
|
|
ID uuid.UUID `json:"id"`
|
|
Username string `json:"username"`
|
|
DisplayName string `json:"display_name"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// GetDisplayName returns the value of DisplayName.
|
|
func (s *User) GetDisplayName() string {
|
|
return s.DisplayName
|
|
}
|
|
|
|
// GetCreatedAt returns the value of CreatedAt.
|
|
func (s *User) GetCreatedAt() time.Time {
|
|
return s.CreatedAt
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// SetDisplayName sets the value of DisplayName.
|
|
func (s *User) SetDisplayName(val string) {
|
|
s.DisplayName = val
|
|
}
|
|
|
|
// SetCreatedAt sets the value of CreatedAt.
|
|
func (s *User) SetCreatedAt(val time.Time) {
|
|
s.CreatedAt = val
|
|
}
|
|
|
|
// UserHeaders wraps User with response headers.
|
|
type UserHeaders struct {
|
|
XRequestID OptString
|
|
Response User
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// 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() {}
|