From 2cc09246702d1b90cb0926e1615b41c49c9e4731 Mon Sep 17 00:00:00 2001 From: ShreyaThapa <44006085+ShreyaThapa@users.noreply.github.com> Date: Wed, 11 Dec 2019 08:37:50 -0600 Subject: [PATCH] 1.3.0 (#40) * Added support for custom headers * Updated README with changelog and example * Update ApiClient.php --- README.md | 8 ++- lib/AccountsApi.php | 10 +++- lib/ApiClient.php | 14 ++++- lib/BeneficialownersApi.php | 21 ++++++-- lib/BusinessclassificationsApi.php | 10 +++- lib/CustomersApi.php | 82 +++++++++++++++++++++++------- lib/DocumentsApi.php | 5 +- lib/EventsApi.php | 11 +++- lib/FundingsourcesApi.php | 52 +++++++++++++++---- lib/KbaApi.php | 10 +++- lib/LabelreallocationsApi.php | 10 +++- lib/LabelsApi.php | 21 ++++++-- lib/LedgerentriesApi.php | 5 +- lib/MasspaymentitemsApi.php | 11 +++- lib/MasspaymentsApi.php | 27 ++++++++-- lib/OndemandauthorizationsApi.php | 5 +- lib/RootApi.php | 5 +- lib/SandboxApi.php | 5 +- lib/TransfersApi.php | 37 +++++++++++--- lib/WebhooksApi.php | 21 ++++++-- lib/WebhooksubscriptionsApi.php | 25 +++++++-- 21 files changed, 317 insertions(+), 78 deletions(-) diff --git a/README.md b/README.md index 434521d..274897c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The new Dwolla API V2 SDK, as generated by [this fork of swagger-codegen](https: ## Version -1.2.0 +1.3.0 ## Installation @@ -61,6 +61,9 @@ $location = $customersApi->create([ 'lastName' => 'Smith', 'email' => 'jsmith@gmail.com', 'phone' => '7188675309' +], +[ + 'Idempotency-Key' => '9051a62-3403-11e6-ac61-9e71128cae77' ]); ``` @@ -155,6 +158,9 @@ Each model represents the different kinds of requests and responses that can be ## Changelog +1.3.0 +* Add support for custom headers on all requests. (e.g. [Idempotency-Key](https://docs.dwolla.com/#idempotency-key) header) + 1.2.0 * API schema updated, `CustomersApi` updated to support KBA related endpoint. * New `KbaApi`. diff --git a/lib/AccountsApi.php b/lib/AccountsApi.php index 4864a46..3e017a9 100644 --- a/lib/AccountsApi.php +++ b/lib/AccountsApi.php @@ -65,7 +65,7 @@ public function setApiClient($apiClient) { * @param string $id Account ID to get info for. (required) * @return FullAccountInfo */ - public function id($id) { + public function id($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -87,6 +87,9 @@ public function id($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -131,7 +134,7 @@ public function id($id) { * @param string $id Account ID to create token for. (required) * @return AccountOAuthToken */ - public function createFundingSourcesToken($id) { + public function createFundingSourcesToken($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -153,6 +156,9 @@ public function createFundingSourcesToken($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } diff --git a/lib/ApiClient.php b/lib/ApiClient.php index 4b2c39d..788609b 100644 --- a/lib/ApiClient.php +++ b/lib/ApiClient.php @@ -35,7 +35,7 @@ class ApiClient { /* * @var string user agent of the HTTP request, set to "PHP-Swagger" by default */ - protected $user_agent = "php-swagger-1.2.0"; + protected $user_agent = "php-swagger-1.3.0"; /** * @param string $host Base url of the API server (optional) @@ -478,7 +478,7 @@ public static function selectHeaderAccept($accept) { /* * return the content type based on an array of content-type provided * - * @param array[string] content_type_array Array fo content-type + * @param array[string] content_type_array Array of content-type * @return string Content-Type (e.g. application/json) */ public static function selectHeaderContentType($content_type) { @@ -491,5 +491,15 @@ public static function selectHeaderContentType($content_type) { } } + /* + * return the idempotency key based on an array of idempotency-key provided + * + * @param array[string] idempotency_key_array Array of idempotency-key + * @return string Idempotency-Key (e.g. some UUID) + */ + public static function selectHeaderIdempotencyKey($idempotency_key) { + return $idempotency_key; + } + } diff --git a/lib/BeneficialownersApi.php b/lib/BeneficialownersApi.php index e60c225..e4f7f1c 100644 --- a/lib/BeneficialownersApi.php +++ b/lib/BeneficialownersApi.php @@ -65,7 +65,7 @@ public function setApiClient($apiClient) { * @param string $id ID of owner to lookup (required) * @return Owner */ - public function getById($id) { + public function getById($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -87,6 +87,9 @@ public function getById($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -132,7 +135,7 @@ public function getById($id) { * @param string $id ID of owner to update (required) * @return Owner */ - public function update($body, $id) { + public function update($body, $id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -154,6 +157,9 @@ public function update($body, $id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -202,7 +208,7 @@ public function update($body, $id) { * @param string $id ID of owner. (required) * @return DocumentListResponse */ - public function getBeneficialOwnerDocuments($id) { + public function getBeneficialOwnerDocuments($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -224,6 +230,9 @@ public function getBeneficialOwnerDocuments($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -268,7 +277,7 @@ public function getBeneficialOwnerDocuments($id) { * @param string $id ID of beneficial owner to delete. (required) * @return Owner */ - public function deleteById($id) { + public function deleteById($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -290,7 +299,9 @@ public function deleteById($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } // Entire URL for ID diff --git a/lib/BusinessclassificationsApi.php b/lib/BusinessclassificationsApi.php index d67b6f3..7f55150 100644 --- a/lib/BusinessclassificationsApi.php +++ b/lib/BusinessclassificationsApi.php @@ -64,7 +64,7 @@ public function setApiClient($apiClient) { * * @return BusinessClassificationListResponse */ - public function _list() { + public function _list($headers = null) { // parse inputs @@ -81,6 +81,9 @@ public function _list() { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -115,7 +118,7 @@ public function _list() { * @param string $id Id of business classification to get. (required) * @return BusinessClassification */ - public function getBusinessClassification($id) { + public function getBusinessClassification($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -137,6 +140,9 @@ public function getBusinessClassification($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } diff --git a/lib/CustomersApi.php b/lib/CustomersApi.php index a452bba..37a9cd5 100644 --- a/lib/CustomersApi.php +++ b/lib/CustomersApi.php @@ -68,7 +68,7 @@ public function setApiClient($apiClient) { * @param string $status Customer status. (optional) * @return CustomerListResponse */ - public function _list($limit = null, $offset = null, $search = null, $status = null) { + public function _list($limit = null, $offset = null, $search = null, $status = null, $headers = null) { // parse inputs @@ -85,6 +85,10 @@ public function _list($limit = null, $offset = null, $search = null, $status = n } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } + // query params if($limit !== null) { $queryParams['limit'] = $this->apiClient->toQueryValue($limit); @@ -130,7 +134,7 @@ public function _list($limit = null, $offset = null, $search = null, $status = n * @param CreateCustomer $body Customer to create. (required) * @return Unit */ - public function create($body) { + public function create($body, $headers = null) { // parse inputs @@ -146,11 +150,14 @@ public function create($body) { $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } - + // body params $_tempBody = null; if (isset($body)) { @@ -185,7 +192,7 @@ public function create($body) { * @param string $id Id of customer to get. (required) * @return Customer */ - public function getCustomer($id) { + public function getCustomer($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -207,6 +214,9 @@ public function getCustomer($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -252,7 +262,7 @@ public function getCustomer($id) { * @param string $id Id of customer to update. (required) * @return Customer */ - public function updateCustomer($body, $id) { + public function updateCustomer($body, $id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -274,6 +284,9 @@ public function updateCustomer($body, $id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -323,7 +336,7 @@ public function updateCustomer($body, $id) { * @param string $id Customer id to add owner for for. (required) * @return Owner */ - public function addBeneficialOwner($body, $id) { + public function addBeneficialOwner($body, $id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -345,6 +358,9 @@ public function addBeneficialOwner($body, $id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -393,7 +409,7 @@ public function addBeneficialOwner($body, $id) { * @param string $id ID of customer. (required) * @return BeneficialOwnerListResponse */ - public function getBeneficialOwners($id) { + public function getBeneficialOwners($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -415,6 +431,9 @@ public function getBeneficialOwners($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -459,7 +478,7 @@ public function getBeneficialOwners($id) { * @param string $id Customer id to get ownership certification status for. (required) * @return Ownership */ - public function getOwnershipStatus($id) { + public function getOwnershipStatus($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -480,7 +499,10 @@ public function getOwnershipStatus($id) { $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); - + + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -526,7 +548,7 @@ public function getOwnershipStatus($id) { * @param string $id Customer id to change ownership status. (required) * @return Ownership */ - public function changeOwnershipStatus($body, $id) { + public function changeOwnershipStatus($body, $id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -548,6 +570,9 @@ public function changeOwnershipStatus($body, $id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -596,7 +621,7 @@ public function changeOwnershipStatus($body, $id) { * @param string $id ID of customer. (required) * @return DocumentListResponse */ - public function getCustomerDocuments($id) { + public function getCustomerDocuments($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -618,7 +643,9 @@ public function getCustomerDocuments($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); - + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } // Entire URL for ID @@ -662,7 +689,7 @@ public function getCustomerDocuments($id) { * @param string $id ID of customer. (required) * @return Unit */ - public function uploadDocument($id) { + public function uploadDocument($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -684,6 +711,9 @@ public function uploadDocument($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('multipart/form-data')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -728,7 +758,7 @@ public function uploadDocument($id) { * @param string $id ID of customer. (required) * @return CustomerOAuthToken */ - public function createFundingSourcesTokenForCustomer($id) { + public function createFundingSourcesTokenForCustomer($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -750,6 +780,9 @@ public function createFundingSourcesTokenForCustomer($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -794,7 +827,7 @@ public function createFundingSourcesTokenForCustomer($id) { * @param string $id ID of customer. (required) * @return IavToken */ - public function getCustomerIavToken($id) { + public function getCustomerIavToken($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -816,6 +849,9 @@ public function getCustomerIavToken($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -860,7 +896,7 @@ public function getCustomerIavToken($id) { * @param string $id Customer id to initiate kba for. (required) * @return Unit */ - public function initiateKba($id) { + public function initiateKba($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -882,6 +918,9 @@ public function initiateKba($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -927,7 +966,7 @@ public function initiateKba($id) { * @param string $id Customer id to create label for. (required) * @return Label */ - public function createLabel($body, $id) { + public function createLabel($body, $id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -949,6 +988,9 @@ public function createLabel($body, $id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -997,7 +1039,7 @@ public function createLabel($body, $id) { * @param string $id Customer id to get labels for. (required) * @return LabelListResponse */ - public function getLabelsForCustomer($id, $limit = null, $offset = null) { + public function getLabelsForCustomer($id, $limit = null, $offset = null, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -1019,6 +1061,10 @@ public function getLabelsForCustomer($id, $limit = null, $offset = null) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } + // query params if($limit !== null) { $queryParams['limit'] = $this->apiClient->toQueryValue($limit); diff --git a/lib/DocumentsApi.php b/lib/DocumentsApi.php index 1b4551b..21a83de 100644 --- a/lib/DocumentsApi.php +++ b/lib/DocumentsApi.php @@ -65,7 +65,7 @@ public function setApiClient($apiClient) { * @param string $id Id of document to get. (required) * @return Document */ - public function getDocument($id) { + public function getDocument($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -87,6 +87,9 @@ public function getDocument($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } diff --git a/lib/EventsApi.php b/lib/EventsApi.php index be4442c..09427ee 100644 --- a/lib/EventsApi.php +++ b/lib/EventsApi.php @@ -66,7 +66,7 @@ public function setApiClient($apiClient) { * @param int $offset How many results to skip. (optional) * @return EventListResponse */ - public function events($limit = null, $offset = null) { + public function events($limit = null, $offset = null, $headers = null) { // parse inputs @@ -83,6 +83,10 @@ public function events($limit = null, $offset = null) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } + // query params if($limit !== null) { $queryParams['limit'] = $this->apiClient->toQueryValue($limit); @@ -123,7 +127,7 @@ public function events($limit = null, $offset = null) { * @param string $id ID of application event to get. (required) * @return ApplicationEvent */ - public function id($id) { + public function id($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -145,6 +149,9 @@ public function id($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } diff --git a/lib/FundingsourcesApi.php b/lib/FundingsourcesApi.php index ca5ed56..347f3c7 100644 --- a/lib/FundingsourcesApi.php +++ b/lib/FundingsourcesApi.php @@ -66,7 +66,7 @@ public function setApiClient($apiClient) { * @param boolean $removed Filter funding sources by this value. (optional) * @return FundingSourceListResponse */ - public function getAccountFundingSources($id, $removed = null) { + public function getAccountFundingSources($id, $removed = null, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -88,6 +88,10 @@ public function getAccountFundingSources($id, $removed = null) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } + // query params if($removed !== null) { $queryParams['removed'] = $this->apiClient->toQueryValue($removed); @@ -136,7 +140,7 @@ public function getAccountFundingSources($id, $removed = null) { * @param boolean $removed Filter funding sources by this value. (optional) * @return FundingSourceListResponse */ - public function getCustomerFundingSources($id, $removed = null) { + public function getCustomerFundingSources($id, $removed = null, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -157,6 +161,10 @@ public function getCustomerFundingSources($id, $removed = null) { $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } // query params if($removed !== null) { @@ -206,7 +214,7 @@ public function getCustomerFundingSources($id, $removed = null) { * @param string $id Customer id to create funding source for. (required) * @return FundingSource */ - public function createCustomerFundingSource($body, $id) { + public function createCustomerFundingSource($body, $id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -228,6 +236,9 @@ public function createCustomerFundingSource($body, $id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -276,7 +287,7 @@ public function createCustomerFundingSource($body, $id) { * @param CreateFundingSourceRequest $body Funding source to create. (required) * @return FundingSource */ - public function createFundingSource($body) { + public function createFundingSource($body, $headers = null) { // parse inputs @@ -293,6 +304,9 @@ public function createFundingSource($body) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -331,7 +345,7 @@ public function createFundingSource($body) { * @param string $id Funding source ID to get. (required) * @return FundingSource */ - public function id($id) { + public function id($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -353,6 +367,9 @@ public function id($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -398,7 +415,7 @@ public function id($id) { * @param string $id Funding source ID to update. (required) * @return FundingSource */ - public function update($body, $id) { + public function update($body, $id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -420,6 +437,9 @@ public function update($body, $id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -469,7 +489,7 @@ public function update($body, $id) { * @param string $id Funding source ID to remove. (required) * @return FundingSource */ - public function softDelete($body, $id) { + public function softDelete($body, $id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -491,6 +511,9 @@ public function softDelete($body, $id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -539,7 +562,7 @@ public function softDelete($body, $id) { * @param string $id Funding source ID to get the balance for. (required) * @return FundingSourceBalance */ - public function getBalance($id) { + public function getBalance($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -561,6 +584,9 @@ public function getBalance($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -605,7 +631,7 @@ public function getBalance($id) { * @param string $id Funding source ID to check for pending validation deposits for. (required) * @return MicroDepositsInitiated */ - public function verifyMicroDepositsExist($id) { + public function verifyMicroDepositsExist($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -627,6 +653,9 @@ public function verifyMicroDepositsExist($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -672,7 +701,7 @@ public function verifyMicroDepositsExist($id) { * @param string $id Funding source ID to initiate or verify micro deposits for. (required) * @return MicroDeposits */ - public function microDeposits($body, $id) { + public function microDeposits($body, $id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -694,6 +723,9 @@ public function microDeposits($body, $id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } diff --git a/lib/KbaApi.php b/lib/KbaApi.php index efc2c01..33c8c0a 100644 --- a/lib/KbaApi.php +++ b/lib/KbaApi.php @@ -65,7 +65,7 @@ public function setApiClient($apiClient) { * @param string $id ID of KBA session to get. (required) * @return KbaQuestions */ - public function getKbaQuestions($id) { + public function getKbaQuestions($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -87,6 +87,9 @@ public function getKbaQuestions($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -132,7 +135,7 @@ public function getKbaQuestions($id) { * @param string $id Id of KBA session to answer (required) * @return AnswerKbaQuestionsResponse */ - public function answerKbaQuestions($body, $id) { + public function answerKbaQuestions($body, $id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -154,6 +157,9 @@ public function answerKbaQuestions($body, $id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } diff --git a/lib/LabelreallocationsApi.php b/lib/LabelreallocationsApi.php index a556c99..aeb4711 100644 --- a/lib/LabelreallocationsApi.php +++ b/lib/LabelreallocationsApi.php @@ -65,7 +65,7 @@ public function setApiClient($apiClient) { * @param LabelReallocationRequest $body Labels to reallocate. (required) * @return LabelReallocation */ - public function reallocateLabel($body) { + public function reallocateLabel($body, $headers = null) { // parse inputs @@ -82,6 +82,9 @@ public function reallocateLabel($body) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -120,7 +123,7 @@ public function reallocateLabel($body) { * @param string $id Label reallocation ID (required) * @return LabelReallocation */ - public function getLabelReallocation($id) { + public function getLabelReallocation($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -142,6 +145,9 @@ public function getLabelReallocation($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } diff --git a/lib/LabelsApi.php b/lib/LabelsApi.php index 8a81854..0547719 100644 --- a/lib/LabelsApi.php +++ b/lib/LabelsApi.php @@ -65,7 +65,7 @@ public function setApiClient($apiClient) { * @param string $id ID of label to get. (required) * @return Label */ - public function getLabel($id) { + public function getLabel($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -87,6 +87,9 @@ public function getLabel($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -131,7 +134,7 @@ public function getLabel($id) { * @param string $id Label id to remove. (required) * @return Label */ - public function removeLabel($id) { + public function removeLabel($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -153,6 +156,9 @@ public function removeLabel($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -199,7 +205,7 @@ public function removeLabel($id) { * @param int $offset How many results to skip. (optional) * @return LedgerEntryListResponse */ - public function getLedgerEntriesForLabel($id, $limit = null, $offset = null) { + public function getLedgerEntriesForLabel($id, $limit = null, $offset = null, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -221,6 +227,10 @@ public function getLedgerEntriesForLabel($id, $limit = null, $offset = null) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } + // query params if($limit !== null) { $queryParams['limit'] = $this->apiClient->toQueryValue($limit); @@ -270,7 +280,7 @@ public function getLedgerEntriesForLabel($id, $limit = null, $offset = null) { * @param string $id Label id to add the ledger entry for. (required) * @return LedgerEntry */ - public function addLedgerEntry($body, $id) { + public function addLedgerEntry($body, $id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -292,6 +302,9 @@ public function addLedgerEntry($body, $id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } diff --git a/lib/LedgerentriesApi.php b/lib/LedgerentriesApi.php index 950f420..c49402d 100644 --- a/lib/LedgerentriesApi.php +++ b/lib/LedgerentriesApi.php @@ -65,7 +65,7 @@ public function setApiClient($apiClient) { * @param string $id ID of ledger entry to get. (required) * @return LedgerEntry */ - public function getLedgerEntry($id) { + public function getLedgerEntry($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -87,6 +87,9 @@ public function getLedgerEntry($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } diff --git a/lib/MasspaymentitemsApi.php b/lib/MasspaymentitemsApi.php index ce5380f..53da776 100644 --- a/lib/MasspaymentitemsApi.php +++ b/lib/MasspaymentitemsApi.php @@ -65,7 +65,7 @@ public function setApiClient($apiClient) { * @param string $id ID of mass payment item to get. (required) * @return MassPaymentItem */ - public function byId($id) { + public function byId($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -87,6 +87,9 @@ public function byId($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -135,7 +138,7 @@ public function byId($id) { * @param string $correlation_id Correlation ID to search by. (optional) * @return MassPaymentItemListResponse */ - public function getMassPaymentItems($id, $limit = null, $offset = null, $status = null, $correlation_id = null) { + public function getMassPaymentItems($id, $limit = null, $offset = null, $status = null, $correlation_id = null, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -157,6 +160,10 @@ public function getMassPaymentItems($id, $limit = null, $offset = null, $status } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } + // query params if($limit !== null) { $queryParams['limit'] = $this->apiClient->toQueryValue($limit); diff --git a/lib/MasspaymentsApi.php b/lib/MasspaymentsApi.php index cc696ca..3b96cb8 100644 --- a/lib/MasspaymentsApi.php +++ b/lib/MasspaymentsApi.php @@ -68,7 +68,7 @@ public function setApiClient($apiClient) { * @param string $correlation_id Correlation ID to search by. (optional) * @return MassPaymentListResponse */ - public function getByAccount($id, $limit = null, $offset = null, $correlation_id = null) { + public function getByAccount($id, $limit = null, $offset = null, $correlation_id = null, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -90,6 +90,10 @@ public function getByAccount($id, $limit = null, $offset = null, $correlation_id } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } + // query params if($limit !== null) { $queryParams['limit'] = $this->apiClient->toQueryValue($limit); @@ -146,7 +150,7 @@ public function getByAccount($id, $limit = null, $offset = null, $correlation_id * @param string $correlation_id Correlation ID to search by. (required) * @return MassPaymentListResponse */ - public function getByCustomer($id, $limit = null, $offset = null, $correlation_id = null) { + public function getByCustomer($id, $limit = null, $offset = null, $correlation_id = null, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -168,6 +172,10 @@ public function getByCustomer($id, $limit = null, $offset = null, $correlation_i } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } + // query params if($limit !== null) { $queryParams['limit'] = $this->apiClient->toQueryValue($limit); @@ -221,7 +229,7 @@ public function getByCustomer($id, $limit = null, $offset = null, $correlation_i * @param MassPaymentRequestBody $body Mass payment request. (required) * @return Unit */ - public function create($body) { + public function create($body, $headers = null) { // parse inputs @@ -238,6 +246,9 @@ public function create($body) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -276,7 +287,7 @@ public function create($body) { * @param string $id ID of mass payment to get. (required) * @return MassPayment */ - public function byId($id) { + public function byId($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -298,6 +309,9 @@ public function byId($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -343,7 +357,7 @@ public function byId($id) { * @param string $id ID of mass-payment to update (required) * @return MassPayment */ - public function update($body, $id) { + public function update($body, $id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -365,6 +379,9 @@ public function update($body, $id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } diff --git a/lib/OndemandauthorizationsApi.php b/lib/OndemandauthorizationsApi.php index 2100901..e54cc64 100644 --- a/lib/OndemandauthorizationsApi.php +++ b/lib/OndemandauthorizationsApi.php @@ -64,7 +64,7 @@ public function setApiClient($apiClient) { * * @return Authorization */ - public function createAuthorization() { + public function createAuthorization($headers = null) { // parse inputs @@ -81,6 +81,9 @@ public function createAuthorization() { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } diff --git a/lib/RootApi.php b/lib/RootApi.php index fbea696..6810fc8 100644 --- a/lib/RootApi.php +++ b/lib/RootApi.php @@ -64,7 +64,7 @@ public function setApiClient($apiClient) { * * @return CatalogResponse */ - public function root() { + public function root($headers = null) { // parse inputs @@ -81,6 +81,9 @@ public function root() { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } diff --git a/lib/SandboxApi.php b/lib/SandboxApi.php index ad7a225..39a3519 100644 --- a/lib/SandboxApi.php +++ b/lib/SandboxApi.php @@ -64,7 +64,7 @@ public function setApiClient($apiClient) { * * @return ProcessResult */ - public function simulations() { + public function simulations($headers = null) { // parse inputs @@ -81,6 +81,9 @@ public function simulations() { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } diff --git a/lib/TransfersApi.php b/lib/TransfersApi.php index 6193a92..2716915 100644 --- a/lib/TransfersApi.php +++ b/lib/TransfersApi.php @@ -68,7 +68,7 @@ public function setApiClient($apiClient) { * @param string $status What status to filter by. (optional) * @return TransferListResponse */ - public function getAccountTransfers($id, $limit = null, $offset = null, $status = null) { + public function getAccountTransfers($id, $limit = null, $offset = null, $status = null, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -90,6 +90,10 @@ public function getAccountTransfers($id, $limit = null, $offset = null, $status } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } + // query params if($limit !== null) { $queryParams['limit'] = $this->apiClient->toQueryValue($limit); @@ -146,7 +150,7 @@ public function getAccountTransfers($id, $limit = null, $offset = null, $status * @param string $status What status to filter by. (required) * @return TransferListResponse */ - public function getCustomerTransfers($id, $limit = null, $offset = null, $status = null) { + public function getCustomerTransfers($id, $limit = null, $offset = null, $status = null, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -168,6 +172,10 @@ public function getCustomerTransfers($id, $limit = null, $offset = null, $status } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } + // query params if($limit !== null) { $queryParams['limit'] = $this->apiClient->toQueryValue($limit); @@ -221,7 +229,7 @@ public function getCustomerTransfers($id, $limit = null, $offset = null, $status * @param TransferRequestBody $body Transfer request. (required) * @return Unit */ - public function create($body) { + public function create($body, $headers = null) { // parse inputs @@ -238,6 +246,9 @@ public function create($body) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -276,7 +287,7 @@ public function create($body) { * @param string $id ID of transfer to get. (required) * @return Transfer */ - public function byId($id) { + public function byId($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -298,6 +309,9 @@ public function byId($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -343,7 +357,7 @@ public function byId($id) { * @param string $id ID of transfer to get. (required) * @return Transfer */ - public function update($body, $id) { + public function update($body, $id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -365,6 +379,9 @@ public function update($body, $id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -413,7 +430,7 @@ public function update($body, $id) { * @param string $id ID of failed bank transfer to get. (required) * @return TransferFailure */ - public function failureById($id) { + public function failureById($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -435,6 +452,9 @@ public function failureById($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -479,7 +499,7 @@ public function failureById($id) { * @param string $id Transfer id to get fees for. (required) * @return FeesBySourceResponse */ - public function getFeesBySource($id) { + public function getFeesBySource($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -501,6 +521,9 @@ public function getFeesBySource($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } diff --git a/lib/WebhooksApi.php b/lib/WebhooksApi.php index 8d55389..9b87f33 100644 --- a/lib/WebhooksApi.php +++ b/lib/WebhooksApi.php @@ -67,7 +67,7 @@ public function setApiClient($apiClient) { * @param int $offset How many results to skip. (optional) * @return WebhookEventListResponse */ - public function hooksById($id, $limit = null, $offset = null) { + public function hooksById($id, $limit = null, $offset = null, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -89,6 +89,10 @@ public function hooksById($id, $limit = null, $offset = null) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } + // query params if($limit !== null) { $queryParams['limit'] = $this->apiClient->toQueryValue($limit); @@ -139,7 +143,7 @@ public function hooksById($id, $limit = null, $offset = null) { * @param string $id ID of webhook to get. (required) * @return Webhook */ - public function id($id) { + public function id($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -161,6 +165,9 @@ public function id($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -205,7 +212,7 @@ public function id($id) { * @param string $id ID of webhook to get retries for. (required) * @return WebhookRetryRequestListResponse */ - public function retriesById($id) { + public function retriesById($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -227,6 +234,9 @@ public function retriesById($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -271,7 +281,7 @@ public function retriesById($id) { * @param string $id ID of webhook to retry. (required) * @return WebhookRetry */ - public function retryWebhook($id) { + public function retryWebhook($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -293,6 +303,9 @@ public function retryWebhook($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } diff --git a/lib/WebhooksubscriptionsApi.php b/lib/WebhooksubscriptionsApi.php index 478645a..850eedc 100644 --- a/lib/WebhooksubscriptionsApi.php +++ b/lib/WebhooksubscriptionsApi.php @@ -64,7 +64,7 @@ public function setApiClient($apiClient) { * * @return WebhookListResponse */ - public function _list() { + public function _list($headers = null) { // parse inputs @@ -81,6 +81,9 @@ public function _list() { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -115,7 +118,7 @@ public function _list() { * @param CreateWebhook $body Webhook subscription to create. (required) * @return WebhookSubscription */ - public function create($body) { + public function create($body, $headers = null) { // parse inputs @@ -132,6 +135,9 @@ public function create($body) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -170,7 +176,7 @@ public function create($body) { * @param string $id ID of webhook subscription to get. (required) * @return WebhookSubscription */ - public function id($id) { + public function id($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -192,6 +198,9 @@ public function id($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -237,7 +246,7 @@ public function id($id) { * @param string $id ID of webhook to update. (required) * @return WebhookSubscription */ - public function updateSubscription($body, $id) { + public function updateSubscription($body, $id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -259,6 +268,9 @@ public function updateSubscription($body, $id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + } @@ -307,7 +319,7 @@ public function updateSubscription($body, $id) { * @param string $id ID of webhook subscription to delete. (required) * @return WebhookSubscription */ - public function deleteById($id) { + public function deleteById($id, $headers = null) { // verify the required parameter 'id' is set if ($id === null) { @@ -329,6 +341,9 @@ public function deleteById($id) { } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + if (!is_null($headers)){ + $headerParams = array_merge($headerParams, $headers); + }