contracts

package
v0.0.0-...-5eda2ce Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package contracts provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.

Package contracts provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.

Index

Constants

View Source
const (
	BearerAuthScopes = "bearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

Types

type AuthRequestPayload

type AuthRequestPayload struct {
	// Email Email address
	Email Email `json:"email"`

	// IsRememberMe Extend token expiration
	IsRememberMe *bool `json:"isRememberMe,omitempty"`

	// Password Password (minimum 8 characters)
	Password Password `json:"password"`
}

AuthRequestPayload Request payload for user authentication

type AuthTokenRefreshRequestPayload

type AuthTokenRefreshRequestPayload struct {
	// RefreshToken JWT refresh token
	RefreshToken string `json:"refreshToken"`
}

AuthTokenRefreshRequestPayload Request payload for refreshing authentication tokens

type AuthenticateUser200JSONResponse

type AuthenticateUser200JSONResponse struct {
	// AccessToken JWT access token
	AccessToken string `json:"accessToken"`

	// AccessTokenExpiresInSeconds Access token expiration time in seconds
	AccessTokenExpiresInSeconds int `json:"accessTokenExpiresInSeconds"`

	// RefreshToken JWT refresh token
	RefreshToken string `json:"refreshToken"`

	// RefreshTokenExpiresInSeconds Refresh token expiration time in seconds
	RefreshTokenExpiresInSeconds int `json:"refreshTokenExpiresInSeconds"`

	// User User entity representing a system user
	User User `json:"user"`
}

func (AuthenticateUser200JSONResponse) VisitAuthenticateUserResponse

func (response AuthenticateUser200JSONResponse) VisitAuthenticateUserResponse(w http.ResponseWriter) error

type AuthenticateUser400JSONResponse

type AuthenticateUser400JSONResponse Error

func (AuthenticateUser400JSONResponse) VisitAuthenticateUserResponse

func (response AuthenticateUser400JSONResponse) VisitAuthenticateUserResponse(w http.ResponseWriter) error

type AuthenticateUser401JSONResponse

type AuthenticateUser401JSONResponse Error

func (AuthenticateUser401JSONResponse) VisitAuthenticateUserResponse

func (response AuthenticateUser401JSONResponse) VisitAuthenticateUserResponse(w http.ResponseWriter) error

type AuthenticateUserJSONRequestBody

type AuthenticateUserJSONRequestBody = AuthRequestPayload

AuthenticateUserJSONRequestBody defines body for AuthenticateUser for application/json ContentType.

type AuthenticateUserRequestObject

type AuthenticateUserRequestObject struct {
	Body *AuthenticateUserJSONRequestBody
}

type AuthenticateUserResponseObject

type AuthenticateUserResponseObject interface {
	VisitAuthenticateUserResponse(w http.ResponseWriter) error
}

type AvatarUrl

type AvatarUrl = string

AvatarUrl User avatar URL

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type CreateUser201JSONResponse

type CreateUser201JSONResponse User

func (CreateUser201JSONResponse) VisitCreateUserResponse

func (response CreateUser201JSONResponse) VisitCreateUserResponse(w http.ResponseWriter) error

type CreateUser400JSONResponse

type CreateUser400JSONResponse Error

func (CreateUser400JSONResponse) VisitCreateUserResponse

func (response CreateUser400JSONResponse) VisitCreateUserResponse(w http.ResponseWriter) error

type CreateUser401JSONResponse

type CreateUser401JSONResponse Error

func (CreateUser401JSONResponse) VisitCreateUserResponse

func (response CreateUser401JSONResponse) VisitCreateUserResponse(w http.ResponseWriter) error

type CreateUser409JSONResponse

type CreateUser409JSONResponse Error

func (CreateUser409JSONResponse) VisitCreateUserResponse

func (response CreateUser409JSONResponse) VisitCreateUserResponse(w http.ResponseWriter) error

type CreateUserJSONRequestBody

type CreateUserJSONRequestBody = UserCreateRequest

CreateUserJSONRequestBody defines body for CreateUser for application/json ContentType.

type CreateUserRequestObject

type CreateUserRequestObject struct {
	Body *CreateUserJSONRequestBody
}

type CreateUserResponseObject

type CreateUserResponseObject interface {
	VisitCreateUserResponse(w http.ResponseWriter) error
}

type DeleteUserById200JSONResponse

type DeleteUserById200JSONResponse struct {
	Success *bool `json:"success,omitempty"`
}

func (DeleteUserById200JSONResponse) VisitDeleteUserByIdResponse

func (response DeleteUserById200JSONResponse) VisitDeleteUserByIdResponse(w http.ResponseWriter) error

type DeleteUserById400JSONResponse

type DeleteUserById400JSONResponse Error

func (DeleteUserById400JSONResponse) VisitDeleteUserByIdResponse

func (response DeleteUserById400JSONResponse) VisitDeleteUserByIdResponse(w http.ResponseWriter) error

type DeleteUserById401JSONResponse

type DeleteUserById401JSONResponse Error

func (DeleteUserById401JSONResponse) VisitDeleteUserByIdResponse

func (response DeleteUserById401JSONResponse) VisitDeleteUserByIdResponse(w http.ResponseWriter) error

type DeleteUserById404JSONResponse

type DeleteUserById404JSONResponse Error

func (DeleteUserById404JSONResponse) VisitDeleteUserByIdResponse

func (response DeleteUserById404JSONResponse) VisitDeleteUserByIdResponse(w http.ResponseWriter) error

type DeleteUserByIdRequestObject

type DeleteUserByIdRequestObject struct {
	UserId UserId `json:"userId"`
}

type DeleteUserByIdResponseObject

type DeleteUserByIdResponseObject interface {
	VisitDeleteUserByIdResponse(w http.ResponseWriter) error
}

type Email

type Email = openapi_types.Email

Email Email address

type Error

type Error struct {
	// Code - ERR_ACCESS_DENIED: Access denied. Usually that error can occur when the user is not authorized to perform the operation (e.g. buyer tries to remove admin or buyer tries to add a new user). Mostly theoretical error.
	// - ERR_ALREADY_EXISTS: The record already exists in the system. Usually that error can occur during adding users, that were already added to the system.
	// - ERR_ALREADY_VERIFIED: The request was already verified. Usually that error can occur during verification of the code, that was already verified.
	// - ERR_AUTH_CODE_INVALID: The provided auth code is invalid. Usually that error can occur during verification of the auth code, that is invalid.
	// - ERR_INSUFFICIENT_FUNDS: Insufficient funds. Usually that error can occur during moving (transferring, withdrawing) funds from the account or card, when the source doesn't have enough of funds.
	// - ERR_INTERNAL: Internal server error. Usually that error indicates some general internal server error, that has nothing to do with client's data, so it can be used with 500 http code.
	// - ERR_INVALID_ARG: Invalid argument(s) was (were) provided during the request. Usually that error can occur when one or more arguments (or their combination) were provided in incorrect format or the operation with the given arguments is prohibited (e.g. you can't delete the general account). Usually that error could be eliminated by calling another endpoint in advance, that provides correct values (or options) to call the former endpoint.
	// - ERR_INVALID_CREDENTIALS: Invalid credentials were provided during the request. Usually that error can occur during providing invalid password and/or email.
	// - ERR_NOT_FOUND: The resource was not found. Usually that error can occur during requesting the resource, that was already removed and can't be accessed anymore (e.g. requesting deleted transaction/user/account information).
	// - ERR_WEAK_PASSWORD: Weak password. Usually that error can occur during providing too weak password for sign up or update password processes. That error should not be the case for web clients, since the password weakness is validated on the FE, so if you encountered that error, probably the FE and the BE are not aligned properly with each other.
	// - ERR_CONTACT_SUPPORT: Some error occurred that needs to be escalated to support. That might signal that liquidity is low.
	// - ERR_SELF_TRANSFER: It is not allowed to transfer funds from an account to itself.
	Code ErrorCode `json:"code"`

	// Details Additional error details
	Details *map[string]interface{} `json:"details,omitempty"`

	// Message Human-readable error message
	Message *string `json:"message,omitempty"`

	// Timestamp Error occurrence timestamp
	Timestamp *time.Time `json:"timestamp,omitempty"`
}

Error Error response payload.

type ErrorCode

type ErrorCode string

ErrorCode - ERR_ACCESS_DENIED: Access denied. Usually that error can occur when the user is not authorized to perform the operation (e.g. buyer tries to remove admin or buyer tries to add a new user). Mostly theoretical error. - ERR_ALREADY_EXISTS: The record already exists in the system. Usually that error can occur during adding users, that were already added to the system. - ERR_ALREADY_VERIFIED: The request was already verified. Usually that error can occur during verification of the code, that was already verified. - ERR_AUTH_CODE_INVALID: The provided auth code is invalid. Usually that error can occur during verification of the auth code, that is invalid. - ERR_INSUFFICIENT_FUNDS: Insufficient funds. Usually that error can occur during moving (transferring, withdrawing) funds from the account or card, when the source doesn't have enough of funds. - ERR_INTERNAL: Internal server error. Usually that error indicates some general internal server error, that has nothing to do with client's data, so it can be used with 500 http code. - ERR_INVALID_ARG: Invalid argument(s) was (were) provided during the request. Usually that error can occur when one or more arguments (or their combination) were provided in incorrect format or the operation with the given arguments is prohibited (e.g. you can't delete the general account). Usually that error could be eliminated by calling another endpoint in advance, that provides correct values (or options) to call the former endpoint. - ERR_INVALID_CREDENTIALS: Invalid credentials were provided during the request. Usually that error can occur during providing invalid password and/or email. - ERR_NOT_FOUND: The resource was not found. Usually that error can occur during requesting the resource, that was already removed and can't be accessed anymore (e.g. requesting deleted transaction/user/account information). - ERR_WEAK_PASSWORD: Weak password. Usually that error can occur during providing too weak password for sign up or update password processes. That error should not be the case for web clients, since the password weakness is validated on the FE, so if you encountered that error, probably the FE and the BE are not aligned properly with each other. - ERR_CONTACT_SUPPORT: Some error occurred that needs to be escalated to support. That might signal that liquidity is low. - ERR_SELF_TRANSFER: It is not allowed to transfer funds from an account to itself.

const (
	ERRACCESSDENIED       ErrorCode = "ERR_ACCESS_DENIED"
	ERRALREADYEXISTS      ErrorCode = "ERR_ALREADY_EXISTS"
	ERRALREADYVERIFIED    ErrorCode = "ERR_ALREADY_VERIFIED"
	ERRAUTHCODEINVALID    ErrorCode = "ERR_AUTH_CODE_INVALID"
	ERRCONTACTSUPPORT     ErrorCode = "ERR_CONTACT_SUPPORT"
	ERRINSUFFICIENTFUNDS  ErrorCode = "ERR_INSUFFICIENT_FUNDS"
	ERRINTERNAL           ErrorCode = "ERR_INTERNAL"
	ERRINVALIDARG         ErrorCode = "ERR_INVALID_ARG"
	ERRINVALIDCREDENTIALS ErrorCode = "ERR_INVALID_CREDENTIALS"
	ERRNOTFOUND           ErrorCode = "ERR_NOT_FOUND"
	ERRSELFTRANSFER       ErrorCode = "ERR_SELF_TRANSFER"
	ERRWEAKPASSWORD       ErrorCode = "ERR_WEAK_PASSWORD"
)

Defines values for ErrorCode.

type GetHealthStatus200JSONResponse

type GetHealthStatus200JSONResponse struct {
	Status    *string    `json:"status,omitempty"`
	Timestamp *time.Time `json:"timestamp,omitempty"`
	Version   *string    `json:"version,omitempty"`
}

func (GetHealthStatus200JSONResponse) VisitGetHealthStatusResponse

func (response GetHealthStatus200JSONResponse) VisitGetHealthStatusResponse(w http.ResponseWriter) error

type GetHealthStatus500JSONResponse

type GetHealthStatus500JSONResponse Error

func (GetHealthStatus500JSONResponse) VisitGetHealthStatusResponse

func (response GetHealthStatus500JSONResponse) VisitGetHealthStatusResponse(w http.ResponseWriter) error

type GetHealthStatusRequestObject

type GetHealthStatusRequestObject struct {
}

type GetHealthStatusResponseObject

type GetHealthStatusResponseObject interface {
	VisitGetHealthStatusResponse(w http.ResponseWriter) error
}

type GetUserById200JSONResponse

type GetUserById200JSONResponse User

func (GetUserById200JSONResponse) VisitGetUserByIdResponse

func (response GetUserById200JSONResponse) VisitGetUserByIdResponse(w http.ResponseWriter) error

type GetUserById400JSONResponse

type GetUserById400JSONResponse Error

func (GetUserById400JSONResponse) VisitGetUserByIdResponse

func (response GetUserById400JSONResponse) VisitGetUserByIdResponse(w http.ResponseWriter) error

type GetUserById401JSONResponse

type GetUserById401JSONResponse Error

func (GetUserById401JSONResponse) VisitGetUserByIdResponse

func (response GetUserById401JSONResponse) VisitGetUserByIdResponse(w http.ResponseWriter) error

type GetUserById404JSONResponse

type GetUserById404JSONResponse Error

func (GetUserById404JSONResponse) VisitGetUserByIdResponse

func (response GetUserById404JSONResponse) VisitGetUserByIdResponse(w http.ResponseWriter) error

type GetUserByIdRequestObject

type GetUserByIdRequestObject struct {
	UserId UserId `json:"userId"`
}

type GetUserByIdResponseObject

type GetUserByIdResponseObject interface {
	VisitGetUserByIdResponse(w http.ResponseWriter) error
}

type GetUserList200JSONResponse

type GetUserList200JSONResponse struct {
	Data *[]User `json:"data,omitempty"`

	// Meta Pagination metadata for list responses
	Meta *PaginationMeta `json:"meta,omitempty"`
}

func (GetUserList200JSONResponse) VisitGetUserListResponse

func (response GetUserList200JSONResponse) VisitGetUserListResponse(w http.ResponseWriter) error

type GetUserList400JSONResponse

type GetUserList400JSONResponse Error

func (GetUserList400JSONResponse) VisitGetUserListResponse

func (response GetUserList400JSONResponse) VisitGetUserListResponse(w http.ResponseWriter) error

type GetUserList401JSONResponse

type GetUserList401JSONResponse Error

func (GetUserList401JSONResponse) VisitGetUserListResponse

func (response GetUserList401JSONResponse) VisitGetUserListResponse(w http.ResponseWriter) error

type GetUserListParams

type GetUserListParams struct {
	// UsersRequestPayload Filter, sort and pagination query to fetch records.
	UsersRequestPayload UsersRequestPayload `form:"UsersRequestPayload" json:"UsersRequestPayload"`
}

GetUserListParams defines parameters for GetUserList.

type GetUserListRequestObject

type GetUserListRequestObject struct {
	Params GetUserListParams
}

type GetUserListResponseObject

type GetUserListResponseObject interface {
	VisitGetUserListResponse(w http.ResponseWriter) error
}

type Id

type Id = openapi_types.UUID

Id Unique identifier

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type Limit

type Limit = int

Limit Limit of records count to return.

type LogoutUser200JSONResponse

type LogoutUser200JSONResponse struct {
	Success *bool `json:"success,omitempty"`
}

func (LogoutUser200JSONResponse) VisitLogoutUserResponse

func (response LogoutUser200JSONResponse) VisitLogoutUserResponse(w http.ResponseWriter) error

type LogoutUser401JSONResponse

type LogoutUser401JSONResponse Error

func (LogoutUser401JSONResponse) VisitLogoutUserResponse

func (response LogoutUser401JSONResponse) VisitLogoutUserResponse(w http.ResponseWriter) error

type LogoutUserRequestObject

type LogoutUserRequestObject struct {
}

type LogoutUserResponseObject

type LogoutUserResponseObject interface {
	VisitLogoutUserResponse(w http.ResponseWriter) error
}

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type Name

type Name = string

Name Name (either first name or last name) of the user.

type Order

type Order string

Order Enum for sorting order.

const (
	ASC  Order = "ASC"
	DESC Order = "DESC"
)

Defines values for Order.

type OrderBy

type OrderBy = []Order

OrderBy Order of sorting (ascending/descending). `sortBy` and `orderBy` arrays have always the same length, and each element or `sortBy` array corresponds to the appropriate element of `orderBy` array.

type PaginationMeta

type PaginationMeta struct {
	// Limit Number of items per page
	Limit int `json:"limit"`

	// Offset Offset of records to skip
	Offset int `json:"offset"`

	// Total Total number of items
	Total int `json:"total"`
}

PaginationMeta Pagination metadata for list responses

type PaginationOffset

type PaginationOffset = int

PaginationOffset Offset of records to skip.

type Password

type Password = string

Password Password (minimum 8 characters)

type RefreshTokens200JSONResponse

type RefreshTokens200JSONResponse TokenResponse

func (RefreshTokens200JSONResponse) VisitRefreshTokensResponse

func (response RefreshTokens200JSONResponse) VisitRefreshTokensResponse(w http.ResponseWriter) error

type RefreshTokens400JSONResponse

type RefreshTokens400JSONResponse Error

func (RefreshTokens400JSONResponse) VisitRefreshTokensResponse

func (response RefreshTokens400JSONResponse) VisitRefreshTokensResponse(w http.ResponseWriter) error

type RefreshTokens401JSONResponse

type RefreshTokens401JSONResponse Error

func (RefreshTokens401JSONResponse) VisitRefreshTokensResponse

func (response RefreshTokens401JSONResponse) VisitRefreshTokensResponse(w http.ResponseWriter) error

type RefreshTokensJSONRequestBody

type RefreshTokensJSONRequestBody = AuthTokenRefreshRequestPayload

RefreshTokensJSONRequestBody defines body for RefreshTokens for application/json ContentType.

type RefreshTokensRequestObject

type RefreshTokensRequestObject struct {
	Body *RefreshTokensJSONRequestBody
}

type RefreshTokensResponseObject

type RefreshTokensResponseObject interface {
	VisitRefreshTokensResponse(w http.ResponseWriter) error
}

type RegisterRequestPayload

type RegisterRequestPayload struct {
	// Email Email address
	Email Email `json:"email"`

	// FirstName Name (either first name or last name) of the user.
	FirstName Name `json:"firstName"`

	// LastName Name (either first name or last name) of the user.
	LastName Name `json:"lastName"`

	// Password Password (minimum 8 characters)
	Password Password `json:"password"`
}

RegisterRequestPayload Request payload for user registration

type RegisterUser201JSONResponse

type RegisterUser201JSONResponse struct {
	// AccessToken JWT access token
	AccessToken string `json:"accessToken"`

	// AccessTokenExpiresInSeconds Access token expiration time in seconds
	AccessTokenExpiresInSeconds int `json:"accessTokenExpiresInSeconds"`

	// RefreshToken JWT refresh token
	RefreshToken string `json:"refreshToken"`

	// RefreshTokenExpiresInSeconds Refresh token expiration time in seconds
	RefreshTokenExpiresInSeconds int `json:"refreshTokenExpiresInSeconds"`

	// User User entity representing a system user
	User User `json:"user"`
}

func (RegisterUser201JSONResponse) VisitRegisterUserResponse

func (response RegisterUser201JSONResponse) VisitRegisterUserResponse(w http.ResponseWriter) error

type RegisterUser400JSONResponse

type RegisterUser400JSONResponse Error

func (RegisterUser400JSONResponse) VisitRegisterUserResponse

func (response RegisterUser400JSONResponse) VisitRegisterUserResponse(w http.ResponseWriter) error

type RegisterUser409JSONResponse

type RegisterUser409JSONResponse Error

func (RegisterUser409JSONResponse) VisitRegisterUserResponse

func (response RegisterUser409JSONResponse) VisitRegisterUserResponse(w http.ResponseWriter) error

type RegisterUserJSONRequestBody

type RegisterUserJSONRequestBody = RegisterRequestPayload

RegisterUserJSONRequestBody defines body for RegisterUser for application/json ContentType.

type RegisterUserRequestObject

type RegisterUserRequestObject struct {
	Body *RegisterUserJSONRequestBody
}

type RegisterUserResponseObject

type RegisterUserResponseObject interface {
	VisitRegisterUserResponse(w http.ResponseWriter) error
}

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type ServerInterface

type ServerInterface interface {
	// User login
	// (POST /v1/auth/login)
	AuthenticateUser(w http.ResponseWriter, r *http.Request)
	// User logout
	// (POST /v1/auth/logout)
	LogoutUser(w http.ResponseWriter, r *http.Request)
	// Refresh tokens
	// (POST /v1/auth/refresh)
	RefreshTokens(w http.ResponseWriter, r *http.Request)
	// Register new user
	// (POST /v1/auth/register)
	RegisterUser(w http.ResponseWriter, r *http.Request)
	// Health check
	// (GET /v1/health)
	GetHealthStatus(w http.ResponseWriter, r *http.Request)
	// List users
	// (GET /v1/users)
	GetUserList(w http.ResponseWriter, r *http.Request, params GetUserListParams)
	// Create user
	// (POST /v1/users)
	CreateUser(w http.ResponseWriter, r *http.Request)
	// Delete user
	// (DELETE /v1/users/{userId})
	DeleteUserById(w http.ResponseWriter, r *http.Request, userId UserId)
	// Get user by ID
	// (GET /v1/users/{userId})
	GetUserById(w http.ResponseWriter, r *http.Request, userId UserId)
	// Update user
	// (PUT /v1/users/{userId})
	UpdateUserById(w http.ResponseWriter, r *http.Request, userId UserId)
	// Update user email
	// (PUT /v1/users/{userId}/email)
	UpdateUserEmail(w http.ResponseWriter, r *http.Request, userId UserId)
}

ServerInterface represents all server handlers.

func NewStrictHandler

func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface

func NewStrictHandlerWithOptions

func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) AuthenticateUser

func (siw *ServerInterfaceWrapper) AuthenticateUser(w http.ResponseWriter, r *http.Request)

AuthenticateUser operation middleware

func (*ServerInterfaceWrapper) CreateUser

func (siw *ServerInterfaceWrapper) CreateUser(w http.ResponseWriter, r *http.Request)

CreateUser operation middleware

func (*ServerInterfaceWrapper) DeleteUserById

func (siw *ServerInterfaceWrapper) DeleteUserById(w http.ResponseWriter, r *http.Request)

DeleteUserById operation middleware

func (*ServerInterfaceWrapper) GetHealthStatus

func (siw *ServerInterfaceWrapper) GetHealthStatus(w http.ResponseWriter, r *http.Request)

GetHealthStatus operation middleware

func (*ServerInterfaceWrapper) GetUserById

func (siw *ServerInterfaceWrapper) GetUserById(w http.ResponseWriter, r *http.Request)

GetUserById operation middleware

func (*ServerInterfaceWrapper) GetUserList

func (siw *ServerInterfaceWrapper) GetUserList(w http.ResponseWriter, r *http.Request)

GetUserList operation middleware

func (*ServerInterfaceWrapper) LogoutUser

func (siw *ServerInterfaceWrapper) LogoutUser(w http.ResponseWriter, r *http.Request)

LogoutUser operation middleware

func (*ServerInterfaceWrapper) RefreshTokens

func (siw *ServerInterfaceWrapper) RefreshTokens(w http.ResponseWriter, r *http.Request)

RefreshTokens operation middleware

func (*ServerInterfaceWrapper) RegisterUser

func (siw *ServerInterfaceWrapper) RegisterUser(w http.ResponseWriter, r *http.Request)

RegisterUser operation middleware

func (*ServerInterfaceWrapper) UpdateUserById

func (siw *ServerInterfaceWrapper) UpdateUserById(w http.ResponseWriter, r *http.Request)

UpdateUserById operation middleware

func (*ServerInterfaceWrapper) UpdateUserEmail

func (siw *ServerInterfaceWrapper) UpdateUserEmail(w http.ResponseWriter, r *http.Request)

UpdateUserEmail operation middleware

type StrictHTTPServerOptions

type StrictHTTPServerOptions struct {
	RequestErrorHandlerFunc  func(w http.ResponseWriter, r *http.Request, err error)
	ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type StrictServerInterface

type StrictServerInterface interface {
	// User login
	// (POST /v1/auth/login)
	AuthenticateUser(ctx context.Context, request AuthenticateUserRequestObject) (AuthenticateUserResponseObject, error)
	// User logout
	// (POST /v1/auth/logout)
	LogoutUser(ctx context.Context, request LogoutUserRequestObject) (LogoutUserResponseObject, error)
	// Refresh tokens
	// (POST /v1/auth/refresh)
	RefreshTokens(ctx context.Context, request RefreshTokensRequestObject) (RefreshTokensResponseObject, error)
	// Register new user
	// (POST /v1/auth/register)
	RegisterUser(ctx context.Context, request RegisterUserRequestObject) (RegisterUserResponseObject, error)
	// Health check
	// (GET /v1/health)
	GetHealthStatus(ctx context.Context, request GetHealthStatusRequestObject) (GetHealthStatusResponseObject, error)
	// List users
	// (GET /v1/users)
	GetUserList(ctx context.Context, request GetUserListRequestObject) (GetUserListResponseObject, error)
	// Create user
	// (POST /v1/users)
	CreateUser(ctx context.Context, request CreateUserRequestObject) (CreateUserResponseObject, error)
	// Delete user
	// (DELETE /v1/users/{userId})
	DeleteUserById(ctx context.Context, request DeleteUserByIdRequestObject) (DeleteUserByIdResponseObject, error)
	// Get user by ID
	// (GET /v1/users/{userId})
	GetUserById(ctx context.Context, request GetUserByIdRequestObject) (GetUserByIdResponseObject, error)
	// Update user
	// (PUT /v1/users/{userId})
	UpdateUserById(ctx context.Context, request UpdateUserByIdRequestObject) (UpdateUserByIdResponseObject, error)
	// Update user email
	// (PUT /v1/users/{userId}/email)
	UpdateUserEmail(ctx context.Context, request UpdateUserEmailRequestObject) (UpdateUserEmailResponseObject, error)
}

StrictServerInterface represents all server handlers.

type TokenResponse

type TokenResponse struct {
	// AccessToken JWT access token
	AccessToken string `json:"accessToken"`

	// AccessTokenExpiresInSeconds Access token expiration time in seconds
	AccessTokenExpiresInSeconds int `json:"accessTokenExpiresInSeconds"`

	// RefreshToken JWT refresh token
	RefreshToken string `json:"refreshToken"`

	// RefreshTokenExpiresInSeconds Refresh token expiration time in seconds
	RefreshTokenExpiresInSeconds int `json:"refreshTokenExpiresInSeconds"`
}

TokenResponse Authentication token response

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type Unimplemented

type Unimplemented struct{}

func (Unimplemented) AuthenticateUser

func (_ Unimplemented) AuthenticateUser(w http.ResponseWriter, r *http.Request)

User login (POST /v1/auth/login)

func (Unimplemented) CreateUser

func (_ Unimplemented) CreateUser(w http.ResponseWriter, r *http.Request)

Create user (POST /v1/users)

func (Unimplemented) DeleteUserById

func (_ Unimplemented) DeleteUserById(w http.ResponseWriter, r *http.Request, userId UserId)

Delete user (DELETE /v1/users/{userId})

func (Unimplemented) GetHealthStatus

func (_ Unimplemented) GetHealthStatus(w http.ResponseWriter, r *http.Request)

Health check (GET /v1/health)

func (Unimplemented) GetUserById

func (_ Unimplemented) GetUserById(w http.ResponseWriter, r *http.Request, userId UserId)

Get user by ID (GET /v1/users/{userId})

func (Unimplemented) GetUserList

func (_ Unimplemented) GetUserList(w http.ResponseWriter, r *http.Request, params GetUserListParams)

List users (GET /v1/users)

func (Unimplemented) LogoutUser

func (_ Unimplemented) LogoutUser(w http.ResponseWriter, r *http.Request)

User logout (POST /v1/auth/logout)

func (Unimplemented) RefreshTokens

func (_ Unimplemented) RefreshTokens(w http.ResponseWriter, r *http.Request)

Refresh tokens (POST /v1/auth/refresh)

func (Unimplemented) RegisterUser

func (_ Unimplemented) RegisterUser(w http.ResponseWriter, r *http.Request)

Register new user (POST /v1/auth/register)

func (Unimplemented) UpdateUserById

func (_ Unimplemented) UpdateUserById(w http.ResponseWriter, r *http.Request, userId UserId)

Update user (PUT /v1/users/{userId})

func (Unimplemented) UpdateUserEmail

func (_ Unimplemented) UpdateUserEmail(w http.ResponseWriter, r *http.Request, userId UserId)

Update user email (PUT /v1/users/{userId}/email)

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

type UpdateUserById200JSONResponse

type UpdateUserById200JSONResponse User

func (UpdateUserById200JSONResponse) VisitUpdateUserByIdResponse

func (response UpdateUserById200JSONResponse) VisitUpdateUserByIdResponse(w http.ResponseWriter) error

type UpdateUserById400JSONResponse

type UpdateUserById400JSONResponse Error

func (UpdateUserById400JSONResponse) VisitUpdateUserByIdResponse

func (response UpdateUserById400JSONResponse) VisitUpdateUserByIdResponse(w http.ResponseWriter) error

type UpdateUserById401JSONResponse

type UpdateUserById401JSONResponse Error

func (UpdateUserById401JSONResponse) VisitUpdateUserByIdResponse

func (response UpdateUserById401JSONResponse) VisitUpdateUserByIdResponse(w http.ResponseWriter) error

type UpdateUserById404JSONResponse

type UpdateUserById404JSONResponse Error

func (UpdateUserById404JSONResponse) VisitUpdateUserByIdResponse

func (response UpdateUserById404JSONResponse) VisitUpdateUserByIdResponse(w http.ResponseWriter) error

type UpdateUserByIdJSONRequestBody

type UpdateUserByIdJSONRequestBody = UserUpdateRequest

UpdateUserByIdJSONRequestBody defines body for UpdateUserById for application/json ContentType.

type UpdateUserByIdRequestObject

type UpdateUserByIdRequestObject struct {
	UserId UserId `json:"userId"`
	Body   *UpdateUserByIdJSONRequestBody
}

type UpdateUserByIdResponseObject

type UpdateUserByIdResponseObject interface {
	VisitUpdateUserByIdResponse(w http.ResponseWriter) error
}

type UpdateUserEmail200JSONResponse

type UpdateUserEmail200JSONResponse User

func (UpdateUserEmail200JSONResponse) VisitUpdateUserEmailResponse

func (response UpdateUserEmail200JSONResponse) VisitUpdateUserEmailResponse(w http.ResponseWriter) error

type UpdateUserEmail400JSONResponse

type UpdateUserEmail400JSONResponse Error

func (UpdateUserEmail400JSONResponse) VisitUpdateUserEmailResponse

func (response UpdateUserEmail400JSONResponse) VisitUpdateUserEmailResponse(w http.ResponseWriter) error

type UpdateUserEmail401JSONResponse

type UpdateUserEmail401JSONResponse Error

func (UpdateUserEmail401JSONResponse) VisitUpdateUserEmailResponse

func (response UpdateUserEmail401JSONResponse) VisitUpdateUserEmailResponse(w http.ResponseWriter) error

type UpdateUserEmail403JSONResponse

type UpdateUserEmail403JSONResponse Error

func (UpdateUserEmail403JSONResponse) VisitUpdateUserEmailResponse

func (response UpdateUserEmail403JSONResponse) VisitUpdateUserEmailResponse(w http.ResponseWriter) error

type UpdateUserEmail404JSONResponse

type UpdateUserEmail404JSONResponse Error

func (UpdateUserEmail404JSONResponse) VisitUpdateUserEmailResponse

func (response UpdateUserEmail404JSONResponse) VisitUpdateUserEmailResponse(w http.ResponseWriter) error

type UpdateUserEmailJSONRequestBody

type UpdateUserEmailJSONRequestBody = UserUpdateEmailRequest

UpdateUserEmailJSONRequestBody defines body for UpdateUserEmail for application/json ContentType.

type UpdateUserEmailRequestObject

type UpdateUserEmailRequestObject struct {
	UserId UserId `json:"userId"`
	Body   *UpdateUserEmailJSONRequestBody
}

type UpdateUserEmailResponseObject

type UpdateUserEmailResponseObject interface {
	VisitUpdateUserEmailResponse(w http.ResponseWriter) error
}

type User

type User struct {
	// AvatarUrl User avatar URL
	AvatarUrl *AvatarUrl `json:"avatarUrl"`

	// CreatedAt Creation timestamp
	CreatedAt time.Time `json:"createdAt"`

	// Email Email address
	Email Email `json:"email"`

	// FirstName Name (either first name or last name) of the user.
	FirstName Name `json:"firstName"`

	// Id Unique identifier
	Id Id `json:"id"`

	// LastLoginAt Last login timestamp
	LastLoginAt *time.Time `json:"lastLoginAt"`

	// LastName Name (either first name or last name) of the user.
	LastName Name `json:"lastName"`

	// Role Profile role.
	Role UserRole `json:"role"`

	// Status User status.
	// - ACTIVE: The user is currently active and operational.
	// - PENDING: User has been invited but not yet activated by the user.
	// - FROZEN: The user is inactive and not available for transactions.
	// - DELETED: The user has been deleted and is no longer active.
	Status UserStatus `json:"status"`

	// UpdatedAt Last update timestamp
	UpdatedAt time.Time `json:"updatedAt"`
}

User User entity representing a system user

type UserCreateRequest

type UserCreateRequest struct {
	// Email Email address
	Email Email `json:"email"`

	// FirstName Name (either first name or last name) of the user.
	FirstName Name `json:"firstName"`

	// LastName Name (either first name or last name) of the user.
	LastName Name `json:"lastName"`

	// Password Password (minimum 8 characters)
	Password Password `json:"password"`

	// Role Profile role.
	Role *UserRole `json:"role,omitempty"`

	// Status User status.
	// - ACTIVE: The user is currently active and operational.
	// - PENDING: User has been invited but not yet activated by the user.
	// - FROZEN: The user is inactive and not available for transactions.
	// - DELETED: The user has been deleted and is no longer active.
	Status *UserStatus `json:"status,omitempty"`
}

UserCreateRequest Request payload for creating a new user

type UserId

type UserId = openapi_types.UUID

UserId defines model for UserId.

type UserRole

type UserRole string

UserRole Profile role.

const (
	ADMIN    UserRole = "ADMIN"
	BUYER    UserRole = "BUYER"
	TEAMLEAD UserRole = "TEAM_LEAD"
)

Defines values for UserRole.

type UserSortField

type UserSortField string

UserSortField Enum defining the fields by which user can sort the users list.

const (
	FULLNAME UserSortField = "FULL_NAME"
)

Defines values for UserSortField.

type UserStatus

type UserStatus string

UserStatus User status. - ACTIVE: The user is currently active and operational. - PENDING: User has been invited but not yet activated by the user. - FROZEN: The user is inactive and not available for transactions. - DELETED: The user has been deleted and is no longer active.

const (
	ACTIVE  UserStatus = "ACTIVE"
	DELETED UserStatus = "DELETED"
	FROZEN  UserStatus = "FROZEN"
	PENDING UserStatus = "PENDING"
)

Defines values for UserStatus.

type UserUpdateEmailRequest

type UserUpdateEmailRequest struct {
	// NewEmail Email address
	NewEmail Email `json:"newEmail"`

	// Password Password (minimum 8 characters)
	Password Password `json:"password"`
}

UserUpdateEmailRequest Request payload for updating user email

type UserUpdateRequest

type UserUpdateRequest struct {
	// AvatarUrl User avatar URL
	AvatarUrl *AvatarUrl `json:"avatarUrl"`

	// FirstName Name (either first name or last name) of the user.
	FirstName *Name `json:"firstName,omitempty"`

	// LastName Name (either first name or last name) of the user.
	LastName *Name `json:"lastName,omitempty"`

	// Role Profile role.
	Role *UserRole `json:"role,omitempty"`

	// Status User status.
	// - ACTIVE: The user is currently active and operational.
	// - PENDING: User has been invited but not yet activated by the user.
	// - FROZEN: The user is inactive and not available for transactions.
	// - DELETED: The user has been deleted and is no longer active.
	Status *UserStatus `json:"status,omitempty"`
}

UserUpdateRequest Request payload for updating user information

type UsersRequestPayload

type UsersRequestPayload struct {
	// Filter Filter criteria for selecting records.
	Filter *struct {
		// Roles Filter by user roles.
		Roles *[]UserRole `json:"roles,omitempty"`

		// Statuses Filter by user statuses.
		Statuses *[]UserStatus `json:"statuses,omitempty"`

		// Text Full text search.
		Text *string `json:"text,omitempty"`
	} `json:"filter,omitempty"`

	// Limit Limit of records count to return.
	Limit Limit `json:"limit"`

	// Offset Offset of records to skip.
	Offset PaginationOffset `json:"offset"`

	// OrderBy Order of sorting (ascending/descending). `sortBy` and `orderBy` arrays have always the same length, and each element or `sortBy` array corresponds to the appropriate element of `orderBy` array.
	OrderBy *OrderBy `json:"orderBy,omitempty"`

	// SortBy Fields to sort the results by.
	SortBy *[]UserSortField `json:"sortBy,omitempty"`
}

UsersRequestPayload Users request payload.

Jump to

Keyboard shortcuts

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