Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add support for arbitrary post data #56

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

Closed
wants to merge 10 commits into from
Closed

Add support for arbitrary post data #56

wants to merge 10 commits into from

Conversation

kyleconroy
Copy link
Contributor

Fix issues #54 and #55. We will no longer have to update the library every time we add a new parameter

@kyleconroy
Copy link
Contributor Author

Looking for a review from @kevinburke

return dict(p)


def format_name(word):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why we need both this method and convert_case a few lines down, there doesn't seem to be much difference.

"NearNumber": near_number,
"NearLatLong": near_lat_long,
})
kwargs["in_region"] = kwargs.get("in_region", region)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I'm a little confused here.

  • why would you pass in_region or in_postal_code instead of passing region or postal_code?
  • why can't we just use kwargs for postal code, region, lata, etc?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we're eventually setting transform_params to use in_postal_code, which means, I believe, that InPostalCode will eventually be sent over the wire? That's incorrect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Available Phone Numbers resource expects the InPostalCode and InRegion list filters, so this is correct

@@ -504,7 +510,7 @@ class Notifications(ListResource):
instance = Notification

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Params is never defined here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never mind, it's a typo. i deleted it

@@ -801,13 +774,7 @@ def validate(self, phone_number, friendly_name=None, call_delay=None,
:param extension: Digits to dial after connecting the validation call.
:returns: A response dictionary
"""
params = transform_params({
"PhoneNumber": phone_number,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

postal_code=None, near_number=None, near_lat_long=None, lata=None,
rate_center=None, distance=None, contains=None):
def list(self, type="local", country="US", region=None, postal_code=None,
lata=None, rate_center=None, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Kyle,
Lata, Postal code and rate center are optional parameters, so I'm curious why we're not just pulling them out of the kwargs array with

kwargs.get('rate_center', None)

Unless this is another thing for backwards compatibility?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is more backwards compatibility. We don't want to convert those arguments into POST parameters because they will be named incorrectly

@kevinburke
Copy link
Contributor

For the transcriptions resource on lines ~444, do we just assume that people pass in the correct params in uppercase? or should that have a transform_params as well? Also for connect apps.

@kevinburke
Copy link
Contributor

This is messy, I am going to close and resubmit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants