ttapi

package
v0.0.0-...-36cdbd3 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *bool

Bool returns a pointer for a boolean value

func Int

func Int(v int) *int

Int returns a pointer for an int value

func String

func String(v string) *string

String returns a pointer for a string value

Types

type Client

type Client struct {
	Locations *LocationService
	Slots     *SlotService
}

Client is an HTTP client for the Trusted Traveler API

func NewClient

func NewClient(options Options) *Client

NewClient initializes a new Client object

type Location

type Location struct {
	ID                  int       `json:"id" header:"ID,text"`
	Name                string    `json:"name" header:"Name"`
	ShortName           string    `json:"shortName"`
	LocationType        string    `json:"locationType"`
	LocationCode        string    `json:"locationCode"`
	Address             string    `json:"address"`
	AddressAdditional   string    `json:"addressAdditional"`
	City                string    `json:"city" header:"City"`
	State               string    `json:"state" header:"State"`
	PostalCode          string    `json:"postalCode"`
	CountryCode         string    `json:"countryCode"`
	TzData              string    `json:"tzData"`
	PhoneNumber         string    `json:"phoneNumber"`
	PhoneAreaCode       string    `json:"phoneAreaCode"`
	PhoneCountryCode    string    `json:"phoneCountryCode"`
	PhoneExtension      string    `json:"phoneExtension"`
	PhoneAltNumber      string    `json:"phoneAltNumber"`
	PhoneAltAreaCode    string    `json:"phoneAltAreaCode"`
	PhoneAltCountryCode string    `json:"phoneAltCountryCode"`
	PhoneAltExtension   string    `json:"phoneAltExtension"`
	FaxNumber           string    `json:"faxNumber"`
	FaxAreaCode         string    `json:"faxAreaCode"`
	FaxCountryCode      string    `json:"faxCountryCode"`
	FaxExtension        string    `json:"faxExtension"`
	EffectiveDate       string    `json:"effectiveDate"`
	Temporary           bool      `json:"temporary"`
	InviteOnly          bool      `json:"inviteOnly"`
	Operational         bool      `json:"operational"`
	Directions          string    `json:"directions"`
	Notes               string    `json:"notes"`
	MapFileName         string    `json:"mapFileName"`
	LastUpdatedBy       string    `json:"lastUpdatedBy"`
	LastUpdatedDate     string    `json:"lastUpdatedDate"`
	CreatedDate         string    `json:"createdDate"`
	Services            []Service `json:"services" header:"Services,text"`
}

Location is a place where Trusted Traveler services are offered

func (*Location) Zone

func (l *Location) Zone() (*time.Location, error)

Zone returns a time.Location describing the time zone for the Trusted Traveler location

type LocationParameters

type LocationParameters struct {
	InviteOnly  *bool   `url:"inviteOnly,omitempty"`
	Operational *bool   `url:"operational,omitempty"`
	ServiceName *string `url:"serviceName,omitempty"`
}

LocationParameters represent filters on a list of locations. All fields are optional and will be omitted if nil.

type LocationService

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

LocationService can list locations from the schedule API

func (*LocationService) List

func (s *LocationService) List(params LocationParameters) ([]Location, error)

List fetches the list of locations based on the supplied parameters

type Options

type Options struct {
	URL string
}

Options holds configurable parameters for a Client

type Service

type Service struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Service is a Trusted Traveler service offered at a Location

func (Service) String

func (s Service) String() string

type Slot

type Slot struct {
	LocationID int    `json:"locationId" header:"Location,text"`
	Start      string `json:"startTimestamp" header:"Start"`
	End        string `json:"endTimestamp" header:"End"`
	Active     bool   `json:"active"`
	Duration   int    `json:"duration" header:"Duration"`
}

Slot is an available interview appointment

type SlotParameters

type SlotParameters struct {
	OrderBy    *string `url:"orderBy,omitempty"`
	Limit      *int    `url:"limit,omitempty"`
	LocationID *string `url:"locationId,omitempty"`
	Minimum    *int    `url:"minimum,omitempty"`
}

SlotParameters represent filters on a list of slots. All fields are optional and will be omitted if nil.

type SlotService

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

SlotService can list appointment slots from the schedule API

func (*SlotService) List

func (s *SlotService) List(params SlotParameters) ([]Slot, error)

List fetches the list of slots based on the supplied parameters

Jump to

Keyboard shortcuts

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