tripit

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIUri holds the TripIt API uri.
	APIUri = "https://api.tripit.com"
	// APIVersion holds the TripIt API version.
	APIVersion = "v1"

	// ListTripsEndpoint is the API endoint to list trips.
	ListTripsEndpoint = "/list/trip"
	// ListObjectsEndpoint is the API endoint to list objects.
	ListObjectsEndpoint = "/list/object"
	// ListPointsProgramsEndpoint is the API endoint to list points programs.
	ListPointsProgramsEndpoint = "/list/points_program"

	// EndpointFormatGetObject is the endpoint format to get an object.
	EndpointFormatGetObject = "get/%s/id/%s/%s"
	// EndpointFormatDeleteObject is the endpoint format to delete an object.
	EndpointFormatDeleteObject = "delete/%s/id/%s"
	// EndpointFormatReplaceObject is the endpoint format to replace an object.
	EndpointFormatReplaceObject = "replace/%s/id/%s"

	// FilterNone is the filter type representing no filter.
	FilterNone TypeFilter = "" // valid on trip, object, points_program
	// FilterTraveler is the filter type for filtering on travelers.
	FilterTraveler TypeFilter = "traveler" // valid on trip, object. Values: true, false, all
	// FilterPast is the filter type for filtering over past objects.
	FilterPast TypeFilter = "past" // valid on trip, object. Values: true, false
	// FilterModifiedSince is the filter type for filtering objects based on when they were modified.
	FilterModifiedSince TypeFilter = "modified_since" // valid on trip, object. Values: integer
	// FilterIncludeObjects is the filter type for including objects.
	FilterIncludeObjects TypeFilter = "include_objects" // valid on trip. Values: true, false
	// FilterTripID is the filter type for filtering by trip ID.
	FilterTripID TypeFilter = "trip_id" // valid on object. Values: integer trip id
	// FilterType is the filter type for filtering by object type.
	FilterType TypeFilter = "type" // valid on object. Values: all object types
	// FilterPageNum is the filter type for the page number.
	FilterPageNum TypeFilter = "page_num"
	// FilterPageSize is the filter type for the page size.
	FilterPageSize TypeFilter = "page_size"

	// TypeActivity is the activity object type.
	TypeActivity Type = "activity"
	// TypeCar is the car object type.
	TypeCar Type = "car"
	// TypeCruise is the cruise object type.
	TypeCruise Type = "cruise"
	// TypeDirections is the directions object type.
	TypeDirections Type = "directions"
	// TypeFlight is the air object type.
	TypeFlight Type = "air"
	// TypeLodging is the lodging object type.
	TypeLodging Type = "lodging"
	// TypeMap is the map object type.
	TypeMap Type = "map"
	// TypeNote is the note object type.
	TypeNote Type = "note"
	// TypePointsProgram is the points_program object type.
	TypePointsProgram Type = "points_program"
	// TypeProfile is the profile object type.
	TypeProfile Type = "profile"
	// TypeRail is the rail object type.
	TypeRail Type = "rail"
	// TypeRestaurant is the restaurant object type.
	TypeRestaurant Type = "restaurant"
	// TypeSegment is the segment object type.
	TypeSegment Type = "segment"
	// TypeTransport is the transport object type.
	TypeTransport Type = "transport"
	// TypeTrip is the trip object type.
	TypeTrip Type = "trip"
	// TypeWeather is the weather object type.
	TypeWeather Type = "weather"

	// FlightStatusNotMonitorable means an AirSegment in this state is usually in this state because the TripIt platform doesn't have enough information about the flight to monitor it.
	FlightStatusNotMonitorable FlightStatusCode = 100

	// FlightStatusNotMonitored means the flight is either not a real flight or TripIt doesn't have a record of it in its database.
	FlightStatusNotMonitored FlightStatusCode = 200

	// FlightStatusScheduled means the flight is monitored but the TripIt platform hasn't seen any updates to the flight yet.
	FlightStatusScheduled FlightStatusCode = 300
	// FlightStatusOnTime means the flight is currently considered to be on time.
	FlightStatusOnTime FlightStatusCode = 301
	// FlightStatusInFlightOnTime means the flight is currently in the air and is considered to be on time.
	FlightStatusInFlightOnTime FlightStatusCode = 302
	// FlightStatusArrivedOnTime means the flight has arrived and the actual arrival time was within 14 minutes of the ScheduledArrivalDateTime.
	FlightStatusArrivedOnTime FlightStatusCode = 303

	// FlightStatusCancelled means the flight has been cancelled.
	FlightStatusCancelled FlightStatusCode = 400
	// FlightStatusDelayed means the flight is currently considered to be delayed.
	FlightStatusDelayed FlightStatusCode = 401
	// FlightStatusInFlightLate means the flight is currently in the air and is considered to be late.
	FlightStatusInFlightLate FlightStatusCode = 402
	// FlightStatusArrivedLate means the flight has arrived and the actual arrival time was more than 14 minutes after the ScheduledArrivalDateTime.
	FlightStatusArrivedLate FlightStatusCode = 403
	// FlightStatusDiverted means the flight was diverted to an airport other than the one it was originally going to fly into.
	FlightStatusDiverted FlightStatusCode = 404
	// FlightStatusPossiblyDelayed means the flight has possibly been delayed.
	FlightStatusPossiblyDelayed FlightStatusCode = 405
	// FlightStatusInFlightPossiblyLate means the flight is in flight and may possibly be late.
	FlightStatusInFlightPossiblyLate FlightStatusCode = 406
	// FlightStatusArrivedPossiblyLate means the flight has arrived but may possibly be late.
	FlightStatusArrivedPossiblyLate FlightStatusCode = 407
	// FlightStatusUnknown means the flight status is unknown.
	FlightStatusUnknown FlightStatusCode = 408

	// TransportDetailTypeFerry is the detail type code for ferry transport.
	TransportDetailTypeFerry DetailTypeCode = "F"
	// TransportDetailTypeGroundTransportation is the detail type code for ground transport.
	TransportDetailTypeGroundTransportation DetailTypeCode = "G"

	// ActivityDetailTypeConcert is the activity detail type code for a concert.
	ActivityDetailTypeConcert DetailTypeCode = "C"
	// ActivityDetailTypeTheatre is the activity detail type code for the theatre.
	ActivityDetailTypeTheatre DetailTypeCode = "H"
	// ActivityDetailTypeMeeting is the activity detail type code for a meeting.
	ActivityDetailTypeMeeting DetailTypeCode = "M"
	// ActivityDetailTypeTour is the activity detail type code for a tour.
	ActivityDetailTypeTour DetailTypeCode = "T"

	// CruiseDetailTypePortOfCall is the detail type code for a cruise port of call.
	CruiseDetailTypePortOfCall DetailTypeCode = "P"

	// NoteDetailTypeArticle is the note detail type code for an article.
	NoteDetailTypeArticle DetailTypeCode = "A"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Activities added in v0.1.1

type Activities []Activity

Activities is a group of Activity objects.

func (*Activities) UnmarshalJSON added in v0.1.1

func (p *Activities) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type Activity

type Activity struct {
	ID                   string         `json:"id,omitempty"`                        // optional, read-only
	TripID               string         `json:"trip_id,omitempty"`                   // optional
	IsClientTraveler     bool           `json:"is_client_traveler,string,omitempty"` // optional, read-only
	RelativeURL          string         `json:"relative_url,omitempty"`              // optional, read-only
	DisplayName          string         `json:"display_name,omitempty"`              // optional
	Images               []Image        `json:"Image,omitempty"`                     // optional
	CancellationDateTime DateTime       `json:"CancellationDateTime,omitempty"`      // optional
	BookingDate          string         `json:"booking_date,omitempty"`              // optional, xs:date
	BookingRate          string         `json:"booking_rate,omitempty"`              // optional
	BookingSiteConfNum   string         `json:"booking_site_conf_num,omitempty"`     // optional
	BookingSiteName      string         `json:"booking_site_name,omitempty"`         // optional
	BookingSitePhone     string         `json:"booking_site_phone,omitempty"`        // optional
	BookingSiteURL       string         `json:"booking_site_url,omitempty"`          // optional
	RecordLocator        string         `json:"record_locator,omitempty"`            // optional
	SupplierConfNum      string         `json:"supplier_conf_num,omitempty"`         // optional
	SupplierContact      string         `json:"supplier_contact,omitempty"`          // optional
	SupplierEmailAddress string         `json:"supplier_email_address,omitempty"`    // optional
	SupplierName         string         `json:"supplier_name,omitempty"`             // optional
	SupplierPhone        string         `json:"supplier_phone,omitempty"`            // optional
	SupplierURL          string         `json:"supplier_url,omitempty"`              // optional
	IsPurchased          bool           `json:"is_purchased,string,omitempty"`       // optional
	Notes                string         `json:"notes,omitempty"`                     // optional
	Restrictions         string         `json:"restrictions,omitempty"`              // optional
	TotalCost            string         `json:"total_cost,omitempty"`                // optional
	StartDateTime        DateTime       `json:"StartDateTime,omitempty"`             // optional
	EndTime              string         `json:"end_time,omitempty"`                  // optional, xs:time
	Address              Address        `json:"Address,omitempty"`                   // optional
	Participants         Travelers      `json:"Participant,omitempty"`               // optional
	DetailTypeCode       DetailTypeCode `json:"detail_type_code,omitempty"`          // optional
	LocationName         string         `json:"location_name,omitempty"`             // optional
}

Activity contains details about activities like museum, theatre, and other events.

type Address

type Address struct {
	Address   string  `json:"address,omitempty" xml:"address"`            // optional
	Addr1     string  `json:"addr1,omitempty" xml:"addr1"`                // optional
	Addr2     string  `json:"addr2,omitempty" xml:"addr2"`                // optional
	City      string  `json:"city,omitempty" xml:"city"`                  // optional
	State     string  `json:"state,omitempty" xml:"state"`                // optional
	Zip       string  `json:"zip,omitempty" xml:"zip"`                    // optional
	Country   string  `json:"country,omitempty" xml:"country"`            // optional
	Latitude  float64 `json:"latitude,string,omitempty" xml:"latitude"`   // optional, read-only
	Longitude float64 `json:"longitude,string,omitempty" xml:"longitude"` // optional, read-only
}

Address represents the address of a location. For create, use either: - address for single-line addresses. - addr1, addr2, city, state, zip, and country for multi-line addresses. Multi-line address will be ignored if single-line address is present. See documentation for more information.

type Car

type Car struct {
	ID                   string    `json:"id,omitempty" xml:"id"`                                         // optional, read-only
	TripID               string    `json:"trip_id,omitempty" xml:"trip_id"`                               // optional
	IsClientTraveler     bool      `json:"is_client_traveler,string,omitempty" xml:"is_client_traveler"`  // optional, read-only
	RelativeURL          string    `json:"relative_url,omitempty" xml:"relative_url"`                     // optional, read-only
	DisplayName          string    `json:"display_name,omitempty" xml:"display_name"`                     // optional
	Images               []Image   `json:"Image,omitempty" xml:"Image"`                                   // optional
	CancellationDateTime DateTime  `json:"CancellationDateTime,omitempty" xml:"CancellationDateTime"`     // optional
	BookingDate          string    `json:"booking_date,omitempty" xml:"booking_date"`                     // optional, xs:date
	BookingRate          string    `json:"booking_rate,omitempty" xml:"booking_rate"`                     // optional
	BookingSiteConfNum   string    `json:"booking_site_conf_num,omitempty" xml:"booking_site_conf_num"`   // optional
	BookingSiteName      string    `json:"booking_site_name,omitempty" xml:"booking_site_name"`           // optional
	BookingSitePhone     string    `json:"booking_site_phone,omitempty" xml:"booking_site_phone"`         // optional
	BookingSiteURL       string    `json:"booking_site_url,omitempty" xml:"booking_site_url"`             // optional
	RecordLocator        string    `json:"record_locator,omitempty" xml:"record_locator"`                 // optional
	SupplierConfNum      string    `json:"supplier_conf_num,omitempty" xml:"supplier_conf_num"`           // optional
	SupplierContact      string    `json:"supplier_contact,omitempty" xml:"supplier_contact"`             // optional
	SupplierEmailAddress string    `json:"supplier_email_address,omitempty" xml:"supplier_email_address"` // optional
	SupplierName         string    `json:"supplier_name,omitempty" xml:"supplier_name"`                   // optional
	SupplierPhone        string    `json:"supplier_phone,omitempty" xml:"supplier_phone"`                 // optional
	SupplierURL          string    `json:"supplier_url,omitempty" xml:"supplier_url"`                     // optional
	IsPurchased          bool      `json:"is_purchased,string,omitempty" xml:"is_purchased"`              // optional
	Notes                string    `json:"notes,omitempty" xml:"notes"`                                   // optional
	Restrictions         string    `json:"restrictions,omitempty" xml:"restrictions"`                     // optional
	TotalCost            string    `json:"total_cost,omitempty" xml:"total_cost"`                         // optional
	StartDateTime        DateTime  `json:"StartDateTime,omitempty" xml:"StartDateTime"`                   // optional
	EndDateTime          DateTime  `json:"EndDateTime,omitempty" xml:"EndDateTime"`                       // optional
	StartLocationAddress Address   `json:"StartLocationAddress,omitempty" xml:"StartLocationAddress"`     // optional
	EndLocationAddress   Address   `json:"EndLocationAddress,omitempty" xml:"EndLocationAddress"`         // optional
	Drivers              Travelers `json:"Driver,omitempty" xml:"Driver"`                                 // optional
	StartLocationHours   string    `json:"start_location_hours,omitempty" xml:"start_location_hours"`     // optional
	StartLocationName    string    `json:"start_location_name,omitempty" xml:"start_location_name"`       // optional
	StartLocationPhone   string    `json:"start_location_phone,omitempty" xml:"start_location_phone"`     // optional
	EndLocationHours     string    `json:"end_location_hours,omitempty" xml:"end_location_hours"`         // optional
	EndLocationName      string    `json:"end_location_name,omitempty" xml:"end_location_name"`           // optional
	EndLocationPhone     string    `json:"end_location_phone,omitempty" xml:"end_location_phone"`         // optional
	CarDescription       string    `json:"car_description,omitempty" xml:"car_description"`               // optional
	CarType              string    `json:"car_type,omitempty" xml:"car_type"`                             // optional
	MileageCharges       string    `json:"mileage_charges,omitempty" xml:"mileage_charges"`               // optional
}

Car contains information about rental cars. car cancellation remarks should be in restrictions. car pickup instructions should be in notes. car daily rate should be in booking_rate.

type Cars

type Cars []Car

Cars is a group of Car objects.

func (*Cars) UnmarshalJSON

func (p *Cars) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type Client

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

Client holds the information needed for TripIt API authentication.

func New

func New(username, password string) *Client

New creates a new TripIt API client.

func (*Client) Create

func (c *Client) Create(req Request) (*Response, error)

Create takes a Request object and creates it.

func (*Client) DeleteActivity

func (c *Client) DeleteActivity(id string) error

DeleteActivity deletes the specific activity with the given id.

func (*Client) DeleteCar

func (c *Client) DeleteCar(id string) error

DeleteCar deletes the specific car with the given id.

func (*Client) DeleteCruise

func (c *Client) DeleteCruise(id string) error

DeleteCruise deletes the specific cruise with the given id.

func (*Client) DeleteDirections

func (c *Client) DeleteDirections(id string) error

DeleteDirections deletes the specific directions with the given id.

func (*Client) DeleteFlight

func (c *Client) DeleteFlight(id string) error

DeleteFlight deletes the specific flight with the given id.

func (*Client) DeleteLodging

func (c *Client) DeleteLodging(id string) error

DeleteLodging deletes the specific lodging with the given id.

func (*Client) DeleteMap

func (c *Client) DeleteMap(id string) error

DeleteMap deletes the specific map with the given id.

func (*Client) DeleteNote

func (c *Client) DeleteNote(id string) error

DeleteNote deletes the specific note with the given id.

func (*Client) DeleteRail

func (c *Client) DeleteRail(id string) error

DeleteRail deletes the specific rail with the given id.

func (*Client) DeleteRestaurant

func (c *Client) DeleteRestaurant(id string) error

DeleteRestaurant deletes the specific restaurant with the given id.

func (*Client) DeleteSegment

func (c *Client) DeleteSegment(id string) error

DeleteSegment deletes the specific segment with the given id.

func (*Client) DeleteTransport

func (c *Client) DeleteTransport(id string) error

DeleteTransport deletes the specific transport with the given id.

func (*Client) DeleteTrip

func (c *Client) DeleteTrip(id string) error

DeleteTrip deletes the specific trip with the given id.

func (*Client) DeleteTripParticipant

func (c *Client) DeleteTripParticipant(tripID, profileRef string) error

DeleteTripParticipant deletes the specific participant from the trip with the given id.

func (*Client) GetActivity

func (c *Client) GetActivity(id string, filters ...Filter) (Activity, error)

GetActivity returns the specific activity for the given id.

func (*Client) GetCar

func (c *Client) GetCar(id string, filters ...Filter) (Car, error)

GetCar returns the specific car for the given id.

func (*Client) GetCruise

func (c *Client) GetCruise(id string, filters ...Filter) (Cruise, error)

GetCruise returns the specific cruise for the given id.

func (*Client) GetDirections

func (c *Client) GetDirections(id string, filters ...Filter) (Direction, error)

GetDirections returns the specific directions for the given id.

func (*Client) GetFlight

func (c *Client) GetFlight(id string, filters ...Filter) (Flight, error)

GetFlight returns the specific flight for the given id.

func (*Client) GetLodging

func (c *Client) GetLodging(id string, filters ...Filter) (Lodging, error)

GetLodging returns the specific lodging for the given id.

func (*Client) GetMap

func (c *Client) GetMap(id string, filters ...Filter) (Map, error)

GetMap returns the specific map for the given id.

func (*Client) GetNote

func (c *Client) GetNote(id string, filters ...Filter) (Note, error)

GetNote returns the specific note for the given id.

func (*Client) GetPointsProgram

func (c *Client) GetPointsProgram(id string, filters ...Filter) (PointsProgram, error)

GetPointsProgram returns the specific points program for the given id.

func (*Client) GetProfile

func (c *Client) GetProfile(id string, filters ...Filter) (Profile, error)

GetProfile returns the specific profile for the given id.

func (*Client) GetRail

func (c *Client) GetRail(id string, filters ...Filter) (Rail, error)

GetRail returns the specific rail for the given id.

func (*Client) GetRestaurant

func (c *Client) GetRestaurant(id string, filters ...Filter) (Restaurant, error)

GetRestaurant returns the specific restaurant for the given id.

func (*Client) GetTransport

func (c *Client) GetTransport(id string, filters ...Filter) (Transport, error)

GetTransport returns the specific transport for the given id.

func (*Client) GetTrip

func (c *Client) GetTrip(id string, filters ...Filter) (Trip, error)

GetTrip returns the specific trip for the given id.

func (*Client) GetWeather

func (c *Client) GetWeather(id string, filters ...Filter) (Weather, error)

GetWeather returns the specific weather information for the given id.

func (*Client) ListObjects

func (c *Client) ListObjects(filters ...Filter) (*Response, error)

ListObjects returns a list of objects and other data depending on the filters passed.

func (*Client) ListPointsPrograms

func (c *Client) ListPointsPrograms(filters ...Filter) ([]PointsProgram, error)

ListPointsPrograms returns a list of points programs depending on the filters passed.

func (*Client) ListTrips

func (c *Client) ListTrips(filters ...Filter) (*Response, error)

ListTrips returns a list of trips and other object data depending on the filters passed.

func (*Client) ReplaceActivity

func (c *Client) ReplaceActivity(id string, activity Activity) (*Response, error)

ReplaceActivity replaces the activity with the given id.

func (*Client) ReplaceCar

func (c *Client) ReplaceCar(id string, car Car) (*Response, error)

ReplaceCar replaces the car with the given id.

func (*Client) ReplaceCruise

func (c *Client) ReplaceCruise(id string, cruise Cruise) (*Response, error)

ReplaceCruise replaces the cruise with the given id.

func (*Client) ReplaceDirections

func (c *Client) ReplaceDirections(id string, directions Direction) (*Response, error)

ReplaceDirections replaces the directions with the given id.

func (*Client) ReplaceFlight

func (c *Client) ReplaceFlight(id string, flight Flight) (*Response, error)

ReplaceFlight replaces the flight with the given id.

func (*Client) ReplaceLodging

func (c *Client) ReplaceLodging(id string, lodging Lodging) (*Response, error)

ReplaceLodging replaces the lodging with the given id.

func (*Client) ReplaceMap

func (c *Client) ReplaceMap(id string, m Map) (*Response, error)

ReplaceMap replaces the map with the given id.

func (*Client) ReplaceNote

func (c *Client) ReplaceNote(id string, note Note) (*Response, error)

ReplaceNote replaces the note with the given id.

func (*Client) ReplaceRail

func (c *Client) ReplaceRail(id string, rail Rail) (*Response, error)

ReplaceRail replaces the rail with the given id.

func (*Client) ReplaceRestaurant

func (c *Client) ReplaceRestaurant(id string, restaurant Restaurant) (*Response, error)

ReplaceRestaurant replaces the restaurant with the given id.

func (*Client) ReplaceTransport

func (c *Client) ReplaceTransport(id string, transport Transport) (*Response, error)

ReplaceTransport replaces the transport with the given id.

func (*Client) ReplaceTrip

func (c *Client) ReplaceTrip(id string, trip Trip) (*Response, error)

ReplaceTrip replaces the trip with the given id.

type ClosenessMatch

type ClosenessMatch struct {
	Attributes ClosenessMatchAttributes `json:"_attributes" xml:"attributes"` // read-only, Use the profile_ref attribute to reference a Profile
}

ClosenessMatch refers to nearby users. All ClosenessMatch elements are read-only.

type ClosenessMatchAttributes

type ClosenessMatchAttributes struct {
	ProfileRef string `json:"profile_ref" xml:"profile_ref"` // read-only, Use the profile_ref attribute to reference a Profile
}

ClosenessMatchAttributes links to profiles of nearby users.

type ClosenessMatches

type ClosenessMatches struct {
	ClosenessMatches []ClosenessMatch `json:"Match,omitempty" xml:"Match"` // optional, ClosenessMatches are read-only
}

ClosenessMatches are TripIt users who are near this trip.

type ConnectionRequest

type ConnectionRequest struct{}

ConnectionRequest stores connection request data.

type Cruise

type Cruise struct {
	ID                   string          `json:"id,omitempty"`                        // optional, read-only
	TripID               string          `json:"trip_id,omitempty"`                   // optional
	IsClientTraveler     bool            `json:"is_client_traveler,string,omitempty"` // optional, read-only
	RelativeURL          string          `json:"relative_url,omitempty"`              // optional, read-only
	DisplayName          string          `json:"display_name,omitempty"`              // optional
	Images               []Image         `json:"Image,omitempty"`                     // optional
	CancellationDateTime DateTime        `json:"CancellationDateTime,omitempty"`      // optional
	BookingDate          string          `json:"booking_date,omitempty"`              // optional, xs:date
	BookingRate          string          `json:"booking_rate,omitempty"`              // optional
	BookingSiteConfNum   string          `json:"booking_site_conf_num,omitempty"`     // optional
	BookingSiteName      string          `json:"booking_site_name,omitempty"`         // optional
	BookingSitePhone     string          `json:"booking_site_phone,omitempty"`        // optional
	BookingSiteURL       string          `json:"booking_site_url,omitempty"`          // optional
	RecordLocator        string          `json:"record_locator,omitempty"`            // optional
	SupplierConfNum      string          `json:"supplier_conf_num,omitempty"`         // optional
	SupplierContact      string          `json:"supplier_contact,omitempty"`          // optional
	SupplierEmailAddress string          `json:"supplier_email_address,omitempty"`    // optional
	SupplierName         string          `json:"supplier_name,omitempty"`             // optional
	SupplierPhone        string          `json:"supplier_phone,omitempty"`            // optional
	SupplierURL          string          `json:"supplier_url,omitempty"`              // optional
	IsPurchased          bool            `json:"is_purchased,string,omitempty"`       // optional
	Notes                string          `json:"notes,omitempty"`                     // optional
	Restrictions         string          `json:"restrictions,omitempty"`              // optional
	TotalCost            string          `json:"total_cost,omitempty"`                // optional
	Segments             []CruiseSegment `json:"Segment,omitempty"`
	Travelers            Travelers       `json:"Traveler,omitempty"`     // optional
	CabinNumber          string          `json:"cabin_number,omitempty"` // optional
	CabinType            string          `json:"cabin_type,omitempty"`   // optional
	Dining               string          `json:"dining,omitempty"`       // optional
	ShipName             string          `json:"ship_name,omitempty"`    // optional
}

Cruise contains information about cruises.

type CruiseSegment

type CruiseSegment struct {
	StartDateTime   DateTime       `json:"StartDateTime,omitempty"`    // optional
	EndDateTime     DateTime       `json:"EndDateTime,omitempty"`      // optional
	LocationAddress Address        `json:"LocationAddress,omitempty"`  // optional
	LocationName    string         `json:"location_name,omitempty"`    // optional
	DetailTypeCode  DetailTypeCode `json:"detail_type_code,omitempty"` // optional
	ID              string         `json:"id,omitempty"`               // optional, read-only
}

CruiseSegment contains details about indivual cruise segments.

type Cruises added in v0.1.1

type Cruises []Cruise

Cruises is a group of Cruise objects.

func (*Cruises) UnmarshalJSON added in v0.1.1

func (p *Cruises) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type DateTime

type DateTime struct {
	Date      string `json:"date,omitempty" xml:"date"`             // optional, xs:date
	Time      string `json:"time,omitempty" xml:"time"`             // optional, xs:time
	Timezone  string `json:"timezone,omitempty" xml:"timezone"`     // optional, read-only
	UTCOffset string `json:"utc_offset,omitempty" xml:"utc_offset"` // optional, read-only
}

DateTime stores date and time zone information.

func (*DateTime) Parse

func (d *DateTime) Parse() (time.Time, error)

Parse converts the DateTime to a time.Time with the respective Date, Time, and Timezone information from the DateTime object.

type DetailTypeCode

type DetailTypeCode string

DetailTypeCode defines the detail type code for an object.

type Direction added in v0.1.1

type Direction struct {
	ID               string   `json:"id,omitempty"`                        // optional, read-only
	TripID           string   `json:"trip_id,omitempty"`                   // optional
	IsClientTraveler bool     `json:"is_client_traveler,string,omitempty"` // optional, read-only
	RelativeURL      string   `json:"relative_url,omitempty"`              // optional, read-only
	DisplayName      string   `json:"display_name,omitempty"`              // optional
	Images           []Image  `json:"Image,omitempty"`                     // optional
	DateTime         DateTime `json:"DateTime,omitempty"`                  // optional
	StartAddress     Address  `json:"StartAddress,omitempty"`              // optional
	EndAddress       Address  `json:"EndAddress,omitempty"`                // optional
}

Direction contains addresses to show directions for on the trip.

type Directions

type Directions []Direction

Directions is a group of Direction objects.

func (*Directions) UnmarshalJSON added in v0.1.1

func (p *Directions) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type Error

type Error struct {
	Code              int     `json:"code,string,omitempty" xml:"code"`                               // read-only
	DetailedErrorCode float64 `json:"detailed_error_code,string,omitempty" xml:"detailed_error_code"` // optional, read-only
	Description       string  `json:"description,omitempty" xml:"description"`                        // read-only
	EntityType        string  `json:"entity_type,omitempty" xml:"entity_type"`                        // read-only
	Timestamp         string  `json:"timestamp,omitempty" xml:"timestamp"`                            // read-only, xs:datetime
}

Error is returned from TripIt on error conditions.

type Event

type Event struct {
	Title              string
	Description        string
	AirportCode        string
	Start              calendar.EventDateTime
	End                calendar.EventDateTime
	ID                 string
	SegmentID          string
	ConfirmationNumber string
}

Event holds the data we will use when creating calendar events for flights, activities, and other TripIt API objects.

type Filter

type Filter struct {
	Type  TypeFilter
	Value string
}

Filter holds the information about a filter including the type and value.

func (Filter) String

func (f Filter) String() string

String returns the string representation of a filter.

type Flight

type Flight struct {
	ID                   string         `json:"id,omitempty" xml:"id"`                                         // optional, read-only
	TripID               string         `json:"trip_id,omitempty" xml:"trip_id"`                               // optional
	IsClientTraveler     bool           `json:"is_client_traveler,string,omitempty" xml:"is_client_traveler"`  // optional, read-only
	RelativeURL          string         `json:"relative_url,omitempty" xml:"relative_url"`                     // optional, read-only
	DisplayName          string         `json:"display_name,omitempty" xml:"display_name"`                     // optional
	Images               []Image        `json:"Image,omitempty" xml:"Image"`                                   // optional
	CancellationDateTime DateTime       `json:"CancellationDateTime,omitempty" xml:"CancellationDateTime"`     // optional
	BookingDate          string         `json:"booking_date,omitempty" xml:"booking_date"`                     // optional, xs:date
	BookingRate          string         `json:"booking_rate,omitempty" xml:"booking_rate"`                     // optional
	BookingSiteConfNum   string         `json:"booking_site_conf_num,omitempty" xml:"booking_site_conf_num"`   // optional
	BookingSiteName      string         `json:"booking_site_name,omitempty" xml:"booking_site_name"`           // optional
	BookingSitePhone     string         `json:"booking_site_phone,omitempty" xml:"booking_site_phone"`         // optional
	BookingSiteURL       string         `json:"booking_site_url,omitempty" xml:"booking_site_url"`             // optional
	RecordLocator        string         `json:"record_locator,omitempty" xml:"record_locator"`                 // optional
	SupplierConfNum      string         `json:"supplier_conf_num,omitempty" xml:"supplier_conf_num"`           // optional
	SupplierContact      string         `json:"supplier_contact,omitempty" xml:"supplier_contact"`             // optional
	SupplierEmailAddress string         `json:"supplier_email_address,omitempty" xml:"supplier_email_address"` // optional
	SupplierName         string         `json:"supplier_name,omitempty" xml:"supplier_name"`                   // optional
	SupplierPhone        string         `json:"supplier_phone,omitempty" xml:"supplier_phone"`                 // optional
	SupplierURL          string         `json:"supplier_url,omitempty" xml:"supplier_url"`                     // optional
	IsPurchased          bool           `json:"is_purchased,string,omitempty" xml:"is_purchased"`              // optional
	Notes                string         `json:"notes,omitempty" xml:"notes"`                                   // optional
	Restrictions         string         `json:"restrictions,omitempty" xml:"restrictions"`                     // optional
	TotalCost            string         `json:"total_cost,omitempty" xml:"total_cost"`                         // optional
	Segments             FlightSegments `json:"Segment,omitempty" xml:"Segment"`
	Travelers            Travelers      `json:"Traveler,omitempty" xml:"Traveler"` // optional
}

Flight contains data about a flight.

func (Flight) GetFlightSegmentsAsEvents

func (f Flight) GetFlightSegmentsAsEvents() ([]Event, error)

GetFlightSegmentsAsEvents returns an Event object for each of the flight segments in the given flight object.

type FlightSegment

type FlightSegment struct {
	ID                    string       `json:"id,omitempty" xml:"id"`                                                  // optional, read-only
	Status                FlightStatus `json:"Status,omitempty" xml:"Status"`                                          // optional
	StartDateTime         DateTime     `json:"StartDateTime,omitempty" xml:"StartDateTime"`                            // optional
	EndDateTime           DateTime     `json:"EndDateTime,omitempty" xml:"EndDateTime"`                                // optional
	StartAirportCode      string       `json:"start_airport_code,omitempty" xml:"start_airport_code"`                  // optional
	StartAirportLatitude  float64      `json:"start_airport_latitude,string,omitempty" xml:"start_airport_latitude"`   // optional, read-only
	StartAirportLongitude float64      `json:"start_airport_longitude,string,omitempty" xml:"start_airport_longitude"` // optional, read-only
	StartCityName         string       `json:"start_city_name,omitempty" xml:"start_city_name"`                        // optional
	StartGate             string       `json:"start_gate,omitempty" xml:"start_gate"`                                  // optional
	StartTerminal         string       `json:"start_terminal,omitempty" xml:"start_terminal"`                          // optional
	EndAirportCode        string       `json:"end_airport_code,omitempty" xml:"end_airport_code"`                      // optional
	EndAirportLatitude    float64      `json:"end_airport_latitude,string,omitempty" xml:"end_airport_latitude"`       // optional, read-only
	EndAirportLongitude   float64      `json:"end_airport_longitude,string,omitempty" xml:"end_airport_longitude"`     // optional, read-only
	EndCityName           string       `json:"end_city_name,omitempty" xml:"end_city_name"`                            // optional
	EndGate               string       `json:"end_gate,omitempty" xml:"end_gate"`                                      // optional
	EndTerminal           string       `json:"end_terminal,omitempty" xml:"end_terminal"`                              // optional
	MarketingAirline      string       `json:"marketing_airline,omitempty" xml:"marketing_airline"`                    // optional
	MarketingAirlineCode  string       `json:"marketing_airline_code,omitempty" xml:"marketing_airline_code"`          // optional, read-only
	MarketingFlightNumber string       `json:"marketing_flight_number,omitempty" xml:"marketing_flight_number"`        // optional
	OperatingAirline      string       `json:"operating_airline,omitempty" xml:"operating_airline"`                    // optional
	OperatingAirlineCode  string       `json:"operating_airline_code,omitempty" xml:"operating_airline_code"`          // optional, read-only
	OperatingFlightNumber string       `json:"operating_flight_number,omitempty" xml:"operating_flight_number"`        // optional
	AlternativeFlightsURL string       `json:"alternate_flights_url,omitempty" xml:"alternate_flights_url"`            // optional, read-only
	Aircraft              string       `json:"aircraft,omitempty" xml:"aircraft"`                                      // optional
	AircraftDisplayName   string       `json:"aircraft_display_name,omitempty" xml:"aircraft_display_name"`            // optional, read-only
	Distance              string       `json:"distance,omitempty" xml:"distance"`                                      // optional
	Duration              string       `json:"duration,omitempty" xml:"duration"`                                      // optional
	Entertainment         string       `json:"entertainment,omitempty" xml:"entertainment"`                            // optional
	Meal                  string       `json:"meal,omitempty" xml:"meal"`                                              // optional
	Notes                 string       `json:"notes,omitempty" xml:"notes"`                                            // optional
	OntimePerc            string       `json:"ontime_perc,omitempty" xml:"ontime_perc"`                                // optional
	Seats                 string       `json:"seats,omitempty" xml:"seats"`                                            // optional
	ServiceClass          string       `json:"service_class,omitempty" xml:"service_class"`                            // optional
	Stops                 string       `json:"stops,omitempty" xml:"stops"`                                            // optional
	BaggageClaim          string       `json:"baggage_claim,omitempty" xml:"baggage_claim"`                            // optional
	CheckInURL            string       `json:"check_in_url,omitempty" xml:"check_in_url"`                              // optional
	ConflictResolutionURL string       `json:"conflict_resolution_url,omitempty" xml:"conflict_resolution_url"`        // optional, read-only
	IsHidden              bool         `json:"is_hidden,string,omitempty" xml:"is_hidden"`                             // optional, read-only
}

FlightSegment contains details about individual flights.

type FlightSegments

type FlightSegments []FlightSegment

FlightSegments is a group of FlightSegment objects.

func (*FlightSegments) UnmarshalJSON

func (p *FlightSegments) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type FlightStatus

type FlightStatus struct {
	ScheduledDepartureDateTime DateTime         `json:"ScheduledDepartureDateTime,omitempty" xml:"ScheduledDepartureDateTime"` // optional, read-only
	EstimatedDepartureDateTime DateTime         `json:"EstimatedDepartureDateTime,omitempty" xml:"EstimatedDepartureDateTime"` // optional, read-only
	ScheduledArrivalDateTime   DateTime         `json:"ScheduledArrivalDateTime,omitempty" xml:"ScheduledArrivalDateTime"`     // optional, read-only
	EstimatedArrivalDateTime   DateTime         `json:"EstimatedArrivalDateTime,omitempty" xml:"EstimatedArrivalDateTime"`     // optional, read-only
	FlightStatus               FlightStatusCode `json:"flight_status,string,omitempty" xml:"flight_status"`                    // optional, read-only
	IsConnectionAtRisk         bool             `json:"is_connection_at_risk,string,omitempty" xml:"is_connection_at_risk"`    // optional, read-only
	DepartureTerminal          string           `json:"departure_terminal,omitempty" xml:"departure_terminal"`                 // optional, read-only
	DepartureGate              string           `json:"departure_gate,omitempty" xml:"departure_gate"`                         // optional, read-only
	ArrivalTerminal            string           `json:"arrival_terminal,omitempty" xml:"arrival_terminal"`                     // optional, read-only
	ArrivalGate                string           `json:"arrival_gate,omitempty" xml:"arrival_gate"`                             // optional, read-only
	LayoverMinutes             string           `json:"layover_minutes,omitempty" xml:"layover_minutes"`                       // optional, read-only
	BaggageClaim               string           `json:"baggage_claim,omitempty" xml:"baggage_claim"`                           // optional, read-only
	DivertedAirportCode        string           `json:"diverted_airport_code,omitempty" xml:"diverted_airport_code"`           // optional, read-only
	LastModified               string           `json:"last_modified,omitempty" xml:"last_modified"`                           // read-only
}

FlightStatus fields are read-only and only available for monitored TripIt Pro AirSegments.

type FlightStatusCode

type FlightStatusCode int

FlightStatusCode defines the type for a flight status code.

type Flights

type Flights []Flight

Flights is a group of Flight objects.

func (*Flights) UnmarshalJSON

func (p *Flights) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type Group

type Group struct {
	DisplayName string `json:"display_name,omitempty" xml:"display_name"` // read-only
	URL         string `json:"url" xml:"url"`                             // read-only
}

Group contains data about a group in TripIt. All Group elements are read-only.

type GroupMemberships

type GroupMemberships []Group

GroupMemberships contains a list of groups that the user is a member of.

func (*GroupMemberships) UnmarshalJSON

func (p *GroupMemberships) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type Image

type Image struct {
	Caption string `json:"caption,omitempty" xml:"caption"` // optional
	URL     string `json:"url" xml:"url"`
}

Image stores information about images.

type Invitation

type Invitation struct {
	EmailAddresses    []string          `json:"EmailAddresses,omitempty" xml:"EmailAddresses"`
	TripShare         TripShare         `json:"TripShare,omitempty" xml:"TripShare"`                 // optional
	ConnectionRequest ConnectionRequest `json:"ConnectionRequest,omitempty" xml:"ConnectionRequest"` // optional
	Message           string            `json:"message,omitempty" xml:"message"`                     // optional
}

Invitation contains a list of users invited to see the trip.

type Invitee

type Invitee struct {
	IsReadOnly bool              `json:"is_read_only,string,omitempty" xml:"is_read_only"` // read-only
	IsTraveler bool              `json:"is_traveler,string,omitempty" xml:"is_traveler"`   // read-only
	Attributes InviteeAttributes `json:"_attributes" xml:"attributes"`                     // read-only, Use the profile_ref attribute to reference a Profile
}

Invitee stores attributes about invitees to a trip. All Invitee elements are read-only.

type InviteeAttributes

type InviteeAttributes struct {
	ProfileRef string `json:"profile_ref" xml:"profile_ref"` // read-only, used to reference a profile
}

InviteeAttributes are used to link to user profiles.

type Invitees

type Invitees []Invitee

Invitees are people invited to view a trip.

func (*Invitees) UnmarshalJSON

func (p *Invitees) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type Lodges added in v0.1.1

type Lodges []Lodging

Lodges is a group of Lodging objects.

func (*Lodges) UnmarshalJSON added in v0.1.1

func (p *Lodges) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type Lodging

type Lodging struct {
	ID                   string    `json:"id,omitempty" xml:"id"`                                         // optional, read-only
	TripID               string    `json:"trip_id,omitempty" xml:"trip_id"`                               // optional
	IsClientTraveler     bool      `json:"is_client_traveler,string,omitempty" xml:"is_client_traveler"`  // optional, read-only
	RelativeURL          string    `json:"relative_url,omitempty" xml:"relative_url"`                     // optional, read-only
	DisplayName          string    `json:"display_name,omitempty" xml:"display_name"`                     // optional
	Images               []Image   `json:"Image,omitempty" xml:"Image"`                                   // optional
	CancellationDateTime DateTime  `json:"CancellationDateTime,omitempty" xml:"CancellationDateTime"`     // optional
	BookingDate          string    `json:"booking_date,omitempty" xml:"booking_date"`                     // optional, xs:date
	BookingRate          string    `json:"booking_rate,omitempty" xml:"booking_rate"`                     // optional
	BookingSiteConfNum   string    `json:"booking_site_conf_num,omitempty" xml:"booking_site_conf_num"`   // optional
	BookingSiteName      string    `json:"booking_site_name,omitempty" xml:"booking_site_name"`           // optional
	BookingSitePhone     string    `json:"booking_site_phone,omitempty" xml:"booking_site_phone"`         // optional
	BookingSiteURL       string    `json:"booking_site_url,omitempty" xml:"booking_site_url"`             // optional
	RecordLocator        string    `json:"record_locator,omitempty" xml:"record_locator"`                 // optional
	SupplierConfNum      string    `json:"supplier_conf_num,omitempty" xml:"supplier_conf_num"`           // optional
	SupplierContact      string    `json:"supplier_contact,omitempty" xml:"supplier_contact"`             // optional
	SupplierEmailAddress string    `json:"supplier_email_address,omitempty" xml:"supplier_email_address"` // optional
	SupplierName         string    `json:"supplier_name,omitempty" xml:"supplier_name"`                   // optional
	SupplierPhone        string    `json:"supplier_phone,omitempty" xml:"supplier_phone"`                 // optional
	SupplierURL          string    `json:"supplier_url,omitempty" xml:"supplier_url"`                     // optional
	IsPurchased          bool      `json:"is_purchased,string,omitempty" xml:"is_purchased"`              // optional
	Notes                string    `json:"notes,omitempty" xml:"notes"`                                   // optional
	Restrictions         string    `json:"restrictions,omitempty" xml:"restrictions"`                     // optional
	TotalCost            string    `json:"total_cost,omitempty" xml:"total_cost"`                         // optional
	StartDateTime        DateTime  `json:"StartDateTime,omitempty" xml:"StartDateTime"`                   // optional
	EndDateTime          DateTime  `json:"EndDateTime,omitempty" xml:"EndDateTime"`                       // optional
	Address              Address   `json:"Address,omitempty" xml:"Address"`                               // optional
	Guests               Travelers `json:"Guest,omitempty" xml:"Guest"`                                   // optional
	NumberGuests         string    `json:"number_guests,omitempty" xml:"number_guests"`                   // optional
	NumberRooms          string    `json:"number_rooms,omitempty" xml:"number_rooms"`                     // optional
	RoomType             string    `json:"room_type,omitempty" xml:"room_type"`                           // optional
}

Lodging contains information about hotels or other lodging. hotel cancellation remarks should be in restrictions. hotel room description should be in notes. hotel average daily rate should be in booking_rate.

type Map

type Map struct {
	ID               string   `json:"id,omitempty"`                        // optional, read-only
	TripID           string   `json:"trip_id,omitempty"`                   // optional
	IsClientTraveler bool     `json:"is_client_traveler,string,omitempty"` // optional, read-only
	RelativeURL      string   `json:"relative_url,omitempty"`              // optional, read-only
	DisplayName      string   `json:"display_name,omitempty"`              // optional
	Images           []Image  `json:"Image,omitempty"`                     // optional
	DateTime         DateTime `json:"DateTime,omitempty"`                  // optional
	Address          Address  `json:"Address,omitempty"`                   // optional
}

Map contains addresses to show on a map.

type Maps added in v0.1.1

type Maps []Map

Maps is a group of Map objects.

func (*Maps) UnmarshalJSON added in v0.1.1

func (p *Maps) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type Note

type Note struct {
	ID               string         `json:"id,omitempty"`                        // optional, read-only
	TripID           string         `json:"trip_id,omitempty"`                   // optional
	IsClientTraveler bool           `json:"is_client_traveler,string,omitempty"` // optional, read-only
	RelativeURL      string         `json:"relative_url,omitempty"`              // optional, read-only
	DisplayName      string         `json:"display_name,omitempty"`              // optional
	Images           []Image        `json:"Image,omitempty"`                     // optional
	DateTime         DateTime       `json:"DateTime,omitempty"`                  // optional
	Address          Address        `json:"Address,omitempty"`                   // optional
	DetailTypeCode   DetailTypeCode `json:"detail_type_code,omitempty"`          // optional
	Source           string         `json:"source,omitempty"`                    // optional
	Text             string         `json:"text,omitempty"`                      // optional
	URL              string         `json:"url,omitempty"`                       // optional
	Notes            string         `json:"notes,omitempty"`                     // optional
}

Note contains information about notes added by the traveler.

type Notes

type Notes []Note

Notes is a group of Note objects.

func (*Notes) UnmarshalJSON

func (p *Notes) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type PointsProgram

type PointsProgram struct {
	ID                  uint                      `json:"id,string,omitempty" xml:"id"`                                       // read-only
	Name                string                    `json:"name,omitempty" xml:"name"`                                          // optional, read-only
	AccountNumber       string                    `json:"account_number,omitempty" xml:"account_number"`                      // optional, read-only
	AccountLogin        string                    `json:"account_login,omitempty" xml:"account_login"`                        // optional, read-only
	Balance             string                    `json:"balance,omitempty" xml:"balance"`                                    // optional, read-only
	EliteStatus         string                    `json:"elite_status,omitempty" xml:"elite_status"`                          // optional, read-only
	EliteNextStatus     string                    `json:"elite_next_status,omitempty" xml:"elite_next_status"`                // optional, read-only
	EliteYtdQualify     string                    `json:"elite_ytd_qualify,omitempty" xml:"elite_ytd_qualify"`                // optional, read-only
	EliteNeedToEarn     string                    `json:"elite_need_to_earn,omitempty" xml:"elite_need_to_earn"`              // optional, read-only
	LastModified        string                    `json:"last_modified,omitempty" xml:"last_modified"`                        // read-only
	TotalNumActivities  int                       `json:"total_num_activities,string,omitempty" xml:"total_num_activities"`   // read-only
	TotalNumExpirations int                       `json:"total_num_expirations,string,omitempty" xml:"total_num_expirations"` // read-only
	ErrorMessage        string                    `json:"error_message,omitempty" xml:"error_message"`                        // optional, read-only
	Activities          []PointsProgramActivity   `json:"Activity,omitempty" xml:"Activity"`                                  // optional, read-only
	Expirations         []PointsProgramExpiration `json:"Expiration,omitempty" xml:"Expiration"`                              // optional, read-only
}

PointsProgram contains information about tracked travel programs for TripIt Pro users. All PointsProgram elements are read-only.

type PointsProgramActivity

type PointsProgramActivity struct {
	Date        string `json:"date,omitempty" xml:"date"`               // read-only, xs:date
	Description string `json:"description,omitempty" xml:"description"` // optional, read-only
	Base        string `json:"base,omitempty" xml:"base"`               // optional, read-only
	Bonus       string `json:"bonus,omitempty" xml:"bonus"`             // optional, read-only
	Total       string `json:"total,omitempty" xml:"total"`             // optional, read-only
}

PointsProgramActivity contains program transactions All PointsProgramActivity elements are read-only

type PointsProgramExpiration

type PointsProgramExpiration struct {
	Date   string `json:"date,omitempty" xml:"date"`     // read-only, xs:date
	Amount string `json:"amount,omitempty" xml:"amount"` // optional, read-only
}

PointsProgramExpiration elements are read-only.

type Profile

type Profile struct {
	Attributes            ProfileAttributes     `json:"_attributes" xml:"attributes"`                                // read-only
	ProfileEmailAddresses ProfileEmailAddresses `json:"ProfileEmailAddresses,omitempty" xml:"ProfileEmailAddresses"` // optional, read-only
	GroupMemberships      GroupMemberships      `json:"GroupMemberships,omitempty" xml:"GroupMemberships"`           // optional, read-only
	IsClient              bool                  `json:"is_client,string,omitempty" xml:"is_client"`                  // read-only
	IsPro                 bool                  `json:"is_pro,string,omitempty" xml:"is_pro"`                        // read-only
	ScreenName            string                `json:"screen_name,omitempty" xml:"screen_name"`                     // read-only
	PublicDisplayName     string                `json:"public_display_name,omitempty" xml:"public_display_name"`     // read-only
	ProfileURL            string                `json:"profile_url,omitempty" xml:"profile_url"`                     // read-only
	HomeCity              string                `json:"home_city,omitempty" xml:"home_city"`                         // optional, read-only
	Company               string                `json:"company,omitempty" xml:"company"`                             // optional, read-only
	AboutMeInfo           string                `json:"about_me_info,omitempty" xml:"about_me_info"`                 // optional, read-only
	PhotoURL              string                `json:"photo_url,omitempty" xml:"photo_url"`                         // optional, read-only
	ActivityFeedURL       string                `json:"activity_feed_url,omitempty" xml:"activity_feed_url"`         // optional, read-only
	AlertsFeedURL         string                `json:"alerts_feed_url,omitempty" xml:"alerts_feed_url"`             // optional, read-only
	IcalURL               string                `json:"ical_url,omitempty" xml:"ical_url"`                           // optional, read-only
}

Profile contains user information. All Profile elements are read-only.

type ProfileAttributes

type ProfileAttributes struct {
	Ref string `json:"ref,omitempty" xml:"ref"` // read-only
}

ProfileAttributes represent links to profiles.

type ProfileEmailAddress

type ProfileEmailAddress struct {
	EmailRef     string `json:"email_ref" xml:"email_ref"`                                            // read-only
	Address      string `json:"address" xml:"address"`                                                // read-only
	IsAutoImport bool   `json:"is_auto_import,string,omitempty" xml:"is_auto_import"`                 // read-only
	IsConfirmed  bool   `json:"is_confirmed,string,omitempty" xml:"is_confirmed"`                     // read-only
	IsPrimary    bool   `json:"is_primary,string,omitempty" xml:"is_primary"`                         // read-only
	IsAutoInbox  bool   `json:"is_auto_inbox_eligible,string,omitempty" xml:"is_auto_inbox_eligible"` // read-only
}

ProfileEmailAddress contains an email address and its properties. All ProfileEmailAddress elements are read-only.

type ProfileEmailAddresses

type ProfileEmailAddresses struct {
	ProfileEmailAddresses ProfileEmailAddress `json:"ProfileEmailAddress,omitempty" xml:"ProfileEmailAddress"`
}

ProfileEmailAddresses contains the list of email addresses for a user.

type Rail

type Rail struct {
	ID                   string       `json:"id,omitempty"`                        // optional, read-only
	TripID               string       `json:"trip_id,omitempty"`                   // optional
	IsClientTraveler     bool         `json:"is_client_traveler,string,omitempty"` // optional, read-only
	RelativeURL          string       `json:"relative_url,omitempty"`              // optional, read-only
	DisplayName          string       `json:"display_name,omitempty"`              // optional
	Images               []Image      `json:"Image,omitempty"`                     // optional
	CancellationDateTime DateTime     `json:"CancellationDateTime,omitempty"`      // optional
	BookingDate          string       `json:"booking_date,omitempty"`              // optional, xs:date
	BookingRate          string       `json:"booking_rate,omitempty"`              // optional
	BookingSiteConfNum   string       `json:"booking_site_conf_num,omitempty"`     // optional
	BookingSiteName      string       `json:"booking_site_name,omitempty"`         // optional
	BookingSitePhone     string       `json:"booking_site_phone,omitempty"`        // optional
	BookingSiteURL       string       `json:"booking_site_url,omitempty"`          // optional
	RecordLocator        string       `json:"record_locator,omitempty"`            // optional
	SupplierConfNum      string       `json:"supplier_conf_num,omitempty"`         // optional
	SupplierContact      string       `json:"supplier_contact,omitempty"`          // optional
	SupplierEmailAddress string       `json:"supplier_email_address,omitempty"`    // optional
	SupplierName         string       `json:"supplier_name,omitempty"`             // optional
	SupplierPhone        string       `json:"supplier_phone,omitempty"`            // optional
	SupplierURL          string       `json:"supplier_url,omitempty"`              // optional
	IsPurchased          bool         `json:"is_purchased,string,omitempty"`       // optional
	Notes                string       `json:"notes,omitempty"`                     // optional
	Restrictions         string       `json:"restrictions,omitempty"`              // optional
	TotalCost            string       `json:"total_cost,omitempty"`                // optional
	Segments             RailSegments `json:"Segment,omitempty"`
	Travelers            Travelers    `json:"Traveler,omitempty"` // optional
}

Rail contains information about trains.

type RailSegment

type RailSegment struct {
	ID                  string   `json:"id,omitempty"`                  // optional, read-only
	StartDateTime       DateTime `json:"StartDateTime,omitempty"`       // optional
	EndDateTime         DateTime `json:"EndDateTime,omitempty"`         // optional
	StartStationAddress Address  `json:"StartStationAddress,omitempty"` // optional
	EndStationAddress   Address  `json:"EndStationAddress,omitempty"`   // optional
	StartStationName    string   `json:"start_station_name,omitempty"`  // optional
	EndStationName      string   `json:"end_station_name,omitempty"`    // optional
	CarrierName         string   `json:"carrier_name,omitempty"`        // optional
	CoachNumber         string   `json:"coach_number,omitempty"`        // optional
	ConfirmationNum     string   `json:"confirmation_num,omitempty"`    // optional
	Seats               string   `json:"seats,omitempty"`               // optional
	ServiceClass        string   `json:"service_class,omitempty"`       // optional
	TrainNumber         string   `json:"train_number,omitempty"`        // optional
	TrainType           string   `json:"train_type,omitempty"`          // optional
}

RailSegment contains details about an individual train ride.

type RailSegments

type RailSegments []RailSegment

RailSegments is a group of RailSegment objects.

func (*RailSegments) UnmarshalJSON

func (p *RailSegments) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type Rails added in v0.1.1

type Rails []Rail

Rails is a group of Rail objects.

func (*Rails) UnmarshalJSON added in v0.1.1

func (p *Rails) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type Remark

type Remark struct {
	RecordLocator string `json:"record_locator,omitempty" xml:"record_locator"` // read-only
	Notes         string `json:"notes,omitempty" xml:"notes"`                   // read-only
}

Remark is a reservation system remark. All TripCrsRemark elements are read-only.

type Remarks

type Remarks struct {
	Remarks []Remark `json:"TripCrsRemark,omitempty" xml:"TripCrsRemark"` // optional, TripCrsRemarks are read-only
}

Remarks are remarks from a reservation system.

type Request

type Request struct {
	Invitations []Invitation `json:"Invitation,omitempty"`       // optional
	Trip        Trip         `json:"Trip,omitempty"`             // optional
	Activity    Activity     `json:"ActivityObject,omitempty"`   // optional
	Car         Car          `json:"CarObject,omitempty"`        // optional
	Cruise      Cruise       `json:"CruiseObject,omitempty"`     // optional
	Directions  Direction    `json:"DirectionsObject,omitempty"` // optional
	Flight      Flight       `json:"AirObject,omitempty"`        // optional
	Lodging     Lodging      `json:"LodgingObject,omitempty"`    // optional
	Map         Map          `json:"MapObject,omitempty"`        // optional
	Note        Note         `json:"NoteObject,omitempty"`       // optional
	Rail        Rail         `json:"RailObject,omitempty"`       // optional
	Restaurant  Restaurant   `json:"RestaurantObject,omitempty"` // optional
	Transport   Transport    `json:"TransportObject,omitempty"`  // optional
}

Request contains the objects that can be sent to the TripIt API in a request.

type Response

type Response struct {
	Timestamp string `json:"timestamp,omitempty" xml:"timestamp"`
	NumBytes  int    `json:"num_bytes,string,omitempty" xml:"num_bytes"`

	Errors   []Error   `json:"Error,omitempty" xml:"Error"`     // optional
	Warnings []Warning `json:"Warning,omitempty" xml:"Warning"` // optional

	Activities  Activities  `json:"ActivityObject,omitempty" xml:"ActivityObject"`     // optional
	Flights     Flights     `json:"AirObject,omitempty" xml:"AirObject"`               // optional
	Cars        Cars        `json:"CarObject,omitempty" xml:"CarObject"`               // optional
	Cruises     Cruises     `json:"CruiseObject,omitempty" xml:"CruiseObject"`         // optional
	Directions  Directions  `json:"DirectionsObject,omitempty" xml:"DirectionsObject"` // optional
	Lodging     Lodges      `json:"LodgingObject,omitempty" xml:"LodgingObject"`       // optional
	Maps        Maps        `json:"MapObject,omitempty" xml:"MapObject"`               // optional
	Notes       Notes       `json:"NoteObject,omitempty" xml:"NoteObject"`             // optional
	Rails       Rails       `json:"RailObject,omitempty" xml:"RailObject"`             // optional
	Restaurants Restaurants `json:"RestaurantObject,omitempty" xml:"RestaurantObject"` // optional

	Transports     Transports      `json:"TransportObject,omitempty" xml:"TransportObject"` // optional
	Trips          Trips           `json:"Trip,omitempty" xml:"Trip"`                       // optional
	Weather        []Weather       `json:"WeatherObject,omitempty" xml:"WeatherObject"`     // optional
	PointsPrograms []PointsProgram `json:"PointsProgram,omitempty" xml:"PointsProgram"`     // optional
	Profiles       []Profile       `json:"Profile,omitempty" xml:"Profile"`                 // optional

	PageNum  string `json:"page_num,omitempty"`
	PageSize string `json:"page_size,omitempty"`
	MaxPage  string `json:"max_page,omitempty"`
}

Response represents the TripIt API Response.

type Restaurant

type Restaurant struct {
	ID                   string   `json:"id,omitempty"`                        // optional, read-only
	TripID               string   `json:"trip_id,omitempty"`                   // optional
	IsClientTraveler     bool     `json:"is_client_traveler,string,omitempty"` // optional, read-only
	RelativeURL          string   `json:"relative_url,omitempty"`              // optional, read-only
	DisplayName          string   `json:"display_name,omitempty"`              // optional
	Images               []Image  `json:"Image,omitempty"`                     // optional
	CancellationDateTime DateTime `json:"CancellationDateTime,omitempty"`      // optional
	BookingDate          string   `json:"booking_date,omitempty"`              // optional, xs:date
	BookingRate          string   `json:"booking_rate,omitempty"`              // optional
	BookingSiteConfNum   string   `json:"booking_site_conf_num,omitempty"`     // optional
	BookingSiteName      string   `json:"booking_site_name,omitempty"`         // optional
	BookingSitePhone     string   `json:"booking_site_phone,omitempty"`        // optional
	BookingSiteURL       string   `json:"booking_site_url,omitempty"`          // optional
	RecordLocator        string   `json:"record_locator,omitempty"`            // optional
	SupplierConfNum      string   `json:"supplier_conf_num,omitempty"`         // optional
	SupplierContact      string   `json:"supplier_contact,omitempty"`          // optional
	SupplierEmailAddress string   `json:"supplier_email_address,omitempty"`    // optional
	SupplierName         string   `json:"supplier_name,omitempty"`             // optional
	SupplierPhone        string   `json:"supplier_phone,omitempty"`            // optional
	SupplierURL          string   `json:"supplier_url,omitempty"`              // optional
	IsPurchased          bool     `json:"is_purchased,string,omitempty"`       // optional
	Notes                string   `json:"notes,omitempty"`                     // optional
	Restrictions         string   `json:"restrictions,omitempty"`              // optional
	TotalCost            string   `json:"total_cost,omitempty"`                // optional
	DateTime             DateTime `json:"DateTime,omitempty"`                  // optional
	Address              Address  `json:"Address,omitempty"`                   // optional
	ReservationHolder    Traveler `json:"ReservationHolder,omitempty"`         // optional
	Cuisine              string   `json:"cuisine,omitempty"`                   // optional
	DressCode            string   `json:"dress_code,omitempty"`                // optional
	Hours                string   `json:"hours,omitempty"`                     // optional
	NumberPatrons        string   `json:"number_patrons,omitempty"`            // optional
	PriceRange           string   `json:"price_range,omitempty"`               // optional
}

Restaurant contains details about dining reservations. restaurant name should be in supplier_name. restaurant notes should be in notes.

type Restaurants added in v0.1.1

type Restaurants []Restaurant

Restaurants is a group of Restaurant objects.

func (*Restaurants) UnmarshalJSON added in v0.1.1

func (p *Restaurants) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type Transport

type Transport struct {
	ID                   string            `json:"id,omitempty"`                        // optional, read-only
	TripID               string            `json:"trip_id,omitempty"`                   // optional
	IsClientTraveler     bool              `json:"is_client_traveler,string,omitempty"` // optional, read-only
	RelativeURL          string            `json:"relative_url,omitempty"`              // optional, read-only
	DisplayName          string            `json:"display_name,omitempty"`              // optional
	Images               []Image           `json:"Image,omitempty"`                     // optional
	CancellationDateTime DateTime          `json:"CancellationDateTime,omitempty"`      // optional
	BookingDate          string            `json:"booking_date,omitempty"`              // optional, xs:date
	BookingRate          string            `json:"booking_rate,omitempty"`              // optional
	BookingSiteConfNum   string            `json:"booking_site_conf_num,omitempty"`     // optional
	BookingSiteName      string            `json:"booking_site_name,omitempty"`         // optional
	BookingSitePhone     string            `json:"booking_site_phone,omitempty"`        // optional
	BookingSiteURL       string            `json:"booking_site_url,omitempty"`          // optional
	RecordLocator        string            `json:"record_locator,omitempty"`            // optional
	SupplierConfNum      string            `json:"supplier_conf_num,omitempty"`         // optional
	SupplierContact      string            `json:"supplier_contact,omitempty"`          // optional
	SupplierEmailAddress string            `json:"supplier_email_address,omitempty"`    // optional
	SupplierName         string            `json:"supplier_name,omitempty"`             // optional
	SupplierPhone        string            `json:"supplier_phone,omitempty"`            // optional
	SupplierURL          string            `json:"supplier_url,omitempty"`              // optional
	IsPurchased          bool              `json:"is_purchased,string,omitempty"`       // optional
	Notes                string            `json:"notes,omitempty"`                     // optional
	Restrictions         string            `json:"restrictions,omitempty"`              // optional
	TotalCost            string            `json:"total_cost,omitempty"`                // optional
	Segments             TransportSegments `json:"Segment,omitempty"`
	Travelers            Travelers         `json:"Traveler,omitempty"` // optional
}

Transport contains details about other forms of transport like bus rides.

type TransportSegment

type TransportSegment struct {
	ID                   string         `json:"id,omitempty"`                   // optional, read-only
	StartDateTime        DateTime       `json:"StartDateTime,omitempty"`        // optional
	EndDateTime          DateTime       `json:"EndDateTime,omitempty"`          // optional
	StartLocationAddress Address        `json:"StartLocationAddress,omitempty"` // optional
	EndLocationAddress   Address        `json:"EndLocationAddress,omitempty"`   // optional
	StartLocationName    string         `json:"start_location_name,omitempty"`  // optional
	EndLocationName      string         `json:"end_location_name,omitempty"`    // optional
	DetailTypeCode       DetailTypeCode `json:"detail_type_code,omitempty"`     // optional
	CarrierName          string         `json:"carrier_name,omitempty"`         // optional
	ConfirmationNum      string         `json:"confirmation_num,omitempty"`     // optional
	NumberPassengers     string         `json:"number_passengers,omitempty"`    // optional
	VehicleDescription   string         `json:"vehicle_description,omitempty"`  // optional
}

TransportSegment contains details about indivual transport rides.

type TransportSegments

type TransportSegments []TransportSegment

TransportSegments is a group of TransportSegment objects.

func (*TransportSegments) UnmarshalJSON

func (p *TransportSegments) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type Transports

type Transports []Transport

Transports is a group of Transport objects.

func (*Transports) UnmarshalJSON

func (p *Transports) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type Traveler

type Traveler struct {
	FirstName                string `json:"first_name,omitempty" xml:"first_name"`                                 // optional
	MiddleName               string `json:"middle_name,omitempty" xml:"middle_name"`                               // optional
	LastName                 string `json:"last_name,omitempty" xml:"last_name"`                                   // optional
	FrequentTravelerNum      string `json:"frequent_traveler_num,omitempty" xml:"frequent_traveler_num"`           // optional
	FrequentTravelerSupplier string `json:"frequent_traveler_supplier,omitempty" xml:"frequent_traveler_supplier"` // optional
	MealPreference           string `json:"meal_preference,omitempty" xml:"meal_preference"`                       // optional
	SeatPreference           string `json:"seat_preference,omitempty" xml:"seat_preference"`                       // optional
	TicketNum                string `json:"ticket_num,omitempty" xml:"ticket_num"`                                 // optional
}

Traveler contains information about a traveler.

type Travelers

type Travelers []Traveler

Travelers is a group of Traveler objects.

func (*Travelers) UnmarshalJSON

func (p *Travelers) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type Trip

type Trip struct {
	ID                     string           `json:"id,omitempty" xml:"id"`                                             // optional, id is a read-only field
	RelativeURL            string           `json:"relative_url,omitempty" xml:"relative_url"`                         // optional, relative_url is a read-only field
	StartDate              string           `json:"start_date,omitempty" xml:"start_date"`                             // optional, xs:date
	EndDate                string           `json:"end_date,omitempty" xml:"end_date"`                                 // optional, xs:date
	Description            string           `json:"description,omitempty" xml:"description"`                           // optional
	DisplayName            string           `json:"display_name,omitempty" xml:"display_name"`                         // optional
	ImageURL               string           `json:"image_url,omitempty" xml:"image_url"`                               // optional
	IsPrivate              bool             `json:"is_private,string,omitempty" xml:"is_private"`                      // optional
	PrimaryLocation        string           `json:"primary_location,omitempty" xml:"primary_location"`                 // optional
	PrimaryLocationAddress Address          `json:"primary_location_address,omitempty" xml:"primary_location_address"` // optional, PrimaryLocationAddress is a read-only field
	ClosenessMatches       ClosenessMatches `json:"ClosenessMatches,omitempty" xml:"ClosenessMatches"`                 // optional, ClosenessMatches are read-only
	Invitees               Invitees         `json:"TripInvitees,omitempty" xml:"TripInvitees"`                         // optional, Invitees are read-only
	Remarks                Remarks          `json:"TripCrsRemarks,omitempty" xml:"TripCrsRemarks"`                     // optional, Remarks are read-only
}

Trip represents a trip in the TripIt model.

type TripShare

type TripShare struct {
	TripID            uint `json:"trip_id,string,omitempty" xml:"trip_id"`
	IsTraveler        bool `json:"is_traveler,string,omitempty" xml:"is_traveler"`
	IsReadOnly        bool `json:"is_read_only,string,omitempty" xml:"is_read_only"`
	IsSentWithDetails bool `json:"is_sent_with_details,string,omitempty" xml:"is_sent_with_details"`
}

TripShare contains information about which users a trip is shared with.

type Trips added in v0.1.1

type Trips []Trip

Trips is a group of Trip objects.

func (*Trips) UnmarshalJSON added in v0.1.1

func (p *Trips) UnmarshalJSON(b []byte) error

UnmarshalJSON builds the vector from the JSON in b.

type Type

type Type string

Type defines the type for an object.

type TypeFilter

type TypeFilter string

TypeFilter defines the type for a filter type.

type Warning

type Warning struct {
	Description string `json:"description,omitempty"` // read-only
	EntityType  string `json:"entity_type,omitempty"` // read-only
	Timestamp   string `json:"timestamp,omitempty"`   // read-only, xs:datetime
}

Warning is returned from TripIt to indicate warning conditions.

type Weather

type Weather struct {
	ID                 string  `json:"id,omitempty"`                          // optional, read-only
	TripID             string  `json:"trip_id,omitempty"`                     // optional
	IsClientTraveler   bool    `json:"is_client_traveler,string,omitempty"`   // optional, read-only
	RelativeURL        string  `json:"relative_url,omitempty"`                // optional, read-only
	DisplayName        string  `json:"display_name,omitempty"`                // optional
	Images             []Image `json:"Image,omitempty"`                       // optional
	Date               string  `json:"date,omitempty"`                        // optional, read-only, xs:date
	Location           string  `json:"location,omitempty"`                    // optional, read-only
	AvgHighTempC       float64 `json:"avg_high_temp_c,string,omitempty"`      // optional, read-only
	AvgLowTempC        float64 `json:"avg_low_temp_c,string,omitempty"`       // optional, read-only
	AvgWindSpeedKn     float64 `json:"avg_wind_speed_kn,string,omitempty"`    // optional, read-only
	AvgPrecipitationCm float64 `json:"avg_precipitation_cm,string,omitempty"` // optional, read-only
	AvgSnowDepthCm     float64 `json:"avg_snow_depth_cm,string,omitempty"`    // optional, read-only
}

Weather contains information about the weather at a particular destination. Weather is read-only.

Jump to

Keyboard shortcuts

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