php-http-client icon indicating copy to clipboard operation
php-http-client copied to clipboard

feat: enable endpoint version selection

Open funder7 opened this issue 1 year ago • 3 comments

Fixes

This update allows the selection of and endpoint version, needed in cases like Segmenting contacts V2 -> Update segment

As you can see, the example code snippet in the doc, uses a syntax that is not compatible with php (calling the endpoint is in fact not possible):

  $response = $sg->client->marketing()->segments()->2.0()->_($segment_id)->patch();
                                                 // ^^^^ wrong syntax

  # working example
  $response = $sg->client->marketing()->segments()->_version('2.0')->_($segment_id)->patch();
                                                 // ^^^^^^^^^^^^^^ 

Contents

  • utility method to set version in the URL
  • unit test of the new functionality
  • improved readability with null coalescing operator

Checklist

  • [x] I acknowledge that all my contributions will be made under the project's license
  • [x] I have made a material change to the repo (functionality, testing, spelling, grammar)
  • [x] I have read the Contribution Guidelines and my PR follows them
  • [x] I have titled the PR appropriately
  • [x] I have updated my branch with the main branch
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [ ] I have added the necessary documentation about the functionality in the appropriate .md file
  • [x] I have added inline documentation to the code I modified

If you have questions, please file a support ticket.

funder7 avatar Oct 27 '23 18:10 funder7

@twilio-dx any news about this PR? Thanks

funder7 avatar Oct 30 '23 23:10 funder7

Hi @funder7! We have added this to our list and we'll be prioritising it soon. Thanks!

tiwarishubham635 avatar Nov 09 '23 07:11 tiwarishubham635

Hi, do you think that this and the other PR #159 will be merged at some point? :-)

funder7 avatar Jun 15 '24 20:06 funder7