tripit

package module
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: Apache-2.0 Imports: 17 Imported by: 1

README

go-tripit

GoDoc

go-tripit is an API library written in go for accessing the TripIt service.

For more information about the TripIt API, see:

For more information about Go, see:

http://golang.org/

Current Status:

OAuth and the Get/List functions are basically operational. Adding, replacing, and deleting objects has not beed tested.

Documentation

Overview

Package tripit is a Go API library for accessing the TripIt service. The API supports two forms of authorization - simple web authorization and OAuth. The library uses TripIt's JSON interface, and has structs representing all of the TripIt types. Within these structs, elements ending in an underscore have access functions that set or get the value in a more pleasant form for use in Go programs.

Index

Constants

View Source
const (
	ApiUrl     = "https://api.tripit.com"
	ApiVersion = "v1"
)

TripIt API information

View Source
const (
	ListTrip          = "trip"
	ListObject        = "object"
	ListPointsProgram = "points_program"
)

List objects

View Source
const (
	FilterNone           = ""                // valid on trip, object, points_program
	FilterTraveler       = "traveler"        // valid on trip, object. Values: true, false, all
	FilterPast           = "past"            // valid on trip, object. Values: true, false
	FilterModifiedSince  = "modified_since"  // valid on trip, object. Values: integer
	FilterIncludeObjects = "include_objects" // valid on trip. Values: true, false
	FilterTripId         = "trip_id"         // valid on object. Values: integer trip id
	FilterType           = "type"            // valid on object. Values: all object types
	FilterPageNum        = "page_num"        // valid on trip, object. Integer, page number to retrieve
	FilterPageSize       = "page_size"       // valid on trip, object. Integer, number of items per page
)

Filter Parameters

View Source
const (
	UrlObtainRequestToken            = "/oauth/request_token"                                                    // POST
	UrlObtainUserAuthorization       = "https://www.tripit.com/oauth/authorize?oauth_token=%s&oauth_callback=%s" // Redirect
	UrlObtainUserAuthorizationMobile = "https://m.tripit.com/oauth/authorize?oauth_token=%s&oauth_callback=%s"   // Redirect
	UrlObtainAccessToken             = "/oauth/access_token"                                                     // POST
)

TripIt API URLs for OAuth

View Source
const (
	OAUTH_SIGNATURE_METHOD = "HMAC-SHA1"
	OAUTH_VERSION          = "1.0"
)

Signature method and version

View Source
const (
	ObjectTypeAir        = "air"
	ObjectTypeActivity   = "activity"
	ObjectTypeCar        = "car"
	ObjectTypeCruise     = "cruise"
	ObjectTypeDirections = "directions"
	ObjectTypeLodging    = "lodging"
	ObjectTypeMap        = "map"
	ObjectTypeNote       = "note"
	ObjectTypeRail       = "rail"
	ObjectTypeRestaurant = "restaurant"
	ObjectTypeTransport  = "transport"
	ObjectTypeTrip       = "trip"
)

TripIt Object Types

View Source
const (
	FlightStatusNotMonitorable = 100
	FlightStatusNotMonitored   = 200
	FlightStatusScheduled      = 300
	FlightStatusOnTime         = 301
	FlightStatusInFlightOnTime = 302
	FlightStatusArrivedOnTime  = 303
	FlightStatusCancelled      = 400
	FlightStatusDelayed        = 401
	FlightStatusInFlightLate   = 402
	FlightStatusArrivedLate    = 403
	FlightStatusDiverted       = 404
)

Flight status values

View Source
const (
	TransportDetailTypeFerry                = "F"
	TransportDetailTypeGroundTransportation = "G"
)

Transport Detail Types

View Source
const (
	ActivityDetailTypeConcert = "C"
	ActivityDetailTypeTheatre = "H"
	ActivityDetailTypeMeeting = "M"
	ActivityDetailTypeTour    = "T"
)

Activity Detail Types

View Source
const (
	CruiseDetailTypePortOfCall = "P"
)

Cruise Detail Types

View Source
const (
	NoteDetailTypeArticle = "A"
)

Note Detail Types

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityObject

type ActivityObject 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
	Image                ImagePtrVector    `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
	Participant          TravelerPtrVector `json:"Participant,omitempty"`               // optional
	DetailTypeCode       string            `json:"detail_type_code,omitempty"`          // optional
	LocationName         string            `json:"location_name,omitempty"`             // optional
}

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

func (*ActivityObject) BookingTime

func (r *ActivityObject) BookingTime() (time.Time, error)

BookingTime returns a time.Time object for BookingDate. Note: This won't have proper time zone information.

type ActivityObjectPtrVector

type ActivityObjectPtrVector []*ActivityObject

ActivityObjectPtrVector is a specialization of Vector for *ActivityObject objects.

func (*ActivityObjectPtrVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

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 AirObject

type AirObject 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
	Image                ImagePtrVector      `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
	Segment              AirSegmentPtrVector `json:"Segment,omitempty" xml:"Segment"`
	Traveler             TravelerPtrVector   `json:"Traveler,omitempty" xml:"Traveler"` // optional
}

AirObject contains data about a flight.

func (*AirObject) BookingTime

func (r *AirObject) BookingTime() (time.Time, error)

BookingTime returns a time.Time object for BookingDate. Note: This won't have proper time zone information.

type AirObjectPtrVector

type AirObjectPtrVector []*AirObject

AirObjectPtrVector is a specialization of Vector for *AirObject objects.

func (*AirObjectPtrVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type AirSegment

type AirSegment struct {
	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
	Id                    string        `json:"id,omitempty" xml:"id"`                                                  // optional, read-only
}

AirSegment contains details about individual flights.

type AirSegmentPtrVector

type AirSegmentPtrVector []*AirSegment

AirSegmentPtrVector is a specialization of Vector for *AirSegment objects.

func (*AirSegmentPtrVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type Authorizable

type Authorizable interface {
	Authorize(request *http.Request, args map[string]string)
}

Authorizable is the interface for authorization objects.

type CarObject

type CarObject 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
	Image                ImagePtrVector    `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
	Driver               TravelerPtrVector `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
}

CarObject 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.

func (*CarObject) BookingTime

func (r *CarObject) BookingTime() (time.Time, error)

BookingTime returns a time.Time object for BookingDate. Note: This won't have proper time zone information.

type CarObjectPtrVector

type CarObjectPtrVector []*CarObject

CarObjectPtrVector is a specialization of Vector for *CarObject objects.

func (*CarObjectPtrVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

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 ClosenessMatchVector

type ClosenessMatchVector []ClosenessMatch

ClosenessMatchVector is a specialization of Vector for ClosenessMatch objects.

func (*ClosenessMatchVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type ClosenessMatches

type ClosenessMatches struct {
	ClosenessMatch ClosenessMatchVector `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 CruiseObject

type CruiseObject 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
	Image                ImagePtrVector         `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
	Segment              CruiseSegmentPtrVector `json:"Segment,omitempty"`
	Traveler             TravelerPtrVector      `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
}

CruiseObject contains information about cruises.

func (*CruiseObject) BookingTime

func (r *CruiseObject) BookingTime() (time.Time, error)

BookingTime returns a time.Time object for BookingDate. Note: This won't have proper time zone information.

type CruiseObjectPtrVector

type CruiseObjectPtrVector []*CruiseObject

CruiseObjectPtrVector is a specialization of Vector for *CruiseObject objects.

func (*CruiseObjectPtrVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

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  string    `json:"detail_type_code,omitempty"` // optional
	Id              string    `json:"id,omitempty"`               // optional, read-only
}

CruiseSegment contains details about indivual cruise segments.

type CruiseSegmentPtrVector

type CruiseSegmentPtrVector []*CruiseSegment

CruiseSegmentPtrVector is a specialization of Vector for *CruiseSegment objects.

func (*CruiseSegmentPtrVector) UnmarshalJSON

func (p *CruiseSegmentPtrVector) 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, for example:

{
	 "date":"2009-11-10",
  "time":"14:00:00",
   "timezone":"America\/Los_Angeles",
   "utc_offset":"-08:00"
}

func (DateTime) GetTime

func (dt DateTime) GetTime() (time.Time, error)

GetTime converts the time to a time.Time.

func (*DateTime) SetTime

func (dt *DateTime) SetTime(t time.Time)

SetTime sets the values of the DateTime strucure from a time.Time.

type DirectionsObject

type DirectionsObject 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
	Image            ImagePtrVector `json:"Image,omitempty"`                     // optional
	DateTime         *DateTime      `json:"DateTime,omitempty"`                  // optional
	StartAddress     *Address       `json:"StartAddress,omitempty"`              // optional
	EndAddress       *Address       `json:"EndAddress,omitempty"`                // optional
}

DirectionsObject contains addresses to show directions for on the trip.

type DirectionsObjectPtrVector

type DirectionsObjectPtrVector []*DirectionsObject

DirectionsObjectPtrVector is a specialization of Vector for *DirectionsObject objects.

func (*DirectionsObjectPtrVector) UnmarshalJSON

func (p *DirectionsObjectPtrVector) 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.

func (*Error) Error

func (e *Error) Error() string

Error returns a string containing the error information.

func (*Error) String

func (e *Error) String() string

String returns a string containing the error information.

func (*Error) Time

func (e *Error) Time() (time.Time, error)

Time returns a time.Time object for the Timestamp.

type ErrorVector

type ErrorVector []Error

ErrorVector is a specialization of Vector for Error objects.

func (*ErrorVector) UnmarshalJSON

func (p *ErrorVector) 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               int       `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.

func (*FlightStatus) LastModifiedTime

func (fs *FlightStatus) LastModifiedTime() (time.Time, error)

LastModifiedTime returns a time.Time object for LastModified.

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 struct {
	Group GroupVector `json:"Group,omitempty" xml:"Group"` // optional, read-only
}

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

type GroupVector

type GroupVector []Group

GroupVector is a specialization of Vector for Group objects.

func (*GroupVector) UnmarshalJSON

func (p *GroupVector) 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 ImagePtrVector

type ImagePtrVector []*Image

ImagePtrVector is a specialization of Vector for *Image objects.

func (*ImagePtrVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

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 InviteeVector

type InviteeVector []Invitee

InviteeVector is a specialization of Vector for Invitee objects.

func (*InviteeVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type LodgingObject

type LodgingObject 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
	Image                ImagePtrVector    `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
	Guest                TravelerPtrVector `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
}

LodgingObject 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.

func (*LodgingObject) BookingTime

func (r *LodgingObject) BookingTime() (time.Time, error)

BookingTime returns a time.Time object for BookingDate. Note: This won't have proper time zone information.

type LodgingObjectPtrVector

type LodgingObjectPtrVector []*LodgingObject

LodgingObjectPtrVector is a specialization of Vector for *LodgingObject objects.

func (*LodgingObjectPtrVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type MapObject

type MapObject 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
	Image            ImagePtrVector `json:"Image,omitempty"`                     // optional
	DateTime         *DateTime      `json:"DateTime,omitempty"`                  // optional
	Address          *Address       `json:"Address,omitempty"`                   // optional
}

MapObject contains addresses to show on a map.

type MapObjectPtrVector

type MapObjectPtrVector []*MapObject

MapObjectPtrVector is a specialization of Vector for *MapObject objects.

func (*MapObjectPtrVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type NoteObject

type NoteObject 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
	Image            ImagePtrVector `json:"Image,omitempty"`                     // optional
	DateTime         *DateTime      `json:"DateTime,omitempty"`                  // optional
	Address          *Address       `json:"Address,omitempty"`                   // optional
	DetailTypeCode   string         `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
}

NoteObject contains information about notes added by the traveler.

type NoteObjectPtrVector

type NoteObjectPtrVector []*NoteObject

NoteObjectPtrVector is a specialization of Vector for *NoteObject objects.

func (*NoteObjectPtrVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type OAuthConsumerCredential

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

OAuthConsumerCredential is the OAuth consumer credential for use with TripIt API.

func NewOAuth2LeggedCredential

func NewOAuth2LeggedCredential(consumerKey string, consumerSecret string, requestorId string) *OAuthConsumerCredential

NewOAuth2LeggedCredential gets a 2 legged OAuth credential.

func NewOAuth3LeggedCredential

func NewOAuth3LeggedCredential(consumerKey string, consumerSecret string, token string, tokenSecret string) *OAuthConsumerCredential

NewOAuth3LeggedCredential gets a 3 legged OAuth credential (request or authorized token).

func NewOAuthRequestCredential

func NewOAuthRequestCredential(consumerKey string, consumerSecret string) *OAuthConsumerCredential

NewOAuthRequestCredential gets a credential with no token (to get a request token).

func (*OAuthConsumerCredential) Authorize

func (a *OAuthConsumerCredential) Authorize(request *http.Request, args map[string]string)

Authorize adds the authorization header for OAuth to the request, including any additional arguments. Additional arguments are used in signature generation.

func (*OAuthConsumerCredential) GetSessionParameters

func (a *OAuthConsumerCredential) GetSessionParameters(redirectUrl string, action string) string

GetSessionParameters returns the OAuth parameters for a given session.

func (*OAuthConsumerCredential) OAuthConsumerKey

func (a *OAuthConsumerCredential) OAuthConsumerKey() string

OAuthConsumerKey returns the consumer key.

func (*OAuthConsumerCredential) OAuthConsumerSecret

func (a *OAuthConsumerCredential) OAuthConsumerSecret() string

OAuthConsumerSecret returnss the consumer secret.

func (*OAuthConsumerCredential) OAuthOAuthToken

func (a *OAuthConsumerCredential) OAuthOAuthToken() string

OAuthOAuthToken returns the OAuth token.

func (*OAuthConsumerCredential) OAuthRequestorId

func (a *OAuthConsumerCredential) OAuthRequestorId() string

OAuthRequestorId returns the requestor ID.

func (*OAuthConsumerCredential) OAuthTokenSecret

func (a *OAuthConsumerCredential) OAuthTokenSecret() string

OAuthTokenSecret returns the OAuth token secret.

func (*OAuthConsumerCredential) ValidateSignature

func (a *OAuthConsumerCredential) ValidateSignature(url_ string) bool

ValidateSignature validates the URL's OAuth signature in the given url.

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
	Activity            PointsProgramActivityVector   `json:"Activity,omitempty" xml:"Activity"`                                  // optional, read-only
	Expiration          PointsProgramExpirationVector `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.

func (*PointsProgram) LastModifiedTime

func (pp *PointsProgram) LastModifiedTime() (time.Time, error)

LastModifiedTime returns a time.Time object for LastModified.

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

func (*PointsProgramActivity) Time

func (pa *PointsProgramActivity) Time() (time.Time, error)

Time returns a time.Time object for Date. Note: This won't have proper time zone information

type PointsProgramActivityVector

type PointsProgramActivityVector []PointsProgramActivity

PointsProgramActivityVector is a specialization of Vector for PointsProgramActivity objects.

func (*PointsProgramActivityVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

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.

func (*PointsProgramExpiration) Time

func (pe *PointsProgramExpiration) Time() (time.Time, error)

Time returns a time.Time object for Date. Note: This won't have proper time zone information.

type PointsProgramExpirationVector

type PointsProgramExpirationVector []PointsProgramExpiration

PointsProgramExpirationVector is a specialization of Vector for PointsProgramExpiration objects.

func (*PointsProgramExpirationVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type PointsProgramVector

type PointsProgramVector []PointsProgram

PointsProgramVector is a specialization of Vector for PointsProgram objects.

func (*PointsProgramVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

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 {
	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
}

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

type ProfileEmailAddressVector

type ProfileEmailAddressVector []ProfileEmailAddress

ProfileEmailAddressVector is a specialization of Vector for ProfileEmailAddress objects.

func (*ProfileEmailAddressVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type ProfileEmailAddresses

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

ProfileEmailAddresses contains the list of email addresses for a user.

type ProfileVector

type ProfileVector []Profile

ProfileVector is a specialization of Vector for Profile objects.

func (*ProfileVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type RailObject

type RailObject 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
	Image                ImagePtrVector       `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
	Segment              RailSegmentPtrVector `json:"Segment,omitempty"`
	Traveler             TravelerPtrVector    `json:"Traveler,omitempty"` // optional
}

RailObject contains information about trains.

func (*RailObject) BookingTime

func (r *RailObject) BookingTime() (time.Time, error)

BookingTime returns a time.Time object for BookingDate. Note: This won't have proper time zone information.

type RailObjectPtrVector

type RailObjectPtrVector []*RailObject

RailObjectPtrVector is a specialization of Vector for *RailObject objects.

func (*RailObjectPtrVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type RailSegment

type RailSegment struct {
	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
	Id                  string    `json:"id,omitempty"`                  // optional, read-only
}

RailSegment contains details about an indivual train ride.

type RailSegmentPtrVector

type RailSegmentPtrVector []*RailSegment

RailSegmentPtrVector is a specialization of Vector for *RailSegment objects.

func (*RailSegmentPtrVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type Request

type Request struct {
	Invitation       []Invitation      `json:"Invitation,omitempty"`       // optional
	Trip             *Trip             `json:"Trip,omitempty"`             // optional
	ActivityObject   *ActivityObject   `json:"ActivityObject,omitempty"`   // optional
	AirObject        *AirObject        `json:"AirObject,omitempty"`        // optional
	CarObject        *CarObject        `json:"CarObject,omitempty"`        // optional
	CruiseObject     *CruiseObject     `json:"CruiseObject,omitempty"`     // optional
	DirectionsObject *DirectionsObject `json:"DirectionsObject,omitempty"` // optional
	LodgingObject    *LodgingObject    `json:"LodgingObject,omitempty"`    // optional
	MapObject        *MapObject        `json:"MapObject,omitempty"`        // optional
	NoteObject       *NoteObject       `json:"NoteObject,omitempty"`       // optional
	RailObject       *RailObject       `json:"RailObject,omitempty"`       // optional
	RestaurantObject *RestaurantObject `json:"RestaurantObject,omitempty"` // optional
	TransportObject  *TransportObject  `json:"TransportObject,omitempty"`  // optional
}

Request contains the objects that can be sent to TripIt 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"`
	Error            ErrorVector               `json:"Error,omitempty" xml:"Error"`                       // optional
	Warning          WarningVector             `json:"Warning,omitempty" xml:"Warning"`                   // optional
	Trip             TripPtrVector             `json:"Trip,omitempty" xml:"Trip"`                         // optional
	ActivityObject   ActivityObjectPtrVector   `json:"ActivityObject,omitempty" xml:"ActivityObject"`     // optional
	AirObject        AirObjectPtrVector        `json:"AirObject,omitempty" xml:"AirObject"`               // optional
	CarObject        CarObjectPtrVector        `json:"CarObject,omitempty" xml:"CarObject"`               // optional
	CruiseObject     CruiseObjectPtrVector     `json:"CruiseObject,omitempty" xml:"CruiseObject"`         // optional
	DirectionsObject DirectionsObjectPtrVector `json:"DirectionsObject,omitempty" xml:"DirectionsObject"` // optional
	LodgingObject    LodgingObjectPtrVector    `json:"LodgingObject,omitempty" xml:"LodgingObject"`       // optional
	MapObject        MapObjectPtrVector        `json:"MapObject,omitempty" xml:"MapObject"`               // optional
	NoteObject       NoteObjectPtrVector       `json:"NoteObject,omitempty" xml:"NoteObject"`             // optional
	RailObject       RailObjectPtrVector       `json:"RailObject,omitempty" xml:"RailObject"`             // optional
	RestaurantObject RestaurantObjectPtrVector `json:"RestaurantObject,omitempty" xml:"RestaurantObject"` // optional
	TransportObject  TransportObjectPtrVector  `json:"TransportObject,omitempty" xml:"TransportObject"`   // optional
	WeatherObject    WeatherObjectVector       `json:"WeatherObject,omitempty" xml:"WeatherObject"`       // optional
	PointsProgram    PointsProgramVector       `json:"PointsProgram,omitempty" xml:"PointsProgram"`       // optional
	Profile          ProfileVector             `json:"Profile,omitempty" xml:"Profile"`                   // optional

	PageNumber json.Number `json:"page_num,omitempty" xml:"page_num"`   // when pagination is activated
	PageSize   json.Number `json:"page_size,omitempty" xml:"page_size"` // when pagination is activated
	MaxPage    json.Number `json:"max_page,omitempty" xml:"max_page"`   // when pagination is activated

}

Response represents a TripIt API Response

func (*Response) Time

func (r *Response) Time() (time.Time, error)

Time returns a time.Time object for the Timestamp

type RestaurantObject

type RestaurantObject 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
	Image                ImagePtrVector `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
}

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

func (*RestaurantObject) BookingTime

func (r *RestaurantObject) BookingTime() (time.Time, error)

BookingTime returns a time.Time object for BookingDate. Note: This won't have proper time zone information.

type RestaurantObjectPtrVector

type RestaurantObjectPtrVector []*RestaurantObject

RestaurantObjectPtrVector is a specialization of Vector for *RestaurantObject objects.

func (*RestaurantObjectPtrVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type TransportObject

type TransportObject 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
	Image                ImagePtrVector            `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
	Segment              TransportSegmentPtrVector `json:"Segment,omitempty"`
	Traveler             TravelerPtrVector         `json:"Traveler,omitempty"` // optional
}

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

func (*TransportObject) BookingTime

func (r *TransportObject) BookingTime() (time.Time, error)

BookingTime returns a time.Time object for BookingDate. Note: This won't have proper time zone information

type TransportObjectPtrVector

type TransportObjectPtrVector []*TransportObject

TransportObjectPtrVector is a specialization of Vector for *TransportObject objects.

func (*TransportObjectPtrVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type TransportSegment

type TransportSegment struct {
	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       string    `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
	Id                   string    `json:"id,omitempty"`                   // optional, read-only
}

TransportSegment contains details about indivual transport rides.

type TransportSegmentPtrVector

type TransportSegmentPtrVector []*TransportSegment

TransportSegmentPtrVector is a specialization of Vector for *TransportSegment objects.

func (*TransportSegmentPtrVector) UnmarshalJSON

func (p *TransportSegmentPtrVector) 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 TravelerPtrVector

type TravelerPtrVector []*Traveler

TravelerPtrVector is a specialization of Vector for *Traveler objects.

func (*TravelerPtrVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type Trip

type Trip struct {
	ClosenessMatches       *ClosenessMatches `json:"ClosenessMatches,omitempty" xml:"ClosenessMatches"`                 // optional, ClosenessMatches are read-only
	TripInvitees           *TripInvitees     `json:"TripInvitees,omitempty" xml:"TripInvitees"`                         // optional, TripInvitees are read-only
	TripCrsRemarks         *TripCrsRemarks   `json:"TripCrsRemarks,omitempty" xml:"TripCrsRemarks"`                     // optional, TripCrsRemarks are read-only
	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
}

Trip represents a trip in the TripIt model.

func (*Trip) EndTime

func (t *Trip) EndTime() (time.Time, error)

EndTime returns a time.Time object for EndDate. Note: This won't have proper time zone information.

func (*Trip) StartTime

func (t *Trip) StartTime() (time.Time, error)

StartTime returns a time.Time object for StartDate. Note: This won't have proper time zone information.

type TripCrsRemark

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

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

type TripCrsRemarkVector

type TripCrsRemarkVector []TripCrsRemark

TripCrsRemarkVector is a specialization of Vector for TripCrsRemark objects.

func (*TripCrsRemarkVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type TripCrsRemarks

type TripCrsRemarks struct {
	TripCrsRemark TripCrsRemarkVector `json:"TripCrsRemark,omitempty" xml:"TripCrsRemark"` // optional, TripCrsRemarks are read-only
}

TripCrsRemarks are remarks from a reservation system.

type TripInvitees

type TripInvitees struct {
	Invitee InviteeVector `json:"Invitee,omitempty" xml:"Invitee"` // optional, TripInvitees are read-only
}

TripInvitees are people invited to view a trip.

type TripIt

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

TripIt class to used to communicate with the API.

func New

func New(apiUrl string, apiVersion string, client *http.Client, creds Authorizable) *TripIt

New creates a new TripIt object using the given HTTP client and authorization object.

func (*TripIt) Create

func (t *TripIt) Create(r *Request) (*Response, error)

Create creates an object in TripIt based on the given Request, returning the Response object from TripIt. supports: air, activity, car, cruise, directions, lodging, map, note, rail, restaurant, transport, trip

func (*TripIt) Delete

func (t *TripIt) Delete(objectType string, objectId uint) (*Response, error)

Delete deletes the object of the given type and ID from TripIt, and returns the Response object from TripIt. supports: air, activity, car, cruise, directions, lodging, map, note, rail, restaurant, transport, trip

func (*TripIt) Get

func (t *TripIt) Get(objectType string, objectId uint) (*Response, error)

Get gets an Object of the given type and ID, and returns the Response object from TripIt. supports: air, activity, car, cruise, directions, lodging, map, note, rail, restaurant, transport, trip

func (*TripIt) GetAccessToken

func (t *TripIt) GetAccessToken() (map[string]string, error)

GetAccessToken gets the final OAuth token and token secret for an authenticated user. These should be saved with the user's ID for future used of the API on the user's behalf.

func (*TripIt) GetRequestToken

func (t *TripIt) GetRequestToken() (map[string]string, error)

GetRequestToken is step 1 of the OAuth process. The function returns the token and secret from TripIt that is used in subsequent authentication requests. This token and secret is not the permanent one - if the user aborts the authentication process, these can be discarded.

func (*TripIt) List

func (t *TripIt) List(objectType string, filterParms map[string]string) (*Response, error)

List lists objects of the given type, filtered by the given filter parameters. Returns the response object from TripIt. To understand filter parameters and which filters can be combined, see the TripIt API documentation. supports: trip, object, points_program

func (*TripIt) Replace

func (t *TripIt) Replace(objectType string, objectId uint, r *Request) (*Response, error)

Replace replaces the object of the given type and ID with the new object in the Request. Returns the Response object from TripIt. supports: air, activity, car, cruise, directions, lodging, map, note, rail, restaurant, transport, trip

type TripPtrVector

type TripPtrVector []*Trip

TripPtrVector is a specialization of Vector for *Trip objects.

func (*TripPtrVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

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 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

func (*Warning) Error

func (w *Warning) Error() string

Error returns a string containing the warning information.

func (*Warning) String

func (w *Warning) String() string

String returns a string containing the warning information.

func (*Warning) Time

func (w *Warning) Time() (time.Time, error)

Time returns a time.Time object for the Timestamp.

type WarningVector

type WarningVector []Warning

WarningVector is a specialization of Vector for Warning objects.

func (*WarningVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type WeatherObject

type WeatherObject 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
	Image              ImagePtrVector `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
}

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

func (*WeatherObject) Time

func (w *WeatherObject) Time() (time.Time, error)

Time returns a time.Time object for StartDate. Note: This won't have proper time zone information.

type WeatherObjectVector

type WeatherObjectVector []WeatherObject

WeatherObjectVector is a specialization of Vector for WeatherObject objects.

func (*WeatherObjectVector) UnmarshalJSON

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

UnmarshalJSON builds the vector from the JSON in b.

type WebAuthCredential

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

WebAuthCredential us used for web authorization. Web authorization is for testing and needs to be enabled on your TripIt account.

func (*WebAuthCredential) Authorize

func (a *WebAuthCredential) Authorize(request *http.Request, args map[string]string)

Authorize adds the authorization header to the HTTP request, including any additional arguments. Note that web authorization ignores extra arguments.

func (*WebAuthCredential) Password

func (a *WebAuthCredential) Password() string

Password returns the password.

func (*WebAuthCredential) Username

func (a *WebAuthCredential) Username() string

Username returns the user name.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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