httpapi

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Overview

Code generated by ogen, DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var OpenAPIDoc []byte

Functions

func WithServerURL

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

WithServerURL sets context key to override server URL.

Types

type AttributeListResponse

type AttributeListResponse struct {
	Items []AttributeResponse `json:"items"`
	// Current page number.
	Page int `json:"page"`
	// Number of items per page.
	Size int `json:"size"`
	// Total number of items.
	Total int `json:"total"`
}

Ref: #/components/schemas/AttributeListResponse

func (*AttributeListResponse) Decode

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

Decode decodes AttributeListResponse from json.

func (*AttributeListResponse) Encode

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

Encode implements json.Marshaler.

func (*AttributeListResponse) GetItems

func (s *AttributeListResponse) GetItems() []AttributeResponse

GetItems returns the value of Items.

func (*AttributeListResponse) GetPage

func (s *AttributeListResponse) GetPage() int

GetPage returns the value of Page.

func (*AttributeListResponse) GetSize

func (s *AttributeListResponse) GetSize() int

GetSize returns the value of Size.

func (*AttributeListResponse) GetTotal

func (s *AttributeListResponse) GetTotal() int

GetTotal returns the value of Total.

func (*AttributeListResponse) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*AttributeListResponse) SetItems

func (s *AttributeListResponse) SetItems(val []AttributeResponse)

SetItems sets the value of Items.

func (*AttributeListResponse) SetPage

func (s *AttributeListResponse) SetPage(val int)

SetPage sets the value of Page.

func (*AttributeListResponse) SetSize

func (s *AttributeListResponse) SetSize(val int)

SetSize sets the value of Size.

func (*AttributeListResponse) SetTotal

func (s *AttributeListResponse) SetTotal(val int)

SetTotal sets the value of Total.

func (*AttributeListResponse) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AttributeListResponse) Validate

func (s *AttributeListResponse) Validate() error

type AttributeOption

type AttributeOption struct {
	Name      string    `json:"name"`
	Slug      string    `json:"slug"`
	ColorCode OptString `json:"colorCode"`
	SortOrder int       `json:"sortOrder"`
}

Embedded attribute option. Ref: #/components/schemas/AttributeOption

func (*AttributeOption) Decode

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

Decode decodes AttributeOption from json.

func (*AttributeOption) Encode

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

Encode implements json.Marshaler.

func (*AttributeOption) GetColorCode

func (s *AttributeOption) GetColorCode() OptString

GetColorCode returns the value of ColorCode.

func (*AttributeOption) GetName

func (s *AttributeOption) GetName() string

GetName returns the value of Name.

func (*AttributeOption) GetSlug

func (s *AttributeOption) GetSlug() string

GetSlug returns the value of Slug.

func (*AttributeOption) GetSortOrder

func (s *AttributeOption) GetSortOrder() int

GetSortOrder returns the value of SortOrder.

func (*AttributeOption) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*AttributeOption) SetColorCode

func (s *AttributeOption) SetColorCode(val OptString)

SetColorCode sets the value of ColorCode.

func (*AttributeOption) SetName

func (s *AttributeOption) SetName(val string)

SetName sets the value of Name.

func (*AttributeOption) SetSlug

func (s *AttributeOption) SetSlug(val string)

SetSlug sets the value of Slug.

func (*AttributeOption) SetSortOrder

func (s *AttributeOption) SetSortOrder(val int)

SetSortOrder sets the value of SortOrder.

func (*AttributeOption) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type AttributeOptionInput

type AttributeOptionInput struct {
	Name string `json:"name"`
	// URL-friendly identifier. Immutable after creation.
	// Used as identifier for updates.
	Slug string `json:"slug"`
	// Hex color code for color attributes.
	ColorCode OptString `json:"colorCode"`
	SortOrder OptInt    `json:"sortOrder"`
}

Input for creating/updating an attribute option. - slug is immutable: set once during creation, used as identifier for updates - To update an option, use the same slug with new name/colorCode/sortOrder. Ref: #/components/schemas/AttributeOptionInput

func (*AttributeOptionInput) Decode

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

Decode decodes AttributeOptionInput from json.

func (*AttributeOptionInput) Encode

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

Encode implements json.Marshaler.

func (*AttributeOptionInput) GetColorCode

func (s *AttributeOptionInput) GetColorCode() OptString

GetColorCode returns the value of ColorCode.

func (*AttributeOptionInput) GetName

func (s *AttributeOptionInput) GetName() string

GetName returns the value of Name.

func (*AttributeOptionInput) GetSlug

func (s *AttributeOptionInput) GetSlug() string

GetSlug returns the value of Slug.

func (*AttributeOptionInput) GetSortOrder

func (s *AttributeOptionInput) GetSortOrder() OptInt

GetSortOrder returns the value of SortOrder.

func (*AttributeOptionInput) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*AttributeOptionInput) SetColorCode

func (s *AttributeOptionInput) SetColorCode(val OptString)

SetColorCode sets the value of ColorCode.

func (*AttributeOptionInput) SetName

func (s *AttributeOptionInput) SetName(val string)

SetName sets the value of Name.

func (*AttributeOptionInput) SetSlug

func (s *AttributeOptionInput) SetSlug(val string)

SetSlug sets the value of Slug.

func (*AttributeOptionInput) SetSortOrder

func (s *AttributeOptionInput) SetSortOrder(val OptInt)

SetSortOrder sets the value of SortOrder.

func (*AttributeOptionInput) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AttributeOptionInput) Validate

func (s *AttributeOptionInput) Validate() error

type AttributeResponse

type AttributeResponse struct {
	ID         string                `json:"id"`
	Version    int                   `json:"version"`
	Name       string                `json:"name"`
	Slug       string                `json:"slug"`
	Type       AttributeResponseType `json:"type"`
	Unit       OptString             `json:"unit"`
	Enabled    bool                  `json:"enabled"`
	Options    []AttributeOption     `json:"options"`
	CreatedAt  time.Time             `json:"createdAt"`
	ModifiedAt time.Time             `json:"modifiedAt"`
}

Ref: #/components/schemas/AttributeResponse

func (*AttributeResponse) Decode

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

Decode decodes AttributeResponse from json.

func (*AttributeResponse) Encode

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

Encode implements json.Marshaler.

func (*AttributeResponse) GetCreatedAt

func (s *AttributeResponse) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*AttributeResponse) GetEnabled

func (s *AttributeResponse) GetEnabled() bool

GetEnabled returns the value of Enabled.

func (*AttributeResponse) GetID

func (s *AttributeResponse) GetID() string

GetID returns the value of ID.

func (*AttributeResponse) GetModifiedAt

func (s *AttributeResponse) GetModifiedAt() time.Time

GetModifiedAt returns the value of ModifiedAt.

func (*AttributeResponse) GetName

func (s *AttributeResponse) GetName() string

GetName returns the value of Name.

func (*AttributeResponse) GetOptions

func (s *AttributeResponse) GetOptions() []AttributeOption

GetOptions returns the value of Options.

func (*AttributeResponse) GetSlug

func (s *AttributeResponse) GetSlug() string

GetSlug returns the value of Slug.

func (*AttributeResponse) GetType

GetType returns the value of Type.

func (*AttributeResponse) GetUnit

func (s *AttributeResponse) GetUnit() OptString

GetUnit returns the value of Unit.

func (*AttributeResponse) GetVersion

func (s *AttributeResponse) GetVersion() int

GetVersion returns the value of Version.

func (*AttributeResponse) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*AttributeResponse) SetCreatedAt

func (s *AttributeResponse) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*AttributeResponse) SetEnabled

func (s *AttributeResponse) SetEnabled(val bool)

SetEnabled sets the value of Enabled.

func (*AttributeResponse) SetID

func (s *AttributeResponse) SetID(val string)

SetID sets the value of ID.

func (*AttributeResponse) SetModifiedAt

func (s *AttributeResponse) SetModifiedAt(val time.Time)

SetModifiedAt sets the value of ModifiedAt.

func (*AttributeResponse) SetName

func (s *AttributeResponse) SetName(val string)

SetName sets the value of Name.

func (*AttributeResponse) SetOptions

func (s *AttributeResponse) SetOptions(val []AttributeOption)

SetOptions sets the value of Options.

func (*AttributeResponse) SetSlug

func (s *AttributeResponse) SetSlug(val string)

SetSlug sets the value of Slug.

func (*AttributeResponse) SetType

func (s *AttributeResponse) SetType(val AttributeResponseType)

SetType sets the value of Type.

func (*AttributeResponse) SetUnit

func (s *AttributeResponse) SetUnit(val OptString)

SetUnit sets the value of Unit.

func (*AttributeResponse) SetVersion

func (s *AttributeResponse) SetVersion(val int)

SetVersion sets the value of Version.

func (*AttributeResponse) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AttributeResponse) Validate

func (s *AttributeResponse) Validate() error

type AttributeResponseType

type AttributeResponseType string
const (
	AttributeResponseTypeSingle   AttributeResponseType = "single"
	AttributeResponseTypeMultiple AttributeResponseType = "multiple"
	AttributeResponseTypeRange    AttributeResponseType = "range"
	AttributeResponseTypeBoolean  AttributeResponseType = "boolean"
	AttributeResponseTypeText     AttributeResponseType = "text"
)

func (AttributeResponseType) AllValues

AllValues returns all AttributeResponseType values.

func (*AttributeResponseType) Decode

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

Decode decodes AttributeResponseType from json.

func (AttributeResponseType) Encode

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

Encode encodes AttributeResponseType as json.

func (AttributeResponseType) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (AttributeResponseType) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*AttributeResponseType) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AttributeResponseType) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (AttributeResponseType) Validate

func (s AttributeResponseType) Validate() error

type AttributeValue

type AttributeValue struct {
	// Reference to the attribute definition.
	AttributeId string `json:"attributeId"`
	// Slug of the selected option (for single type).
	OptionSlugValue OptString `json:"optionSlugValue"`
	// Slugs of selected options (for multiple type).
	OptionSlugValues []string `json:"optionSlugValues"`
	// Numeric value (for range type).
	NumericValue OptFloat64 `json:"numericValue"`
	// Free text value (for text type).
	TextValue OptString `json:"textValue"`
	// Boolean value (for boolean type).
	BooleanValue OptBool `json:"booleanValue"`
}

Embedded product attribute with value. Ref: #/components/schemas/AttributeValue

func (*AttributeValue) Decode

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

Decode decodes AttributeValue from json.

func (*AttributeValue) Encode

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

Encode implements json.Marshaler.

func (*AttributeValue) GetAttributeId

func (s *AttributeValue) GetAttributeId() string

GetAttributeId returns the value of AttributeId.

func (*AttributeValue) GetBooleanValue

func (s *AttributeValue) GetBooleanValue() OptBool

GetBooleanValue returns the value of BooleanValue.

func (*AttributeValue) GetNumericValue

func (s *AttributeValue) GetNumericValue() OptFloat64

GetNumericValue returns the value of NumericValue.

func (*AttributeValue) GetOptionSlugValue

func (s *AttributeValue) GetOptionSlugValue() OptString

GetOptionSlugValue returns the value of OptionSlugValue.

func (*AttributeValue) GetOptionSlugValues

func (s *AttributeValue) GetOptionSlugValues() []string

GetOptionSlugValues returns the value of OptionSlugValues.

func (*AttributeValue) GetTextValue

func (s *AttributeValue) GetTextValue() OptString

GetTextValue returns the value of TextValue.

func (*AttributeValue) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*AttributeValue) SetAttributeId

func (s *AttributeValue) SetAttributeId(val string)

SetAttributeId sets the value of AttributeId.

func (*AttributeValue) SetBooleanValue

func (s *AttributeValue) SetBooleanValue(val OptBool)

SetBooleanValue sets the value of BooleanValue.

func (*AttributeValue) SetNumericValue

func (s *AttributeValue) SetNumericValue(val OptFloat64)

SetNumericValue sets the value of NumericValue.

func (*AttributeValue) SetOptionSlugValue

func (s *AttributeValue) SetOptionSlugValue(val OptString)

SetOptionSlugValue sets the value of OptionSlugValue.

func (*AttributeValue) SetOptionSlugValues

func (s *AttributeValue) SetOptionSlugValues(val []string)

SetOptionSlugValues sets the value of OptionSlugValues.

func (*AttributeValue) SetTextValue

func (s *AttributeValue) SetTextValue(val OptString)

SetTextValue sets the value of TextValue.

func (*AttributeValue) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AttributeValue) Validate

func (s *AttributeValue) Validate() error

type AttributeValueInput

type AttributeValueInput struct {
	// Reference to the attribute definition.
	AttributeId uuid.UUID `json:"attributeId"`
	// Slug of the selected option (for single type).
	OptionSlugValue OptString `json:"optionSlugValue"`
	// Slugs of selected options (for multiple type).
	OptionSlugValues []string `json:"optionSlugValues"`
	// Numeric value (for range type - e.g., RAM, storage).
	NumericValue OptFloat64 `json:"numericValue"`
	// Free text value (for text type).
	TextValue OptString `json:"textValue"`
	// Boolean value (for boolean type).
	BooleanValue OptBool `json:"booleanValue"`
}

Input for assigning an attribute value to a product. Ref: #/components/schemas/AttributeValueInput

func (*AttributeValueInput) Decode

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

Decode decodes AttributeValueInput from json.

func (*AttributeValueInput) Encode

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

Encode implements json.Marshaler.

func (*AttributeValueInput) GetAttributeId

func (s *AttributeValueInput) GetAttributeId() uuid.UUID

GetAttributeId returns the value of AttributeId.

func (*AttributeValueInput) GetBooleanValue

func (s *AttributeValueInput) GetBooleanValue() OptBool

GetBooleanValue returns the value of BooleanValue.

func (*AttributeValueInput) GetNumericValue

func (s *AttributeValueInput) GetNumericValue() OptFloat64

GetNumericValue returns the value of NumericValue.

func (*AttributeValueInput) GetOptionSlugValue

func (s *AttributeValueInput) GetOptionSlugValue() OptString

GetOptionSlugValue returns the value of OptionSlugValue.

func (*AttributeValueInput) GetOptionSlugValues

func (s *AttributeValueInput) GetOptionSlugValues() []string

GetOptionSlugValues returns the value of OptionSlugValues.

func (*AttributeValueInput) GetTextValue

func (s *AttributeValueInput) GetTextValue() OptString

GetTextValue returns the value of TextValue.

func (*AttributeValueInput) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*AttributeValueInput) SetAttributeId

func (s *AttributeValueInput) SetAttributeId(val uuid.UUID)

SetAttributeId sets the value of AttributeId.

func (*AttributeValueInput) SetBooleanValue

func (s *AttributeValueInput) SetBooleanValue(val OptBool)

SetBooleanValue sets the value of BooleanValue.

func (*AttributeValueInput) SetNumericValue

func (s *AttributeValueInput) SetNumericValue(val OptFloat64)

SetNumericValue sets the value of NumericValue.

func (*AttributeValueInput) SetOptionSlugValue

func (s *AttributeValueInput) SetOptionSlugValue(val OptString)

SetOptionSlugValue sets the value of OptionSlugValue.

func (*AttributeValueInput) SetOptionSlugValues

func (s *AttributeValueInput) SetOptionSlugValues(val []string)

SetOptionSlugValues sets the value of OptionSlugValues.

func (*AttributeValueInput) SetTextValue

func (s *AttributeValueInput) SetTextValue(val OptString)

SetTextValue sets the value of TextValue.

func (*AttributeValueInput) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*AttributeValueInput) Validate

func (s *AttributeValueInput) Validate() error

type BearerAuth

type BearerAuth struct {
	Token string
	Roles []string
}

func (*BearerAuth) GetRoles

func (s *BearerAuth) GetRoles() []string

GetRoles returns the value of Roles.

func (*BearerAuth) GetToken

func (s *BearerAuth) GetToken() string

GetToken returns the value of Token.

func (*BearerAuth) SetRoles

func (s *BearerAuth) SetRoles(val []string)

SetRoles sets the value of Roles.

func (*BearerAuth) SetToken

func (s *BearerAuth) SetToken(val string)

SetToken sets the value of Token.

type CategoryAttribute

type CategoryAttribute struct {
	AttributeId string                `json:"attributeId"`
	Role        CategoryAttributeRole `json:"role"`
	Required    bool                  `json:"required"`
	SortOrder   int                   `json:"sortOrder"`
	Filterable  bool                  `json:"filterable"`
	Searchable  bool                  `json:"searchable"`
}

Embedded category attribute. Ref: #/components/schemas/CategoryAttribute

func (*CategoryAttribute) Decode

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

Decode decodes CategoryAttribute from json.

func (*CategoryAttribute) Encode

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

Encode implements json.Marshaler.

func (*CategoryAttribute) GetAttributeId

func (s *CategoryAttribute) GetAttributeId() string

GetAttributeId returns the value of AttributeId.

func (*CategoryAttribute) GetFilterable

func (s *CategoryAttribute) GetFilterable() bool

GetFilterable returns the value of Filterable.

func (*CategoryAttribute) GetRequired

func (s *CategoryAttribute) GetRequired() bool

GetRequired returns the value of Required.

func (*CategoryAttribute) GetRole

GetRole returns the value of Role.

func (*CategoryAttribute) GetSearchable

func (s *CategoryAttribute) GetSearchable() bool

GetSearchable returns the value of Searchable.

func (*CategoryAttribute) GetSortOrder

func (s *CategoryAttribute) GetSortOrder() int

GetSortOrder returns the value of SortOrder.

func (*CategoryAttribute) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CategoryAttribute) SetAttributeId

func (s *CategoryAttribute) SetAttributeId(val string)

SetAttributeId sets the value of AttributeId.

func (*CategoryAttribute) SetFilterable

func (s *CategoryAttribute) SetFilterable(val bool)

SetFilterable sets the value of Filterable.

func (*CategoryAttribute) SetRequired

func (s *CategoryAttribute) SetRequired(val bool)

SetRequired sets the value of Required.

func (*CategoryAttribute) SetRole

func (s *CategoryAttribute) SetRole(val CategoryAttributeRole)

SetRole sets the value of Role.

func (*CategoryAttribute) SetSearchable

func (s *CategoryAttribute) SetSearchable(val bool)

SetSearchable sets the value of Searchable.

func (*CategoryAttribute) SetSortOrder

func (s *CategoryAttribute) SetSortOrder(val int)

SetSortOrder sets the value of SortOrder.

func (*CategoryAttribute) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CategoryAttribute) Validate

func (s *CategoryAttribute) Validate() error

type CategoryAttributeInput

type CategoryAttributeInput struct {
	AttributeId uuid.UUID `json:"attributeId"`
	// How this attribute is used in this category:
	// - variant: Creates product variants (color, size) - buyer can choose
	// - specification: Describes the product (processor, screen) - shown in specs.
	Role CategoryAttributeInputRole `json:"role"`
	// Whether products must have this attribute.
	Required  OptBool `json:"required"`
	SortOrder OptInt  `json:"sortOrder"`
	// Whether this attribute can be used as a filter.
	Filterable bool `json:"filterable"`
	// Whether this attribute value is included in search.
	Searchable bool `json:"searchable"`
}

Input for assigning an attribute to a category. Ref: #/components/schemas/CategoryAttributeInput

func (*CategoryAttributeInput) Decode

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

Decode decodes CategoryAttributeInput from json.

func (*CategoryAttributeInput) Encode

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

Encode implements json.Marshaler.

func (*CategoryAttributeInput) GetAttributeId

func (s *CategoryAttributeInput) GetAttributeId() uuid.UUID

GetAttributeId returns the value of AttributeId.

func (*CategoryAttributeInput) GetFilterable

func (s *CategoryAttributeInput) GetFilterable() bool

GetFilterable returns the value of Filterable.

func (*CategoryAttributeInput) GetRequired

func (s *CategoryAttributeInput) GetRequired() OptBool

GetRequired returns the value of Required.

func (*CategoryAttributeInput) GetRole

GetRole returns the value of Role.

func (*CategoryAttributeInput) GetSearchable

func (s *CategoryAttributeInput) GetSearchable() bool

GetSearchable returns the value of Searchable.

func (*CategoryAttributeInput) GetSortOrder

func (s *CategoryAttributeInput) GetSortOrder() OptInt

GetSortOrder returns the value of SortOrder.

func (*CategoryAttributeInput) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CategoryAttributeInput) SetAttributeId

func (s *CategoryAttributeInput) SetAttributeId(val uuid.UUID)

SetAttributeId sets the value of AttributeId.

func (*CategoryAttributeInput) SetFilterable

func (s *CategoryAttributeInput) SetFilterable(val bool)

SetFilterable sets the value of Filterable.

func (*CategoryAttributeInput) SetRequired

func (s *CategoryAttributeInput) SetRequired(val OptBool)

SetRequired sets the value of Required.

func (*CategoryAttributeInput) SetRole

SetRole sets the value of Role.

func (*CategoryAttributeInput) SetSearchable

func (s *CategoryAttributeInput) SetSearchable(val bool)

SetSearchable sets the value of Searchable.

func (*CategoryAttributeInput) SetSortOrder

func (s *CategoryAttributeInput) SetSortOrder(val OptInt)

SetSortOrder sets the value of SortOrder.

func (*CategoryAttributeInput) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CategoryAttributeInput) Validate

func (s *CategoryAttributeInput) Validate() error

type CategoryAttributeInputRole

type CategoryAttributeInputRole string

How this attribute is used in this category: - variant: Creates product variants (color, size) - buyer can choose - specification: Describes the product (processor, screen) - shown in specs.

const (
	CategoryAttributeInputRoleVariant       CategoryAttributeInputRole = "variant"
	CategoryAttributeInputRoleSpecification CategoryAttributeInputRole = "specification"
)

func (CategoryAttributeInputRole) AllValues

AllValues returns all CategoryAttributeInputRole values.

func (*CategoryAttributeInputRole) Decode

Decode decodes CategoryAttributeInputRole from json.

func (CategoryAttributeInputRole) Encode

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

Encode encodes CategoryAttributeInputRole as json.

func (CategoryAttributeInputRole) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (CategoryAttributeInputRole) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*CategoryAttributeInputRole) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CategoryAttributeInputRole) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (CategoryAttributeInputRole) Validate

func (s CategoryAttributeInputRole) Validate() error

type CategoryAttributeRole

type CategoryAttributeRole string
const (
	CategoryAttributeRoleVariant       CategoryAttributeRole = "variant"
	CategoryAttributeRoleSpecification CategoryAttributeRole = "specification"
)

func (CategoryAttributeRole) AllValues

AllValues returns all CategoryAttributeRole values.

func (*CategoryAttributeRole) Decode

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

Decode decodes CategoryAttributeRole from json.

func (CategoryAttributeRole) Encode

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

Encode encodes CategoryAttributeRole as json.

func (CategoryAttributeRole) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (CategoryAttributeRole) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*CategoryAttributeRole) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CategoryAttributeRole) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (CategoryAttributeRole) Validate

func (s CategoryAttributeRole) Validate() error

type CategoryListResponse

type CategoryListResponse struct {
	Items []CategoryResponse `json:"items"`
	// Current page number.
	Page int `json:"page"`
	// Number of items per page.
	Size int `json:"size"`
	// Total number of items.
	Total int `json:"total"`
}

Ref: #/components/schemas/CategoryListResponse

func (*CategoryListResponse) Decode

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

Decode decodes CategoryListResponse from json.

func (*CategoryListResponse) Encode

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

Encode implements json.Marshaler.

func (*CategoryListResponse) GetItems

func (s *CategoryListResponse) GetItems() []CategoryResponse

GetItems returns the value of Items.

func (*CategoryListResponse) GetPage

func (s *CategoryListResponse) GetPage() int

GetPage returns the value of Page.

func (*CategoryListResponse) GetSize

func (s *CategoryListResponse) GetSize() int

GetSize returns the value of Size.

func (*CategoryListResponse) GetTotal

func (s *CategoryListResponse) GetTotal() int

GetTotal returns the value of Total.

func (*CategoryListResponse) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CategoryListResponse) SetItems

func (s *CategoryListResponse) SetItems(val []CategoryResponse)

SetItems sets the value of Items.

func (*CategoryListResponse) SetPage

func (s *CategoryListResponse) SetPage(val int)

SetPage sets the value of Page.

func (*CategoryListResponse) SetSize

func (s *CategoryListResponse) SetSize(val int)

SetSize sets the value of Size.

func (*CategoryListResponse) SetTotal

func (s *CategoryListResponse) SetTotal(val int)

SetTotal sets the value of Total.

func (*CategoryListResponse) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CategoryListResponse) Validate

func (s *CategoryListResponse) Validate() error

type CategoryResponse

type CategoryResponse struct {
	ID         string    `json:"id"`
	Version    int       `json:"version"`
	Name       string    `json:"name"`
	Enabled    bool      `json:"enabled"`
	CreatedAt  time.Time `json:"createdAt"`
	ModifiedAt time.Time `json:"modifiedAt"`
	// List of attributes assigned to this category.
	Attributes []CategoryAttribute `json:"attributes"`
}

Ref: #/components/schemas/CategoryResponse

func (*CategoryResponse) Decode

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

Decode decodes CategoryResponse from json.

func (*CategoryResponse) Encode

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

Encode implements json.Marshaler.

func (*CategoryResponse) GetAttributes

func (s *CategoryResponse) GetAttributes() []CategoryAttribute

GetAttributes returns the value of Attributes.

func (*CategoryResponse) GetCreatedAt

func (s *CategoryResponse) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*CategoryResponse) GetEnabled

func (s *CategoryResponse) GetEnabled() bool

GetEnabled returns the value of Enabled.

func (*CategoryResponse) GetID

func (s *CategoryResponse) GetID() string

GetID returns the value of ID.

func (*CategoryResponse) GetModifiedAt

func (s *CategoryResponse) GetModifiedAt() time.Time

GetModifiedAt returns the value of ModifiedAt.

func (*CategoryResponse) GetName

func (s *CategoryResponse) GetName() string

GetName returns the value of Name.

func (*CategoryResponse) GetVersion

func (s *CategoryResponse) GetVersion() int

GetVersion returns the value of Version.

func (*CategoryResponse) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CategoryResponse) SetAttributes

func (s *CategoryResponse) SetAttributes(val []CategoryAttribute)

SetAttributes sets the value of Attributes.

func (*CategoryResponse) SetCreatedAt

func (s *CategoryResponse) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*CategoryResponse) SetEnabled

func (s *CategoryResponse) SetEnabled(val bool)

SetEnabled sets the value of Enabled.

func (*CategoryResponse) SetID

func (s *CategoryResponse) SetID(val string)

SetID sets the value of ID.

func (*CategoryResponse) SetModifiedAt

func (s *CategoryResponse) SetModifiedAt(val time.Time)

SetModifiedAt sets the value of ModifiedAt.

func (*CategoryResponse) SetName

func (s *CategoryResponse) SetName(val string)

SetName sets the value of Name.

func (*CategoryResponse) SetVersion

func (s *CategoryResponse) SetVersion(val int)

SetVersion sets the value of Version.

func (*CategoryResponse) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CategoryResponse) Validate

func (s *CategoryResponse) Validate() error

type Client

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

Client implements OAS client.

func NewClient

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

NewClient initializes new Client defined by OAS.

func ProvideClient added in v1.0.10

func ProvideClient(
	httpClient *http.Client,
	cfg httpclient.Config,
	tokenCfg token.Config,
	tracerProvider trace.TracerProvider,
	meterProvider metric.MeterProvider,
) (*Client, error)

ProvideClient creates a configured API client with all dependencies for fx DI.

func (*Client) CreateAttribute

func (c *Client) CreateAttribute(ctx context.Context, request *CreateAttributeRequest) (CreateAttributeRes, error)

CreateAttribute invokes createAttribute operation.

Create a new attribute.

POST /v1/attribute/create

func (*Client) CreateCategory

func (c *Client) CreateCategory(ctx context.Context, request *CreateCategoryRequest) (CreateCategoryRes, error)

CreateCategory invokes createCategory operation.

Create a new category.

POST /v1/category/create

func (*Client) CreateProduct

func (c *Client) CreateProduct(ctx context.Context, request *CreateProductRequest) (CreateProductRes, error)

CreateProduct invokes createProduct operation.

Create a new product.

POST /v1/product/create

func (*Client) GetAttributeById

func (c *Client) GetAttributeById(ctx context.Context, params GetAttributeByIdParams) (GetAttributeByIdRes, error)

GetAttributeById invokes getAttributeById operation.

Get an attribute by ID.

GET /v1/attribute/get/{id}

func (*Client) GetAttributeList

func (c *Client) GetAttributeList(ctx context.Context, params GetAttributeListParams) (GetAttributeListRes, error)

GetAttributeList invokes getAttributeList operation.

Get a paginated list of attributes.

GET /v1/attribute/list

func (*Client) GetCategoryById

func (c *Client) GetCategoryById(ctx context.Context, params GetCategoryByIdParams) (GetCategoryByIdRes, error)

GetCategoryById invokes getCategoryById operation.

Get a category by ID.

GET /v1/category/get/{id}

func (*Client) GetCategoryList

func (c *Client) GetCategoryList(ctx context.Context, params GetCategoryListParams) (GetCategoryListRes, error)

GetCategoryList invokes getCategoryList operation.

Get a paginated list of categories.

GET /v1/category/list

func (*Client) GetProductById

func (c *Client) GetProductById(ctx context.Context, params GetProductByIdParams) (GetProductByIdRes, error)

GetProductById invokes getProductById operation.

Get a product by ID.

GET /v1/product/get/{id}

func (*Client) GetProductList

func (c *Client) GetProductList(ctx context.Context, params GetProductListParams) (GetProductListRes, error)

GetProductList invokes getProductList operation.

Get a paginated list of products.

GET /v1/product/list

func (*Client) UpdateAttribute

func (c *Client) UpdateAttribute(ctx context.Context, request *UpdateAttributeRequest) (UpdateAttributeRes, error)

UpdateAttribute invokes updateAttribute operation.

Update an existing attribute.

PUT /v1/attribute/update

func (*Client) UpdateCategory

func (c *Client) UpdateCategory(ctx context.Context, request *UpdateCategoryRequest) (UpdateCategoryRes, error)

UpdateCategory invokes updateCategory operation.

Update an existing category.

PUT /v1/category/update

func (*Client) UpdateProduct

func (c *Client) UpdateProduct(ctx context.Context, request *UpdateProductRequest) (UpdateProductRes, error)

UpdateProduct invokes updateProduct operation.

Update an existing product.

PUT /v1/product/update

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 CreateAttributeBadRequest

type CreateAttributeBadRequest Problem

func (*CreateAttributeBadRequest) Decode

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

Decode decodes CreateAttributeBadRequest from json.

func (*CreateAttributeBadRequest) Encode

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

Encode encodes CreateAttributeBadRequest as json.

func (*CreateAttributeBadRequest) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateAttributeBadRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateAttributeConflict

type CreateAttributeConflict Problem

func (*CreateAttributeConflict) Decode

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

Decode decodes CreateAttributeConflict from json.

func (*CreateAttributeConflict) Encode

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

Encode encodes CreateAttributeConflict as json.

func (*CreateAttributeConflict) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateAttributeConflict) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateAttributeInternalServerError

type CreateAttributeInternalServerError Problem

func (*CreateAttributeInternalServerError) Decode

Decode decodes CreateAttributeInternalServerError from json.

func (*CreateAttributeInternalServerError) Encode

Encode encodes CreateAttributeInternalServerError as json.

func (*CreateAttributeInternalServerError) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateAttributeInternalServerError) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateAttributeRequest

type CreateAttributeRequest struct {
	// Optional client-generated UUID.
	ID   OptUUID `json:"id"`
	Name string  `json:"name"`
	// URL-friendly identifier.
	Slug string `json:"slug"`
	// Attribute type:
	// - single: One option from list (e.g., color)
	// - multiple: Multiple options (e.g., connectivity: WiFi, Bluetooth)
	// - range: Numeric value with optional unit (e.g., RAM: 8 GB)
	// - boolean: Yes/No value (e.g., waterproof)
	// - text: Free text (e.g., custom engraving).
	Type CreateAttributeRequestType `json:"type"`
	// Unit for range type (GB, kg, mm, etc.).
	Unit    OptString `json:"unit"`
	Enabled bool      `json:"enabled"`
	// Options for single/multiple types.
	Options []AttributeOptionInput `json:"options"`
}

Ref: #/components/schemas/CreateAttributeRequest

func (*CreateAttributeRequest) Decode

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

Decode decodes CreateAttributeRequest from json.

func (*CreateAttributeRequest) Encode

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

Encode implements json.Marshaler.

func (*CreateAttributeRequest) GetEnabled

func (s *CreateAttributeRequest) GetEnabled() bool

GetEnabled returns the value of Enabled.

func (*CreateAttributeRequest) GetID

func (s *CreateAttributeRequest) GetID() OptUUID

GetID returns the value of ID.

func (*CreateAttributeRequest) GetName

func (s *CreateAttributeRequest) GetName() string

GetName returns the value of Name.

func (*CreateAttributeRequest) GetOptions

func (s *CreateAttributeRequest) GetOptions() []AttributeOptionInput

GetOptions returns the value of Options.

func (*CreateAttributeRequest) GetSlug

func (s *CreateAttributeRequest) GetSlug() string

GetSlug returns the value of Slug.

func (*CreateAttributeRequest) GetType

GetType returns the value of Type.

func (*CreateAttributeRequest) GetUnit

func (s *CreateAttributeRequest) GetUnit() OptString

GetUnit returns the value of Unit.

func (*CreateAttributeRequest) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateAttributeRequest) SetEnabled

func (s *CreateAttributeRequest) SetEnabled(val bool)

SetEnabled sets the value of Enabled.

func (*CreateAttributeRequest) SetID

func (s *CreateAttributeRequest) SetID(val OptUUID)

SetID sets the value of ID.

func (*CreateAttributeRequest) SetName

func (s *CreateAttributeRequest) SetName(val string)

SetName sets the value of Name.

func (*CreateAttributeRequest) SetOptions

func (s *CreateAttributeRequest) SetOptions(val []AttributeOptionInput)

SetOptions sets the value of Options.

func (*CreateAttributeRequest) SetSlug

func (s *CreateAttributeRequest) SetSlug(val string)

SetSlug sets the value of Slug.

func (*CreateAttributeRequest) SetType

SetType sets the value of Type.

func (*CreateAttributeRequest) SetUnit

func (s *CreateAttributeRequest) SetUnit(val OptString)

SetUnit sets the value of Unit.

func (*CreateAttributeRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateAttributeRequest) Validate

func (s *CreateAttributeRequest) Validate() error

type CreateAttributeRequestType

type CreateAttributeRequestType string

Attribute type: - single: One option from list (e.g., color) - multiple: Multiple options (e.g., connectivity: WiFi, Bluetooth) - range: Numeric value with optional unit (e.g., RAM: 8 GB) - boolean: Yes/No value (e.g., waterproof) - text: Free text (e.g., custom engraving).

const (
	CreateAttributeRequestTypeSingle   CreateAttributeRequestType = "single"
	CreateAttributeRequestTypeMultiple CreateAttributeRequestType = "multiple"
	CreateAttributeRequestTypeRange    CreateAttributeRequestType = "range"
	CreateAttributeRequestTypeBoolean  CreateAttributeRequestType = "boolean"
	CreateAttributeRequestTypeText     CreateAttributeRequestType = "text"
)

func (CreateAttributeRequestType) AllValues

AllValues returns all CreateAttributeRequestType values.

func (*CreateAttributeRequestType) Decode

Decode decodes CreateAttributeRequestType from json.

func (CreateAttributeRequestType) Encode

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

Encode encodes CreateAttributeRequestType as json.

func (CreateAttributeRequestType) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (CreateAttributeRequestType) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*CreateAttributeRequestType) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateAttributeRequestType) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (CreateAttributeRequestType) Validate

func (s CreateAttributeRequestType) Validate() error

type CreateAttributeRes

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

type CreateCategoryBadRequest

type CreateCategoryBadRequest Problem

func (*CreateCategoryBadRequest) Decode

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

Decode decodes CreateCategoryBadRequest from json.

func (*CreateCategoryBadRequest) Encode

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

Encode encodes CreateCategoryBadRequest as json.

func (*CreateCategoryBadRequest) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateCategoryBadRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateCategoryInternalServerError

type CreateCategoryInternalServerError Problem

func (*CreateCategoryInternalServerError) Decode

Decode decodes CreateCategoryInternalServerError from json.

func (*CreateCategoryInternalServerError) Encode

Encode encodes CreateCategoryInternalServerError as json.

func (*CreateCategoryInternalServerError) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateCategoryInternalServerError) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateCategoryRequest

type CreateCategoryRequest struct {
	// Optional client-generated UUID.
	ID      OptUUID `json:"id"`
	Name    string  `json:"name"`
	Enabled bool    `json:"enabled"`
	// List of attributes to assign to this category.
	Attributes []CategoryAttributeInput `json:"attributes"`
}

Ref: #/components/schemas/CreateCategoryRequest

func (*CreateCategoryRequest) Decode

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

Decode decodes CreateCategoryRequest from json.

func (*CreateCategoryRequest) Encode

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

Encode implements json.Marshaler.

func (*CreateCategoryRequest) GetAttributes

func (s *CreateCategoryRequest) GetAttributes() []CategoryAttributeInput

GetAttributes returns the value of Attributes.

func (*CreateCategoryRequest) GetEnabled

func (s *CreateCategoryRequest) GetEnabled() bool

GetEnabled returns the value of Enabled.

func (*CreateCategoryRequest) GetID

func (s *CreateCategoryRequest) GetID() OptUUID

GetID returns the value of ID.

func (*CreateCategoryRequest) GetName

func (s *CreateCategoryRequest) GetName() string

GetName returns the value of Name.

func (*CreateCategoryRequest) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateCategoryRequest) SetAttributes

func (s *CreateCategoryRequest) SetAttributes(val []CategoryAttributeInput)

SetAttributes sets the value of Attributes.

func (*CreateCategoryRequest) SetEnabled

func (s *CreateCategoryRequest) SetEnabled(val bool)

SetEnabled sets the value of Enabled.

func (*CreateCategoryRequest) SetID

func (s *CreateCategoryRequest) SetID(val OptUUID)

SetID sets the value of ID.

func (*CreateCategoryRequest) SetName

func (s *CreateCategoryRequest) SetName(val string)

SetName sets the value of Name.

func (*CreateCategoryRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateCategoryRequest) Validate

func (s *CreateCategoryRequest) Validate() error

type CreateCategoryRes

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

type CreateProductBadRequest

type CreateProductBadRequest Problem

func (*CreateProductBadRequest) Decode

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

Decode decodes CreateProductBadRequest from json.

func (*CreateProductBadRequest) Encode

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

Encode encodes CreateProductBadRequest as json.

func (*CreateProductBadRequest) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateProductBadRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateProductForbidden

type CreateProductForbidden Problem

func (*CreateProductForbidden) Decode

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

Decode decodes CreateProductForbidden from json.

func (*CreateProductForbidden) Encode

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

Encode encodes CreateProductForbidden as json.

func (*CreateProductForbidden) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateProductForbidden) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateProductInternalServerError

type CreateProductInternalServerError Problem

func (*CreateProductInternalServerError) Decode

Decode decodes CreateProductInternalServerError from json.

func (*CreateProductInternalServerError) Encode

Encode encodes CreateProductInternalServerError as json.

func (*CreateProductInternalServerError) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateProductInternalServerError) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateProductRequest

type CreateProductRequest struct {
	// Optional client-generated UUID.
	ID          OptUUID   `json:"id"`
	Name        string    `json:"name"`
	Description OptString `json:"description"`
	Price       float64   `json:"price"`
	Quantity    int       `json:"quantity"`
	// Reference to image in Image Service.
	ImageId OptUUID `json:"imageId"`
	// Category this product belongs to.
	CategoryId OptUUID `json:"categoryId"`
	Enabled    bool    `json:"enabled"`
	// List of attribute values for this product.
	Attributes []AttributeValueInput `json:"attributes"`
}

Ref: #/components/schemas/CreateProductRequest

func (*CreateProductRequest) Decode

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

Decode decodes CreateProductRequest from json.

func (*CreateProductRequest) Encode

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

Encode implements json.Marshaler.

func (*CreateProductRequest) GetAttributes

func (s *CreateProductRequest) GetAttributes() []AttributeValueInput

GetAttributes returns the value of Attributes.

func (*CreateProductRequest) GetCategoryId

func (s *CreateProductRequest) GetCategoryId() OptUUID

GetCategoryId returns the value of CategoryId.

func (*CreateProductRequest) GetDescription

func (s *CreateProductRequest) GetDescription() OptString

GetDescription returns the value of Description.

func (*CreateProductRequest) GetEnabled

func (s *CreateProductRequest) GetEnabled() bool

GetEnabled returns the value of Enabled.

func (*CreateProductRequest) GetID

func (s *CreateProductRequest) GetID() OptUUID

GetID returns the value of ID.

func (*CreateProductRequest) GetImageId

func (s *CreateProductRequest) GetImageId() OptUUID

GetImageId returns the value of ImageId.

func (*CreateProductRequest) GetName

func (s *CreateProductRequest) GetName() string

GetName returns the value of Name.

func (*CreateProductRequest) GetPrice

func (s *CreateProductRequest) GetPrice() float64

GetPrice returns the value of Price.

func (*CreateProductRequest) GetQuantity

func (s *CreateProductRequest) GetQuantity() int

GetQuantity returns the value of Quantity.

func (*CreateProductRequest) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateProductRequest) SetAttributes

func (s *CreateProductRequest) SetAttributes(val []AttributeValueInput)

SetAttributes sets the value of Attributes.

func (*CreateProductRequest) SetCategoryId

func (s *CreateProductRequest) SetCategoryId(val OptUUID)

SetCategoryId sets the value of CategoryId.

func (*CreateProductRequest) SetDescription

func (s *CreateProductRequest) SetDescription(val OptString)

SetDescription sets the value of Description.

func (*CreateProductRequest) SetEnabled

func (s *CreateProductRequest) SetEnabled(val bool)

SetEnabled sets the value of Enabled.

func (*CreateProductRequest) SetID

func (s *CreateProductRequest) SetID(val OptUUID)

SetID sets the value of ID.

func (*CreateProductRequest) SetImageId

func (s *CreateProductRequest) SetImageId(val OptUUID)

SetImageId sets the value of ImageId.

func (*CreateProductRequest) SetName

func (s *CreateProductRequest) SetName(val string)

SetName sets the value of Name.

func (*CreateProductRequest) SetPrice

func (s *CreateProductRequest) SetPrice(val float64)

SetPrice sets the value of Price.

func (*CreateProductRequest) SetQuantity

func (s *CreateProductRequest) SetQuantity(val int)

SetQuantity sets the value of Quantity.

func (*CreateProductRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*CreateProductRequest) Validate

func (s *CreateProductRequest) Validate() error

type CreateProductRes

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

type CreateProductUnauthorized

type CreateProductUnauthorized Problem

func (*CreateProductUnauthorized) Decode

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

Decode decodes CreateProductUnauthorized from json.

func (*CreateProductUnauthorized) Encode

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

Encode encodes CreateProductUnauthorized as json.

func (*CreateProductUnauthorized) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*CreateProductUnauthorized) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type GetAttributeByIdInternalServerError

type GetAttributeByIdInternalServerError Problem

func (*GetAttributeByIdInternalServerError) Decode

Decode decodes GetAttributeByIdInternalServerError from json.

func (*GetAttributeByIdInternalServerError) Encode

Encode encodes GetAttributeByIdInternalServerError as json.

func (*GetAttributeByIdInternalServerError) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*GetAttributeByIdInternalServerError) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type GetAttributeByIdNotFound

type GetAttributeByIdNotFound Problem

func (*GetAttributeByIdNotFound) Decode

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

Decode decodes GetAttributeByIdNotFound from json.

func (*GetAttributeByIdNotFound) Encode

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

Encode encodes GetAttributeByIdNotFound as json.

func (*GetAttributeByIdNotFound) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*GetAttributeByIdNotFound) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type GetAttributeByIdParams

type GetAttributeByIdParams struct {
	// Attribute UUID.
	ID uuid.UUID
}

GetAttributeByIdParams is parameters of getAttributeById operation.

type GetAttributeByIdRes

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

type GetAttributeListBadRequest

type GetAttributeListBadRequest Problem

func (*GetAttributeListBadRequest) Decode

Decode decodes GetAttributeListBadRequest from json.

func (*GetAttributeListBadRequest) Encode

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

Encode encodes GetAttributeListBadRequest as json.

func (*GetAttributeListBadRequest) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*GetAttributeListBadRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type GetAttributeListInternalServerError

type GetAttributeListInternalServerError Problem

func (*GetAttributeListInternalServerError) Decode

Decode decodes GetAttributeListInternalServerError from json.

func (*GetAttributeListInternalServerError) Encode

Encode encodes GetAttributeListInternalServerError as json.

func (*GetAttributeListInternalServerError) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*GetAttributeListInternalServerError) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type GetAttributeListOrder

type GetAttributeListOrder string
const (
	GetAttributeListOrderAsc  GetAttributeListOrder = "asc"
	GetAttributeListOrderDesc GetAttributeListOrder = "desc"
)

func (GetAttributeListOrder) AllValues

AllValues returns all GetAttributeListOrder values.

func (GetAttributeListOrder) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*GetAttributeListOrder) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (GetAttributeListOrder) Validate

func (s GetAttributeListOrder) Validate() error

type GetAttributeListParams

type GetAttributeListParams struct {
	// Page number (1-based).
	Page int
	// Number of items per page (max 100).
	Size int
	// Filter by enabled status.
	Enabled OptBool `json:",omitempty,omitzero"`
	// Filter by attribute type.
	Type OptGetAttributeListType `json:",omitempty,omitzero"`
	// Field to sort by.
	Sort OptGetAttributeListSort `json:",omitempty,omitzero"`
	// Sort order.
	Order OptGetAttributeListOrder `json:",omitempty,omitzero"`
}

GetAttributeListParams is parameters of getAttributeList operation.

type GetAttributeListRes

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

type GetAttributeListSort

type GetAttributeListSort string
const (
	GetAttributeListSortName       GetAttributeListSort = "name"
	GetAttributeListSortSlug       GetAttributeListSort = "slug"
	GetAttributeListSortCreatedAt  GetAttributeListSort = "createdAt"
	GetAttributeListSortModifiedAt GetAttributeListSort = "modifiedAt"
)

func (GetAttributeListSort) AllValues

AllValues returns all GetAttributeListSort values.

func (GetAttributeListSort) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*GetAttributeListSort) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (GetAttributeListSort) Validate

func (s GetAttributeListSort) Validate() error

type GetAttributeListType

type GetAttributeListType string
const (
	GetAttributeListTypeSingle   GetAttributeListType = "single"
	GetAttributeListTypeMultiple GetAttributeListType = "multiple"
	GetAttributeListTypeRange    GetAttributeListType = "range"
	GetAttributeListTypeBoolean  GetAttributeListType = "boolean"
	GetAttributeListTypeText     GetAttributeListType = "text"
)

func (GetAttributeListType) AllValues

AllValues returns all GetAttributeListType values.

func (GetAttributeListType) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*GetAttributeListType) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (GetAttributeListType) Validate

func (s GetAttributeListType) Validate() error

type GetCategoryByIdInternalServerError

type GetCategoryByIdInternalServerError Problem

func (*GetCategoryByIdInternalServerError) Decode

Decode decodes GetCategoryByIdInternalServerError from json.

func (*GetCategoryByIdInternalServerError) Encode

Encode encodes GetCategoryByIdInternalServerError as json.

func (*GetCategoryByIdInternalServerError) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*GetCategoryByIdInternalServerError) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type GetCategoryByIdNotFound

type GetCategoryByIdNotFound Problem

func (*GetCategoryByIdNotFound) Decode

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

Decode decodes GetCategoryByIdNotFound from json.

func (*GetCategoryByIdNotFound) Encode

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

Encode encodes GetCategoryByIdNotFound as json.

func (*GetCategoryByIdNotFound) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*GetCategoryByIdNotFound) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type GetCategoryByIdParams

type GetCategoryByIdParams struct {
	// Category UUID.
	ID uuid.UUID
}

GetCategoryByIdParams is parameters of getCategoryById operation.

type GetCategoryByIdRes

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

type GetCategoryListBadRequest

type GetCategoryListBadRequest Problem

func (*GetCategoryListBadRequest) Decode

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

Decode decodes GetCategoryListBadRequest from json.

func (*GetCategoryListBadRequest) Encode

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

Encode encodes GetCategoryListBadRequest as json.

func (*GetCategoryListBadRequest) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*GetCategoryListBadRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type GetCategoryListInternalServerError

type GetCategoryListInternalServerError Problem

func (*GetCategoryListInternalServerError) Decode

Decode decodes GetCategoryListInternalServerError from json.

func (*GetCategoryListInternalServerError) Encode

Encode encodes GetCategoryListInternalServerError as json.

func (*GetCategoryListInternalServerError) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*GetCategoryListInternalServerError) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type GetCategoryListOrder

type GetCategoryListOrder string
const (
	GetCategoryListOrderAsc  GetCategoryListOrder = "asc"
	GetCategoryListOrderDesc GetCategoryListOrder = "desc"
)

func (GetCategoryListOrder) AllValues

AllValues returns all GetCategoryListOrder values.

func (GetCategoryListOrder) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*GetCategoryListOrder) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (GetCategoryListOrder) Validate

func (s GetCategoryListOrder) Validate() error

type GetCategoryListParams

type GetCategoryListParams struct {
	// Page number (1-based).
	Page int
	// Number of items per page (max 100).
	Size int
	// Filter by enabled status.
	Enabled OptBool `json:",omitempty,omitzero"`
	// Field to sort by.
	Sort OptGetCategoryListSort `json:",omitempty,omitzero"`
	// Sort order.
	Order OptGetCategoryListOrder `json:",omitempty,omitzero"`
}

GetCategoryListParams is parameters of getCategoryList operation.

type GetCategoryListRes

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

type GetCategoryListSort

type GetCategoryListSort string
const (
	GetCategoryListSortName       GetCategoryListSort = "name"
	GetCategoryListSortCreatedAt  GetCategoryListSort = "createdAt"
	GetCategoryListSortModifiedAt GetCategoryListSort = "modifiedAt"
)

func (GetCategoryListSort) AllValues

AllValues returns all GetCategoryListSort values.

func (GetCategoryListSort) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*GetCategoryListSort) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (GetCategoryListSort) Validate

func (s GetCategoryListSort) Validate() error

type GetProductByIdForbidden

type GetProductByIdForbidden Problem

func (*GetProductByIdForbidden) Decode

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

Decode decodes GetProductByIdForbidden from json.

func (*GetProductByIdForbidden) Encode

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

Encode encodes GetProductByIdForbidden as json.

func (*GetProductByIdForbidden) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*GetProductByIdForbidden) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type GetProductByIdInternalServerError

type GetProductByIdInternalServerError Problem

func (*GetProductByIdInternalServerError) Decode

Decode decodes GetProductByIdInternalServerError from json.

func (*GetProductByIdInternalServerError) Encode

Encode encodes GetProductByIdInternalServerError as json.

func (*GetProductByIdInternalServerError) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*GetProductByIdInternalServerError) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type GetProductByIdNotFound

type GetProductByIdNotFound Problem

func (*GetProductByIdNotFound) Decode

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

Decode decodes GetProductByIdNotFound from json.

func (*GetProductByIdNotFound) Encode

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

Encode encodes GetProductByIdNotFound as json.

func (*GetProductByIdNotFound) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*GetProductByIdNotFound) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type GetProductByIdParams

type GetProductByIdParams struct {
	// Product UUID.
	ID uuid.UUID
}

GetProductByIdParams is parameters of getProductById operation.

type GetProductByIdRes

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

type GetProductByIdUnauthorized

type GetProductByIdUnauthorized Problem

func (*GetProductByIdUnauthorized) Decode

Decode decodes GetProductByIdUnauthorized from json.

func (*GetProductByIdUnauthorized) Encode

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

Encode encodes GetProductByIdUnauthorized as json.

func (*GetProductByIdUnauthorized) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*GetProductByIdUnauthorized) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type GetProductListBadRequest

type GetProductListBadRequest Problem

func (*GetProductListBadRequest) Decode

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

Decode decodes GetProductListBadRequest from json.

func (*GetProductListBadRequest) Encode

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

Encode encodes GetProductListBadRequest as json.

func (*GetProductListBadRequest) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*GetProductListBadRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type GetProductListForbidden

type GetProductListForbidden Problem

func (*GetProductListForbidden) Decode

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

Decode decodes GetProductListForbidden from json.

func (*GetProductListForbidden) Encode

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

Encode encodes GetProductListForbidden as json.

func (*GetProductListForbidden) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*GetProductListForbidden) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type GetProductListInternalServerError

type GetProductListInternalServerError Problem

func (*GetProductListInternalServerError) Decode

Decode decodes GetProductListInternalServerError from json.

func (*GetProductListInternalServerError) Encode

Encode encodes GetProductListInternalServerError as json.

func (*GetProductListInternalServerError) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*GetProductListInternalServerError) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type GetProductListOrder

type GetProductListOrder string
const (
	GetProductListOrderAsc  GetProductListOrder = "asc"
	GetProductListOrderDesc GetProductListOrder = "desc"
)

func (GetProductListOrder) AllValues

AllValues returns all GetProductListOrder values.

func (GetProductListOrder) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*GetProductListOrder) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (GetProductListOrder) Validate

func (s GetProductListOrder) Validate() error

type GetProductListParams

type GetProductListParams struct {
	// Page number (1-based).
	Page int
	// Number of items per page (max 100).
	Size int
	// Filter by enabled status.
	Enabled OptBool `json:",omitempty,omitzero"`
	// Filter by category ID.
	CategoryId OptUUID `json:",omitempty,omitzero"`
	// Field to sort by.
	Sort OptGetProductListSort `json:",omitempty,omitzero"`
	// Sort order.
	Order OptGetProductListOrder `json:",omitempty,omitzero"`
}

GetProductListParams is parameters of getProductList operation.

type GetProductListRes

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

type GetProductListSort

type GetProductListSort string
const (
	GetProductListSortName       GetProductListSort = "name"
	GetProductListSortPrice      GetProductListSort = "price"
	GetProductListSortQuantity   GetProductListSort = "quantity"
	GetProductListSortCreatedAt  GetProductListSort = "createdAt"
	GetProductListSortModifiedAt GetProductListSort = "modifiedAt"
	GetProductListSortCategoryId GetProductListSort = "categoryId"
)

func (GetProductListSort) AllValues

func (GetProductListSort) AllValues() []GetProductListSort

AllValues returns all GetProductListSort values.

func (GetProductListSort) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*GetProductListSort) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (GetProductListSort) Validate

func (s GetProductListSort) Validate() error

type GetProductListUnauthorized

type GetProductListUnauthorized Problem

func (*GetProductListUnauthorized) Decode

Decode decodes GetProductListUnauthorized from json.

func (*GetProductListUnauthorized) Encode

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

Encode encodes GetProductListUnauthorized as json.

func (*GetProductListUnauthorized) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*GetProductListUnauthorized) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Handler

type Handler interface {
	// CreateAttribute implements createAttribute operation.
	//
	// Create a new attribute.
	//
	// POST /v1/attribute/create
	CreateAttribute(ctx context.Context, req *CreateAttributeRequest) (CreateAttributeRes, error)
	// CreateCategory implements createCategory operation.
	//
	// Create a new category.
	//
	// POST /v1/category/create
	CreateCategory(ctx context.Context, req *CreateCategoryRequest) (CreateCategoryRes, error)
	// CreateProduct implements createProduct operation.
	//
	// Create a new product.
	//
	// POST /v1/product/create
	CreateProduct(ctx context.Context, req *CreateProductRequest) (CreateProductRes, error)
	// GetAttributeById implements getAttributeById operation.
	//
	// Get an attribute by ID.
	//
	// GET /v1/attribute/get/{id}
	GetAttributeById(ctx context.Context, params GetAttributeByIdParams) (GetAttributeByIdRes, error)
	// GetAttributeList implements getAttributeList operation.
	//
	// Get a paginated list of attributes.
	//
	// GET /v1/attribute/list
	GetAttributeList(ctx context.Context, params GetAttributeListParams) (GetAttributeListRes, error)
	// GetCategoryById implements getCategoryById operation.
	//
	// Get a category by ID.
	//
	// GET /v1/category/get/{id}
	GetCategoryById(ctx context.Context, params GetCategoryByIdParams) (GetCategoryByIdRes, error)
	// GetCategoryList implements getCategoryList operation.
	//
	// Get a paginated list of categories.
	//
	// GET /v1/category/list
	GetCategoryList(ctx context.Context, params GetCategoryListParams) (GetCategoryListRes, error)
	// GetProductById implements getProductById operation.
	//
	// Get a product by ID.
	//
	// GET /v1/product/get/{id}
	GetProductById(ctx context.Context, params GetProductByIdParams) (GetProductByIdRes, error)
	// GetProductList implements getProductList operation.
	//
	// Get a paginated list of products.
	//
	// GET /v1/product/list
	GetProductList(ctx context.Context, params GetProductListParams) (GetProductListRes, error)
	// UpdateAttribute implements updateAttribute operation.
	//
	// Update an existing attribute.
	//
	// PUT /v1/attribute/update
	UpdateAttribute(ctx context.Context, req *UpdateAttributeRequest) (UpdateAttributeRes, error)
	// UpdateCategory implements updateCategory operation.
	//
	// Update an existing category.
	//
	// PUT /v1/category/update
	UpdateCategory(ctx context.Context, req *UpdateCategoryRequest) (UpdateCategoryRes, error)
	// UpdateProduct implements updateProduct operation.
	//
	// Update an existing product.
	//
	// PUT /v1/product/update
	UpdateProduct(ctx context.Context, req *UpdateProductRequest) (UpdateProductRes, error)
}

Handler handles operations described by OpenAPI v3 specification.

type Invoker

type Invoker interface {
	// CreateAttribute invokes createAttribute operation.
	//
	// Create a new attribute.
	//
	// POST /v1/attribute/create
	CreateAttribute(ctx context.Context, request *CreateAttributeRequest) (CreateAttributeRes, error)
	// CreateCategory invokes createCategory operation.
	//
	// Create a new category.
	//
	// POST /v1/category/create
	CreateCategory(ctx context.Context, request *CreateCategoryRequest) (CreateCategoryRes, error)
	// CreateProduct invokes createProduct operation.
	//
	// Create a new product.
	//
	// POST /v1/product/create
	CreateProduct(ctx context.Context, request *CreateProductRequest) (CreateProductRes, error)
	// GetAttributeById invokes getAttributeById operation.
	//
	// Get an attribute by ID.
	//
	// GET /v1/attribute/get/{id}
	GetAttributeById(ctx context.Context, params GetAttributeByIdParams) (GetAttributeByIdRes, error)
	// GetAttributeList invokes getAttributeList operation.
	//
	// Get a paginated list of attributes.
	//
	// GET /v1/attribute/list
	GetAttributeList(ctx context.Context, params GetAttributeListParams) (GetAttributeListRes, error)
	// GetCategoryById invokes getCategoryById operation.
	//
	// Get a category by ID.
	//
	// GET /v1/category/get/{id}
	GetCategoryById(ctx context.Context, params GetCategoryByIdParams) (GetCategoryByIdRes, error)
	// GetCategoryList invokes getCategoryList operation.
	//
	// Get a paginated list of categories.
	//
	// GET /v1/category/list
	GetCategoryList(ctx context.Context, params GetCategoryListParams) (GetCategoryListRes, error)
	// GetProductById invokes getProductById operation.
	//
	// Get a product by ID.
	//
	// GET /v1/product/get/{id}
	GetProductById(ctx context.Context, params GetProductByIdParams) (GetProductByIdRes, error)
	// GetProductList invokes getProductList operation.
	//
	// Get a paginated list of products.
	//
	// GET /v1/product/list
	GetProductList(ctx context.Context, params GetProductListParams) (GetProductListRes, error)
	// UpdateAttribute invokes updateAttribute operation.
	//
	// Update an existing attribute.
	//
	// PUT /v1/attribute/update
	UpdateAttribute(ctx context.Context, request *UpdateAttributeRequest) (UpdateAttributeRes, error)
	// UpdateCategory invokes updateCategory operation.
	//
	// Update an existing category.
	//
	// PUT /v1/category/update
	UpdateCategory(ctx context.Context, request *UpdateCategoryRequest) (UpdateCategoryRes, error)
	// UpdateProduct invokes updateProduct operation.
	//
	// Update an existing product.
	//
	// PUT /v1/product/update
	UpdateProduct(ctx context.Context, request *UpdateProductRequest) (UpdateProductRes, error)
}

Invoker invokes operations described by OpenAPI v3 specification.

type Labeler

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

Labeler is used to allow adding custom attributes to the server request metrics.

func LabelerFromContext

func LabelerFromContext(ctx context.Context) (*Labeler, bool)

LabelerFromContext retrieves the Labeler from the provided context, if present.

If no Labeler was found in the provided context a new, empty Labeler is returned and the second return value is false. In this case it is safe to use the Labeler but any attributes added to it will not be used.

func (*Labeler) Add

func (l *Labeler) Add(attrs ...attribute.KeyValue)

Add attributes to the Labeler.

func (*Labeler) AttributeSet

func (l *Labeler) AttributeSet() attribute.Set

AttributeSet returns the attributes added to the Labeler as an attribute.Set.

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type OperationName

type OperationName = string

OperationName is the ogen operation name

const (
	CreateAttributeOperation  OperationName = "CreateAttribute"
	CreateCategoryOperation   OperationName = "CreateCategory"
	CreateProductOperation    OperationName = "CreateProduct"
	GetAttributeByIdOperation OperationName = "GetAttributeById"
	GetAttributeListOperation OperationName = "GetAttributeList"
	GetCategoryByIdOperation  OperationName = "GetCategoryById"
	GetCategoryListOperation  OperationName = "GetCategoryList"
	GetProductByIdOperation   OperationName = "GetProductById"
	GetProductListOperation   OperationName = "GetProductList"
	UpdateAttributeOperation  OperationName = "UpdateAttribute"
	UpdateCategoryOperation   OperationName = "UpdateCategory"
	UpdateProductOperation    OperationName = "UpdateProduct"
)

type OptBool

type OptBool struct {
	Value bool
	Set   bool
}

OptBool is optional bool.

func NewOptBool

func NewOptBool(v bool) OptBool

NewOptBool returns new OptBool with value set to v.

func (*OptBool) Decode

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

Decode decodes bool from json.

func (OptBool) Encode

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

Encode encodes bool as json.

func (OptBool) Get

func (o OptBool) Get() (v bool, ok bool)

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

func (OptBool) IsSet

func (o OptBool) IsSet() bool

IsSet returns true if OptBool was set.

func (OptBool) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptBool) Or

func (o OptBool) Or(d bool) bool

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

func (*OptBool) Reset

func (o *OptBool) Reset()

Reset unsets value.

func (*OptBool) SetTo

func (o *OptBool) SetTo(v bool)

SetTo sets value to v.

func (*OptBool) UnmarshalJSON

func (s *OptBool) 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 OptGetAttributeListOrder

type OptGetAttributeListOrder struct {
	Value GetAttributeListOrder
	Set   bool
}

OptGetAttributeListOrder is optional GetAttributeListOrder.

func NewOptGetAttributeListOrder

func NewOptGetAttributeListOrder(v GetAttributeListOrder) OptGetAttributeListOrder

NewOptGetAttributeListOrder returns new OptGetAttributeListOrder with value set to v.

func (OptGetAttributeListOrder) Get

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

func (OptGetAttributeListOrder) IsSet

func (o OptGetAttributeListOrder) IsSet() bool

IsSet returns true if OptGetAttributeListOrder was set.

func (OptGetAttributeListOrder) Or

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

func (*OptGetAttributeListOrder) Reset

func (o *OptGetAttributeListOrder) Reset()

Reset unsets value.

func (*OptGetAttributeListOrder) SetTo

SetTo sets value to v.

type OptGetAttributeListSort

type OptGetAttributeListSort struct {
	Value GetAttributeListSort
	Set   bool
}

OptGetAttributeListSort is optional GetAttributeListSort.

func NewOptGetAttributeListSort

func NewOptGetAttributeListSort(v GetAttributeListSort) OptGetAttributeListSort

NewOptGetAttributeListSort returns new OptGetAttributeListSort with value set to v.

func (OptGetAttributeListSort) Get

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

func (OptGetAttributeListSort) IsSet

func (o OptGetAttributeListSort) IsSet() bool

IsSet returns true if OptGetAttributeListSort was set.

func (OptGetAttributeListSort) Or

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

func (*OptGetAttributeListSort) Reset

func (o *OptGetAttributeListSort) Reset()

Reset unsets value.

func (*OptGetAttributeListSort) SetTo

SetTo sets value to v.

type OptGetAttributeListType

type OptGetAttributeListType struct {
	Value GetAttributeListType
	Set   bool
}

OptGetAttributeListType is optional GetAttributeListType.

func NewOptGetAttributeListType

func NewOptGetAttributeListType(v GetAttributeListType) OptGetAttributeListType

NewOptGetAttributeListType returns new OptGetAttributeListType with value set to v.

func (OptGetAttributeListType) Get

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

func (OptGetAttributeListType) IsSet

func (o OptGetAttributeListType) IsSet() bool

IsSet returns true if OptGetAttributeListType was set.

func (OptGetAttributeListType) Or

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

func (*OptGetAttributeListType) Reset

func (o *OptGetAttributeListType) Reset()

Reset unsets value.

func (*OptGetAttributeListType) SetTo

SetTo sets value to v.

type OptGetCategoryListOrder

type OptGetCategoryListOrder struct {
	Value GetCategoryListOrder
	Set   bool
}

OptGetCategoryListOrder is optional GetCategoryListOrder.

func NewOptGetCategoryListOrder

func NewOptGetCategoryListOrder(v GetCategoryListOrder) OptGetCategoryListOrder

NewOptGetCategoryListOrder returns new OptGetCategoryListOrder with value set to v.

func (OptGetCategoryListOrder) Get

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

func (OptGetCategoryListOrder) IsSet

func (o OptGetCategoryListOrder) IsSet() bool

IsSet returns true if OptGetCategoryListOrder was set.

func (OptGetCategoryListOrder) Or

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

func (*OptGetCategoryListOrder) Reset

func (o *OptGetCategoryListOrder) Reset()

Reset unsets value.

func (*OptGetCategoryListOrder) SetTo

SetTo sets value to v.

type OptGetCategoryListSort

type OptGetCategoryListSort struct {
	Value GetCategoryListSort
	Set   bool
}

OptGetCategoryListSort is optional GetCategoryListSort.

func NewOptGetCategoryListSort

func NewOptGetCategoryListSort(v GetCategoryListSort) OptGetCategoryListSort

NewOptGetCategoryListSort returns new OptGetCategoryListSort with value set to v.

func (OptGetCategoryListSort) Get

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

func (OptGetCategoryListSort) IsSet

func (o OptGetCategoryListSort) IsSet() bool

IsSet returns true if OptGetCategoryListSort was set.

func (OptGetCategoryListSort) Or

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

func (*OptGetCategoryListSort) Reset

func (o *OptGetCategoryListSort) Reset()

Reset unsets value.

func (*OptGetCategoryListSort) SetTo

SetTo sets value to v.

type OptGetProductListOrder

type OptGetProductListOrder struct {
	Value GetProductListOrder
	Set   bool
}

OptGetProductListOrder is optional GetProductListOrder.

func NewOptGetProductListOrder

func NewOptGetProductListOrder(v GetProductListOrder) OptGetProductListOrder

NewOptGetProductListOrder returns new OptGetProductListOrder with value set to v.

func (OptGetProductListOrder) Get

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

func (OptGetProductListOrder) IsSet

func (o OptGetProductListOrder) IsSet() bool

IsSet returns true if OptGetProductListOrder was set.

func (OptGetProductListOrder) Or

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

func (*OptGetProductListOrder) Reset

func (o *OptGetProductListOrder) Reset()

Reset unsets value.

func (*OptGetProductListOrder) SetTo

SetTo sets value to v.

type OptGetProductListSort

type OptGetProductListSort struct {
	Value GetProductListSort
	Set   bool
}

OptGetProductListSort is optional GetProductListSort.

func NewOptGetProductListSort

func NewOptGetProductListSort(v GetProductListSort) OptGetProductListSort

NewOptGetProductListSort returns new OptGetProductListSort with value set to v.

func (OptGetProductListSort) Get

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

func (OptGetProductListSort) IsSet

func (o OptGetProductListSort) IsSet() bool

IsSet returns true if OptGetProductListSort was set.

func (OptGetProductListSort) Or

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

func (*OptGetProductListSort) Reset

func (o *OptGetProductListSort) Reset()

Reset unsets value.

func (*OptGetProductListSort) SetTo

SetTo sets value to v.

type OptInt

type OptInt struct {
	Value int
	Set   bool
}

OptInt is optional int.

func NewOptInt

func NewOptInt(v int) OptInt

NewOptInt returns new OptInt with value set to v.

func (*OptInt) Decode

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

Decode decodes int from json.

func (OptInt) Encode

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

Encode encodes int as json.

func (OptInt) Get

func (o OptInt) Get() (v int, ok bool)

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

func (OptInt) IsSet

func (o OptInt) IsSet() bool

IsSet returns true if OptInt was set.

func (OptInt) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptInt) Or

func (o OptInt) Or(d int) int

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

func (*OptInt) Reset

func (o *OptInt) Reset()

Reset unsets value.

func (*OptInt) SetTo

func (o *OptInt) SetTo(v int)

SetTo sets value to v.

func (*OptInt) UnmarshalJSON

func (s *OptInt) 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) Decode

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

Decode decodes string from json.

func (OptString) Encode

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

Encode encodes string as json.

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) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

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.

func (*OptString) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptURI

type OptURI struct {
	Value url.URL
	Set   bool
}

OptURI is optional url.URL.

func NewOptURI

func NewOptURI(v url.URL) OptURI

NewOptURI returns new OptURI with value set to v.

func (*OptURI) Decode

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

Decode decodes url.URL from json.

func (OptURI) Encode

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

Encode encodes url.URL as json.

func (OptURI) Get

func (o OptURI) Get() (v url.URL, ok bool)

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

func (OptURI) IsSet

func (o OptURI) IsSet() bool

IsSet returns true if OptURI was set.

func (OptURI) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptURI) Or

func (o OptURI) Or(d url.URL) url.URL

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

func (*OptURI) Reset

func (o *OptURI) Reset()

Reset unsets value.

func (*OptURI) SetTo

func (o *OptURI) SetTo(v url.URL)

SetTo sets value to v.

func (*OptURI) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptUUID

type OptUUID struct {
	Value uuid.UUID
	Set   bool
}

OptUUID is optional uuid.UUID.

func NewOptUUID

func NewOptUUID(v uuid.UUID) OptUUID

NewOptUUID returns new OptUUID with value set to v.

func (*OptUUID) Decode

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

Decode decodes uuid.UUID from json.

func (OptUUID) Encode

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

Encode encodes uuid.UUID as json.

func (OptUUID) Get

func (o OptUUID) Get() (v uuid.UUID, ok bool)

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

func (OptUUID) IsSet

func (o OptUUID) IsSet() bool

IsSet returns true if OptUUID was set.

func (OptUUID) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptUUID) Or

func (o OptUUID) Or(d uuid.UUID) uuid.UUID

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

func (*OptUUID) Reset

func (o *OptUUID) Reset()

Reset unsets value.

func (*OptUUID) SetTo

func (o *OptUUID) SetTo(v uuid.UUID)

SetTo sets value to v.

func (*OptUUID) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Option

type Option interface {
	ServerOption
	ClientOption
}

Option is config option.

func WithAttributes

func WithAttributes(attributes ...attribute.KeyValue) Option

WithAttributes specifies default otel attributes.

func WithMeterProvider

func WithMeterProvider(provider metric.MeterProvider) Option

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

If none is specified, the otel.GetMeterProvider() 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 Problem

type Problem struct {
	Type     url.URL             `json:"type"`
	Title    string              `json:"title"`
	Status   int                 `json:"status"`
	Detail   OptString           `json:"detail"`
	Instance OptURI              `json:"instance"`
	TraceId  OptString           `json:"traceId"`
	Errors   []ProblemErrorsItem `json:"errors"`
}

RFC7807 Problem Details. Ref: #/components/schemas/Problem

func (*Problem) Decode

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

Decode decodes Problem from json.

func (*Problem) Encode

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

Encode implements json.Marshaler.

func (*Problem) GetDetail

func (s *Problem) GetDetail() OptString

GetDetail returns the value of Detail.

func (*Problem) GetErrors

func (s *Problem) GetErrors() []ProblemErrorsItem

GetErrors returns the value of Errors.

func (*Problem) GetInstance

func (s *Problem) GetInstance() OptURI

GetInstance returns the value of Instance.

func (*Problem) GetStatus

func (s *Problem) GetStatus() int

GetStatus returns the value of Status.

func (*Problem) GetTitle

func (s *Problem) GetTitle() string

GetTitle returns the value of Title.

func (*Problem) GetTraceId

func (s *Problem) GetTraceId() OptString

GetTraceId returns the value of TraceId.

func (*Problem) GetType

func (s *Problem) GetType() url.URL

GetType returns the value of Type.

func (*Problem) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Problem) SetDetail

func (s *Problem) SetDetail(val OptString)

SetDetail sets the value of Detail.

func (*Problem) SetErrors

func (s *Problem) SetErrors(val []ProblemErrorsItem)

SetErrors sets the value of Errors.

func (*Problem) SetInstance

func (s *Problem) SetInstance(val OptURI)

SetInstance sets the value of Instance.

func (*Problem) SetStatus

func (s *Problem) SetStatus(val int)

SetStatus sets the value of Status.

func (*Problem) SetTitle

func (s *Problem) SetTitle(val string)

SetTitle sets the value of Title.

func (*Problem) SetTraceId

func (s *Problem) SetTraceId(val OptString)

SetTraceId sets the value of TraceId.

func (*Problem) SetType

func (s *Problem) SetType(val url.URL)

SetType sets the value of Type.

func (*Problem) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type ProblemErrorsItem

type ProblemErrorsItem struct {
	Field   OptString `json:"field"`
	Message OptString `json:"message"`
}

func (*ProblemErrorsItem) Decode

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

Decode decodes ProblemErrorsItem from json.

func (*ProblemErrorsItem) Encode

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

Encode implements json.Marshaler.

func (*ProblemErrorsItem) GetField

func (s *ProblemErrorsItem) GetField() OptString

GetField returns the value of Field.

func (*ProblemErrorsItem) GetMessage

func (s *ProblemErrorsItem) GetMessage() OptString

GetMessage returns the value of Message.

func (*ProblemErrorsItem) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ProblemErrorsItem) SetField

func (s *ProblemErrorsItem) SetField(val OptString)

SetField sets the value of Field.

func (*ProblemErrorsItem) SetMessage

func (s *ProblemErrorsItem) SetMessage(val OptString)

SetMessage sets the value of Message.

func (*ProblemErrorsItem) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type ProductListResponse

type ProductListResponse struct {
	Items []ProductResponse `json:"items"`
	// Current page number.
	Page int `json:"page"`
	// Number of items per page.
	Size int `json:"size"`
	// Total number of items.
	Total int `json:"total"`
}

Ref: #/components/schemas/ProductListResponse

func (*ProductListResponse) Decode

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

Decode decodes ProductListResponse from json.

func (*ProductListResponse) Encode

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

Encode implements json.Marshaler.

func (*ProductListResponse) GetItems

func (s *ProductListResponse) GetItems() []ProductResponse

GetItems returns the value of Items.

func (*ProductListResponse) GetPage

func (s *ProductListResponse) GetPage() int

GetPage returns the value of Page.

func (*ProductListResponse) GetSize

func (s *ProductListResponse) GetSize() int

GetSize returns the value of Size.

func (*ProductListResponse) GetTotal

func (s *ProductListResponse) GetTotal() int

GetTotal returns the value of Total.

func (*ProductListResponse) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ProductListResponse) SetItems

func (s *ProductListResponse) SetItems(val []ProductResponse)

SetItems sets the value of Items.

func (*ProductListResponse) SetPage

func (s *ProductListResponse) SetPage(val int)

SetPage sets the value of Page.

func (*ProductListResponse) SetSize

func (s *ProductListResponse) SetSize(val int)

SetSize sets the value of Size.

func (*ProductListResponse) SetTotal

func (s *ProductListResponse) SetTotal(val int)

SetTotal sets the value of Total.

func (*ProductListResponse) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ProductListResponse) Validate

func (s *ProductListResponse) Validate() error

type ProductResponse

type ProductResponse struct {
	ID          string    `json:"id"`
	Version     int       `json:"version"`
	Name        string    `json:"name"`
	Description OptString `json:"description"`
	Price       float64   `json:"price"`
	Quantity    int       `json:"quantity"`
	ImageId     OptString `json:"imageId"`
	CategoryId  OptString `json:"categoryId"`
	Enabled     bool      `json:"enabled"`
	CreatedAt   time.Time `json:"createdAt"`
	ModifiedAt  time.Time `json:"modifiedAt"`
	// List of attribute values for this product.
	Attributes []AttributeValue `json:"attributes"`
}

Ref: #/components/schemas/ProductResponse

func (*ProductResponse) Decode

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

Decode decodes ProductResponse from json.

func (*ProductResponse) Encode

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

Encode implements json.Marshaler.

func (*ProductResponse) GetAttributes

func (s *ProductResponse) GetAttributes() []AttributeValue

GetAttributes returns the value of Attributes.

func (*ProductResponse) GetCategoryId

func (s *ProductResponse) GetCategoryId() OptString

GetCategoryId returns the value of CategoryId.

func (*ProductResponse) GetCreatedAt

func (s *ProductResponse) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*ProductResponse) GetDescription

func (s *ProductResponse) GetDescription() OptString

GetDescription returns the value of Description.

func (*ProductResponse) GetEnabled

func (s *ProductResponse) GetEnabled() bool

GetEnabled returns the value of Enabled.

func (*ProductResponse) GetID

func (s *ProductResponse) GetID() string

GetID returns the value of ID.

func (*ProductResponse) GetImageId

func (s *ProductResponse) GetImageId() OptString

GetImageId returns the value of ImageId.

func (*ProductResponse) GetModifiedAt

func (s *ProductResponse) GetModifiedAt() time.Time

GetModifiedAt returns the value of ModifiedAt.

func (*ProductResponse) GetName

func (s *ProductResponse) GetName() string

GetName returns the value of Name.

func (*ProductResponse) GetPrice

func (s *ProductResponse) GetPrice() float64

GetPrice returns the value of Price.

func (*ProductResponse) GetQuantity

func (s *ProductResponse) GetQuantity() int

GetQuantity returns the value of Quantity.

func (*ProductResponse) GetVersion

func (s *ProductResponse) GetVersion() int

GetVersion returns the value of Version.

func (*ProductResponse) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*ProductResponse) SetAttributes

func (s *ProductResponse) SetAttributes(val []AttributeValue)

SetAttributes sets the value of Attributes.

func (*ProductResponse) SetCategoryId

func (s *ProductResponse) SetCategoryId(val OptString)

SetCategoryId sets the value of CategoryId.

func (*ProductResponse) SetCreatedAt

func (s *ProductResponse) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*ProductResponse) SetDescription

func (s *ProductResponse) SetDescription(val OptString)

SetDescription sets the value of Description.

func (*ProductResponse) SetEnabled

func (s *ProductResponse) SetEnabled(val bool)

SetEnabled sets the value of Enabled.

func (*ProductResponse) SetID

func (s *ProductResponse) SetID(val string)

SetID sets the value of ID.

func (*ProductResponse) SetImageId

func (s *ProductResponse) SetImageId(val OptString)

SetImageId sets the value of ImageId.

func (*ProductResponse) SetModifiedAt

func (s *ProductResponse) SetModifiedAt(val time.Time)

SetModifiedAt sets the value of ModifiedAt.

func (*ProductResponse) SetName

func (s *ProductResponse) SetName(val string)

SetName sets the value of Name.

func (*ProductResponse) SetPrice

func (s *ProductResponse) SetPrice(val float64)

SetPrice sets the value of Price.

func (*ProductResponse) SetQuantity

func (s *ProductResponse) SetQuantity(val int)

SetQuantity sets the value of Quantity.

func (*ProductResponse) SetVersion

func (s *ProductResponse) SetVersion(val int)

SetVersion sets the value of Version.

func (*ProductResponse) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ProductResponse) Validate

func (s *ProductResponse) 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) OperationGroup

func (r Route) OperationGroup() string

OperationGroup returns the x-ogen-operation-group value.

func (Route) OperationID

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

func (Route) PathPattern

func (r Route) PathPattern() string

PathPattern returns OpenAPI path.

func (Route) Summary

func (r Route) Summary() string

Summary returns OpenAPI summary.

type SecurityHandler

type SecurityHandler interface {
	// HandleBearerAuth handles BearerAuth security.
	// PASETO token in Authorization header.
	HandleBearerAuth(ctx context.Context, operationName OperationName, t BearerAuth) (context.Context, error)
}

SecurityHandler is handler for security parameters.

type SecuritySource

type SecuritySource interface {
	// BearerAuth provides BearerAuth security value.
	// PASETO token in Authorization header.
	BearerAuth(ctx context.Context, operationName OperationName) (BearerAuth, error)
}

SecuritySource is provider of security values (tokens, passwords, etc.).

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, sec SecurityHandler, opts ...ServerOption) (*Server, error)

NewServer creates new Server.

func ProvideServer added in v1.0.10

func ProvideServer(
	handler Handler,
	securityHandler SecurityHandler,
	tracerProvider trace.TracerProvider,
	meterProvider metric.MeterProvider,
	middlewares []middleware.Middleware,
	errorHandler ogenerrors.ErrorHandler,
) (*Server, error)

ProvideServer creates an ogen server with security handler for fx DI.

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 TokenSecuritySource added in v1.0.10

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

TokenSecuritySource implements SecuritySource for service-to-service authentication.

func NewTokenSecuritySource added in v1.0.10

func NewTokenSecuritySource(token string) *TokenSecuritySource

NewTokenSecuritySource creates a SecuritySource that uses a static token.

func (*TokenSecuritySource) BearerAuth added in v1.0.10

BearerAuth returns the bearer token for authentication.

type UnimplementedHandler

type UnimplementedHandler struct{}

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

func (UnimplementedHandler) CreateAttribute

CreateAttribute implements createAttribute operation.

Create a new attribute.

POST /v1/attribute/create

func (UnimplementedHandler) CreateCategory

CreateCategory implements createCategory operation.

Create a new category.

POST /v1/category/create

func (UnimplementedHandler) CreateProduct

CreateProduct implements createProduct operation.

Create a new product.

POST /v1/product/create

func (UnimplementedHandler) GetAttributeById

GetAttributeById implements getAttributeById operation.

Get an attribute by ID.

GET /v1/attribute/get/{id}

func (UnimplementedHandler) GetAttributeList

GetAttributeList implements getAttributeList operation.

Get a paginated list of attributes.

GET /v1/attribute/list

func (UnimplementedHandler) GetCategoryById

GetCategoryById implements getCategoryById operation.

Get a category by ID.

GET /v1/category/get/{id}

func (UnimplementedHandler) GetCategoryList

GetCategoryList implements getCategoryList operation.

Get a paginated list of categories.

GET /v1/category/list

func (UnimplementedHandler) GetProductById

GetProductById implements getProductById operation.

Get a product by ID.

GET /v1/product/get/{id}

func (UnimplementedHandler) GetProductList

GetProductList implements getProductList operation.

Get a paginated list of products.

GET /v1/product/list

func (UnimplementedHandler) UpdateAttribute

UpdateAttribute implements updateAttribute operation.

Update an existing attribute.

PUT /v1/attribute/update

func (UnimplementedHandler) UpdateCategory

UpdateCategory implements updateCategory operation.

Update an existing category.

PUT /v1/category/update

func (UnimplementedHandler) UpdateProduct

UpdateProduct implements updateProduct operation.

Update an existing product.

PUT /v1/product/update

type UpdateAttributeBadRequest

type UpdateAttributeBadRequest Problem

func (*UpdateAttributeBadRequest) Decode

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

Decode decodes UpdateAttributeBadRequest from json.

func (*UpdateAttributeBadRequest) Encode

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

Encode encodes UpdateAttributeBadRequest as json.

func (*UpdateAttributeBadRequest) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateAttributeBadRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateAttributeConflict

type UpdateAttributeConflict Problem

func (*UpdateAttributeConflict) Decode

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

Decode decodes UpdateAttributeConflict from json.

func (*UpdateAttributeConflict) Encode

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

Encode encodes UpdateAttributeConflict as json.

func (*UpdateAttributeConflict) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateAttributeConflict) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateAttributeInternalServerError

type UpdateAttributeInternalServerError Problem

func (*UpdateAttributeInternalServerError) Decode

Decode decodes UpdateAttributeInternalServerError from json.

func (*UpdateAttributeInternalServerError) Encode

Encode encodes UpdateAttributeInternalServerError as json.

func (*UpdateAttributeInternalServerError) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateAttributeInternalServerError) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateAttributeNotFound

type UpdateAttributeNotFound Problem

func (*UpdateAttributeNotFound) Decode

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

Decode decodes UpdateAttributeNotFound from json.

func (*UpdateAttributeNotFound) Encode

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

Encode encodes UpdateAttributeNotFound as json.

func (*UpdateAttributeNotFound) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateAttributeNotFound) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateAttributePreconditionFailed

type UpdateAttributePreconditionFailed Problem

func (*UpdateAttributePreconditionFailed) Decode

Decode decodes UpdateAttributePreconditionFailed from json.

func (*UpdateAttributePreconditionFailed) Encode

Encode encodes UpdateAttributePreconditionFailed as json.

func (*UpdateAttributePreconditionFailed) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateAttributePreconditionFailed) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateAttributeRequest

type UpdateAttributeRequest struct {
	ID      uuid.UUID `json:"id"`
	Name    string    `json:"name"`
	Unit    OptString `json:"unit"`
	Enabled bool      `json:"enabled"`
	// Optimistic locking version.
	Version int `json:"version"`
	// Options for single/multiple types.
	// - To add option: include new option with slug
	// - To update option: include existing option with same slug
	// - To remove option: omit option from array (only if not used by products).
	Options []AttributeOptionInput `json:"options"`
}

Ref: #/components/schemas/UpdateAttributeRequest

func (*UpdateAttributeRequest) Decode

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

Decode decodes UpdateAttributeRequest from json.

func (*UpdateAttributeRequest) Encode

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

Encode implements json.Marshaler.

func (*UpdateAttributeRequest) GetEnabled

func (s *UpdateAttributeRequest) GetEnabled() bool

GetEnabled returns the value of Enabled.

func (*UpdateAttributeRequest) GetID

func (s *UpdateAttributeRequest) GetID() uuid.UUID

GetID returns the value of ID.

func (*UpdateAttributeRequest) GetName

func (s *UpdateAttributeRequest) GetName() string

GetName returns the value of Name.

func (*UpdateAttributeRequest) GetOptions

func (s *UpdateAttributeRequest) GetOptions() []AttributeOptionInput

GetOptions returns the value of Options.

func (*UpdateAttributeRequest) GetUnit

func (s *UpdateAttributeRequest) GetUnit() OptString

GetUnit returns the value of Unit.

func (*UpdateAttributeRequest) GetVersion

func (s *UpdateAttributeRequest) GetVersion() int

GetVersion returns the value of Version.

func (*UpdateAttributeRequest) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateAttributeRequest) SetEnabled

func (s *UpdateAttributeRequest) SetEnabled(val bool)

SetEnabled sets the value of Enabled.

func (*UpdateAttributeRequest) SetID

func (s *UpdateAttributeRequest) SetID(val uuid.UUID)

SetID sets the value of ID.

func (*UpdateAttributeRequest) SetName

func (s *UpdateAttributeRequest) SetName(val string)

SetName sets the value of Name.

func (*UpdateAttributeRequest) SetOptions

func (s *UpdateAttributeRequest) SetOptions(val []AttributeOptionInput)

SetOptions sets the value of Options.

func (*UpdateAttributeRequest) SetUnit

func (s *UpdateAttributeRequest) SetUnit(val OptString)

SetUnit sets the value of Unit.

func (*UpdateAttributeRequest) SetVersion

func (s *UpdateAttributeRequest) SetVersion(val int)

SetVersion sets the value of Version.

func (*UpdateAttributeRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*UpdateAttributeRequest) Validate

func (s *UpdateAttributeRequest) Validate() error

type UpdateAttributeRes

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

type UpdateCategoryBadRequest

type UpdateCategoryBadRequest Problem

func (*UpdateCategoryBadRequest) Decode

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

Decode decodes UpdateCategoryBadRequest from json.

func (*UpdateCategoryBadRequest) Encode

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

Encode encodes UpdateCategoryBadRequest as json.

func (*UpdateCategoryBadRequest) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateCategoryBadRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateCategoryInternalServerError

type UpdateCategoryInternalServerError Problem

func (*UpdateCategoryInternalServerError) Decode

Decode decodes UpdateCategoryInternalServerError from json.

func (*UpdateCategoryInternalServerError) Encode

Encode encodes UpdateCategoryInternalServerError as json.

func (*UpdateCategoryInternalServerError) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateCategoryInternalServerError) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateCategoryNotFound

type UpdateCategoryNotFound Problem

func (*UpdateCategoryNotFound) Decode

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

Decode decodes UpdateCategoryNotFound from json.

func (*UpdateCategoryNotFound) Encode

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

Encode encodes UpdateCategoryNotFound as json.

func (*UpdateCategoryNotFound) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateCategoryNotFound) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateCategoryPreconditionFailed

type UpdateCategoryPreconditionFailed Problem

func (*UpdateCategoryPreconditionFailed) Decode

Decode decodes UpdateCategoryPreconditionFailed from json.

func (*UpdateCategoryPreconditionFailed) Encode

Encode encodes UpdateCategoryPreconditionFailed as json.

func (*UpdateCategoryPreconditionFailed) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateCategoryPreconditionFailed) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateCategoryRequest

type UpdateCategoryRequest struct {
	ID      uuid.UUID `json:"id"`
	Name    string    `json:"name"`
	Enabled bool      `json:"enabled"`
	// Optimistic locking version.
	Version int `json:"version"`
	// List of attributes assigned to this category.
	Attributes []CategoryAttributeInput `json:"attributes"`
}

Ref: #/components/schemas/UpdateCategoryRequest

func (*UpdateCategoryRequest) Decode

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

Decode decodes UpdateCategoryRequest from json.

func (*UpdateCategoryRequest) Encode

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

Encode implements json.Marshaler.

func (*UpdateCategoryRequest) GetAttributes

func (s *UpdateCategoryRequest) GetAttributes() []CategoryAttributeInput

GetAttributes returns the value of Attributes.

func (*UpdateCategoryRequest) GetEnabled

func (s *UpdateCategoryRequest) GetEnabled() bool

GetEnabled returns the value of Enabled.

func (*UpdateCategoryRequest) GetID

func (s *UpdateCategoryRequest) GetID() uuid.UUID

GetID returns the value of ID.

func (*UpdateCategoryRequest) GetName

func (s *UpdateCategoryRequest) GetName() string

GetName returns the value of Name.

func (*UpdateCategoryRequest) GetVersion

func (s *UpdateCategoryRequest) GetVersion() int

GetVersion returns the value of Version.

func (*UpdateCategoryRequest) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateCategoryRequest) SetAttributes

func (s *UpdateCategoryRequest) SetAttributes(val []CategoryAttributeInput)

SetAttributes sets the value of Attributes.

func (*UpdateCategoryRequest) SetEnabled

func (s *UpdateCategoryRequest) SetEnabled(val bool)

SetEnabled sets the value of Enabled.

func (*UpdateCategoryRequest) SetID

func (s *UpdateCategoryRequest) SetID(val uuid.UUID)

SetID sets the value of ID.

func (*UpdateCategoryRequest) SetName

func (s *UpdateCategoryRequest) SetName(val string)

SetName sets the value of Name.

func (*UpdateCategoryRequest) SetVersion

func (s *UpdateCategoryRequest) SetVersion(val int)

SetVersion sets the value of Version.

func (*UpdateCategoryRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*UpdateCategoryRequest) Validate

func (s *UpdateCategoryRequest) Validate() error

type UpdateCategoryRes

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

type UpdateProductBadRequest

type UpdateProductBadRequest Problem

func (*UpdateProductBadRequest) Decode

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

Decode decodes UpdateProductBadRequest from json.

func (*UpdateProductBadRequest) Encode

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

Encode encodes UpdateProductBadRequest as json.

func (*UpdateProductBadRequest) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateProductBadRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateProductForbidden

type UpdateProductForbidden Problem

func (*UpdateProductForbidden) Decode

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

Decode decodes UpdateProductForbidden from json.

func (*UpdateProductForbidden) Encode

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

Encode encodes UpdateProductForbidden as json.

func (*UpdateProductForbidden) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateProductForbidden) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateProductInternalServerError

type UpdateProductInternalServerError Problem

func (*UpdateProductInternalServerError) Decode

Decode decodes UpdateProductInternalServerError from json.

func (*UpdateProductInternalServerError) Encode

Encode encodes UpdateProductInternalServerError as json.

func (*UpdateProductInternalServerError) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateProductInternalServerError) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateProductNotFound

type UpdateProductNotFound Problem

func (*UpdateProductNotFound) Decode

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

Decode decodes UpdateProductNotFound from json.

func (*UpdateProductNotFound) Encode

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

Encode encodes UpdateProductNotFound as json.

func (*UpdateProductNotFound) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateProductNotFound) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateProductPreconditionFailed

type UpdateProductPreconditionFailed Problem

func (*UpdateProductPreconditionFailed) Decode

Decode decodes UpdateProductPreconditionFailed from json.

func (*UpdateProductPreconditionFailed) Encode

Encode encodes UpdateProductPreconditionFailed as json.

func (*UpdateProductPreconditionFailed) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateProductPreconditionFailed) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateProductRequest

type UpdateProductRequest struct {
	ID          uuid.UUID `json:"id"`
	Name        string    `json:"name"`
	Description OptString `json:"description"`
	Price       float64   `json:"price"`
	Quantity    int       `json:"quantity"`
	ImageId     OptUUID   `json:"imageId"`
	CategoryId  OptUUID   `json:"categoryId"`
	Enabled     bool      `json:"enabled"`
	// Optimistic locking version.
	Version int `json:"version"`
	// List of attribute values for this product.
	Attributes []AttributeValueInput `json:"attributes"`
}

Ref: #/components/schemas/UpdateProductRequest

func (*UpdateProductRequest) Decode

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

Decode decodes UpdateProductRequest from json.

func (*UpdateProductRequest) Encode

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

Encode implements json.Marshaler.

func (*UpdateProductRequest) GetAttributes

func (s *UpdateProductRequest) GetAttributes() []AttributeValueInput

GetAttributes returns the value of Attributes.

func (*UpdateProductRequest) GetCategoryId

func (s *UpdateProductRequest) GetCategoryId() OptUUID

GetCategoryId returns the value of CategoryId.

func (*UpdateProductRequest) GetDescription

func (s *UpdateProductRequest) GetDescription() OptString

GetDescription returns the value of Description.

func (*UpdateProductRequest) GetEnabled

func (s *UpdateProductRequest) GetEnabled() bool

GetEnabled returns the value of Enabled.

func (*UpdateProductRequest) GetID

func (s *UpdateProductRequest) GetID() uuid.UUID

GetID returns the value of ID.

func (*UpdateProductRequest) GetImageId

func (s *UpdateProductRequest) GetImageId() OptUUID

GetImageId returns the value of ImageId.

func (*UpdateProductRequest) GetName

func (s *UpdateProductRequest) GetName() string

GetName returns the value of Name.

func (*UpdateProductRequest) GetPrice

func (s *UpdateProductRequest) GetPrice() float64

GetPrice returns the value of Price.

func (*UpdateProductRequest) GetQuantity

func (s *UpdateProductRequest) GetQuantity() int

GetQuantity returns the value of Quantity.

func (*UpdateProductRequest) GetVersion

func (s *UpdateProductRequest) GetVersion() int

GetVersion returns the value of Version.

func (*UpdateProductRequest) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateProductRequest) SetAttributes

func (s *UpdateProductRequest) SetAttributes(val []AttributeValueInput)

SetAttributes sets the value of Attributes.

func (*UpdateProductRequest) SetCategoryId

func (s *UpdateProductRequest) SetCategoryId(val OptUUID)

SetCategoryId sets the value of CategoryId.

func (*UpdateProductRequest) SetDescription

func (s *UpdateProductRequest) SetDescription(val OptString)

SetDescription sets the value of Description.

func (*UpdateProductRequest) SetEnabled

func (s *UpdateProductRequest) SetEnabled(val bool)

SetEnabled sets the value of Enabled.

func (*UpdateProductRequest) SetID

func (s *UpdateProductRequest) SetID(val uuid.UUID)

SetID sets the value of ID.

func (*UpdateProductRequest) SetImageId

func (s *UpdateProductRequest) SetImageId(val OptUUID)

SetImageId sets the value of ImageId.

func (*UpdateProductRequest) SetName

func (s *UpdateProductRequest) SetName(val string)

SetName sets the value of Name.

func (*UpdateProductRequest) SetPrice

func (s *UpdateProductRequest) SetPrice(val float64)

SetPrice sets the value of Price.

func (*UpdateProductRequest) SetQuantity

func (s *UpdateProductRequest) SetQuantity(val int)

SetQuantity sets the value of Quantity.

func (*UpdateProductRequest) SetVersion

func (s *UpdateProductRequest) SetVersion(val int)

SetVersion sets the value of Version.

func (*UpdateProductRequest) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*UpdateProductRequest) Validate

func (s *UpdateProductRequest) Validate() error

type UpdateProductRes

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

type UpdateProductUnauthorized

type UpdateProductUnauthorized Problem

func (*UpdateProductUnauthorized) Decode

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

Decode decodes UpdateProductUnauthorized from json.

func (*UpdateProductUnauthorized) Encode

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

Encode encodes UpdateProductUnauthorized as json.

func (*UpdateProductUnauthorized) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*UpdateProductUnauthorized) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

Jump to

Keyboard shortcuts

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