Files
rudder-go-sdk/skills/rudder-go-sdk/reference/inventory.md
T
edmand46 304d6c12c1
CI / build (push) Successful in 51s
Add agent skill (SKILL.md + per-service reference)
2026-08-29 11:46:23 +03:00

1.3 KiB

Inventory

Source: inventory.go, player_inventory.go. Types: InventoryItem, InventoryList, InventoryAdjustment.

Batch adjust

func (s *InventoryService) Adjust(ctx context.Context, parameters AdjustInventoryParameters) ([]InventoryItem, error)
type AdjustInventoryParameters struct {
    IdempotencyKey string
    Items          []InventoryAdjustment
}
// InventoryAdjustment: {PlayerID, Slug, Amount int64, Reason}
// Negative Amount removes items. Returns updated items in item order.

List

func (s *InventoryService) List(ctx context.Context, playerID string, parameters ListInventoryParameters) (*InventoryList, error)
type ListInventoryParameters struct {
    Limit  int
    Cursor *string
}
// InventoryList: {Items []InventoryItem, NextCursor string}
// InventoryItem: {ID, Slug, Amount int64, UpdatedAt}

PlayerInventoryHandle

client.Player(id).Inventory():

func (h *PlayerInventoryHandle) Adjust(ctx context.Context, parameters AdjustPlayerInventoryParameters) (*InventoryItem, error)
type AdjustPlayerInventoryParameters struct {
    IdempotencyKey string
    Slug           string
    Amount         int64
    Reason         string
}

func (h *PlayerInventoryHandle) List(ctx context.Context, parameters ListInventoryParameters) (*InventoryList, error)