propertyep

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CatalogPropertiesRoute         = "/v1/catalog/properties"
	CatalogPropertyRoute           = "/v1/catalog/properties/{id}"
	CatalogPropertyAttributesRoute = "/v1/catalog/properties/{property_id}/attributes"
	CatalogPropertyAttributeRoute  = "/v1/catalog/properties/{property_id}/attributes/{id}"
)

Canonical HTTP route templates for this package. Endpoint Materialize Route fields must use these constants; presenters build concrete paths via apiendpoint.ExpandRoute.

Variables

This section is empty.

Functions

This section is empty.

Types

type BulkUpsertPropertiesEndpoint

type BulkUpsertPropertiesEndpoint struct{}

Creates or updates multiple properties and their attributes for the account, matched by name (case-insensitive), then writes asynchronously — 202 with a job to poll.

func (*BulkUpsertPropertiesEndpoint) Materialize

type BulkUpsertPropertiesRequest

type BulkUpsertPropertiesRequest struct {
	// Properties to create or update, matched by name (case-insensitive) within the account.
	Properties []UpsertPropertyInput `json:"properties" validate:"required,min=1,max=1000,dive"`
}

carries the properties to bulk upsert

func (*BulkUpsertPropertiesRequest) SchemaExample

func (*BulkUpsertPropertiesRequest) SchemaExample() any

type CreateAttributeEndpoint

type CreateAttributeEndpoint struct{}

Creates an attribute under a property.

An attribute is one selectable value of the property, such as `Red` under `Color`, and can then be assigned to items. Returns a conflict error if another attribute in the account already uses the same value.

func (*CreateAttributeEndpoint) Materialize

type CreateAttributeRequest

type CreateAttributeRequest struct {
	// The property to add this attribute to.
	PropertyID string `path:"property_id" validate:"required"`
	// The selectable value this attribute represents, such as `Red`.
	//
	// Must be unique across all attributes in the account, not just within the property. Leading and trailing whitespace is trimmed.
	Value string `json:"value" validate:"required"`
	// Swatch color used to display this attribute in the UI.
	//
	// When omitted, one of the nine named colors (everything except `default`) is assigned at random.
	ColorCode field.Optional[constants.Color] `json:"color,omitzero"`
	// Position of the new attribute relative to its siblings within the property, starting at `1`.
	//
	// Must be at most the property's current attribute count plus one; siblings at or after this position are shifted one position later. Defaults to the last position if not provided.
	SortOrder field.Optional[int32] `json:"sort_order,omitzero" validate:"omitempty,min=1"`
}

Request to create an attribute.

func (*CreateAttributeRequest) SchemaExample

func (*CreateAttributeRequest) SchemaExample() any

type CreatePropertyEndpoint

type CreatePropertyEndpoint struct{}

Creates a property.

The property starts with no attributes; add its selectable values afterwards with the create attribute endpoint. Returns a conflict error if a property with the same name already exists.

func (*CreatePropertyEndpoint) Materialize

type CreatePropertyRequest

type CreatePropertyRequest struct {
	// Display name of the property, such as `Color` or `Size`.
	//
	// Must be unique within your account.
	Name string `json:"name" validate:"required,max=255"`
}

Request to create a property.

func (*CreatePropertyRequest) SchemaExample

func (*CreatePropertyRequest) SchemaExample() any

type DeleteAttributeEndpoint

type DeleteAttributeEndpoint struct{}

Deletes an attribute from a property.

Remaining attributes in the property are shifted so their sort orders stay contiguous.

func (*DeleteAttributeEndpoint) Materialize

type DeleteAttributeRequest

type DeleteAttributeRequest struct {
	// The property the attribute belongs to.
	PropertyID string `path:"property_id" validate:"required"`
	// Attribute ID.
	AttributeID string `path:"id" validate:"required"`
}

Request to delete an attribute.

type DeletePropertyEndpoint

type DeletePropertyEndpoint struct{}

Deletes a property and every attribute defined under it.

Items previously classified by those attributes lose that classification.

func (*DeletePropertyEndpoint) Materialize

type DeletePropertyRequest

type DeletePropertyRequest struct {
	// Property ID.
	PropertyID string `path:"id" validate:"required"`
}

Request to delete a property.

type ExportPropertiesEndpoint

type ExportPropertiesEndpoint struct{}

Starts an export of every matching property, one row per attribute, and returns the job that tracks it.

func (*ExportPropertiesEndpoint) Materialize

type ExportPropertiesRequest

type ExportPropertiesRequest struct {
	// Free-text search term matched against property names.
	Query *string `json:"q"`
}

Filters which properties land in the exported file.

func (*ExportPropertiesRequest) SchemaExample

func (*ExportPropertiesRequest) SchemaExample() any

type ListAttributesEndpoint

type ListAttributesEndpoint struct{}

Returns a paginated list of attributes for a property.

Attributes come back in the order they are arranged within the property, first to last. The `q` search term is matched against the attribute value.

type ListAttributesRequest

type ListAttributesRequest struct {
	apiresource.PaginationRequest
	// The property whose attributes are listed.
	PropertyID string `path:"property_id" validate:"required"`
}

Request to list attributes for a property.

type ListPropertiesEndpoint

type ListPropertiesEndpoint struct{}

Returns a paginated list of properties for the target account.

Properties come back newest first. The `q` search term is matched against the property name.

type ListPropertiesRequest

type ListPropertiesRequest struct {
	apiresource.PaginationRequest
}

Request to list properties.

type PropertySvcConfig

type PropertySvcConfig struct {
	// CoreClient (required) is the core-service gRPC client.
	CoreClient pb.CoreServiceClient
}

type RetrieveAttributeEndpoint

type RetrieveAttributeEndpoint struct{}

Returns an attribute by ID within a property.

func (*RetrieveAttributeEndpoint) Materialize

type RetrieveAttributeRequest

type RetrieveAttributeRequest struct {
	// The property the attribute belongs to.
	PropertyID string `path:"property_id" validate:"required"`
	// Attribute ID.
	AttributeID string `path:"id" validate:"required"`
}

Request to retrieve an attribute.

type RetrievePropertyEndpoint

type RetrievePropertyEndpoint struct{}

Returns a property by ID.

func (*RetrievePropertyEndpoint) Materialize

type RetrievePropertyRequest

type RetrievePropertyRequest struct {
	// Property ID.
	PropertyID string `path:"id" validate:"required"`
}

Request to retrieve a property.

type UpdateAttributeEndpoint

type UpdateAttributeEndpoint struct{}

Partially updates an attribute.

Items reference attributes by ID, so changing the value renames the attribute everywhere it is already assigned.

func (*UpdateAttributeEndpoint) Materialize

type UpdateAttributeRequest

type UpdateAttributeRequest struct {
	// The property the attribute belongs to.
	PropertyID string `path:"property_id" validate:"required"`
	// Attribute ID.
	AttributeID string `path:"id" validate:"required"`
	// The selectable value this attribute represents, such as `Red`.
	//
	// Must be non-blank and unique across all attributes in the account, not just within the property.
	Value field.Optional[string] `json:"value,omitzero"`
	// Swatch color used to display this attribute in the UI.
	ColorCode field.Optional[constants.Color] `json:"color,omitzero"`
	// New position of this attribute relative to its siblings within the property, starting at `1`.
	//
	// Must be at most the property's current attribute count; the attributes between the old and new positions shift to make room.
	SortOrder field.Optional[int32] `json:"sort_order,omitzero" validate:"omitempty,min=1"`
}

Request to update an attribute.

func (*UpdateAttributeRequest) SchemaExample

func (*UpdateAttributeRequest) SchemaExample() any

type UpdatePropertyEndpoint

type UpdatePropertyEndpoint struct{}

Partially updates a property.

func (*UpdatePropertyEndpoint) Materialize

type UpdatePropertyRequest

type UpdatePropertyRequest struct {
	// Property ID.
	PropertyID string `path:"id" validate:"required"`
	// Display name of the property, such as `Color` or `Size`.
	//
	// Must be unique within your account.
	Name field.Optional[string] `json:"name,omitzero" validate:"omitempty,max=255"`
}

Request to update a property.

func (*UpdatePropertyRequest) SchemaExample

func (*UpdatePropertyRequest) SchemaExample() any

type UpsertPropertyAttributeInput

type UpsertPropertyAttributeInput struct {
	// The selectable value this attribute represents, such as `Red`.
	//
	// Must be unique across all attributes in the account, not just within the property. Leading and trailing whitespace is trimmed.
	Value string `json:"value" validate:"required,max=255"`
	// Swatch color used to display this attribute in the UI.
	//
	// When omitted, one of the nine named colors is assigned. Ignored for a value the property already defines.
	ColorCode field.Optional[constants.Color] `json:"color,omitzero"`
}

carries one attribute under a bulk-upserted property

type UpsertPropertyInput

type UpsertPropertyInput struct {
	// Display name of the property, used to match existing properties within the account.
	Name string `json:"name" validate:"required,max=255"`
	// The selectable values to define under this property, in the order they should be arranged.
	//
	// Additive — values the property already defines are left as they stand, and none are removed. New values are appended after the existing ones.
	Attributes []UpsertPropertyAttributeInput `json:"attributes" default:"[]" validate:"max=1000,dive"`
}

carries one property in a bulk upsert

Jump to

Keyboard shortcuts

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