locationep

package
v1.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LocationTypePresenter

func LocationTypePresenter(slt *pb.LocationTypeInfo) apiresource.LocationType

Types

type BulkUpsertLocationsEndpoint

type BulkUpsertLocationsEndpoint struct{}

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

func (*BulkUpsertLocationsEndpoint) Materialize

type BulkUpsertLocationsRequest

type BulkUpsertLocationsRequest struct {
	// Locations to create or update, matched by name within the account.
	Locations []UpsertLocationInput `json:"locations" validate:"required,min=1,max=1000,dive"`
}

BulkUpsertLocationsRequest is the request to bulk upsert locations.

func (*BulkUpsertLocationsRequest) SchemaExample

func (*BulkUpsertLocationsRequest) SchemaExample() any

type CreateLocationEndpoint

type CreateLocationEndpoint struct{}

Creates a storage location, optionally placing it in the location hierarchy.

func (*CreateLocationEndpoint) Materialize

type CreateLocationRequest

type CreateLocationRequest struct {
	// Display name of the location.
	//
	// Maximum 255 characters.
	Name string `json:"name" validate:"required,max=255"`
	// This location's level in the storage hierarchy.
	//
	// The levels run from largest to smallest: `building`, `section`, `aisle`, `rack`, `shelf`, `bin`. They are descriptive labels rather than a rule — the parent you choose is not required to be the next level up.
	TypeCode constants.LocationTypeCode `json:"type" validate:"required"`
	// The location this one sits under in the storage hierarchy.
	//
	// Must be an existing location in your account. Omit to create a top-level location.
	ParentID field.Optional[string] `json:"parent_id,omitzero"`
	// Existing locations to attach beneath the new location.
	//
	// Each listed location is reparented onto the new location, detaching it from its current parent. Every ID must belong to your account.
	ChildIDs field.Optional[[]string] `json:"child_ids,omitzero"`
}

Request to create a location.

func (*CreateLocationRequest) SchemaExample

func (*CreateLocationRequest) SchemaExample() any

type DeleteLocationEndpoint

type DeleteLocationEndpoint struct{}

Deletes a location.

Fails if the location has child locations; remove or reassign the children first.

func (*DeleteLocationEndpoint) Materialize

type DeleteLocationRequest

type DeleteLocationRequest struct {
	// Location ID.
	LocationID string `path:"id" validate:"required"`
}

Request to delete a location.

type ExportLocationsEndpoint

type ExportLocationsEndpoint struct{}

Starts an export of every matching storage location and returns the job that tracks it.

func (*ExportLocationsEndpoint) Materialize

type ExportLocationsRequest

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

Filters which storage locations land in the exported file.

func (*ExportLocationsRequest) SchemaExample

func (*ExportLocationsRequest) SchemaExample() any

type ListLocationTypesEndpoint

type ListLocationTypesEndpoint struct{}

Returns a paginated list of location types.

Location types are platform-defined and the same for every account, so this list is the complete set of levels you can assign when creating a location. The `q` search term matches on location type name.

type ListLocationTypesRequest

type ListLocationTypesRequest struct {
	apiresource.PaginationRequest
}

Request to list location types.

type ListLocationsEndpoint

type ListLocationsEndpoint struct{}

Returns a paginated list of locations in your account, newest first.

Every location is returned regardless of its depth in the hierarchy, so top-level locations and their descendants appear side by side. The `q` search term matches on location name.

type ListLocationsRequest

type ListLocationsRequest struct {
	apiresource.PaginationRequest
}

Request to list locations.

type LocationSvcConfig

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

type RetrieveLocationEndpoint

type RetrieveLocationEndpoint struct{}

Returns a location by ID.

func (*RetrieveLocationEndpoint) Materialize

type RetrieveLocationRequest

type RetrieveLocationRequest struct {
	// Location ID.
	LocationID string `path:"id" validate:"required"`
}

Request to get a location.

type RetrieveLocationTypeEndpoint

type RetrieveLocationTypeEndpoint struct{}

Returns a location type by ID or code.

type RetrieveLocationTypeRequest

type RetrieveLocationTypeRequest struct {
	// Location type ID or code, such as `building` or `bin`.
	Identifier string `path:"id" validate:"required"`
}

Request to get a location type.

type UpdateLocationEndpoint

type UpdateLocationEndpoint struct{}

Partially updates a location.

func (*UpdateLocationEndpoint) Materialize

type UpdateLocationRequest

type UpdateLocationRequest struct {
	// Location ID.
	LocationID string `path:"id" validate:"required"`
	// Display name of the location.
	//
	// Maximum 255 characters.
	Name field.Optional[string] `json:"name,omitzero" validate:"omitempty,max=255"`
	// This location's level in the storage hierarchy.
	//
	// The levels run from largest to smallest: `building`, `section`, `aisle`, `rack`, `shelf`, `bin`. They are descriptive labels rather than a rule — the parent is not required to be the next level up.
	TypeCode field.Optional[constants.LocationTypeCode] `json:"type,omitzero"`
	// The location this one sits under in the storage hierarchy.
	//
	// Must be an existing location in your account, and cannot be the location being updated. Send `null` to detach it from its parent and make it a top-level location.
	ParentID field.Clearable[string] `json:"parent_id,omitzero" validate:"omitempty"`
	// The locations that sit directly beneath this one.
	//
	// This replaces the full set of children: current children that are not listed are detached and become top-level locations, and listed locations are reparented onto this location. Send `null` to detach every child. Omit the field to leave the existing children untouched.
	ChildIDs field.Clearable[[]string] `json:"child_ids,omitzero"`
}

Request to partially update a location.

func (*UpdateLocationRequest) SchemaExample

func (*UpdateLocationRequest) SchemaExample() any

type UpsertLocationInput

type UpsertLocationInput struct {
	// Display name of the location, used to match existing locations.
	Name string `json:"name" validate:"required,max=255"`
	// Location type code.
	TypeCode constants.LocationTypeCode `json:"type" validate:"required"`
	// Parent location, referenced by `id` or `name`, or by name for a location in the same
	// batch. Omitted, a new location is top-level and an existing one keeps its parent.
	Parent *apirequest.ObjectIdentifier `json:"parent,omitempty"`
	// Child locations to re-parent under this one, referenced by `id` or `name`, or by name
	// for a location in the same batch. Redundant with `parent` on each child.
	Children []apirequest.ObjectIdentifier `json:"children,omitempty"`
}

UpsertLocationInput is the input for a single location in a bulk upsert operation.

Jump to

Keyboard shortcuts

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