api

package
v0.0.0-...-ee3aab2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithServerURL

func WithServerURL(ctx context.Context, u *url.URL) context.Context

WithServerURL sets context key to override server URL.

Types

type ApplyPostOK

type ApplyPostOK struct{}

ApplyPostOK is response for ApplyPost operation.

type CallbackPaypalPostOK

type CallbackPaypalPostOK struct{}

CallbackPaypalPostOK is response for CallbackPaypalPost operation.

type CallbackStripePostOK

type CallbackStripePostOK struct{}

CallbackStripePostOK is response for CallbackStripePost operation.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client implements OAS client.

func NewClient

func NewClient(serverURL string, opts ...ClientOption) (*Client, error)

NewClient initializes new Client defined by OAS.

func (*Client) ApplyPost

func (c *Client) ApplyPost(ctx context.Context, request *SystemState) error

ApplyPost invokes POST /Apply operation.

Brings all products, groups and roles into the given state will disable/delete anything not present so use carefully.

POST /Apply

func (*Client) CallbackPaypalPost

func (c *Client) CallbackPaypalPost(ctx context.Context) error

CallbackPaypalPost invokes POST /Callback/paypal operation.

Accept callbacks from paypal.

POST /Callback/paypal

func (*Client) CallbackStripePost

func (c *Client) CallbackStripePost(ctx context.Context) error

CallbackStripePost invokes POST /Callback/stripe operation.

Webhook callback for stripe.

POST /Callback/stripe

func (*Client) GroupGet

func (c *Client) GroupGet(ctx context.Context, params GroupGetParams) ([]Group, error)

GroupGet invokes GET /Group operation.

GET /Group

func (*Client) GroupGroupSlugDelete

func (c *Client) GroupGroupSlugDelete(ctx context.Context, params GroupGroupSlugDeleteParams) (*Group, error)

GroupGroupSlugDelete invokes DELETE /Group/{groupSlug} operation.

DELETE /Group/{groupSlug}

func (*Client) GroupGroupSlugGet

func (c *Client) GroupGroupSlugGet(ctx context.Context, params GroupGroupSlugGetParams) (*Group, error)

GroupGroupSlugGet invokes GET /Group/{groupSlug} operation.

GET /Group/{groupSlug}

func (*Client) GroupGroupSlugProductsDelete

func (c *Client) GroupGroupSlugProductsDelete(ctx context.Context, request []string, params GroupGroupSlugProductsDeleteParams) (*Group, error)

GroupGroupSlugProductsDelete invokes DELETE /Group/{groupSlug}/products operation.

DELETE /Group/{groupSlug}/products

func (*Client) GroupGroupSlugProductsPost

func (c *Client) GroupGroupSlugProductsPost(ctx context.Context, request []string, params GroupGroupSlugProductsPostParams) (*Group, error)

GroupGroupSlugProductsPost invokes POST /Group/{groupSlug}/products operation.

POST /Group/{groupSlug}/products

func (*Client) GroupGroupSlugPut

func (c *Client) GroupGroupSlugPut(ctx context.Context, request *Group, params GroupGroupSlugPutParams) (*Group, error)

GroupGroupSlugPut invokes PUT /Group/{groupSlug} operation.

PUT /Group/{groupSlug}

func (*Client) GroupPost

func (c *Client) GroupPost(ctx context.Context, request *Group) (*Group, error)

GroupPost invokes POST /Group operation.

POST /Group

func (*Client) ProductsGet

func (c *Client) ProductsGet(ctx context.Context, params ProductsGetParams) ([]PurchaseableProduct, error)

ProductsGet invokes GET /Products operation.

Get all products.

GET /Products

func (*Client) ProductsPProductSlugGet

func (c *Client) ProductsPProductSlugGet(ctx context.Context, params ProductsPProductSlugGetParams) (*PurchaseableProduct, error)

ProductsPProductSlugGet invokes GET /Products/p/{productSlug} operation.

Get the details of a product.

GET /Products/p/{productSlug}

func (*Client) ProductsPut

func (c *Client) ProductsPut(ctx context.Context, request *PurchaseableProduct) (*PurchaseableProduct, error)

ProductsPut invokes PUT /Products operation.

Updates a product by replacing it with a new one. Old products can not be deleted to furfill accounting needs.

PUT /Products

func (*Client) ProductsServiceServiceSlugCountGet

func (c *Client) ProductsServiceServiceSlugCountGet(ctx context.Context, params ProductsServiceServiceSlugCountGetParams) (int32, error)

ProductsServiceServiceSlugCountGet invokes GET /Products/service/{serviceSlug}/count operation.

Count of users owning a service.

GET /Products/service/{serviceSlug}/count

func (*Client) ProductsServiceServiceSlugIdsGet

func (c *Client) ProductsServiceServiceSlugIdsGet(ctx context.Context, params ProductsServiceServiceSlugIdsGetParams) ([]string, error)

ProductsServiceServiceSlugIdsGet invokes GET /Products/service/{serviceSlug}/ids operation.

Gets all userIds owning a service.

GET /Products/service/{serviceSlug}/ids

func (*Client) ProductsServicesGet

func (c *Client) ProductsServicesGet(ctx context.Context, params ProductsServicesGetParams) ([]PurchaseableProduct, error)

ProductsServicesGet invokes GET /Products/services operation.

Get services.

GET /Products/services

func (*Client) ProductsTopupGet

func (c *Client) ProductsTopupGet(ctx context.Context, params ProductsTopupGetParams) ([]TopUpProduct, error)

ProductsTopupGet invokes GET /Products/topup operation.

Get topup options.

GET /Products/topup

func (*Client) ProductsTopupPut

func (c *Client) ProductsTopupPut(ctx context.Context, request *TopUpProduct) (*TopUpProduct, error)

ProductsTopupPut invokes PUT /Products/topup operation.

Updates a topup option by replacing it with a new one. Old options get a new slug and are marked as disabled.

PUT /Products/topup

func (*Client) ProductsUserUserIdGet

func (c *Client) ProductsUserUserIdGet(ctx context.Context, params ProductsUserUserIdGetParams) ([]RuleResult, error)

ProductsUserUserIdGet invokes GET /Products/user/{userId} operation.

Get adjusted prices for a user.

GET /Products/user/{userId}

func (*Client) RulesGet

func (c *Client) RulesGet(ctx context.Context, params RulesGetParams) ([]Rule, error)

RulesGet invokes GET /Rules operation.

Returns all rules.

GET /Rules

func (*Client) RulesPost

func (c *Client) RulesPost(ctx context.Context, request *RuleCreate) (*Rule, error)

RulesPost invokes POST /Rules operation.

Creates a new rule.

POST /Rules

func (*Client) RulesRuleSlugDelete

func (c *Client) RulesRuleSlugDelete(ctx context.Context, params RulesRuleSlugDeleteParams) (*Rule, error)

RulesRuleSlugDelete invokes DELETE /Rules/{ruleSlug} operation.

Deletes a rule.

DELETE /Rules/{ruleSlug}

func (*Client) RulesRuleSlugGet

func (c *Client) RulesRuleSlugGet(ctx context.Context, params RulesRuleSlugGetParams) (*Rule, error)

RulesRuleSlugGet invokes GET /Rules/{ruleSlug} operation.

Returns a rule by slug.

GET /Rules/{ruleSlug}

func (*Client) TopUpCompensatePost

func (c *Client) TopUpCompensatePost(ctx context.Context, request *Compensation) (*Int32Int32ValueTuple, error)

TopUpCompensatePost invokes POST /TopUp/compensate operation.

Compensates users of a service for something.

POST /TopUp/compensate

func (*Client) TopUpCustomPost

func (c *Client) TopUpCustomPost(ctx context.Context, request *CustomTopUp, params TopUpCustomPostParams) (*TopUpIdResponse, error)

TopUpCustomPost invokes POST /TopUp/custom operation.

Creates a custom topup that is instantly credited.

POST /TopUp/custom

func (*Client) TopUpOptionsGet

func (c *Client) TopUpOptionsGet(ctx context.Context) ([]TopUpProduct, error)

TopUpOptionsGet invokes GET /TopUp/options operation.

All available topup options.

GET /TopUp/options

func (*Client) TopUpPaypalPost

func (c *Client) TopUpPaypalPost(ctx context.Context, request *TopUpOptions, params TopUpPaypalPostParams) (*TopUpIdResponse, error)

TopUpPaypalPost invokes POST /TopUp/paypal operation.

Creates a payment session with paypal.

POST /TopUp/paypal

func (*Client) TopUpStripePost

func (c *Client) TopUpStripePost(ctx context.Context, request *TopUpOptions, params TopUpStripePostParams) (*TopUpIdResponse, error)

TopUpStripePost invokes POST /TopUp/stripe operation.

Creates a payment session with stripe.

POST /TopUp/stripe

func (*Client) TransactionPlanedUUserIdGet

func (c *Client) TransactionPlanedUUserIdGet(ctx context.Context, params TransactionPlanedUUserIdGetParams) ([]ExternalTransaction, error)

TransactionPlanedUUserIdGet invokes GET /Transaction/planed/u/{userId} operation.

GET /Transaction/planed/u/{userId}

func (*Client) TransactionPlanedUUserIdPost

func (c *Client) TransactionPlanedUUserIdPost(ctx context.Context, request *ExternalTransaction, params TransactionPlanedUUserIdPostParams) (*PlanedTransaction, error)

TransactionPlanedUUserIdPost invokes POST /Transaction/planed/u/{userId} operation.

POST /Transaction/planed/u/{userId}

func (*Client) TransactionPlanedUUserIdTTransactionIdDelete

func (c *Client) TransactionPlanedUUserIdTTransactionIdDelete(ctx context.Context, params TransactionPlanedUUserIdTTransactionIdDeleteParams) (*PlanedTransaction, error)

TransactionPlanedUUserIdTTransactionIdDelete invokes DELETE /Transaction/planed/u/{userId}/t/{transactionId} operation.

DELETE /Transaction/planed/u/{userId}/t/{transactionId}

func (*Client) TransactionPlanedUUserIdTTransactionIdPut

func (c *Client) TransactionPlanedUUserIdTTransactionIdPut(ctx context.Context, request *ExternalTransaction, params TransactionPlanedUUserIdTTransactionIdPutParams) (*PlanedTransaction, error)

TransactionPlanedUUserIdTTransactionIdPut invokes PUT /Transaction/planed/u/{userId}/t/{transactionId} operation.

PUT /Transaction/planed/u/{userId}/t/{transactionId}

func (*Client) TransactionSendPost

func (c *Client) TransactionSendPost(ctx context.Context, request *TransactionEvent) error

TransactionSendPost invokes POST /Transaction/send operation.

POST /Transaction/send

func (*Client) TransactionUUserIdGet

func (c *Client) TransactionUUserIdGet(ctx context.Context, params TransactionUUserIdGetParams) ([]ExternalTransaction, error)

TransactionUUserIdGet invokes GET /Transaction/u/{userId} operation.

GET /Transaction/u/{userId}

func (*Client) UserUserIdGet

func (c *Client) UserUserIdGet(ctx context.Context, params UserUserIdGetParams) (*User, error)

UserUserIdGet invokes GET /User/{userId} operation.

Gets the user with the given id.

GET /User/{userId}

func (*Client) UserUserIdOwnsLongestPost

func (c *Client) UserUserIdOwnsLongestPost(ctx context.Context, request []string, params UserUserIdOwnsLongestPostParams) (time.Time, error)

UserUserIdOwnsLongestPost invokes POST /User/{userId}/owns/longest operation.

Returns the bigest time out of a list of product ids.

POST /User/{userId}/owns/longest

func (*Client) UserUserIdOwnsPost deprecated

func (c *Client) UserUserIdOwnsPost(ctx context.Context, request []string, params UserUserIdOwnsPostParams) ([]OwnerShip, error)

UserUserIdOwnsPost invokes POST /User/{userId}/owns operation.

Returns all ownership data for an user out of a list of interested.

Deprecated: schema marks this operation as deprecated.

POST /User/{userId}/owns

func (*Client) UserUserIdOwnsProductSlugUntilGet

func (c *Client) UserUserIdOwnsProductSlugUntilGet(ctx context.Context, params UserUserIdOwnsProductSlugUntilGetParams) (time.Time, error)

UserUserIdOwnsProductSlugUntilGet invokes GET /User/{userId}/owns/{productSlug}/until operation.

Returns the time for how long a user owns a given product.

GET /User/{userId}/owns/{productSlug}/until

func (*Client) UserUserIdOwnsUntilPost

func (c *Client) UserUserIdOwnsUntilPost(ctx context.Context, request []string, params UserUserIdOwnsUntilPostParams) (UserUserIdOwnsUntilPostOKApplicationJSON, error)

UserUserIdOwnsUntilPost invokes POST /User/{userId}/owns/until operation.

Returns all ownership data for an user out of a list of interested.

POST /User/{userId}/owns/until

func (*Client) UserUserIdPost

func (c *Client) UserUserIdPost(ctx context.Context, params UserUserIdPostParams) (*User, error)

UserUserIdPost invokes POST /User/{userId} operation.

Creates a new user with the given id.

POST /User/{userId}

func (*Client) UserUserIdPurchaseProductSlugPost

func (c *Client) UserUserIdPurchaseProductSlugPost(ctx context.Context, params UserUserIdPurchaseProductSlugPostParams) (*User, error)

UserUserIdPurchaseProductSlugPost invokes POST /User/{userId}/purchase/{productSlug} operation.

Purchase a new product if enough funds are available.

POST /User/{userId}/purchase/{productSlug}

func (*Client) UserUserIdServicePurchaseProductSlugPost

func (c *Client) UserUserIdServicePurchaseProductSlugPost(ctx context.Context, params UserUserIdServicePurchaseProductSlugPostParams) (*User, error)

UserUserIdServicePurchaseProductSlugPost invokes POST /User/{userId}/service/purchase/{productSlug} operation.

Purchase/extends a service if enough funds are available.

POST /User/{userId}/service/purchase/{productSlug}

func (*Client) UserUserIdTransactionIdDelete

func (c *Client) UserUserIdTransactionIdDelete(ctx context.Context, params UserUserIdTransactionIdDeleteParams) (*User, error)

UserUserIdTransactionIdDelete invokes DELETE /User/{userId}/{transactionId} operation.

Undo the purchase of a service.

DELETE /User/{userId}/{transactionId}

func (*Client) UserUserIdTransferPost

func (c *Client) UserUserIdTransferPost(ctx context.Context, request *TransferRequest, params UserUserIdTransferPostParams) (*TransactionEvent, error)

UserUserIdTransferPost invokes POST /User/{userId}/transfer operation.

Transfers coins to another user.

POST /User/{userId}/transfer

type ClientOption

type ClientOption interface {
	// contains filtered or unexported methods
}

ClientOption is client config option.

func WithClient

func WithClient(client ht.Client) ClientOption

WithClient specifies http client to use.

type Compensation

type Compensation struct {
	// The product id owners of which to compensate.
	ProductId OptNilString `json:"productId"`
	// A reason for the compensation, also serves as double compensation prevention.
	Reference OptNilString `json:"reference"`
	// How much to compensate.
	Amount OptInt32 `json:"amount"`
	// At what time ownership of Coflnet.Payments.Models.Product should be looked for (services might
	// expired since).
	When OptDateTime `json:"when"`
}

Compensation for some kind of incident. Ref: #/components/schemas/Compensation

func (*Compensation) Decode

func (s *Compensation) Decode(d *jx.Decoder) error

Decode decodes Compensation from json.

func (*Compensation) Encode

func (s *Compensation) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Compensation) GetAmount

func (s *Compensation) GetAmount() OptInt32

GetAmount returns the value of Amount.

func (*Compensation) GetProductId

func (s *Compensation) GetProductId() OptNilString

GetProductId returns the value of ProductId.

func (*Compensation) GetReference

func (s *Compensation) GetReference() OptNilString

GetReference returns the value of Reference.

func (*Compensation) GetWhen

func (s *Compensation) GetWhen() OptDateTime

GetWhen returns the value of When.

func (*Compensation) MarshalJSON

func (s *Compensation) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Compensation) SetAmount

func (s *Compensation) SetAmount(val OptInt32)

SetAmount sets the value of Amount.

func (*Compensation) SetProductId

func (s *Compensation) SetProductId(val OptNilString)

SetProductId sets the value of ProductId.

func (*Compensation) SetReference

func (s *Compensation) SetReference(val OptNilString)

SetReference sets the value of Reference.

func (*Compensation) SetWhen

func (s *Compensation) SetWhen(val OptDateTime)

SetWhen sets the value of When.

func (*Compensation) UnmarshalJSON

func (s *Compensation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CustomTopUp

type CustomTopUp struct {
	// What product this coresponds to (the product can define additional information).
	ProductId OptNilString `json:"productId"`
	// How much to add/substract.
	Amount OptInt64 `json:"amount"`
	// Reference/Reason this topup took place, dupplicates will be rejected.
	Reference OptNilString `json:"reference"`
}

Represents a custom adjustment to an users balance. Ref: #/components/schemas/CustomTopUp

func (*CustomTopUp) Decode

func (s *CustomTopUp) Decode(d *jx.Decoder) error

Decode decodes CustomTopUp from json.

func (*CustomTopUp) Encode

func (s *CustomTopUp) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CustomTopUp) GetAmount

func (s *CustomTopUp) GetAmount() OptInt64

GetAmount returns the value of Amount.

func (*CustomTopUp) GetProductId

func (s *CustomTopUp) GetProductId() OptNilString

GetProductId returns the value of ProductId.

func (*CustomTopUp) GetReference

func (s *CustomTopUp) GetReference() OptNilString

GetReference returns the value of Reference.

func (*CustomTopUp) MarshalJSON

func (s *CustomTopUp) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CustomTopUp) SetAmount

func (s *CustomTopUp) SetAmount(val OptInt64)

SetAmount sets the value of Amount.

func (*CustomTopUp) SetProductId

func (s *CustomTopUp) SetProductId(val OptNilString)

SetProductId sets the value of ProductId.

func (*CustomTopUp) SetReference

func (s *CustomTopUp) SetReference(val OptNilString)

SetReference sets the value of Reference.

func (*CustomTopUp) UnmarshalJSON

func (s *CustomTopUp) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type ExternalTransaction

type ExternalTransaction struct {
	ID        OptNilString `json:"id"`
	ProductId OptNilString `json:"productId"`
	Reference OptNilString `json:"reference"`
	Amount    OptFloat64   `json:"amount"`
	TimeStamp OptDateTime  `json:"timeStamp"`
}

Ref: #/components/schemas/ExternalTransaction

func (*ExternalTransaction) Decode

func (s *ExternalTransaction) Decode(d *jx.Decoder) error

Decode decodes ExternalTransaction from json.

func (*ExternalTransaction) Encode

func (s *ExternalTransaction) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ExternalTransaction) GetAmount

func (s *ExternalTransaction) GetAmount() OptFloat64

GetAmount returns the value of Amount.

func (*ExternalTransaction) GetID

func (s *ExternalTransaction) GetID() OptNilString

GetID returns the value of ID.

func (*ExternalTransaction) GetProductId

func (s *ExternalTransaction) GetProductId() OptNilString

GetProductId returns the value of ProductId.

func (*ExternalTransaction) GetReference

func (s *ExternalTransaction) GetReference() OptNilString

GetReference returns the value of Reference.

func (*ExternalTransaction) GetTimeStamp

func (s *ExternalTransaction) GetTimeStamp() OptDateTime

GetTimeStamp returns the value of TimeStamp.

func (*ExternalTransaction) MarshalJSON

func (s *ExternalTransaction) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ExternalTransaction) SetAmount

func (s *ExternalTransaction) SetAmount(val OptFloat64)

SetAmount sets the value of Amount.

func (*ExternalTransaction) SetID

func (s *ExternalTransaction) SetID(val OptNilString)

SetID sets the value of ID.

func (*ExternalTransaction) SetProductId

func (s *ExternalTransaction) SetProductId(val OptNilString)

SetProductId sets the value of ProductId.

func (*ExternalTransaction) SetReference

func (s *ExternalTransaction) SetReference(val OptNilString)

SetReference sets the value of Reference.

func (*ExternalTransaction) SetTimeStamp

func (s *ExternalTransaction) SetTimeStamp(val OptDateTime)

SetTimeStamp sets the value of TimeStamp.

func (*ExternalTransaction) UnmarshalJSON

func (s *ExternalTransaction) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ExternalTransaction) Validate

func (s *ExternalTransaction) Validate() error

type Group

type Group struct {
	// Primary Key.
	ID OptInt32 `json:"id"`
	// Identifier of this group.
	Slug OptNilString `json:"slug"`
	// Products in this group.
	Products OptNilProductArray `json:"products"`
}

A group is a collection of one or more Coflnet.Payments.Models.Product. Ref: #/components/schemas/Group

func (*Group) Decode

func (s *Group) Decode(d *jx.Decoder) error

Decode decodes Group from json.

func (*Group) Encode

func (s *Group) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Group) GetID

func (s *Group) GetID() OptInt32

GetID returns the value of ID.

func (*Group) GetProducts

func (s *Group) GetProducts() OptNilProductArray

GetProducts returns the value of Products.

func (*Group) GetSlug

func (s *Group) GetSlug() OptNilString

GetSlug returns the value of Slug.

func (*Group) MarshalJSON

func (s *Group) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Group) SetID

func (s *Group) SetID(val OptInt32)

SetID sets the value of ID.

func (*Group) SetProducts

func (s *Group) SetProducts(val OptNilProductArray)

SetProducts sets the value of Products.

func (*Group) SetSlug

func (s *Group) SetSlug(val OptNilString)

SetSlug sets the value of Slug.

func (*Group) UnmarshalJSON

func (s *Group) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Group) Validate

func (s *Group) Validate() error

type GroupGetParams

type GroupGetParams struct {
	Offset OptInt32
	Amount OptInt32
}

GroupGetParams is parameters of GET /Group operation.

type GroupGroupSlugDeleteParams

type GroupGroupSlugDeleteParams struct {
	GroupSlug string
}

GroupGroupSlugDeleteParams is parameters of DELETE /Group/{groupSlug} operation.

type GroupGroupSlugGetParams

type GroupGroupSlugGetParams struct {
	GroupSlug string
}

GroupGroupSlugGetParams is parameters of GET /Group/{groupSlug} operation.

type GroupGroupSlugProductsDeleteParams

type GroupGroupSlugProductsDeleteParams struct {
	GroupSlug string
}

GroupGroupSlugProductsDeleteParams is parameters of DELETE /Group/{groupSlug}/products operation.

type GroupGroupSlugProductsPostParams

type GroupGroupSlugProductsPostParams struct {
	GroupSlug string
}

GroupGroupSlugProductsPostParams is parameters of POST /Group/{groupSlug}/products operation.

type GroupGroupSlugPutParams

type GroupGroupSlugPutParams struct {
	GroupSlug string
}

GroupGroupSlugPutParams is parameters of PUT /Group/{groupSlug} operation.

type Handler

type Handler interface {
	// ApplyPost implements POST /Apply operation.
	//
	// Brings all products, groups and roles into the given state
	// will disable/delete anything not present so use carefully.
	//
	// POST /Apply
	ApplyPost(ctx context.Context, req *SystemState) error
	// CallbackPaypalPost implements POST /Callback/paypal operation.
	//
	// Accept callbacks from paypal.
	//
	// POST /Callback/paypal
	CallbackPaypalPost(ctx context.Context) error
	// CallbackStripePost implements POST /Callback/stripe operation.
	//
	// Webhook callback for stripe.
	//
	// POST /Callback/stripe
	CallbackStripePost(ctx context.Context) error
	// GroupGet implements GET /Group operation.
	//
	// GET /Group
	GroupGet(ctx context.Context, params GroupGetParams) ([]Group, error)
	// GroupGroupSlugDelete implements DELETE /Group/{groupSlug} operation.
	//
	// DELETE /Group/{groupSlug}
	GroupGroupSlugDelete(ctx context.Context, params GroupGroupSlugDeleteParams) (*Group, error)
	// GroupGroupSlugGet implements GET /Group/{groupSlug} operation.
	//
	// GET /Group/{groupSlug}
	GroupGroupSlugGet(ctx context.Context, params GroupGroupSlugGetParams) (*Group, error)
	// GroupGroupSlugProductsDelete implements DELETE /Group/{groupSlug}/products operation.
	//
	// DELETE /Group/{groupSlug}/products
	GroupGroupSlugProductsDelete(ctx context.Context, req []string, params GroupGroupSlugProductsDeleteParams) (*Group, error)
	// GroupGroupSlugProductsPost implements POST /Group/{groupSlug}/products operation.
	//
	// POST /Group/{groupSlug}/products
	GroupGroupSlugProductsPost(ctx context.Context, req []string, params GroupGroupSlugProductsPostParams) (*Group, error)
	// GroupGroupSlugPut implements PUT /Group/{groupSlug} operation.
	//
	// PUT /Group/{groupSlug}
	GroupGroupSlugPut(ctx context.Context, req *Group, params GroupGroupSlugPutParams) (*Group, error)
	// GroupPost implements POST /Group operation.
	//
	// POST /Group
	GroupPost(ctx context.Context, req *Group) (*Group, error)
	// ProductsGet implements GET /Products operation.
	//
	// Get all products.
	//
	// GET /Products
	ProductsGet(ctx context.Context, params ProductsGetParams) ([]PurchaseableProduct, error)
	// ProductsPProductSlugGet implements GET /Products/p/{productSlug} operation.
	//
	// Get the details of a product.
	//
	// GET /Products/p/{productSlug}
	ProductsPProductSlugGet(ctx context.Context, params ProductsPProductSlugGetParams) (*PurchaseableProduct, error)
	// ProductsPut implements PUT /Products operation.
	//
	// Updates a product by replacing it with a new one.
	// Old products can not be deleted to furfill accounting needs.
	//
	// PUT /Products
	ProductsPut(ctx context.Context, req *PurchaseableProduct) (*PurchaseableProduct, error)
	// ProductsServiceServiceSlugCountGet implements GET /Products/service/{serviceSlug}/count operation.
	//
	// Count of users owning a service.
	//
	// GET /Products/service/{serviceSlug}/count
	ProductsServiceServiceSlugCountGet(ctx context.Context, params ProductsServiceServiceSlugCountGetParams) (int32, error)
	// ProductsServiceServiceSlugIdsGet implements GET /Products/service/{serviceSlug}/ids operation.
	//
	// Gets all userIds owning a service.
	//
	// GET /Products/service/{serviceSlug}/ids
	ProductsServiceServiceSlugIdsGet(ctx context.Context, params ProductsServiceServiceSlugIdsGetParams) ([]string, error)
	// ProductsServicesGet implements GET /Products/services operation.
	//
	// Get services.
	//
	// GET /Products/services
	ProductsServicesGet(ctx context.Context, params ProductsServicesGetParams) ([]PurchaseableProduct, error)
	// ProductsTopupGet implements GET /Products/topup operation.
	//
	// Get topup options.
	//
	// GET /Products/topup
	ProductsTopupGet(ctx context.Context, params ProductsTopupGetParams) ([]TopUpProduct, error)
	// ProductsTopupPut implements PUT /Products/topup operation.
	//
	// Updates a topup option by replacing it with a new one.
	// Old options get a new slug and are marked as disabled.
	//
	// PUT /Products/topup
	ProductsTopupPut(ctx context.Context, req *TopUpProduct) (*TopUpProduct, error)
	// ProductsUserUserIdGet implements GET /Products/user/{userId} operation.
	//
	// Get adjusted prices for a user.
	//
	// GET /Products/user/{userId}
	ProductsUserUserIdGet(ctx context.Context, params ProductsUserUserIdGetParams) ([]RuleResult, error)
	// RulesGet implements GET /Rules operation.
	//
	// Returns all rules.
	//
	// GET /Rules
	RulesGet(ctx context.Context, params RulesGetParams) ([]Rule, error)
	// RulesPost implements POST /Rules operation.
	//
	// Creates a new rule.
	//
	// POST /Rules
	RulesPost(ctx context.Context, req *RuleCreate) (*Rule, error)
	// RulesRuleSlugDelete implements DELETE /Rules/{ruleSlug} operation.
	//
	// Deletes a rule.
	//
	// DELETE /Rules/{ruleSlug}
	RulesRuleSlugDelete(ctx context.Context, params RulesRuleSlugDeleteParams) (*Rule, error)
	// RulesRuleSlugGet implements GET /Rules/{ruleSlug} operation.
	//
	// Returns a rule by slug.
	//
	// GET /Rules/{ruleSlug}
	RulesRuleSlugGet(ctx context.Context, params RulesRuleSlugGetParams) (*Rule, error)
	// TopUpCompensatePost implements POST /TopUp/compensate operation.
	//
	// Compensates users of a service for something.
	//
	// POST /TopUp/compensate
	TopUpCompensatePost(ctx context.Context, req *Compensation) (*Int32Int32ValueTuple, error)
	// TopUpCustomPost implements POST /TopUp/custom operation.
	//
	// Creates a custom topup that is instantly credited.
	//
	// POST /TopUp/custom
	TopUpCustomPost(ctx context.Context, req *CustomTopUp, params TopUpCustomPostParams) (*TopUpIdResponse, error)
	// TopUpOptionsGet implements GET /TopUp/options operation.
	//
	// All available topup options.
	//
	// GET /TopUp/options
	TopUpOptionsGet(ctx context.Context) ([]TopUpProduct, error)
	// TopUpPaypalPost implements POST /TopUp/paypal operation.
	//
	// Creates a payment session with paypal.
	//
	// POST /TopUp/paypal
	TopUpPaypalPost(ctx context.Context, req *TopUpOptions, params TopUpPaypalPostParams) (*TopUpIdResponse, error)
	// TopUpStripePost implements POST /TopUp/stripe operation.
	//
	// Creates a payment session with stripe.
	//
	// POST /TopUp/stripe
	TopUpStripePost(ctx context.Context, req *TopUpOptions, params TopUpStripePostParams) (*TopUpIdResponse, error)
	// TransactionPlanedUUserIdGet implements GET /Transaction/planed/u/{userId} operation.
	//
	// GET /Transaction/planed/u/{userId}
	TransactionPlanedUUserIdGet(ctx context.Context, params TransactionPlanedUUserIdGetParams) ([]ExternalTransaction, error)
	// TransactionPlanedUUserIdPost implements POST /Transaction/planed/u/{userId} operation.
	//
	// POST /Transaction/planed/u/{userId}
	TransactionPlanedUUserIdPost(ctx context.Context, req *ExternalTransaction, params TransactionPlanedUUserIdPostParams) (*PlanedTransaction, error)
	// TransactionPlanedUUserIdTTransactionIdDelete implements DELETE /Transaction/planed/u/{userId}/t/{transactionId} operation.
	//
	// DELETE /Transaction/planed/u/{userId}/t/{transactionId}
	TransactionPlanedUUserIdTTransactionIdDelete(ctx context.Context, params TransactionPlanedUUserIdTTransactionIdDeleteParams) (*PlanedTransaction, error)
	// TransactionPlanedUUserIdTTransactionIdPut implements PUT /Transaction/planed/u/{userId}/t/{transactionId} operation.
	//
	// PUT /Transaction/planed/u/{userId}/t/{transactionId}
	TransactionPlanedUUserIdTTransactionIdPut(ctx context.Context, req *ExternalTransaction, params TransactionPlanedUUserIdTTransactionIdPutParams) (*PlanedTransaction, error)
	// TransactionSendPost implements POST /Transaction/send operation.
	//
	// POST /Transaction/send
	TransactionSendPost(ctx context.Context, req *TransactionEvent) error
	// TransactionUUserIdGet implements GET /Transaction/u/{userId} operation.
	//
	// GET /Transaction/u/{userId}
	TransactionUUserIdGet(ctx context.Context, params TransactionUUserIdGetParams) ([]ExternalTransaction, error)
	// UserUserIdGet implements GET /User/{userId} operation.
	//
	// Gets the user with the given id.
	//
	// GET /User/{userId}
	UserUserIdGet(ctx context.Context, params UserUserIdGetParams) (*User, error)
	// UserUserIdOwnsLongestPost implements POST /User/{userId}/owns/longest operation.
	//
	// Returns the bigest time out of a list of product ids.
	//
	// POST /User/{userId}/owns/longest
	UserUserIdOwnsLongestPost(ctx context.Context, req []string, params UserUserIdOwnsLongestPostParams) (time.Time, error)
	// UserUserIdOwnsPost implements POST /User/{userId}/owns operation.
	//
	// Returns all ownership data for an user out of a list of interested.
	//
	// Deprecated: schema marks this operation as deprecated.
	//
	// POST /User/{userId}/owns
	UserUserIdOwnsPost(ctx context.Context, req []string, params UserUserIdOwnsPostParams) ([]OwnerShip, error)
	// UserUserIdOwnsProductSlugUntilGet implements GET /User/{userId}/owns/{productSlug}/until operation.
	//
	// Returns the time for how long a user owns a given product.
	//
	// GET /User/{userId}/owns/{productSlug}/until
	UserUserIdOwnsProductSlugUntilGet(ctx context.Context, params UserUserIdOwnsProductSlugUntilGetParams) (time.Time, error)
	// UserUserIdOwnsUntilPost implements POST /User/{userId}/owns/until operation.
	//
	// Returns all ownership data for an user out of a list of interested.
	//
	// POST /User/{userId}/owns/until
	UserUserIdOwnsUntilPost(ctx context.Context, req []string, params UserUserIdOwnsUntilPostParams) (UserUserIdOwnsUntilPostOKApplicationJSON, error)
	// UserUserIdPost implements POST /User/{userId} operation.
	//
	// Creates a new user with the given id.
	//
	// POST /User/{userId}
	UserUserIdPost(ctx context.Context, params UserUserIdPostParams) (*User, error)
	// UserUserIdPurchaseProductSlugPost implements POST /User/{userId}/purchase/{productSlug} operation.
	//
	// Purchase a new product if enough funds are available.
	//
	// POST /User/{userId}/purchase/{productSlug}
	UserUserIdPurchaseProductSlugPost(ctx context.Context, params UserUserIdPurchaseProductSlugPostParams) (*User, error)
	// UserUserIdServicePurchaseProductSlugPost implements POST /User/{userId}/service/purchase/{productSlug} operation.
	//
	// Purchase/extends a service if enough funds are available.
	//
	// POST /User/{userId}/service/purchase/{productSlug}
	UserUserIdServicePurchaseProductSlugPost(ctx context.Context, params UserUserIdServicePurchaseProductSlugPostParams) (*User, error)
	// UserUserIdTransactionIdDelete implements DELETE /User/{userId}/{transactionId} operation.
	//
	// Undo the purchase of a service.
	//
	// DELETE /User/{userId}/{transactionId}
	UserUserIdTransactionIdDelete(ctx context.Context, params UserUserIdTransactionIdDeleteParams) (*User, error)
	// UserUserIdTransferPost implements POST /User/{userId}/transfer operation.
	//
	// Transfers coins to another user.
	//
	// POST /User/{userId}/transfer
	UserUserIdTransferPost(ctx context.Context, req *TransferRequest, params UserUserIdTransferPostParams) (*TransactionEvent, error)
}

Handler handles operations described by OpenAPI v3 specification.

type Int32Int32ValueTuple

type Int32Int32ValueTuple struct {
	Item1 OptInt32 `json:"item1"`
	Item2 OptInt32 `json:"item2"`
}

Ref: #/components/schemas/Int32Int32ValueTuple

func (*Int32Int32ValueTuple) Decode

func (s *Int32Int32ValueTuple) Decode(d *jx.Decoder) error

Decode decodes Int32Int32ValueTuple from json.

func (*Int32Int32ValueTuple) Encode

func (s *Int32Int32ValueTuple) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Int32Int32ValueTuple) GetItem1

func (s *Int32Int32ValueTuple) GetItem1() OptInt32

GetItem1 returns the value of Item1.

func (*Int32Int32ValueTuple) GetItem2

func (s *Int32Int32ValueTuple) GetItem2() OptInt32

GetItem2 returns the value of Item2.

func (*Int32Int32ValueTuple) MarshalJSON

func (s *Int32Int32ValueTuple) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Int32Int32ValueTuple) SetItem1

func (s *Int32Int32ValueTuple) SetItem1(val OptInt32)

SetItem1 sets the value of Item1.

func (*Int32Int32ValueTuple) SetItem2

func (s *Int32Int32ValueTuple) SetItem2(val OptInt32)

SetItem2 sets the value of Item2.

func (*Int32Int32ValueTuple) UnmarshalJSON

func (s *Int32Int32ValueTuple) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type OptDateTime

type OptDateTime struct {
	Value time.Time
	Set   bool
}

OptDateTime is optional time.Time.

func NewOptDateTime

func NewOptDateTime(v time.Time) OptDateTime

NewOptDateTime returns new OptDateTime with value set to v.

func (*OptDateTime) Decode

func (o *OptDateTime) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error

Decode decodes time.Time from json.

func (OptDateTime) Encode

func (o OptDateTime) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time))

Encode encodes time.Time as json.

func (OptDateTime) Get

func (o OptDateTime) Get() (v time.Time, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptDateTime) IsSet

func (o OptDateTime) IsSet() bool

IsSet returns true if OptDateTime was set.

func (OptDateTime) MarshalJSON

func (s OptDateTime) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptDateTime) Or

func (o OptDateTime) Or(d time.Time) time.Time

Or returns value if set, or given parameter if does not.

func (*OptDateTime) Reset

func (o *OptDateTime) Reset()

Reset unsets value.

func (*OptDateTime) SetTo

func (o *OptDateTime) SetTo(v time.Time)

SetTo sets value to v.

func (*OptDateTime) UnmarshalJSON

func (s *OptDateTime) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptFloat64

type OptFloat64 struct {
	Value float64
	Set   bool
}

OptFloat64 is optional float64.

func NewOptFloat64

func NewOptFloat64(v float64) OptFloat64

NewOptFloat64 returns new OptFloat64 with value set to v.

func (*OptFloat64) Decode

func (o *OptFloat64) Decode(d *jx.Decoder) error

Decode decodes float64 from json.

func (OptFloat64) Encode

func (o OptFloat64) Encode(e *jx.Encoder)

Encode encodes float64 as json.

func (OptFloat64) Get

func (o OptFloat64) Get() (v float64, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptFloat64) IsSet

func (o OptFloat64) IsSet() bool

IsSet returns true if OptFloat64 was set.

func (OptFloat64) MarshalJSON

func (s OptFloat64) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptFloat64) Or

func (o OptFloat64) Or(d float64) float64

Or returns value if set, or given parameter if does not.

func (*OptFloat64) Reset

func (o *OptFloat64) Reset()

Reset unsets value.

func (*OptFloat64) SetTo

func (o *OptFloat64) SetTo(v float64)

SetTo sets value to v.

func (*OptFloat64) UnmarshalJSON

func (s *OptFloat64) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptGroup

type OptGroup struct {
	Value Group
	Set   bool
}

OptGroup is optional Group.

func NewOptGroup

func NewOptGroup(v Group) OptGroup

NewOptGroup returns new OptGroup with value set to v.

func (*OptGroup) Decode

func (o *OptGroup) Decode(d *jx.Decoder) error

Decode decodes Group from json.

func (OptGroup) Encode

func (o OptGroup) Encode(e *jx.Encoder)

Encode encodes Group as json.

func (OptGroup) Get

func (o OptGroup) Get() (v Group, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptGroup) IsSet

func (o OptGroup) IsSet() bool

IsSet returns true if OptGroup was set.

func (OptGroup) MarshalJSON

func (s OptGroup) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptGroup) Or

func (o OptGroup) Or(d Group) Group

Or returns value if set, or given parameter if does not.

func (*OptGroup) Reset

func (o *OptGroup) Reset()

Reset unsets value.

func (*OptGroup) SetTo

func (o *OptGroup) SetTo(v Group)

SetTo sets value to v.

func (*OptGroup) UnmarshalJSON

func (s *OptGroup) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptInt32

type OptInt32 struct {
	Value int32
	Set   bool
}

OptInt32 is optional int32.

func NewOptInt32

func NewOptInt32(v int32) OptInt32

NewOptInt32 returns new OptInt32 with value set to v.

func (*OptInt32) Decode

func (o *OptInt32) Decode(d *jx.Decoder) error

Decode decodes int32 from json.

func (OptInt32) Encode

func (o OptInt32) Encode(e *jx.Encoder)

Encode encodes int32 as json.

func (OptInt32) Get

func (o OptInt32) Get() (v int32, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptInt32) IsSet

func (o OptInt32) IsSet() bool

IsSet returns true if OptInt32 was set.

func (OptInt32) MarshalJSON

func (s OptInt32) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptInt32) Or

func (o OptInt32) Or(d int32) int32

Or returns value if set, or given parameter if does not.

func (*OptInt32) Reset

func (o *OptInt32) Reset()

Reset unsets value.

func (*OptInt32) SetTo

func (o *OptInt32) SetTo(v int32)

SetTo sets value to v.

func (*OptInt32) UnmarshalJSON

func (s *OptInt32) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptInt64

type OptInt64 struct {
	Value int64
	Set   bool
}

OptInt64 is optional int64.

func NewOptInt64

func NewOptInt64(v int64) OptInt64

NewOptInt64 returns new OptInt64 with value set to v.

func (*OptInt64) Decode

func (o *OptInt64) Decode(d *jx.Decoder) error

Decode decodes int64 from json.

func (OptInt64) Encode

func (o OptInt64) Encode(e *jx.Encoder)

Encode encodes int64 as json.

func (OptInt64) Get

func (o OptInt64) Get() (v int64, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptInt64) IsSet

func (o OptInt64) IsSet() bool

IsSet returns true if OptInt64 was set.

func (OptInt64) MarshalJSON

func (s OptInt64) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptInt64) Or

func (o OptInt64) Or(d int64) int64

Or returns value if set, or given parameter if does not.

func (*OptInt64) Reset

func (o *OptInt64) Reset()

Reset unsets value.

func (*OptInt64) SetTo

func (o *OptInt64) SetTo(v int64)

SetTo sets value to v.

func (*OptInt64) UnmarshalJSON

func (s *OptInt64) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilOwnerShipArray

type OptNilOwnerShipArray struct {
	Value []OwnerShip
	Set   bool
	Null  bool
}

OptNilOwnerShipArray is optional nullable []OwnerShip.

func NewOptNilOwnerShipArray

func NewOptNilOwnerShipArray(v []OwnerShip) OptNilOwnerShipArray

NewOptNilOwnerShipArray returns new OptNilOwnerShipArray with value set to v.

func (*OptNilOwnerShipArray) Decode

func (o *OptNilOwnerShipArray) Decode(d *jx.Decoder) error

Decode decodes []OwnerShip from json.

func (OptNilOwnerShipArray) Encode

func (o OptNilOwnerShipArray) Encode(e *jx.Encoder)

Encode encodes []OwnerShip as json.

func (OptNilOwnerShipArray) Get

func (o OptNilOwnerShipArray) Get() (v []OwnerShip, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptNilOwnerShipArray) IsNull

func (o OptNilOwnerShipArray) IsNull() bool

IsSet returns true if value is Null.

func (OptNilOwnerShipArray) IsSet

func (o OptNilOwnerShipArray) IsSet() bool

IsSet returns true if OptNilOwnerShipArray was set.

func (OptNilOwnerShipArray) MarshalJSON

func (s OptNilOwnerShipArray) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilOwnerShipArray) Or

Or returns value if set, or given parameter if does not.

func (*OptNilOwnerShipArray) Reset

func (o *OptNilOwnerShipArray) Reset()

Reset unsets value.

func (*OptNilOwnerShipArray) SetTo

func (o *OptNilOwnerShipArray) SetTo(v []OwnerShip)

SetTo sets value to v.

func (*OptNilOwnerShipArray) UnmarshalJSON

func (s *OptNilOwnerShipArray) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilProductArray

type OptNilProductArray struct {
	Value []Product
	Set   bool
	Null  bool
}

OptNilProductArray is optional nullable []Product.

func NewOptNilProductArray

func NewOptNilProductArray(v []Product) OptNilProductArray

NewOptNilProductArray returns new OptNilProductArray with value set to v.

func (*OptNilProductArray) Decode

func (o *OptNilProductArray) Decode(d *jx.Decoder) error

Decode decodes []Product from json.

func (OptNilProductArray) Encode

func (o OptNilProductArray) Encode(e *jx.Encoder)

Encode encodes []Product as json.

func (OptNilProductArray) Get

func (o OptNilProductArray) Get() (v []Product, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptNilProductArray) IsNull

func (o OptNilProductArray) IsNull() bool

IsSet returns true if value is Null.

func (OptNilProductArray) IsSet

func (o OptNilProductArray) IsSet() bool

IsSet returns true if OptNilProductArray was set.

func (OptNilProductArray) MarshalJSON

func (s OptNilProductArray) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilProductArray) Or

func (o OptNilProductArray) Or(d []Product) []Product

Or returns value if set, or given parameter if does not.

func (*OptNilProductArray) Reset

func (o *OptNilProductArray) Reset()

Reset unsets value.

func (*OptNilProductArray) SetTo

func (o *OptNilProductArray) SetTo(v []Product)

SetTo sets value to v.

func (*OptNilProductArray) UnmarshalJSON

func (s *OptNilProductArray) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilPurchaseableProductArray

type OptNilPurchaseableProductArray struct {
	Value []PurchaseableProduct
	Set   bool
	Null  bool
}

OptNilPurchaseableProductArray is optional nullable []PurchaseableProduct.

func NewOptNilPurchaseableProductArray

func NewOptNilPurchaseableProductArray(v []PurchaseableProduct) OptNilPurchaseableProductArray

NewOptNilPurchaseableProductArray returns new OptNilPurchaseableProductArray with value set to v.

func (*OptNilPurchaseableProductArray) Decode

Decode decodes []PurchaseableProduct from json.

func (OptNilPurchaseableProductArray) Encode

Encode encodes []PurchaseableProduct as json.

func (OptNilPurchaseableProductArray) Get

Get returns value and boolean that denotes whether value was set.

func (OptNilPurchaseableProductArray) IsNull

IsSet returns true if value is Null.

func (OptNilPurchaseableProductArray) IsSet

IsSet returns true if OptNilPurchaseableProductArray was set.

func (OptNilPurchaseableProductArray) MarshalJSON

func (s OptNilPurchaseableProductArray) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilPurchaseableProductArray) Or

Or returns value if set, or given parameter if does not.

func (*OptNilPurchaseableProductArray) Reset

func (o *OptNilPurchaseableProductArray) Reset()

Reset unsets value.

func (*OptNilPurchaseableProductArray) SetTo

SetTo sets value to v.

func (*OptNilPurchaseableProductArray) UnmarshalJSON

func (s *OptNilPurchaseableProductArray) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilRuleArray

type OptNilRuleArray struct {
	Value []Rule
	Set   bool
	Null  bool
}

OptNilRuleArray is optional nullable []Rule.

func NewOptNilRuleArray

func NewOptNilRuleArray(v []Rule) OptNilRuleArray

NewOptNilRuleArray returns new OptNilRuleArray with value set to v.

func (*OptNilRuleArray) Decode

func (o *OptNilRuleArray) Decode(d *jx.Decoder) error

Decode decodes []Rule from json.

func (OptNilRuleArray) Encode

func (o OptNilRuleArray) Encode(e *jx.Encoder)

Encode encodes []Rule as json.

func (OptNilRuleArray) Get

func (o OptNilRuleArray) Get() (v []Rule, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptNilRuleArray) IsNull

func (o OptNilRuleArray) IsNull() bool

IsSet returns true if value is Null.

func (OptNilRuleArray) IsSet

func (o OptNilRuleArray) IsSet() bool

IsSet returns true if OptNilRuleArray was set.

func (OptNilRuleArray) MarshalJSON

func (s OptNilRuleArray) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilRuleArray) Or

func (o OptNilRuleArray) Or(d []Rule) []Rule

Or returns value if set, or given parameter if does not.

func (*OptNilRuleArray) Reset

func (o *OptNilRuleArray) Reset()

Reset unsets value.

func (*OptNilRuleArray) SetTo

func (o *OptNilRuleArray) SetTo(v []Rule)

SetTo sets value to v.

func (*OptNilRuleArray) UnmarshalJSON

func (s *OptNilRuleArray) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilRuleCreateArray

type OptNilRuleCreateArray struct {
	Value []RuleCreate
	Set   bool
	Null  bool
}

OptNilRuleCreateArray is optional nullable []RuleCreate.

func NewOptNilRuleCreateArray

func NewOptNilRuleCreateArray(v []RuleCreate) OptNilRuleCreateArray

NewOptNilRuleCreateArray returns new OptNilRuleCreateArray with value set to v.

func (*OptNilRuleCreateArray) Decode

func (o *OptNilRuleCreateArray) Decode(d *jx.Decoder) error

Decode decodes []RuleCreate from json.

func (OptNilRuleCreateArray) Encode

func (o OptNilRuleCreateArray) Encode(e *jx.Encoder)

Encode encodes []RuleCreate as json.

func (OptNilRuleCreateArray) Get

func (o OptNilRuleCreateArray) Get() (v []RuleCreate, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptNilRuleCreateArray) IsNull

func (o OptNilRuleCreateArray) IsNull() bool

IsSet returns true if value is Null.

func (OptNilRuleCreateArray) IsSet

func (o OptNilRuleCreateArray) IsSet() bool

IsSet returns true if OptNilRuleCreateArray was set.

func (OptNilRuleCreateArray) MarshalJSON

func (s OptNilRuleCreateArray) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilRuleCreateArray) Or

Or returns value if set, or given parameter if does not.

func (*OptNilRuleCreateArray) Reset

func (o *OptNilRuleCreateArray) Reset()

Reset unsets value.

func (*OptNilRuleCreateArray) SetTo

func (o *OptNilRuleCreateArray) SetTo(v []RuleCreate)

SetTo sets value to v.

func (*OptNilRuleCreateArray) UnmarshalJSON

func (s *OptNilRuleCreateArray) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilString

type OptNilString struct {
	Value string
	Set   bool
	Null  bool
}

OptNilString is optional nullable string.

func NewOptNilString

func NewOptNilString(v string) OptNilString

NewOptNilString returns new OptNilString with value set to v.

func (*OptNilString) Decode

func (o *OptNilString) Decode(d *jx.Decoder) error

Decode decodes string from json.

func (OptNilString) Encode

func (o OptNilString) Encode(e *jx.Encoder)

Encode encodes string as json.

func (OptNilString) Get

func (o OptNilString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptNilString) IsNull

func (o OptNilString) IsNull() bool

IsSet returns true if value is Null.

func (OptNilString) IsSet

func (o OptNilString) IsSet() bool

IsSet returns true if OptNilString was set.

func (OptNilString) MarshalJSON

func (s OptNilString) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilString) Or

func (o OptNilString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptNilString) Reset

func (o *OptNilString) Reset()

Reset unsets value.

func (*OptNilString) SetTo

func (o *OptNilString) SetTo(v string)

SetTo sets value to v.

func (*OptNilString) UnmarshalJSON

func (s *OptNilString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilSystemStateGroups

type OptNilSystemStateGroups struct {
	Value SystemStateGroups
	Set   bool
	Null  bool
}

OptNilSystemStateGroups is optional nullable SystemStateGroups.

func NewOptNilSystemStateGroups

func NewOptNilSystemStateGroups(v SystemStateGroups) OptNilSystemStateGroups

NewOptNilSystemStateGroups returns new OptNilSystemStateGroups with value set to v.

func (*OptNilSystemStateGroups) Decode

func (o *OptNilSystemStateGroups) Decode(d *jx.Decoder) error

Decode decodes SystemStateGroups from json.

func (OptNilSystemStateGroups) Encode

func (o OptNilSystemStateGroups) Encode(e *jx.Encoder)

Encode encodes SystemStateGroups as json.

func (OptNilSystemStateGroups) Get

Get returns value and boolean that denotes whether value was set.

func (OptNilSystemStateGroups) IsNull

func (o OptNilSystemStateGroups) IsNull() bool

IsSet returns true if value is Null.

func (OptNilSystemStateGroups) IsSet

func (o OptNilSystemStateGroups) IsSet() bool

IsSet returns true if OptNilSystemStateGroups was set.

func (OptNilSystemStateGroups) MarshalJSON

func (s OptNilSystemStateGroups) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilSystemStateGroups) Or

Or returns value if set, or given parameter if does not.

func (*OptNilSystemStateGroups) Reset

func (o *OptNilSystemStateGroups) Reset()

Reset unsets value.

func (*OptNilSystemStateGroups) SetTo

SetTo sets value to v.

func (*OptNilSystemStateGroups) UnmarshalJSON

func (s *OptNilSystemStateGroups) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilTopUpProductArray

type OptNilTopUpProductArray struct {
	Value []TopUpProduct
	Set   bool
	Null  bool
}

OptNilTopUpProductArray is optional nullable []TopUpProduct.

func NewOptNilTopUpProductArray

func NewOptNilTopUpProductArray(v []TopUpProduct) OptNilTopUpProductArray

NewOptNilTopUpProductArray returns new OptNilTopUpProductArray with value set to v.

func (*OptNilTopUpProductArray) Decode

func (o *OptNilTopUpProductArray) Decode(d *jx.Decoder) error

Decode decodes []TopUpProduct from json.

func (OptNilTopUpProductArray) Encode

func (o OptNilTopUpProductArray) Encode(e *jx.Encoder)

Encode encodes []TopUpProduct as json.

func (OptNilTopUpProductArray) Get

func (o OptNilTopUpProductArray) Get() (v []TopUpProduct, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptNilTopUpProductArray) IsNull

func (o OptNilTopUpProductArray) IsNull() bool

IsSet returns true if value is Null.

func (OptNilTopUpProductArray) IsSet

func (o OptNilTopUpProductArray) IsSet() bool

IsSet returns true if OptNilTopUpProductArray was set.

func (OptNilTopUpProductArray) MarshalJSON

func (s OptNilTopUpProductArray) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilTopUpProductArray) Or

Or returns value if set, or given parameter if does not.

func (*OptNilTopUpProductArray) Reset

func (o *OptNilTopUpProductArray) Reset()

Reset unsets value.

func (*OptNilTopUpProductArray) SetTo

func (o *OptNilTopUpProductArray) SetTo(v []TopUpProduct)

SetTo sets value to v.

func (*OptNilTopUpProductArray) UnmarshalJSON

func (s *OptNilTopUpProductArray) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptProduct

type OptProduct struct {
	Value Product
	Set   bool
}

OptProduct is optional Product.

func NewOptProduct

func NewOptProduct(v Product) OptProduct

NewOptProduct returns new OptProduct with value set to v.

func (*OptProduct) Decode

func (o *OptProduct) Decode(d *jx.Decoder) error

Decode decodes Product from json.

func (OptProduct) Encode

func (o OptProduct) Encode(e *jx.Encoder)

Encode encodes Product as json.

func (OptProduct) Get

func (o OptProduct) Get() (v Product, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptProduct) IsSet

func (o OptProduct) IsSet() bool

IsSet returns true if OptProduct was set.

func (OptProduct) MarshalJSON

func (s OptProduct) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptProduct) Or

func (o OptProduct) Or(d Product) Product

Or returns value if set, or given parameter if does not.

func (*OptProduct) Reset

func (o *OptProduct) Reset()

Reset unsets value.

func (*OptProduct) SetTo

func (o *OptProduct) SetTo(v Product)

SetTo sets value to v.

func (*OptProduct) UnmarshalJSON

func (s *OptProduct) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptProductType

type OptProductType struct {
	Value ProductType
	Set   bool
}

OptProductType is optional ProductType.

func NewOptProductType

func NewOptProductType(v ProductType) OptProductType

NewOptProductType returns new OptProductType with value set to v.

func (*OptProductType) Decode

func (o *OptProductType) Decode(d *jx.Decoder) error

Decode decodes ProductType from json.

func (OptProductType) Encode

func (o OptProductType) Encode(e *jx.Encoder)

Encode encodes ProductType as json.

func (OptProductType) Get

func (o OptProductType) Get() (v ProductType, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptProductType) IsSet

func (o OptProductType) IsSet() bool

IsSet returns true if OptProductType was set.

func (OptProductType) MarshalJSON

func (s OptProductType) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptProductType) Or

Or returns value if set, or given parameter if does not.

func (*OptProductType) Reset

func (o *OptProductType) Reset()

Reset unsets value.

func (*OptProductType) SetTo

func (o *OptProductType) SetTo(v ProductType)

SetTo sets value to v.

func (*OptProductType) UnmarshalJSON

func (s *OptProductType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptPurchaseableProduct

type OptPurchaseableProduct struct {
	Value PurchaseableProduct
	Set   bool
}

OptPurchaseableProduct is optional PurchaseableProduct.

func NewOptPurchaseableProduct

func NewOptPurchaseableProduct(v PurchaseableProduct) OptPurchaseableProduct

NewOptPurchaseableProduct returns new OptPurchaseableProduct with value set to v.

func (*OptPurchaseableProduct) Decode

func (o *OptPurchaseableProduct) Decode(d *jx.Decoder) error

Decode decodes PurchaseableProduct from json.

func (OptPurchaseableProduct) Encode

func (o OptPurchaseableProduct) Encode(e *jx.Encoder)

Encode encodes PurchaseableProduct as json.

func (OptPurchaseableProduct) Get

Get returns value and boolean that denotes whether value was set.

func (OptPurchaseableProduct) IsSet

func (o OptPurchaseableProduct) IsSet() bool

IsSet returns true if OptPurchaseableProduct was set.

func (OptPurchaseableProduct) MarshalJSON

func (s OptPurchaseableProduct) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptPurchaseableProduct) Or

Or returns value if set, or given parameter if does not.

func (*OptPurchaseableProduct) Reset

func (o *OptPurchaseableProduct) Reset()

Reset unsets value.

func (*OptPurchaseableProduct) SetTo

SetTo sets value to v.

func (*OptPurchaseableProduct) UnmarshalJSON

func (s *OptPurchaseableProduct) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptRuleFlags

type OptRuleFlags struct {
	Value RuleFlags
	Set   bool
}

OptRuleFlags is optional RuleFlags.

func NewOptRuleFlags

func NewOptRuleFlags(v RuleFlags) OptRuleFlags

NewOptRuleFlags returns new OptRuleFlags with value set to v.

func (*OptRuleFlags) Decode

func (o *OptRuleFlags) Decode(d *jx.Decoder) error

Decode decodes RuleFlags from json.

func (OptRuleFlags) Encode

func (o OptRuleFlags) Encode(e *jx.Encoder)

Encode encodes RuleFlags as json.

func (OptRuleFlags) Get

func (o OptRuleFlags) Get() (v RuleFlags, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptRuleFlags) IsSet

func (o OptRuleFlags) IsSet() bool

IsSet returns true if OptRuleFlags was set.

func (OptRuleFlags) MarshalJSON

func (s OptRuleFlags) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptRuleFlags) Or

Or returns value if set, or given parameter if does not.

func (*OptRuleFlags) Reset

func (o *OptRuleFlags) Reset()

Reset unsets value.

func (*OptRuleFlags) SetTo

func (o *OptRuleFlags) SetTo(v RuleFlags)

SetTo sets value to v.

func (*OptRuleFlags) UnmarshalJSON

func (s *OptRuleFlags) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptString

type OptString struct {
	Value string
	Set   bool
}

OptString is optional string.

func NewOptString

func NewOptString(v string) OptString

NewOptString returns new OptString with value set to v.

func (OptString) Get

func (o OptString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptString) IsSet

func (o OptString) IsSet() bool

IsSet returns true if OptString was set.

func (OptString) Or

func (o OptString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptString) Reset

func (o *OptString) Reset()

Reset unsets value.

func (*OptString) SetTo

func (o *OptString) SetTo(v string)

SetTo sets value to v.

type Option

type Option interface {
	ServerOption
	ClientOption
}

Option is config option.

func WithMeterProvider

func WithMeterProvider(provider metric.MeterProvider) Option

WithMeterProvider specifies a meter provider to use for creating a meter.

If none is specified, the metric.NewNoopMeterProvider is used.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer.

If none is specified, the global provider is used.

type OwnerShip

type OwnerShip struct {
	// Primary Id.
	ID      OptInt64               `json:"id"`
	Product OptPurchaseableProduct `json:"product"`
	// How long.
	Expires OptDateTime `json:"expires"`
}

Represents an ownership of some product by some user. Has the time of when the ownership expires. Ref: #/components/schemas/OwnerShip

func (*OwnerShip) Decode

func (s *OwnerShip) Decode(d *jx.Decoder) error

Decode decodes OwnerShip from json.

func (*OwnerShip) Encode

func (s *OwnerShip) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*OwnerShip) GetExpires

func (s *OwnerShip) GetExpires() OptDateTime

GetExpires returns the value of Expires.

func (*OwnerShip) GetID

func (s *OwnerShip) GetID() OptInt64

GetID returns the value of ID.

func (*OwnerShip) GetProduct

func (s *OwnerShip) GetProduct() OptPurchaseableProduct

GetProduct returns the value of Product.

func (*OwnerShip) MarshalJSON

func (s *OwnerShip) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*OwnerShip) SetExpires

func (s *OwnerShip) SetExpires(val OptDateTime)

SetExpires sets the value of Expires.

func (*OwnerShip) SetID

func (s *OwnerShip) SetID(val OptInt64)

SetID sets the value of ID.

func (*OwnerShip) SetProduct

func (s *OwnerShip) SetProduct(val OptPurchaseableProduct)

SetProduct sets the value of Product.

func (*OwnerShip) UnmarshalJSON

func (s *OwnerShip) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*OwnerShip) Validate

func (s *OwnerShip) Validate() error

type PlanedTransaction

type PlanedTransaction struct {
	// Primary Id.
	ID      OptInt64   `json:"id"`
	Product OptProduct `json:"product"`
	// The size of the transaction.
	Amount OptFloat64 `json:"amount"`
	// Custom reference data for this transaction.
	// External identifiers, notes, metadata.
	Reference OptNilString `json:"reference"`
	// Timestamp of this transaction.
	Timestamp OptDateTime `json:"timestamp"`
}

A empheral transaction that can still be changed. Intended for invoices that may still be canceled or bidding. Ref: #/components/schemas/PlanedTransaction

func (*PlanedTransaction) Decode

func (s *PlanedTransaction) Decode(d *jx.Decoder) error

Decode decodes PlanedTransaction from json.

func (*PlanedTransaction) Encode

func (s *PlanedTransaction) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PlanedTransaction) GetAmount

func (s *PlanedTransaction) GetAmount() OptFloat64

GetAmount returns the value of Amount.

func (*PlanedTransaction) GetID

func (s *PlanedTransaction) GetID() OptInt64

GetID returns the value of ID.

func (*PlanedTransaction) GetProduct

func (s *PlanedTransaction) GetProduct() OptProduct

GetProduct returns the value of Product.

func (*PlanedTransaction) GetReference

func (s *PlanedTransaction) GetReference() OptNilString

GetReference returns the value of Reference.

func (*PlanedTransaction) GetTimestamp

func (s *PlanedTransaction) GetTimestamp() OptDateTime

GetTimestamp returns the value of Timestamp.

func (*PlanedTransaction) MarshalJSON

func (s *PlanedTransaction) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PlanedTransaction) SetAmount

func (s *PlanedTransaction) SetAmount(val OptFloat64)

SetAmount sets the value of Amount.

func (*PlanedTransaction) SetID

func (s *PlanedTransaction) SetID(val OptInt64)

SetID sets the value of ID.

func (*PlanedTransaction) SetProduct

func (s *PlanedTransaction) SetProduct(val OptProduct)

SetProduct sets the value of Product.

func (*PlanedTransaction) SetReference

func (s *PlanedTransaction) SetReference(val OptNilString)

SetReference sets the value of Reference.

func (*PlanedTransaction) SetTimestamp

func (s *PlanedTransaction) SetTimestamp(val OptDateTime)

SetTimestamp sets the value of Timestamp.

func (*PlanedTransaction) UnmarshalJSON

func (s *PlanedTransaction) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*PlanedTransaction) Validate

func (s *PlanedTransaction) Validate() error

type Product

type Product struct {
	// Primary Key.
	ID OptInt32 `json:"id"`
	// Title of this product.
	Title OptNilString `json:"title"`
	// Unique Slug for this product.
	Slug OptNilString `json:"slug"`
	// DB-Level description may not be displayed to the end user directly (localisation n stuff).
	Description OptNilString `json:"description"`
	// The exact amount this product costs to purchase.
	Cost OptFloat64 `json:"cost"`
	// How long this product is owned by an user in seconds.
	OwnershipSeconds OptInt64       `json:"ownershipSeconds"`
	Type             OptProductType `json:"type"`
}

Base class for Products. Ref: #/components/schemas/Product

func (*Product) Decode

func (s *Product) Decode(d *jx.Decoder) error

Decode decodes Product from json.

func (*Product) Encode

func (s *Product) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Product) GetCost

func (s *Product) GetCost() OptFloat64

GetCost returns the value of Cost.

func (*Product) GetDescription

func (s *Product) GetDescription() OptNilString

GetDescription returns the value of Description.

func (*Product) GetID

func (s *Product) GetID() OptInt32

GetID returns the value of ID.

func (*Product) GetOwnershipSeconds

func (s *Product) GetOwnershipSeconds() OptInt64

GetOwnershipSeconds returns the value of OwnershipSeconds.

func (*Product) GetSlug

func (s *Product) GetSlug() OptNilString

GetSlug returns the value of Slug.

func (*Product) GetTitle

func (s *Product) GetTitle() OptNilString

GetTitle returns the value of Title.

func (*Product) GetType

func (s *Product) GetType() OptProductType

GetType returns the value of Type.

func (*Product) MarshalJSON

func (s *Product) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Product) SetCost

func (s *Product) SetCost(val OptFloat64)

SetCost sets the value of Cost.

func (*Product) SetDescription

func (s *Product) SetDescription(val OptNilString)

SetDescription sets the value of Description.

func (*Product) SetID

func (s *Product) SetID(val OptInt32)

SetID sets the value of ID.

func (*Product) SetOwnershipSeconds

func (s *Product) SetOwnershipSeconds(val OptInt64)

SetOwnershipSeconds sets the value of OwnershipSeconds.

func (*Product) SetSlug

func (s *Product) SetSlug(val OptNilString)

SetSlug sets the value of Slug.

func (*Product) SetTitle

func (s *Product) SetTitle(val OptNilString)

SetTitle sets the value of Title.

func (*Product) SetType

func (s *Product) SetType(val OptProductType)

SetType sets the value of Type.

func (*Product) UnmarshalJSON

func (s *Product) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Product) Validate

func (s *Product) Validate() error

type ProductType

type ProductType struct {
	Type   ProductTypeType // switch on this field
	String string
	Int    int
}

Types of products. Ref: #/components/schemas/ProductType ProductType represents sum type.

func NewIntProductType

func NewIntProductType(v int) ProductType

NewIntProductType returns new ProductType from int.

func NewStringProductType

func NewStringProductType(v string) ProductType

NewStringProductType returns new ProductType from string.

func (*ProductType) Decode

func (s *ProductType) Decode(d *jx.Decoder) error

Decode decodes ProductType from json.

func (ProductType) Encode

func (s ProductType) Encode(e *jx.Encoder)

Encode encodes ProductType as json.

func (ProductType) GetInt

func (s ProductType) GetInt() (v int, ok bool)

GetInt returns int and true boolean if ProductType is int.

func (ProductType) GetString

func (s ProductType) GetString() (v string, ok bool)

GetString returns string and true boolean if ProductType is string.

func (ProductType) IsInt

func (s ProductType) IsInt() bool

IsInt reports whether ProductType is int.

func (ProductType) IsString

func (s ProductType) IsString() bool

IsString reports whether ProductType is string.

func (ProductType) MarshalJSON

func (s ProductType) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ProductType) SetInt

func (s *ProductType) SetInt(v int)

SetInt sets ProductType to int.

func (*ProductType) SetString

func (s *ProductType) SetString(v string)

SetString sets ProductType to string.

func (*ProductType) UnmarshalJSON

func (s *ProductType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ProductTypeType

type ProductTypeType string

ProductTypeType is oneOf type of ProductType.

const (
	StringProductType ProductTypeType = "string"
	IntProductType    ProductTypeType = "int"
)

Possible values for ProductTypeType.

type ProductsGetParams

type ProductsGetParams struct {
	Offset OptInt32
	Amount OptInt32
}

ProductsGetParams is parameters of GET /Products operation.

type ProductsPProductSlugGetParams

type ProductsPProductSlugGetParams struct {
	ProductSlug string
}

ProductsPProductSlugGetParams is parameters of GET /Products/p/{productSlug} operation.

type ProductsServiceServiceSlugCountGetParams

type ProductsServiceServiceSlugCountGetParams struct {
	ServiceSlug string
}

ProductsServiceServiceSlugCountGetParams is parameters of GET /Products/service/{serviceSlug}/count operation.

type ProductsServiceServiceSlugIdsGetParams

type ProductsServiceServiceSlugIdsGetParams struct {
	ServiceSlug string
}

ProductsServiceServiceSlugIdsGetParams is parameters of GET /Products/service/{serviceSlug}/ids operation.

type ProductsServicesGetParams

type ProductsServicesGetParams struct {
	Offset OptInt32
	Amount OptInt32
}

ProductsServicesGetParams is parameters of GET /Products/services operation.

type ProductsTopupGetParams

type ProductsTopupGetParams struct {
	Offset OptInt32
	Amount OptInt32
}

ProductsTopupGetParams is parameters of GET /Products/topup operation.

type ProductsUserUserIdGetParams

type ProductsUserUserIdGetParams struct {
	UserId       string
	ProductSlugs []string
}

ProductsUserUserIdGetParams is parameters of GET /Products/user/{userId} operation.

type PurchaseableProduct

type PurchaseableProduct struct {
	// Primary Key.
	ID OptInt32 `json:"id"`
	// Title of this product.
	Title OptNilString `json:"title"`
	// Unique Slug for this product.
	Slug OptNilString `json:"slug"`
	// DB-Level description may not be displayed to the end user directly (localisation n stuff).
	Description OptNilString `json:"description"`
	// The exact amount this product costs to purchase.
	Cost OptFloat64 `json:"cost"`
	// How long this product is owned by an user in seconds.
	OwnershipSeconds OptInt64       `json:"ownershipSeconds"`
	Type             OptProductType `json:"type"`
}

Products that can be purchased. Ref: #/components/schemas/PurchaseableProduct

func (*PurchaseableProduct) Decode

func (s *PurchaseableProduct) Decode(d *jx.Decoder) error

Decode decodes PurchaseableProduct from json.

func (*PurchaseableProduct) Encode

func (s *PurchaseableProduct) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*PurchaseableProduct) GetCost

func (s *PurchaseableProduct) GetCost() OptFloat64

GetCost returns the value of Cost.

func (*PurchaseableProduct) GetDescription

func (s *PurchaseableProduct) GetDescription() OptNilString

GetDescription returns the value of Description.

func (*PurchaseableProduct) GetID

func (s *PurchaseableProduct) GetID() OptInt32

GetID returns the value of ID.

func (*PurchaseableProduct) GetOwnershipSeconds

func (s *PurchaseableProduct) GetOwnershipSeconds() OptInt64

GetOwnershipSeconds returns the value of OwnershipSeconds.

func (*PurchaseableProduct) GetSlug

func (s *PurchaseableProduct) GetSlug() OptNilString

GetSlug returns the value of Slug.

func (*PurchaseableProduct) GetTitle

func (s *PurchaseableProduct) GetTitle() OptNilString

GetTitle returns the value of Title.

func (*PurchaseableProduct) GetType

func (s *PurchaseableProduct) GetType() OptProductType

GetType returns the value of Type.

func (*PurchaseableProduct) MarshalJSON

func (s *PurchaseableProduct) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*PurchaseableProduct) SetCost

func (s *PurchaseableProduct) SetCost(val OptFloat64)

SetCost sets the value of Cost.

func (*PurchaseableProduct) SetDescription

func (s *PurchaseableProduct) SetDescription(val OptNilString)

SetDescription sets the value of Description.

func (*PurchaseableProduct) SetID

func (s *PurchaseableProduct) SetID(val OptInt32)

SetID sets the value of ID.

func (*PurchaseableProduct) SetOwnershipSeconds

func (s *PurchaseableProduct) SetOwnershipSeconds(val OptInt64)

SetOwnershipSeconds sets the value of OwnershipSeconds.

func (*PurchaseableProduct) SetSlug

func (s *PurchaseableProduct) SetSlug(val OptNilString)

SetSlug sets the value of Slug.

func (*PurchaseableProduct) SetTitle

func (s *PurchaseableProduct) SetTitle(val OptNilString)

SetTitle sets the value of Title.

func (*PurchaseableProduct) SetType

func (s *PurchaseableProduct) SetType(val OptProductType)

SetType sets the value of Type.

func (*PurchaseableProduct) UnmarshalJSON

func (s *PurchaseableProduct) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*PurchaseableProduct) Validate

func (s *PurchaseableProduct) Validate() error

type Route

type Route struct {
	// contains filtered or unexported fields
}

Route is route object.

func (Route) Args

func (r Route) Args() []string

Args returns parsed arguments.

func (Route) Name

func (r Route) Name() string

Name returns ogen operation name.

It is guaranteed to be unique and not empty.

func (Route) OperationID

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

func (Route) PathPattern

func (r Route) PathPattern() string

PathPattern returns OpenAPI path.

type Rule

type Rule struct {
	// Primary key of this rule.
	ID OptInt32 `json:"id"`
	// Identifier of this rule.
	Slug OptNilString `json:"slug"`
	// In what order to apply the rules.
	Priority OptInt32     `json:"priority"`
	Requires OptGroup     `json:"requires"`
	Targets  OptGroup     `json:"targets"`
	Flags    OptRuleFlags `json:"flags"`
	// Amount this rule changes the target property.
	Amount OptFloat64 `json:"amount"`
}

Rules can change attributes of products based on the ownership of another. Ref: #/components/schemas/Rule

func (*Rule) Decode

func (s *Rule) Decode(d *jx.Decoder) error

Decode decodes Rule from json.

func (*Rule) Encode

func (s *Rule) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Rule) GetAmount

func (s *Rule) GetAmount() OptFloat64

GetAmount returns the value of Amount.

func (*Rule) GetFlags

func (s *Rule) GetFlags() OptRuleFlags

GetFlags returns the value of Flags.

func (*Rule) GetID

func (s *Rule) GetID() OptInt32

GetID returns the value of ID.

func (*Rule) GetPriority

func (s *Rule) GetPriority() OptInt32

GetPriority returns the value of Priority.

func (*Rule) GetRequires

func (s *Rule) GetRequires() OptGroup

GetRequires returns the value of Requires.

func (*Rule) GetSlug

func (s *Rule) GetSlug() OptNilString

GetSlug returns the value of Slug.

func (*Rule) GetTargets

func (s *Rule) GetTargets() OptGroup

GetTargets returns the value of Targets.

func (*Rule) MarshalJSON

func (s *Rule) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Rule) SetAmount

func (s *Rule) SetAmount(val OptFloat64)

SetAmount sets the value of Amount.

func (*Rule) SetFlags

func (s *Rule) SetFlags(val OptRuleFlags)

SetFlags sets the value of Flags.

func (*Rule) SetID

func (s *Rule) SetID(val OptInt32)

SetID sets the value of ID.

func (*Rule) SetPriority

func (s *Rule) SetPriority(val OptInt32)

SetPriority sets the value of Priority.

func (*Rule) SetRequires

func (s *Rule) SetRequires(val OptGroup)

SetRequires sets the value of Requires.

func (*Rule) SetSlug

func (s *Rule) SetSlug(val OptNilString)

SetSlug sets the value of Slug.

func (*Rule) SetTargets

func (s *Rule) SetTargets(val OptGroup)

SetTargets sets the value of Targets.

func (*Rule) UnmarshalJSON

func (s *Rule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Rule) Validate

func (s *Rule) Validate() error

type RuleCreate

type RuleCreate struct {
	// Identifier of this rule.
	Slug OptNilString `json:"slug"`
	// In what order to apply the rules (highest first).
	Priority OptInt32 `json:"priority"`
	// This rule only applies if the user owns a product contained in this group
	// if null, the rule always applies to the target group (except overriden by another rule).
	RequiresGroup OptNilString `json:"requiresGroup"`
	// This rule applies to all products in this group.
	TargetsGroup OptNilString `json:"targetsGroup"`
	Flags        OptRuleFlags `json:"flags"`
	// Amount this rule changes the target property.
	Amount OptFloat64 `json:"amount"`
}

Arguments for creating a new rule. Ref: #/components/schemas/RuleCreate

func (*RuleCreate) Decode

func (s *RuleCreate) Decode(d *jx.Decoder) error

Decode decodes RuleCreate from json.

func (*RuleCreate) Encode

func (s *RuleCreate) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*RuleCreate) GetAmount

func (s *RuleCreate) GetAmount() OptFloat64

GetAmount returns the value of Amount.

func (*RuleCreate) GetFlags

func (s *RuleCreate) GetFlags() OptRuleFlags

GetFlags returns the value of Flags.

func (*RuleCreate) GetPriority

func (s *RuleCreate) GetPriority() OptInt32

GetPriority returns the value of Priority.

func (*RuleCreate) GetRequiresGroup

func (s *RuleCreate) GetRequiresGroup() OptNilString

GetRequiresGroup returns the value of RequiresGroup.

func (*RuleCreate) GetSlug

func (s *RuleCreate) GetSlug() OptNilString

GetSlug returns the value of Slug.

func (*RuleCreate) GetTargetsGroup

func (s *RuleCreate) GetTargetsGroup() OptNilString

GetTargetsGroup returns the value of TargetsGroup.

func (*RuleCreate) MarshalJSON

func (s *RuleCreate) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RuleCreate) SetAmount

func (s *RuleCreate) SetAmount(val OptFloat64)

SetAmount sets the value of Amount.

func (*RuleCreate) SetFlags

func (s *RuleCreate) SetFlags(val OptRuleFlags)

SetFlags sets the value of Flags.

func (*RuleCreate) SetPriority

func (s *RuleCreate) SetPriority(val OptInt32)

SetPriority sets the value of Priority.

func (*RuleCreate) SetRequiresGroup

func (s *RuleCreate) SetRequiresGroup(val OptNilString)

SetRequiresGroup sets the value of RequiresGroup.

func (*RuleCreate) SetSlug

func (s *RuleCreate) SetSlug(val OptNilString)

SetSlug sets the value of Slug.

func (*RuleCreate) SetTargetsGroup

func (s *RuleCreate) SetTargetsGroup(val OptNilString)

SetTargetsGroup sets the value of TargetsGroup.

func (*RuleCreate) UnmarshalJSON

func (s *RuleCreate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*RuleCreate) Validate

func (s *RuleCreate) Validate() error

type RuleFlags

type RuleFlags string

Flags modifying a Coflnet.Payments.Models.Rule. Ref: #/components/schemas/RuleFlags

const (
	RuleFlagsNONE          RuleFlags = "NONE"
	RuleFlagsINVERT        RuleFlags = "INVERT"
	RuleFlagsPERCENT       RuleFlags = "PERCENT"
	RuleFlagsLONGER        RuleFlags = "LONGER"
	RuleFlagsDISCOUNT      RuleFlags = "DISCOUNT"
	RuleFlagsEARLYBREAK    RuleFlags = "EARLY_BREAK"
	RuleFlagsBLOCKPURCHASE RuleFlags = "BLOCK_PURCHASE"
)

func (*RuleFlags) Decode

func (s *RuleFlags) Decode(d *jx.Decoder) error

Decode decodes RuleFlags from json.

func (RuleFlags) Encode

func (s RuleFlags) Encode(e *jx.Encoder)

Encode encodes RuleFlags as json.

func (RuleFlags) MarshalJSON

func (s RuleFlags) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (RuleFlags) MarshalText

func (s RuleFlags) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*RuleFlags) UnmarshalJSON

func (s *RuleFlags) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*RuleFlags) UnmarshalText

func (s *RuleFlags) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (RuleFlags) Validate

func (s RuleFlags) Validate() error

type RuleResult

type RuleResult struct {
	ModifiedProduct OptProduct      `json:"modifiedProduct"`
	Rules           OptNilRuleArray `json:"rules"`
}

Ref: #/components/schemas/RuleResult

func (*RuleResult) Decode

func (s *RuleResult) Decode(d *jx.Decoder) error

Decode decodes RuleResult from json.

func (*RuleResult) Encode

func (s *RuleResult) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*RuleResult) GetModifiedProduct

func (s *RuleResult) GetModifiedProduct() OptProduct

GetModifiedProduct returns the value of ModifiedProduct.

func (*RuleResult) GetRules

func (s *RuleResult) GetRules() OptNilRuleArray

GetRules returns the value of Rules.

func (*RuleResult) MarshalJSON

func (s *RuleResult) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*RuleResult) SetModifiedProduct

func (s *RuleResult) SetModifiedProduct(val OptProduct)

SetModifiedProduct sets the value of ModifiedProduct.

func (*RuleResult) SetRules

func (s *RuleResult) SetRules(val OptNilRuleArray)

SetRules sets the value of Rules.

func (*RuleResult) UnmarshalJSON

func (s *RuleResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*RuleResult) Validate

func (s *RuleResult) Validate() error

type RulesGetParams

type RulesGetParams struct {
	Offset OptInt32
	Amount OptInt32
}

RulesGetParams is parameters of GET /Rules operation.

type RulesRuleSlugDeleteParams

type RulesRuleSlugDeleteParams struct {
	RuleSlug string
}

RulesRuleSlugDeleteParams is parameters of DELETE /Rules/{ruleSlug} operation.

type RulesRuleSlugGetParams

type RulesRuleSlugGetParams struct {
	RuleSlug string
}

RulesRuleSlugGetParams is parameters of GET /Rules/{ruleSlug} operation.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server implements http server based on OpenAPI v3 specification and calls Handler to handle requests.

func NewServer

func NewServer(h Handler, opts ...ServerOption) (*Server, error)

NewServer creates new Server.

func (*Server) FindPath

func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool)

FindPath finds Route for given method and URL.

func (*Server) FindRoute

func (s *Server) FindRoute(method, path string) (Route, bool)

FindRoute finds Route for given method and path.

Note: this method does not unescape path or handle reserved characters in path properly. Use FindPath instead.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves http request as defined by OpenAPI v3 specification, calling handler that matches the path or returning not found error.

type ServerOption

type ServerOption interface {
	// contains filtered or unexported methods
}

ServerOption is server config option.

func WithErrorHandler

func WithErrorHandler(h ErrorHandler) ServerOption

WithErrorHandler specifies error handler to use.

func WithMaxMultipartMemory

func WithMaxMultipartMemory(max int64) ServerOption

WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.

func WithMethodNotAllowed

func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption

WithMethodNotAllowed specifies Method Not Allowed handler to use.

func WithMiddleware

func WithMiddleware(m ...Middleware) ServerOption

WithMiddleware specifies middlewares to use.

func WithNotFound

func WithNotFound(notFound http.HandlerFunc) ServerOption

WithNotFound specifies Not Found handler to use.

func WithPathPrefix

func WithPathPrefix(prefix string) ServerOption

WithPathPrefix specifies server path prefix.

type SystemState

type SystemState struct {
	// Available products.
	Products OptNilPurchaseableProductArray `json:"products"`
	// Topups that are currently active.
	TopUps OptNilTopUpProductArray `json:"topUps"`
	// What products go into which groups.
	Groups OptNilSystemStateGroups `json:"groups"`
	// Rules.
	Rules OptNilRuleCreateArray `json:"rules"`
}

State to get the db into Useful for gitops. Ref: #/components/schemas/SystemState

func (*SystemState) Decode

func (s *SystemState) Decode(d *jx.Decoder) error

Decode decodes SystemState from json.

func (*SystemState) Encode

func (s *SystemState) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*SystemState) GetGroups

func (s *SystemState) GetGroups() OptNilSystemStateGroups

GetGroups returns the value of Groups.

func (*SystemState) GetProducts

GetProducts returns the value of Products.

func (*SystemState) GetRules

func (s *SystemState) GetRules() OptNilRuleCreateArray

GetRules returns the value of Rules.

func (*SystemState) GetTopUps

func (s *SystemState) GetTopUps() OptNilTopUpProductArray

GetTopUps returns the value of TopUps.

func (*SystemState) MarshalJSON

func (s *SystemState) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SystemState) SetGroups

func (s *SystemState) SetGroups(val OptNilSystemStateGroups)

SetGroups sets the value of Groups.

func (*SystemState) SetProducts

func (s *SystemState) SetProducts(val OptNilPurchaseableProductArray)

SetProducts sets the value of Products.

func (*SystemState) SetRules

func (s *SystemState) SetRules(val OptNilRuleCreateArray)

SetRules sets the value of Rules.

func (*SystemState) SetTopUps

func (s *SystemState) SetTopUps(val OptNilTopUpProductArray)

SetTopUps sets the value of TopUps.

func (*SystemState) UnmarshalJSON

func (s *SystemState) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*SystemState) Validate

func (s *SystemState) Validate() error

type SystemStateGroups

type SystemStateGroups map[string][]string

What products go into which groups.

func (*SystemStateGroups) Decode

func (s *SystemStateGroups) Decode(d *jx.Decoder) error

Decode decodes SystemStateGroups from json.

func (SystemStateGroups) Encode

func (s SystemStateGroups) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (SystemStateGroups) MarshalJSON

func (s SystemStateGroups) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*SystemStateGroups) UnmarshalJSON

func (s *SystemStateGroups) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type TopUpCustomPostParams

type TopUpCustomPostParams struct {
	UserId OptString
}

TopUpCustomPostParams is parameters of POST /TopUp/custom operation.

type TopUpIdResponse

type TopUpIdResponse struct {
	// Checkout id.
	ID OptNilString `json:"id"`
	// Directlink to redirect the user to.
	DirctLink OptNilString `json:"dirctLink"`
}

Response containing an id. Ref: #/components/schemas/TopUpIdResponse

func (*TopUpIdResponse) Decode

func (s *TopUpIdResponse) Decode(d *jx.Decoder) error

Decode decodes TopUpIdResponse from json.

func (*TopUpIdResponse) Encode

func (s *TopUpIdResponse) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (s *TopUpIdResponse) GetDirctLink() OptNilString

GetDirctLink returns the value of DirctLink.

func (*TopUpIdResponse) GetID

func (s *TopUpIdResponse) GetID() OptNilString

GetID returns the value of ID.

func (*TopUpIdResponse) MarshalJSON

func (s *TopUpIdResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (s *TopUpIdResponse) SetDirctLink(val OptNilString)

SetDirctLink sets the value of DirctLink.

func (*TopUpIdResponse) SetID

func (s *TopUpIdResponse) SetID(val OptNilString)

SetID sets the value of ID.

func (*TopUpIdResponse) UnmarshalJSON

func (s *TopUpIdResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type TopUpOptions

type TopUpOptions struct {
	// Overwrite the default redirect url after successful payment.
	SuccessUrl OptNilString `json:"successUrl"`
	// Overwrite the default redirect url for anything else but payment.
	CancelUrl OptNilString `json:"cancelUrl"`
	// If provided, this value will be used when the Customer object is created. If not provided,
	// customers will be asked to enter their email address.
	UserEmail OptNilString `json:"userEmail"`
	// Percise amount of coflcoins to topup.
	TopUpAmount OptInt64 `json:"topUpAmount"`
}

Ref: #/components/schemas/TopUpOptions

func (*TopUpOptions) Decode

func (s *TopUpOptions) Decode(d *jx.Decoder) error

Decode decodes TopUpOptions from json.

func (*TopUpOptions) Encode

func (s *TopUpOptions) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*TopUpOptions) GetCancelUrl

func (s *TopUpOptions) GetCancelUrl() OptNilString

GetCancelUrl returns the value of CancelUrl.

func (*TopUpOptions) GetSuccessUrl

func (s *TopUpOptions) GetSuccessUrl() OptNilString

GetSuccessUrl returns the value of SuccessUrl.

func (*TopUpOptions) GetTopUpAmount

func (s *TopUpOptions) GetTopUpAmount() OptInt64

GetTopUpAmount returns the value of TopUpAmount.

func (*TopUpOptions) GetUserEmail

func (s *TopUpOptions) GetUserEmail() OptNilString

GetUserEmail returns the value of UserEmail.

func (*TopUpOptions) MarshalJSON

func (s *TopUpOptions) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TopUpOptions) SetCancelUrl

func (s *TopUpOptions) SetCancelUrl(val OptNilString)

SetCancelUrl sets the value of CancelUrl.

func (*TopUpOptions) SetSuccessUrl

func (s *TopUpOptions) SetSuccessUrl(val OptNilString)

SetSuccessUrl sets the value of SuccessUrl.

func (*TopUpOptions) SetTopUpAmount

func (s *TopUpOptions) SetTopUpAmount(val OptInt64)

SetTopUpAmount sets the value of TopUpAmount.

func (*TopUpOptions) SetUserEmail

func (s *TopUpOptions) SetUserEmail(val OptNilString)

SetUserEmail sets the value of UserEmail.

func (*TopUpOptions) UnmarshalJSON

func (s *TopUpOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type TopUpPaypalPostParams

type TopUpPaypalPostParams struct {
	UserId    OptString
	ProductId OptString
}

TopUpPaypalPostParams is parameters of POST /TopUp/paypal operation.

type TopUpProduct

type TopUpProduct struct {
	// The price of this Coflnet.Payments.Models.TopUpProduct in Coflnet.Payments.Models.TopUpProduct.
	// CurrencyCode.
	Price OptFloat64 `json:"price"`
	// The currency code.
	CurrencyCode OptNilString `json:"currencyCode"`
	// What provider this top up is valid for
	// (differnt fees can require different prices).
	ProviderSlug OptNilString `json:"providerSlug"`
	// Primary Key.
	ID OptInt32 `json:"id"`
	// Title of this product.
	Title OptNilString `json:"title"`
	// Unique Slug for this product.
	Slug OptNilString `json:"slug"`
	// DB-Level description may not be displayed to the end user directly (localisation n stuff).
	Description OptNilString `json:"description"`
	// The exact amount this product costs to purchase.
	Cost OptFloat64 `json:"cost"`
	// How long this product is owned by an user in seconds.
	OwnershipSeconds OptInt64       `json:"ownershipSeconds"`
	Type             OptProductType `json:"type"`
}

Ref: #/components/schemas/TopUpProduct

func (*TopUpProduct) Decode

func (s *TopUpProduct) Decode(d *jx.Decoder) error

Decode decodes TopUpProduct from json.

func (*TopUpProduct) Encode

func (s *TopUpProduct) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*TopUpProduct) GetCost

func (s *TopUpProduct) GetCost() OptFloat64

GetCost returns the value of Cost.

func (*TopUpProduct) GetCurrencyCode

func (s *TopUpProduct) GetCurrencyCode() OptNilString

GetCurrencyCode returns the value of CurrencyCode.

func (*TopUpProduct) GetDescription

func (s *TopUpProduct) GetDescription() OptNilString

GetDescription returns the value of Description.

func (*TopUpProduct) GetID

func (s *TopUpProduct) GetID() OptInt32

GetID returns the value of ID.

func (*TopUpProduct) GetOwnershipSeconds

func (s *TopUpProduct) GetOwnershipSeconds() OptInt64

GetOwnershipSeconds returns the value of OwnershipSeconds.

func (*TopUpProduct) GetPrice

func (s *TopUpProduct) GetPrice() OptFloat64

GetPrice returns the value of Price.

func (*TopUpProduct) GetProviderSlug

func (s *TopUpProduct) GetProviderSlug() OptNilString

GetProviderSlug returns the value of ProviderSlug.

func (*TopUpProduct) GetSlug

func (s *TopUpProduct) GetSlug() OptNilString

GetSlug returns the value of Slug.

func (*TopUpProduct) GetTitle

func (s *TopUpProduct) GetTitle() OptNilString

GetTitle returns the value of Title.

func (*TopUpProduct) GetType

func (s *TopUpProduct) GetType() OptProductType

GetType returns the value of Type.

func (*TopUpProduct) MarshalJSON

func (s *TopUpProduct) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TopUpProduct) SetCost

func (s *TopUpProduct) SetCost(val OptFloat64)

SetCost sets the value of Cost.

func (*TopUpProduct) SetCurrencyCode

func (s *TopUpProduct) SetCurrencyCode(val OptNilString)

SetCurrencyCode sets the value of CurrencyCode.

func (*TopUpProduct) SetDescription

func (s *TopUpProduct) SetDescription(val OptNilString)

SetDescription sets the value of Description.

func (*TopUpProduct) SetID

func (s *TopUpProduct) SetID(val OptInt32)

SetID sets the value of ID.

func (*TopUpProduct) SetOwnershipSeconds

func (s *TopUpProduct) SetOwnershipSeconds(val OptInt64)

SetOwnershipSeconds sets the value of OwnershipSeconds.

func (*TopUpProduct) SetPrice

func (s *TopUpProduct) SetPrice(val OptFloat64)

SetPrice sets the value of Price.

func (*TopUpProduct) SetProviderSlug

func (s *TopUpProduct) SetProviderSlug(val OptNilString)

SetProviderSlug sets the value of ProviderSlug.

func (*TopUpProduct) SetSlug

func (s *TopUpProduct) SetSlug(val OptNilString)

SetSlug sets the value of Slug.

func (*TopUpProduct) SetTitle

func (s *TopUpProduct) SetTitle(val OptNilString)

SetTitle sets the value of Title.

func (*TopUpProduct) SetType

func (s *TopUpProduct) SetType(val OptProductType)

SetType sets the value of Type.

func (*TopUpProduct) UnmarshalJSON

func (s *TopUpProduct) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*TopUpProduct) Validate

func (s *TopUpProduct) Validate() error

type TopUpStripePostParams

type TopUpStripePostParams struct {
	UserId    OptString
	ProductId OptString
}

TopUpStripePostParams is parameters of POST /TopUp/stripe operation.

type TransactionEvent

type TransactionEvent struct {
	// The internal id of the transaction.
	ID OptInt64 `json:"id"`
	// Id of the user triggering the transaction.
	UserId OptNilString `json:"userId"`
	// Slug of the product.
	ProductSlug OptNilString `json:"productSlug"`
	// Unique id of this product settings.
	ProductId OptInt32 `json:"productId"`
	// How long this product will last till it expires.
	OwnedSeconds OptInt64       `json:"ownedSeconds"`
	ProductType  OptProductType `json:"productType"`
	// The transaction amount.
	Amount OptFloat64 `json:"amount"`
	// Optional reference.
	Reference OptNilString `json:"reference"`
	// When this transaction occured.
	Timestamp OptDateTime `json:"timestamp"`
}

Event produced when a transaction occurs. Ref: #/components/schemas/TransactionEvent

func (*TransactionEvent) Decode

func (s *TransactionEvent) Decode(d *jx.Decoder) error

Decode decodes TransactionEvent from json.

func (*TransactionEvent) Encode

func (s *TransactionEvent) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*TransactionEvent) GetAmount

func (s *TransactionEvent) GetAmount() OptFloat64

GetAmount returns the value of Amount.

func (*TransactionEvent) GetID

func (s *TransactionEvent) GetID() OptInt64

GetID returns the value of ID.

func (*TransactionEvent) GetOwnedSeconds

func (s *TransactionEvent) GetOwnedSeconds() OptInt64

GetOwnedSeconds returns the value of OwnedSeconds.

func (*TransactionEvent) GetProductId

func (s *TransactionEvent) GetProductId() OptInt32

GetProductId returns the value of ProductId.

func (*TransactionEvent) GetProductSlug

func (s *TransactionEvent) GetProductSlug() OptNilString

GetProductSlug returns the value of ProductSlug.

func (*TransactionEvent) GetProductType

func (s *TransactionEvent) GetProductType() OptProductType

GetProductType returns the value of ProductType.

func (*TransactionEvent) GetReference

func (s *TransactionEvent) GetReference() OptNilString

GetReference returns the value of Reference.

func (*TransactionEvent) GetTimestamp

func (s *TransactionEvent) GetTimestamp() OptDateTime

GetTimestamp returns the value of Timestamp.

func (*TransactionEvent) GetUserId

func (s *TransactionEvent) GetUserId() OptNilString

GetUserId returns the value of UserId.

func (*TransactionEvent) MarshalJSON

func (s *TransactionEvent) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TransactionEvent) SetAmount

func (s *TransactionEvent) SetAmount(val OptFloat64)

SetAmount sets the value of Amount.

func (*TransactionEvent) SetID

func (s *TransactionEvent) SetID(val OptInt64)

SetID sets the value of ID.

func (*TransactionEvent) SetOwnedSeconds

func (s *TransactionEvent) SetOwnedSeconds(val OptInt64)

SetOwnedSeconds sets the value of OwnedSeconds.

func (*TransactionEvent) SetProductId

func (s *TransactionEvent) SetProductId(val OptInt32)

SetProductId sets the value of ProductId.

func (*TransactionEvent) SetProductSlug

func (s *TransactionEvent) SetProductSlug(val OptNilString)

SetProductSlug sets the value of ProductSlug.

func (*TransactionEvent) SetProductType

func (s *TransactionEvent) SetProductType(val OptProductType)

SetProductType sets the value of ProductType.

func (*TransactionEvent) SetReference

func (s *TransactionEvent) SetReference(val OptNilString)

SetReference sets the value of Reference.

func (*TransactionEvent) SetTimestamp

func (s *TransactionEvent) SetTimestamp(val OptDateTime)

SetTimestamp sets the value of Timestamp.

func (*TransactionEvent) SetUserId

func (s *TransactionEvent) SetUserId(val OptNilString)

SetUserId sets the value of UserId.

func (*TransactionEvent) UnmarshalJSON

func (s *TransactionEvent) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*TransactionEvent) Validate

func (s *TransactionEvent) Validate() error

type TransactionPlanedUUserIdGetParams

type TransactionPlanedUUserIdGetParams struct {
	UserId string
}

TransactionPlanedUUserIdGetParams is parameters of GET /Transaction/planed/u/{userId} operation.

type TransactionPlanedUUserIdPostParams

type TransactionPlanedUUserIdPostParams struct {
	UserId string
}

TransactionPlanedUUserIdPostParams is parameters of POST /Transaction/planed/u/{userId} operation.

type TransactionPlanedUUserIdTTransactionIdDeleteParams

type TransactionPlanedUUserIdTTransactionIdDeleteParams struct {
	UserId        string
	TransactionId int32
}

TransactionPlanedUUserIdTTransactionIdDeleteParams is parameters of DELETE /Transaction/planed/u/{userId}/t/{transactionId} operation.

type TransactionPlanedUUserIdTTransactionIdPutParams

type TransactionPlanedUUserIdTTransactionIdPutParams struct {
	UserId        string
	TransactionId int32
}

TransactionPlanedUUserIdTTransactionIdPutParams is parameters of PUT /Transaction/planed/u/{userId}/t/{transactionId} operation.

type TransactionSendPostOK

type TransactionSendPostOK struct{}

TransactionSendPostOK is response for TransactionSendPost operation.

type TransactionUUserIdGetParams

type TransactionUUserIdGetParams struct {
	UserId string
}

TransactionUUserIdGetParams is parameters of GET /Transaction/u/{userId} operation.

type TransferRequest

type TransferRequest struct {
	// The identifier of the user which should receive the funds.
	TargetUser OptNilString `json:"targetUser"`
	// A unique reference to prevent double transfers.
	Reference OptNilString `json:"reference"`
	// The amount to transfer.
	Amount OptFloat64 `json:"amount"`
}

Transfer request to another user. Ref: #/components/schemas/TransferRequest

func (*TransferRequest) Decode

func (s *TransferRequest) Decode(d *jx.Decoder) error

Decode decodes TransferRequest from json.

func (*TransferRequest) Encode

func (s *TransferRequest) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*TransferRequest) GetAmount

func (s *TransferRequest) GetAmount() OptFloat64

GetAmount returns the value of Amount.

func (*TransferRequest) GetReference

func (s *TransferRequest) GetReference() OptNilString

GetReference returns the value of Reference.

func (*TransferRequest) GetTargetUser

func (s *TransferRequest) GetTargetUser() OptNilString

GetTargetUser returns the value of TargetUser.

func (*TransferRequest) MarshalJSON

func (s *TransferRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TransferRequest) SetAmount

func (s *TransferRequest) SetAmount(val OptFloat64)

SetAmount sets the value of Amount.

func (*TransferRequest) SetReference

func (s *TransferRequest) SetReference(val OptNilString)

SetReference sets the value of Reference.

func (*TransferRequest) SetTargetUser

func (s *TransferRequest) SetTargetUser(val OptNilString)

SetTargetUser sets the value of TargetUser.

func (*TransferRequest) UnmarshalJSON

func (s *TransferRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*TransferRequest) Validate

func (s *TransferRequest) Validate() error

type UnimplementedHandler

type UnimplementedHandler struct{}

UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.

func (UnimplementedHandler) ApplyPost

func (UnimplementedHandler) ApplyPost(ctx context.Context, req *SystemState) error

ApplyPost implements POST /Apply operation.

Brings all products, groups and roles into the given state will disable/delete anything not present so use carefully.

POST /Apply

func (UnimplementedHandler) CallbackPaypalPost

func (UnimplementedHandler) CallbackPaypalPost(ctx context.Context) error

CallbackPaypalPost implements POST /Callback/paypal operation.

Accept callbacks from paypal.

POST /Callback/paypal

func (UnimplementedHandler) CallbackStripePost

func (UnimplementedHandler) CallbackStripePost(ctx context.Context) error

CallbackStripePost implements POST /Callback/stripe operation.

Webhook callback for stripe.

POST /Callback/stripe

func (UnimplementedHandler) GroupGet

func (UnimplementedHandler) GroupGet(ctx context.Context, params GroupGetParams) (r []Group, _ error)

GroupGet implements GET /Group operation.

GET /Group

func (UnimplementedHandler) GroupGroupSlugDelete

func (UnimplementedHandler) GroupGroupSlugDelete(ctx context.Context, params GroupGroupSlugDeleteParams) (r *Group, _ error)

GroupGroupSlugDelete implements DELETE /Group/{groupSlug} operation.

DELETE /Group/{groupSlug}

func (UnimplementedHandler) GroupGroupSlugGet

func (UnimplementedHandler) GroupGroupSlugGet(ctx context.Context, params GroupGroupSlugGetParams) (r *Group, _ error)

GroupGroupSlugGet implements GET /Group/{groupSlug} operation.

GET /Group/{groupSlug}

func (UnimplementedHandler) GroupGroupSlugProductsDelete

func (UnimplementedHandler) GroupGroupSlugProductsDelete(ctx context.Context, req []string, params GroupGroupSlugProductsDeleteParams) (r *Group, _ error)

GroupGroupSlugProductsDelete implements DELETE /Group/{groupSlug}/products operation.

DELETE /Group/{groupSlug}/products

func (UnimplementedHandler) GroupGroupSlugProductsPost

func (UnimplementedHandler) GroupGroupSlugProductsPost(ctx context.Context, req []string, params GroupGroupSlugProductsPostParams) (r *Group, _ error)

GroupGroupSlugProductsPost implements POST /Group/{groupSlug}/products operation.

POST /Group/{groupSlug}/products

func (UnimplementedHandler) GroupGroupSlugPut

func (UnimplementedHandler) GroupGroupSlugPut(ctx context.Context, req *Group, params GroupGroupSlugPutParams) (r *Group, _ error)

GroupGroupSlugPut implements PUT /Group/{groupSlug} operation.

PUT /Group/{groupSlug}

func (UnimplementedHandler) GroupPost

func (UnimplementedHandler) GroupPost(ctx context.Context, req *Group) (r *Group, _ error)

GroupPost implements POST /Group operation.

POST /Group

func (UnimplementedHandler) ProductsGet

ProductsGet implements GET /Products operation.

Get all products.

GET /Products

func (UnimplementedHandler) ProductsPProductSlugGet

func (UnimplementedHandler) ProductsPProductSlugGet(ctx context.Context, params ProductsPProductSlugGetParams) (r *PurchaseableProduct, _ error)

ProductsPProductSlugGet implements GET /Products/p/{productSlug} operation.

Get the details of a product.

GET /Products/p/{productSlug}

func (UnimplementedHandler) ProductsPut

ProductsPut implements PUT /Products operation.

Updates a product by replacing it with a new one. Old products can not be deleted to furfill accounting needs.

PUT /Products

func (UnimplementedHandler) ProductsServiceServiceSlugCountGet

func (UnimplementedHandler) ProductsServiceServiceSlugCountGet(ctx context.Context, params ProductsServiceServiceSlugCountGetParams) (r int32, _ error)

ProductsServiceServiceSlugCountGet implements GET /Products/service/{serviceSlug}/count operation.

Count of users owning a service.

GET /Products/service/{serviceSlug}/count

func (UnimplementedHandler) ProductsServiceServiceSlugIdsGet

func (UnimplementedHandler) ProductsServiceServiceSlugIdsGet(ctx context.Context, params ProductsServiceServiceSlugIdsGetParams) (r []string, _ error)

ProductsServiceServiceSlugIdsGet implements GET /Products/service/{serviceSlug}/ids operation.

Gets all userIds owning a service.

GET /Products/service/{serviceSlug}/ids

func (UnimplementedHandler) ProductsServicesGet

func (UnimplementedHandler) ProductsServicesGet(ctx context.Context, params ProductsServicesGetParams) (r []PurchaseableProduct, _ error)

ProductsServicesGet implements GET /Products/services operation.

Get services.

GET /Products/services

func (UnimplementedHandler) ProductsTopupGet

func (UnimplementedHandler) ProductsTopupGet(ctx context.Context, params ProductsTopupGetParams) (r []TopUpProduct, _ error)

ProductsTopupGet implements GET /Products/topup operation.

Get topup options.

GET /Products/topup

func (UnimplementedHandler) ProductsTopupPut

func (UnimplementedHandler) ProductsTopupPut(ctx context.Context, req *TopUpProduct) (r *TopUpProduct, _ error)

ProductsTopupPut implements PUT /Products/topup operation.

Updates a topup option by replacing it with a new one. Old options get a new slug and are marked as disabled.

PUT /Products/topup

func (UnimplementedHandler) ProductsUserUserIdGet

func (UnimplementedHandler) ProductsUserUserIdGet(ctx context.Context, params ProductsUserUserIdGetParams) (r []RuleResult, _ error)

ProductsUserUserIdGet implements GET /Products/user/{userId} operation.

Get adjusted prices for a user.

GET /Products/user/{userId}

func (UnimplementedHandler) RulesGet

func (UnimplementedHandler) RulesGet(ctx context.Context, params RulesGetParams) (r []Rule, _ error)

RulesGet implements GET /Rules operation.

Returns all rules.

GET /Rules

func (UnimplementedHandler) RulesPost

func (UnimplementedHandler) RulesPost(ctx context.Context, req *RuleCreate) (r *Rule, _ error)

RulesPost implements POST /Rules operation.

Creates a new rule.

POST /Rules

func (UnimplementedHandler) RulesRuleSlugDelete

func (UnimplementedHandler) RulesRuleSlugDelete(ctx context.Context, params RulesRuleSlugDeleteParams) (r *Rule, _ error)

RulesRuleSlugDelete implements DELETE /Rules/{ruleSlug} operation.

Deletes a rule.

DELETE /Rules/{ruleSlug}

func (UnimplementedHandler) RulesRuleSlugGet

func (UnimplementedHandler) RulesRuleSlugGet(ctx context.Context, params RulesRuleSlugGetParams) (r *Rule, _ error)

RulesRuleSlugGet implements GET /Rules/{ruleSlug} operation.

Returns a rule by slug.

GET /Rules/{ruleSlug}

func (UnimplementedHandler) TopUpCompensatePost

func (UnimplementedHandler) TopUpCompensatePost(ctx context.Context, req *Compensation) (r *Int32Int32ValueTuple, _ error)

TopUpCompensatePost implements POST /TopUp/compensate operation.

Compensates users of a service for something.

POST /TopUp/compensate

func (UnimplementedHandler) TopUpCustomPost

func (UnimplementedHandler) TopUpCustomPost(ctx context.Context, req *CustomTopUp, params TopUpCustomPostParams) (r *TopUpIdResponse, _ error)

TopUpCustomPost implements POST /TopUp/custom operation.

Creates a custom topup that is instantly credited.

POST /TopUp/custom

func (UnimplementedHandler) TopUpOptionsGet

func (UnimplementedHandler) TopUpOptionsGet(ctx context.Context) (r []TopUpProduct, _ error)

TopUpOptionsGet implements GET /TopUp/options operation.

All available topup options.

GET /TopUp/options

func (UnimplementedHandler) TopUpPaypalPost

func (UnimplementedHandler) TopUpPaypalPost(ctx context.Context, req *TopUpOptions, params TopUpPaypalPostParams) (r *TopUpIdResponse, _ error)

TopUpPaypalPost implements POST /TopUp/paypal operation.

Creates a payment session with paypal.

POST /TopUp/paypal

func (UnimplementedHandler) TopUpStripePost

func (UnimplementedHandler) TopUpStripePost(ctx context.Context, req *TopUpOptions, params TopUpStripePostParams) (r *TopUpIdResponse, _ error)

TopUpStripePost implements POST /TopUp/stripe operation.

Creates a payment session with stripe.

POST /TopUp/stripe

func (UnimplementedHandler) TransactionPlanedUUserIdGet

func (UnimplementedHandler) TransactionPlanedUUserIdGet(ctx context.Context, params TransactionPlanedUUserIdGetParams) (r []ExternalTransaction, _ error)

TransactionPlanedUUserIdGet implements GET /Transaction/planed/u/{userId} operation.

GET /Transaction/planed/u/{userId}

func (UnimplementedHandler) TransactionPlanedUUserIdPost

TransactionPlanedUUserIdPost implements POST /Transaction/planed/u/{userId} operation.

POST /Transaction/planed/u/{userId}

func (UnimplementedHandler) TransactionPlanedUUserIdTTransactionIdDelete

func (UnimplementedHandler) TransactionPlanedUUserIdTTransactionIdDelete(ctx context.Context, params TransactionPlanedUUserIdTTransactionIdDeleteParams) (r *PlanedTransaction, _ error)

TransactionPlanedUUserIdTTransactionIdDelete implements DELETE /Transaction/planed/u/{userId}/t/{transactionId} operation.

DELETE /Transaction/planed/u/{userId}/t/{transactionId}

func (UnimplementedHandler) TransactionPlanedUUserIdTTransactionIdPut

func (UnimplementedHandler) TransactionPlanedUUserIdTTransactionIdPut(ctx context.Context, req *ExternalTransaction, params TransactionPlanedUUserIdTTransactionIdPutParams) (r *PlanedTransaction, _ error)

TransactionPlanedUUserIdTTransactionIdPut implements PUT /Transaction/planed/u/{userId}/t/{transactionId} operation.

PUT /Transaction/planed/u/{userId}/t/{transactionId}

func (UnimplementedHandler) TransactionSendPost

func (UnimplementedHandler) TransactionSendPost(ctx context.Context, req *TransactionEvent) error

TransactionSendPost implements POST /Transaction/send operation.

POST /Transaction/send

func (UnimplementedHandler) TransactionUUserIdGet

func (UnimplementedHandler) TransactionUUserIdGet(ctx context.Context, params TransactionUUserIdGetParams) (r []ExternalTransaction, _ error)

TransactionUUserIdGet implements GET /Transaction/u/{userId} operation.

GET /Transaction/u/{userId}

func (UnimplementedHandler) UserUserIdGet

func (UnimplementedHandler) UserUserIdGet(ctx context.Context, params UserUserIdGetParams) (r *User, _ error)

UserUserIdGet implements GET /User/{userId} operation.

Gets the user with the given id.

GET /User/{userId}

func (UnimplementedHandler) UserUserIdOwnsLongestPost

func (UnimplementedHandler) UserUserIdOwnsLongestPost(ctx context.Context, req []string, params UserUserIdOwnsLongestPostParams) (r time.Time, _ error)

UserUserIdOwnsLongestPost implements POST /User/{userId}/owns/longest operation.

Returns the bigest time out of a list of product ids.

POST /User/{userId}/owns/longest

func (UnimplementedHandler) UserUserIdOwnsPost deprecated

func (UnimplementedHandler) UserUserIdOwnsPost(ctx context.Context, req []string, params UserUserIdOwnsPostParams) (r []OwnerShip, _ error)

UserUserIdOwnsPost implements POST /User/{userId}/owns operation.

Returns all ownership data for an user out of a list of interested.

Deprecated: schema marks this operation as deprecated.

POST /User/{userId}/owns

func (UnimplementedHandler) UserUserIdOwnsProductSlugUntilGet

func (UnimplementedHandler) UserUserIdOwnsProductSlugUntilGet(ctx context.Context, params UserUserIdOwnsProductSlugUntilGetParams) (r time.Time, _ error)

UserUserIdOwnsProductSlugUntilGet implements GET /User/{userId}/owns/{productSlug}/until operation.

Returns the time for how long a user owns a given product.

GET /User/{userId}/owns/{productSlug}/until

func (UnimplementedHandler) UserUserIdOwnsUntilPost

UserUserIdOwnsUntilPost implements POST /User/{userId}/owns/until operation.

Returns all ownership data for an user out of a list of interested.

POST /User/{userId}/owns/until

func (UnimplementedHandler) UserUserIdPost

func (UnimplementedHandler) UserUserIdPost(ctx context.Context, params UserUserIdPostParams) (r *User, _ error)

UserUserIdPost implements POST /User/{userId} operation.

Creates a new user with the given id.

POST /User/{userId}

func (UnimplementedHandler) UserUserIdPurchaseProductSlugPost

func (UnimplementedHandler) UserUserIdPurchaseProductSlugPost(ctx context.Context, params UserUserIdPurchaseProductSlugPostParams) (r *User, _ error)

UserUserIdPurchaseProductSlugPost implements POST /User/{userId}/purchase/{productSlug} operation.

Purchase a new product if enough funds are available.

POST /User/{userId}/purchase/{productSlug}

func (UnimplementedHandler) UserUserIdServicePurchaseProductSlugPost

func (UnimplementedHandler) UserUserIdServicePurchaseProductSlugPost(ctx context.Context, params UserUserIdServicePurchaseProductSlugPostParams) (r *User, _ error)

UserUserIdServicePurchaseProductSlugPost implements POST /User/{userId}/service/purchase/{productSlug} operation.

Purchase/extends a service if enough funds are available.

POST /User/{userId}/service/purchase/{productSlug}

func (UnimplementedHandler) UserUserIdTransactionIdDelete

func (UnimplementedHandler) UserUserIdTransactionIdDelete(ctx context.Context, params UserUserIdTransactionIdDeleteParams) (r *User, _ error)

UserUserIdTransactionIdDelete implements DELETE /User/{userId}/{transactionId} operation.

Undo the purchase of a service.

DELETE /User/{userId}/{transactionId}

func (UnimplementedHandler) UserUserIdTransferPost

UserUserIdTransferPost implements POST /User/{userId}/transfer operation.

Transfers coins to another user.

POST /User/{userId}/transfer

type User

type User struct {
	// Primary key.
	ID OptInt32 `json:"id"`
	// The identifier of the account system.
	ExternalId OptNilString `json:"externalId"`
	// Balance of this user.
	Balance OptFloat64 `json:"balance"`
	// The balance available (Coflnet.Payments.Models.User.Balance minus any Coflnet.Payments.Models.
	// PlanedTransaction).
	AvailableBalance OptFloat64 `json:"availableBalance"`
	// Things this user owns.
	Owns OptNilOwnerShipArray `json:"owns"`
}

An user capable of making transactions. Ref: #/components/schemas/User

func (*User) Decode

func (s *User) Decode(d *jx.Decoder) error

Decode decodes User from json.

func (*User) Encode

func (s *User) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*User) GetAvailableBalance

func (s *User) GetAvailableBalance() OptFloat64

GetAvailableBalance returns the value of AvailableBalance.

func (*User) GetBalance

func (s *User) GetBalance() OptFloat64

GetBalance returns the value of Balance.

func (*User) GetExternalId

func (s *User) GetExternalId() OptNilString

GetExternalId returns the value of ExternalId.

func (*User) GetID

func (s *User) GetID() OptInt32

GetID returns the value of ID.

func (*User) GetOwns

func (s *User) GetOwns() OptNilOwnerShipArray

GetOwns returns the value of Owns.

func (*User) MarshalJSON

func (s *User) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*User) SetAvailableBalance

func (s *User) SetAvailableBalance(val OptFloat64)

SetAvailableBalance sets the value of AvailableBalance.

func (*User) SetBalance

func (s *User) SetBalance(val OptFloat64)

SetBalance sets the value of Balance.

func (*User) SetExternalId

func (s *User) SetExternalId(val OptNilString)

SetExternalId sets the value of ExternalId.

func (*User) SetID

func (s *User) SetID(val OptInt32)

SetID sets the value of ID.

func (*User) SetOwns

func (s *User) SetOwns(val OptNilOwnerShipArray)

SetOwns sets the value of Owns.

func (*User) UnmarshalJSON

func (s *User) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*User) Validate

func (s *User) Validate() error

type UserUserIdGetParams

type UserUserIdGetParams struct {
	UserId string
}

UserUserIdGetParams is parameters of GET /User/{userId} operation.

type UserUserIdOwnsLongestPostParams

type UserUserIdOwnsLongestPostParams struct {
	UserId string
}

UserUserIdOwnsLongestPostParams is parameters of POST /User/{userId}/owns/longest operation.

type UserUserIdOwnsPostParams

type UserUserIdOwnsPostParams struct {
	UserId string
}

UserUserIdOwnsPostParams is parameters of POST /User/{userId}/owns operation.

type UserUserIdOwnsProductSlugUntilGetParams

type UserUserIdOwnsProductSlugUntilGetParams struct {
	UserId      string
	ProductSlug string
}

UserUserIdOwnsProductSlugUntilGetParams is parameters of GET /User/{userId}/owns/{productSlug}/until operation.

type UserUserIdOwnsUntilPostOKApplicationJSON

type UserUserIdOwnsUntilPostOKApplicationJSON map[string]time.Time

func (*UserUserIdOwnsUntilPostOKApplicationJSON) Decode

Decode decodes UserUserIdOwnsUntilPostOKApplicationJSON from json.

func (UserUserIdOwnsUntilPostOKApplicationJSON) Encode

Encode implements json.Marshaler.

func (UserUserIdOwnsUntilPostOKApplicationJSON) MarshalJSON

MarshalJSON implements stdjson.Marshaler.

func (*UserUserIdOwnsUntilPostOKApplicationJSON) UnmarshalJSON

func (s *UserUserIdOwnsUntilPostOKApplicationJSON) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type UserUserIdOwnsUntilPostParams

type UserUserIdOwnsUntilPostParams struct {
	UserId string
}

UserUserIdOwnsUntilPostParams is parameters of POST /User/{userId}/owns/until operation.

type UserUserIdPostParams

type UserUserIdPostParams struct {
	UserId string
}

UserUserIdPostParams is parameters of POST /User/{userId} operation.

type UserUserIdPurchaseProductSlugPostParams

type UserUserIdPurchaseProductSlugPostParams struct {
	UserId      string
	ProductSlug string
	Price       OptInt32
}

UserUserIdPurchaseProductSlugPostParams is parameters of POST /User/{userId}/purchase/{productSlug} operation.

type UserUserIdServicePurchaseProductSlugPostParams

type UserUserIdServicePurchaseProductSlugPostParams struct {
	UserId      string
	ProductSlug string
	Reference   OptString
	Count       OptInt32
}

UserUserIdServicePurchaseProductSlugPostParams is parameters of POST /User/{userId}/service/purchase/{productSlug} operation.

type UserUserIdTransactionIdDeleteParams

type UserUserIdTransactionIdDeleteParams struct {
	UserId        string
	TransactionId int32
}

UserUserIdTransactionIdDeleteParams is parameters of DELETE /User/{userId}/{transactionId} operation.

type UserUserIdTransferPostParams

type UserUserIdTransferPostParams struct {
	UserId string
}

UserUserIdTransferPostParams is parameters of POST /User/{userId}/transfer operation.

Jump to

Keyboard shortcuts

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