Skip to content

Commit

Permalink
1.3.0 (#40)
Browse files Browse the repository at this point in the history
* Added support for custom headers

* Updated README with changelog and example

* Update ApiClient.php
  • Loading branch information
ShreyaThapa authored and spencerhunter committed Dec 11, 2019
1 parent 30149f9 commit 2cc0924
Show file tree
Hide file tree
Showing 21 changed files with 317 additions and 78 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -61,6 +61,9 @@ $location = $customersApi->create([
'lastName' => 'Smith',
'email' => '[email protected]',
'phone' => '7188675309'
],
[
'Idempotency-Key' => '9051a62-3403-11e6-ac61-9e71128cae77'
]);
```

Expand Down Expand Up @@ -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`.
Expand Down
10 changes: 8 additions & 2 deletions lib/AccountsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -87,6 +87,9 @@ public function id($id) {
}
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());

if (!is_null($headers)){
$headerParams = array_merge($headerParams, $headers);
}



Expand Down Expand Up @@ -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) {
Expand All @@ -153,6 +156,9 @@ public function createFundingSourcesToken($id) {
}
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());

if (!is_null($headers)){
$headerParams = array_merge($headerParams, $headers);
}



Expand Down
14 changes: 12 additions & 2 deletions lib/ApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand All @@ -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;
}

}

21 changes: 16 additions & 5 deletions lib/BeneficialownersApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -87,6 +87,9 @@ public function getById($id) {
}
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());

if (!is_null($headers)){
$headerParams = array_merge($headerParams, $headers);
}



Expand Down Expand Up @@ -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) {
Expand All @@ -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);
}



Expand Down Expand Up @@ -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) {
Expand All @@ -224,6 +230,9 @@ public function getBeneficialOwnerDocuments($id) {
}
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());

if (!is_null($headers)){
$headerParams = array_merge($headerParams, $headers);
}



Expand Down Expand Up @@ -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) {
Expand All @@ -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
Expand Down
10 changes: 8 additions & 2 deletions lib/BusinessclassificationsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function setApiClient($apiClient) {
*
* @return BusinessClassificationListResponse
*/
public function _list() {
public function _list($headers = null) {


// parse inputs
Expand All @@ -81,6 +81,9 @@ public function _list() {
}
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());

if (!is_null($headers)){
$headerParams = array_merge($headerParams, $headers);
}



Expand Down Expand Up @@ -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) {
Expand All @@ -137,6 +140,9 @@ public function getBusinessClassification($id) {
}
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());

if (!is_null($headers)){
$headerParams = array_merge($headerParams, $headers);
}



Expand Down
Loading

0 comments on commit 2cc0924

Please sign in to comment.