-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
delivery: implemented Client.ListDeliveries
Updates #32 * Implemented Client.ListDeliveries. * Introduced scope oauth2.ScopeDelivery. NB: * ListDeliveries hits the /v1 API instead of /v1.2 Sample usage: ```go func main() { client, err := uber.NewClientFromOAuth2File(os.ExpandEnv("$HOME/.uber/credentials.json")) if err != nil { log.Fatal(err) } delivRes, err := client.ListDeliveries(&uber.DeliveryListRequest{ Status: uber.StatusCompleted, StartOffset: 20, }) if err != nil { log.Fatal(err) } itemCount := uint64(0) for page := range delivRes.Pages { if page.Err != nil { fmt.Printf("Page #%d err: %v", page.PageNumber, page.Err) } for i, delivery := range page.Deliveries { fmt.Printf("\t(%d): %#v\n", i, delivery) itemCount += 1 } if itemCount >= 10 { delivRes.Cancel() } } } ```
- Loading branch information
Showing
6 changed files
with
301 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.