Documentation ¶
Index ¶
- func Float64(f float64) *float64
- type Address
- type Admin
- type AdminServiceInterface
- type AdminsService
- type Client
- func (c *Client) Admins() AdminServiceInterface
- func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) error
- func (c *Client) Hubs() HubsServiceInterface
- func (c *Client) Init(apiKey string)
- func (c *Client) NewRequest(method string, path string, body interface{}) (*http.Request, error)
- func (c *Client) Organization() OrganizationServiceInterface
- func (c *Client) Tasks() TasksServiceInterface
- func (c *Client) Teams() TeamServiceInterface
- func (c *Client) WithBaseURL(baseURL string)
- func (c *Client) Workers() WorkersServiceInterface
- type ClientInterface
- type CompletionDetails
- type Container
- type Destination
- type Hub
- type HubsService
- type HubsServiceInterface
- type Metadata
- type Organization
- type OrganizationService
- type OrganizationServiceInterface
- type Overrides
- type Recipients
- type Task
- type TaskCompletePayload
- type TaskCreatePayload
- type TaskError
- type TaskUpdatePayload
- type TasksCreatePayload
- type TasksCreateReturn
- type TasksListOptions
- type TasksListState
- type TasksService
- func (s *TasksService) Complete(ctx context.Context, taskId string, payload *TaskCompletePayload) (*Task, error)
- func (s *TasksService) Create(ctx context.Context, payload *TasksCreatePayload) ([]Task, error)
- func (s *TasksService) Delete(ctx context.Context, taskId string) (*Task, error)
- func (s *TasksService) Get(ctx context.Context, taskId string) (*Task, error)
- func (s *TasksService) List(ctx context.Context, opts *TasksListOptions) ([]Task, error)
- func (s *TasksService) Update(ctx context.Context, taskId string, payload *TaskUpdatePayload) (*Task, error)
- type TasksServiceInterface
- type Team
- type TeamService
- type TeamServiceInterface
- type UserData
- type Vehicle
- type Worker
- type WorkersListOptions
- type WorkersListState
- type WorkersLocationOptions
- type WorkersService
- type WorkersServiceInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Admin ¶ added in v1.0.6
type Admin struct { ID string `json:"id"` TimeCreated int64 `json:"timeCreated"` TimeLastModified int64 `json:"timeLastModified"` Organization string `json:"organization"` Email string `json:"email"` Type string `json:"type"` Name string `json:"name"` IsActive bool `json:"isActive"` IsReadOnly bool `json:"isReadOnly"` Phone string `json:"phone"` Teams []string `json:"teams"` }
type AdminServiceInterface ¶ added in v1.0.8
type AdminsService ¶ added in v1.0.6
type AdminsService service
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Admins ¶ added in v1.0.7
func (c *Client) Admins() AdminServiceInterface
func (*Client) Hubs ¶
func (c *Client) Hubs() HubsServiceInterface
func (*Client) NewRequest ¶
func (*Client) Organization ¶
func (c *Client) Organization() OrganizationServiceInterface
func (*Client) Tasks ¶ added in v0.3.0
func (c *Client) Tasks() TasksServiceInterface
func (*Client) Teams ¶
func (c *Client) Teams() TeamServiceInterface
func (*Client) WithBaseURL ¶
func (*Client) Workers ¶
func (c *Client) Workers() WorkersServiceInterface
type ClientInterface ¶ added in v1.0.8
type ClientInterface interface { Init(apiKey string) WithBaseURL(baseURL string) NewRequest(method string, path string, body interface{}) (*http.Request, error) Do(ctx context.Context, req *http.Request, v interface{}) error Organization() OrganizationServiceInterface Workers() WorkersServiceInterface Hubs() HubsServiceInterface Teams() TeamServiceInterface Tasks() TasksServiceInterface Admins() AdminServiceInterface }
type CompletionDetails ¶ added in v0.2.0
type Destination ¶ added in v0.2.0
type HubsService ¶
type HubsService service
type HubsServiceInterface ¶ added in v1.0.8
type Organization ¶
type Organization struct { Id string `json:"id"` TimeCreated int64 `json:"timeCreated"` TimeLastModified int64 `json:"timeLastModified"` Name string `json:"name"` Email string `json:"email"` Image string `json:"image"` Timezone string `json:"timezone"` Country string `json:"country"` Delegatees []string `json:"delegatees"` }
type OrganizationService ¶
type OrganizationService service
func (*OrganizationService) Get ¶
func (s *OrganizationService) Get(ctx context.Context) (*Organization, error)
type OrganizationServiceInterface ¶ added in v1.0.8
type OrganizationServiceInterface interface {
Get(ctx context.Context) (*Organization, error)
}
type Overrides ¶ added in v0.2.0
type Overrides struct { RecipientSkipSMSNotifications interface{} `json:"recipientSkipSMSNotifications"` RecipientNotes interface{} `json:"recipientNotes"` RecipientName interface{} `json:"recipientName"` }
type Recipients ¶ added in v0.2.0
type Recipients struct { Id string `json:"id"` Organization string `json:"organization"` TimeCreated int64 `json:"timeCreated"` TimeLastModified int64 `json:"timeLastModified"` Name string `json:"name"` Phone string `json:"phone"` Notes string `json:"notes"` SkipSMSNotifications bool `json:"skipSMSNotifications"` Metadata []interface{} `json:"metadata"` }
type Task ¶ added in v0.2.0
type Task struct { Id string `json:"id"` TimeCreated int64 `json:"timeCreated"` TimeLastModified int64 `json:"timeLastModified"` Organization string `json:"organization"` ShortID string `json:"shortId"` TrackingURL string `json:"trackingURL"` Worker string `json:"worker"` Merchant string `json:"merchant"` Executor string `json:"executor"` Creator string `json:"creator"` Dependencies []interface{} `json:"dependencies"` State int `json:"state"` CompleteAfter int64 `json:"completeAfter"` CompleteBefore interface{} `json:"completeBefore"` PickupTask bool `json:"pickupTask"` Notes string `json:"notes"` CompletionDetails CompletionDetails `json:"completionDetails"` Feedback []interface{} `json:"feedback"` Metadata []interface{} `json:"metadata"` Overrides Overrides `json:"overrides"` Container Container `json:"container"` Recipients []Recipients `json:"recipients"` EstimatedCompletionTime int64 `json:"estimatedCompletionTime"` EstimatedArrivalTime int64 `json:"estimatedArrivalTime"` Destination Destination `json:"destination"` DidAutoAssign bool `json:"didAutoAssign"` }
type TaskCompletePayload ¶ added in v1.0.1
type TaskCompletePayload struct {
CompletionDetails CompletionDetails `json:"completionDetails"`
}
type TaskCreatePayload ¶ added in v0.2.0
type TaskCreatePayload struct { Destination *Destination `json:"destination"` Recipients []*Recipients `json:"recipients"` CompleteAfter int64 `json:"completeAfter"` CompleteBefore int64 `json:"completeBefore"` Notes string `json:"notes"` Container Container `json:"container"` Metadata []Metadata `json:"metadata"` Quantity int64 `json:"quantity"` ServiceTime int64 `json:"serviceTime"` }
type TaskUpdatePayload ¶ added in v0.4.0
type TaskUpdatePayload struct { Destination *Destination `json:"destination,omitempty"` Recipients []*Recipients `json:"recipients,omitempty"` CompleteAfter int64 `json:"completeAfter,omitempty"` Notes string `json:"notes,omitempty"` Container Container `json:"container,omitempty"` CompletionDetails CompletionDetails `json:"completionDetails"` State int `json:"state"` }
type TasksCreatePayload ¶ added in v0.2.0
type TasksCreatePayload struct {
Tasks []TaskCreatePayload `json:"tasks"`
}
type TasksCreateReturn ¶ added in v0.3.0
type TasksCreateReturn struct { Tasks []Task `json:"tasks"` Errors []struct { Error TaskError `json:"error"` Task TaskCreatePayload `json:"task"` } `json:"errors"` }
type TasksListOptions ¶ added in v0.2.0
type TasksListOptions struct { From int64 `url:"from"` States []TasksListState `url:"state,omitempty"` Worker string `url:"worker,omitempty"` }
type TasksListState ¶ added in v0.2.0
type TasksListState string
var ( TasksListStateUnassigned TasksListState = "0" TasksListStateAssigned TasksListState = "1" TasksListStateActive TasksListState = "2" TasksListStateCompleted TasksListState = "3" )
type TasksService ¶ added in v0.2.0
type TasksService service
func (*TasksService) Complete ¶ added in v1.0.1
func (s *TasksService) Complete(ctx context.Context, taskId string, payload *TaskCompletePayload) (*Task, error)
func (*TasksService) Create ¶ added in v0.2.0
func (s *TasksService) Create(ctx context.Context, payload *TasksCreatePayload) ([]Task, error)
Create tasks https://docs.onfleet.com/reference#create-tasks-in-batch
func (*TasksService) Delete ¶ added in v1.0.3
Delete task https://docs.onfleet.com/reference/delete-task
func (*TasksService) List ¶ added in v0.2.0
func (s *TasksService) List(ctx context.Context, opts *TasksListOptions) ([]Task, error)
List all tasks https://docs.onfleet.com/reference#list-tasks
func (*TasksService) Update ¶ added in v0.4.0
func (s *TasksService) Update(ctx context.Context, taskId string, payload *TaskUpdatePayload) (*Task, error)
Update task https://docs.onfleet.com/reference#update-task
type TasksServiceInterface ¶ added in v1.0.8
type TasksServiceInterface interface { List(ctx context.Context, opts *TasksListOptions) ([]Task, error) Create(ctx context.Context, payload *TasksCreatePayload) ([]Task, error) Update(ctx context.Context, taskId string, payload *TaskUpdatePayload) (*Task, error) Complete(ctx context.Context, taskId string, payload *TaskCompletePayload) (*Task, error) Get(ctx context.Context, taskId string) (*Task, error) Delete(ctx context.Context, taskId string) (*Task, error) }
type TeamService ¶ added in v1.0.8
type TeamService service
type TeamServiceInterface ¶ added in v1.0.8
type Worker ¶
type Worker struct { Id string `json:"id"` TimeCreated int64 `json:"timeCreated"` TimeLastModified int64 `json:"timeLastModified"` Organization string `json:"organization"` Name string `json:"name"` DisplayName string `json:"displayName"` Phone string `json:"phone"` ActiveTask *string `json:"activeTask"` Tasks []string `json:"tasks"` OnDuty bool `json:"onDuty"` IsResponding bool `json:"isResponding"` TimeLastSeen *int64 `json:"timeLastSeen"` Capacity int `json:"capacity"` AccountStatus string `json:"accountStatus"` ImageUrl *string `json:"imageUrl"` Location []float64 `json:"location"` DelayTime *float64 `json:"delayTime"` Timezone *string `json:"timezone"` Teams []string `json:"teams"` UserData UserData `json:"userData"` Vehicle *Vehicle `json:"vehicle"` HasRecentlyUsedSpoofedLocations bool `json:"hasRecentlyUsedSpoofedLocations"` }
type WorkersListOptions ¶
type WorkersListOptions struct { Teams []string `url:"teams,omitempty"` States []WorkersListState `url:"states,omitempty"` Phones []string `url:"phones,omitempty"` }
type WorkersListState ¶
type WorkersListState string
var ( WorkersListStateOffDuty WorkersListState = "0" WorkersListStateIdle WorkersListState = "1" WorkersListStateActive WorkersListState = "2" )
type WorkersLocationOptions ¶
type WorkersService ¶
type WorkersService service
func (*WorkersService) Get ¶ added in v0.7.0
Get worker https://docs.onfleet.com/reference#get-single-worker
func (*WorkersService) List ¶
func (s *WorkersService) List(ctx context.Context, opts *WorkersListOptions) ([]Worker, error)
List list all workers https://docs.onfleet.com/reference#list-workers
func (*WorkersService) Location ¶
func (s *WorkersService) Location(ctx context.Context, opts *WorkersLocationOptions) ([]Worker, error)
Location get workers by location https://docs.onfleet.com/reference#get-workers-by-location
Source Files ¶
Click to show internal directories.
Click to hide internal directories.