Skip to content
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

Updating operations to accept generic request options instead of just query parameters #522

Merged
merged 5 commits into from
Jul 27, 2020

Conversation

douglasmiller
Copy link
Contributor

This is an update to the 4.x version of the client.

Operations now require that query string parameters be specified under the params key of the $options parameter. This will allow for additional options to be specified in requests. Currently, this only includes custom headers, but may be expanded in the future.

This pull request also adds the getRequest() method to the \Recurly\Response class for debugging purposes.

In the 3.x version of the client, query string parameters would be specified directly on the $options parameter of the operation:

$options = [
  'limit' => 200
];
$accounts = $client->listAccounts($options);

With this update, the params key must be added to the $options. Additionally, a headers key may be added:

$options = [
  'params' => [
    'limit' => 200
  ],
  'headers' => [
    'Accept-Language' => 'fr'
  ]
];
$accounts = $client->listAccounts($options);

Copy link
Contributor

@bhelx bhelx left a comment

Choose a reason for hiding this comment

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

👍

@bhelx bhelx merged commit 044577e into v3-v2020-01-01 Jul 27, 2020
@bhelx bhelx deleted the options-params branch July 27, 2020 17:55
@joannasese joannasese added the V4 v2021-02-25 Client label Feb 11, 2021
douglasmiller added a commit that referenced this pull request Mar 1, 2021
# Changelog

## [Unreleased](https://github.com/recurly/recurly-client-php/tree/HEAD)

[Full Changelog](3.11.0...HEAD)

# Major Version Release

The 4.x major version of the client pairs with the `v2021-02-25` API version. This version of the client and the API contain breaking changes that should be considered before upgrading your integration.

## Breaking Changes in the API
All changes to the core API are documented in the [Developer Portal changelog](https://developers.recurly.com/api/changelog.html#v2021-02-25---current-ga-version)

## Breaking Changes in Client

- Require query string parameters to be specified under the `params` key of the `$options` parameter. [[#522](#522)]

    ### 3.x
    ```php
    $options = [
      'limit' => 200
    ];
    $accounts = $client->listAccounts($options);
   ```
    ### 4.x
    ```php
    $options = [
      'params' => [
        'limit' => 200
      ],
      'headers' => [
        'Accept-Language' => 'fr'
      ]
    ];
    $accounts = $client->listAccounts($options);
    ```

**Implemented enhancements:**

- Updating operations to accept generic request options instead of just query parameters [\#522](#522) ([douglasmiller](https://github.com/douglasmiller))

**Merged pull requests:**

- Updating changelog script and changelog generator config for 4.x release [\#582](#582) ([douglasmiller](https://github.com/douglasmiller))
- Null checking variable before calling property\_exists to prevent Warning [\#526](#526) ([douglasmiller](https://github.com/douglasmiller))
- Mon Jul  6 14:54:15 UTC 2020 Upgrade API version v2019-10-10 [\#515](#515) ([douglasmiller](https://github.com/douglasmiller))
@douglasmiller douglasmiller mentioned this pull request Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement V4 v2021-02-25 Client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants