locations

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

API Actor api for managing locations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ItemLocation

type ItemLocation struct {
	// Grid ID
	GID uint64 `json:"gid"`

	// ID
	ID uint64 `json:"id"`

	// GUID
	GUID uint64 `json:"guid"`

	// Location code
	LocationCode string `json:"locationCode"`

	// Name
	Name string `json:"name"`

	// Flag
	Flag string `json:"flag"`

	// Meta
	Meta []interface{} `json:"_meta"`

	// CKey
	CKey string `json:"_ckey"`
}

Main information about locations

func (ItemLocation) Serialize

func (il ItemLocation) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type ListLocations

type ListLocations struct {
	// Data
	Data []ItemLocation `json:"data"`

	// Entry count
	EntryCount uint64 `json:"entryCount"`
}

List of locations

func (ListLocations) FilterByGID added in v1.3.1

func (ll ListLocations) FilterByGID(gid uint64) ListLocations

FilterByGID returns ListLocations with specified GID.

func (ListLocations) FilterByID

func (ll ListLocations) FilterByID(id uint64) ListLocations

FilterByID returns ListLocations with specified ID.

func (ListLocations) FilterByName

func (ll ListLocations) FilterByName(name string) ListLocations

FilterByName returns ListLocations with specified Name.

func (ListLocations) FilterFunc

func (ll ListLocations) FilterFunc(predicate func(ItemLocation) bool) ListLocations

FilterFunc allows filtering ListLocations based on a user-specified predicate.

func (ListLocations) FindOne

func (ll ListLocations) FindOne() ItemLocation

FindOne returns first found ItemLocation If none was found, returns an empty struct.

func (ListLocations) Serialize

func (ll ListLocations) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type ListRequest

type ListRequest struct {
	// Page number
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`

	// Page size
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`

	// Find by flag
	// Required: false
	Flag string `url:"flag,omitempty" json:"flag,omitempty"`

	// Find by name
	// Required: false
	Name string `url:"name,omitempty" json:"name,omitempty"`

	// Find by ID
	// Required: false
	ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`

	// Find by code location
	// Required: false
	LocationCode string `url:"locationCode,omitempty" json:"locationCode,omitempty"`
}

ListRequest struct to get list of locations

type Locations

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

Structure for creating request to locations

func New

func New(client interfaces.Caller) *Locations

Builder for locations endpoints

func (Locations) GetURL

func (l Locations) GetURL(ctx context.Context) (string, error)

GetURL gets the portal URL

func (Locations) List

func (l Locations) List(ctx context.Context, req ListRequest) (*ListLocations, error)

List gets list of all locations as a ListLocations struct

func (Locations) ListRaw added in v1.6.6

func (l Locations) ListRaw(ctx context.Context, req ListRequest) ([]byte, error)

ListRaw gets list of all locations as an array of bytes

Jump to

Keyboard shortcuts

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