-
Notifications
You must be signed in to change notification settings - Fork 0
DEVEXP-785: Numbers API - Snippets #2
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
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.
Is it going to be a root commit that will reset all the history? It should be the case as there is nothing to save from the previous version
number_type="LOCAL" | ||
) | ||
page_counter = 1 | ||
while active_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.
Let me check if I understand correctly: this will evaluate to True only is the API call is successful. Then you'll enter in the loop and start displaying the numbers page by page.
active_numbers
will be updated within the loop and should always be evaluated to True as long as the API answers properly.
But in the case there is an error with the API, wouldn't the SDK raise an error? If so, then it would mean this loop is unreachable.
All of this to say: wouldn't it be more readable to use while True:
?
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.
Done
@@ -0,0 +1,7 @@ | |||
def execute(numbers_service): | |||
phone_number = "YOUR_PHONE_NUMBER" |
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.
It shouldn't be "YOUR" phone number but "A" phone number as at this moment, you haven't rented it yet
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.
Done
|
||
|
||
def execute(numbers_service): | ||
phone_number = "YOUR_PHONE_NUMBER" |
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.
Same here. I just checked what I did in the node.js snippets and I call it available_phone_number_to_be_rented
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.
Done
voice_configuration: VoiceConfigurationDictType = { | ||
"app_id": "YOUR_APP_ID", | ||
} |
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.
Although it's not mandatory for backward compatibility reasons, I think it's best to showcase the type
property too (RTC for the app_id
use case)
Note for myself: do it too for Node.js :D
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.
Done
def callback_configuration_get(numbers_service): | ||
response = numbers_service.callback_configuration.get() | ||
|
||
print("Callback Configuration:", response) |
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: add a space after the :
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.
Done
4047dfc
to
3c1f783
Compare
Created an orphan branch |
No description provided.