-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trip experiences: implement the trip experiences API #31
Labels
Comments
2 tasks
So in regards to the trip experiences, checklist of already implemented features:
func Example_client_RetrieveMyProfile() {
client, err := uber.NewClient()
if err != nil {
log.Fatal(err)
}
myProfile, err := client.RetrieveMyProfile()
if err != nil {
log.Fatal(err)
}
fmt.Printf("Here is my profile: %#v\n", myProfile)
}
func Example_client_ListHistory() {
client, err := uber.NewClient()
if err != nil {
log.Fatal(err)
}
pagesChan, cancelPaging, err := client.ListHistory(&uber.Pager{
MaxPages: 4,
LimitPerPage: 10,
StartOffset: 0,
})
if err != nil {
log.Fatal(err)
}
for page := range pagesChan {
if page.Err != nil {
fmt.Printf("Page: #%d err: %v\n", page.PageNumber, page.Err)
continue
}
fmt.Printf("Page: #%d\n\n", page.PageNumber)
for i, trip := range page.Trips {
startCity := trip.StartCity
if startCity.Name == "Tokyo" {
fmt.Printf("aha found the first Tokyo trip, canceling any more requests!: %#v\n", trip)
cancelPaging()
break
}
// Otherwise, continue listing
fmt.Printf("Trip: #%d ==> %#v place: %#v\n", i, trip, startCity)
}
}
}
All the necessary methods have been implemented, now what's needed is an app to glue all the pieces together simple ideas:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The trip experiences API allows Uber to send contextual information about the user, for example:
Now that webhooks have been added with webhooks: implemented Uber webhooks #30, it is now possible to implement a trip experiences app that say integrates with their:
The text was updated successfully, but these errors were encountered: