-
Notifications
You must be signed in to change notification settings - Fork 117
Adding the phone number apis #703
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
Conversation
davidzhao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lg, just a couple of nits
cmd/lk/phone_number.go
Outdated
| return nil | ||
| } | ||
|
|
||
| return listAndPrint(ctx, cmd, func(ctx context.Context, req *livekit.SearchPhoneNumbersRequest) (*livekit.SearchPhoneNumbersResponse, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this is a bit hard to read. any chance to break it out?
cmd/lk/phone_number.go
Outdated
| var ( | ||
| PhoneNumberCommands = []*cli.Command{ | ||
| { | ||
| Name: "phonenumber", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we just use number for short? wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, that works well for the cli. Want to call out that the apis use phonenumber though.
…endering block more readable
rektdeckard
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Minor comments on naming
cmd/lk/phone_number.go
Outdated
| &cli.IntFlag{ | ||
| Name: "limit", | ||
| Usage: "Maximum number of results (default: 50)", | ||
| Value: 50, | ||
| }, | ||
| &cli.StringFlag{ | ||
| Name: "page-token", | ||
| Usage: "Token for pagination (empty for first page)", | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the best solution for now, but we were discussing either running implicit (behind the scenes) pagination (example here: #694) or doing a TUI pager that would abstract away having to find and pass an explicit page-token.
As it stands, will I need to format my results as --json to see the page token in order to be able to fetch the next page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mention it here because we can be pretty sure that at least a few of our customers will have hundreds of numbers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I haven't implemented pagination fully in the backend. I'm going to remove this param for now, fix it in the backend and then create another PR for pagination.
on the approach for pagination, for the implicit pagination, would we run into memory issues if we load large lists ? I guess I'd like to understand concerns against the page-token approach.
cmd/lk/phone_number.go
Outdated
| Usage: "Use phone number ID for direct lookup", | ||
| }, | ||
| &cli.StringFlag{ | ||
| Name: "phonenumber", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: number is simpler
cmd/lk/phone_number.go
Outdated
| Action: purchasePhoneNumbers, | ||
| Flags: []cli.Flag{ | ||
| &cli.StringSliceFlag{ | ||
| Name: "phonenumbers", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: numbers is nicer, and how we refer to them in other SIP contexts
cmd/lk/phone_number.go
Outdated
| Usage: "Use phone number IDs for direct lookup", | ||
| }, | ||
| &cli.StringSliceFlag{ | ||
| Name: "phonenumbers", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
…nenumber(s) to number(s)
de97c0c to
d21eca3
Compare
No description provided.