-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
22 changed files
with
1,394 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
<?php | ||
/** | ||
* Copyright 2015 SmartBear Software | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* | ||
* NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. | ||
*/ | ||
|
||
namespace DwollaSwagger; | ||
|
||
class LabelreallocationsApi { | ||
|
||
function __construct($apiClient = null) { | ||
if (null === $apiClient) { | ||
if (Configuration::$apiClient === null) { | ||
Configuration::$apiClient = new ApiClient(); // create a new API client if not present | ||
$this->apiClient = Configuration::$apiClient; | ||
} | ||
else | ||
$this->apiClient = Configuration::$apiClient; // use the default one | ||
} else { | ||
$this->apiClient = $apiClient; // use the one provided by the user | ||
} | ||
|
||
// Authentication methods | ||
$this->authSettings = array('oauth2'); | ||
} | ||
|
||
private $apiClient; // instance of the ApiClient | ||
|
||
/** | ||
* get the API client | ||
*/ | ||
public function getApiClient() { | ||
return $this->apiClient; | ||
} | ||
|
||
/** | ||
* set the API client | ||
*/ | ||
public function setApiClient($apiClient) { | ||
$this->apiClient = $apiClient; | ||
} | ||
|
||
|
||
/** | ||
* reallocateLabel | ||
* | ||
* Reallocate two labels. | ||
* | ||
* @param LabelReallocationRequest $body Labels to reallocate. (required) | ||
* @return LabelReallocation | ||
*/ | ||
public function reallocateLabel($body) { | ||
|
||
|
||
// parse inputs | ||
$resourcePath = "/label-reallocations"; | ||
$resourcePath = str_replace("{format}", "json", $resourcePath); | ||
$method = "POST"; | ||
$httpBody = ''; | ||
$queryParams = array(); | ||
$headerParams = array(); | ||
$formParams = array(); | ||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/vnd.dwolla.v1.hal+json')); | ||
if (!is_null($_header_accept)) { | ||
$headerParams['Accept'] = $_header_accept; | ||
} | ||
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); | ||
|
||
|
||
|
||
|
||
|
||
// body params | ||
$_tempBody = null; | ||
if (isset($body)) { | ||
$_tempBody = $body; | ||
} | ||
|
||
// for model (json/xml) | ||
if (isset($_tempBody)) { | ||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present | ||
} else if (count($formParams) > 0) { | ||
// for HTTP post (form) | ||
$httpBody = $formParams; | ||
} | ||
|
||
// make the API Call | ||
$response = $this->apiClient->callAPI($resourcePath, $method, | ||
$queryParams, $httpBody, | ||
$headerParams, $this->authSettings); | ||
|
||
if(!$response[1]) { | ||
return null; | ||
} | ||
|
||
return $response[0] == 201 ? $response[1] : $this->apiClient->deserialize($response[1],'LabelReallocation'); | ||
} | ||
|
||
/** | ||
* getLabelReallocation | ||
* | ||
* Get label reallocation. | ||
* | ||
* @param string $id Label reallocation ID (required) | ||
* @return LabelReallocation | ||
*/ | ||
public function getLabelReallocation($id) { | ||
|
||
// verify the required parameter 'id' is set | ||
if ($id === null) { | ||
throw new \InvalidArgumentException('Missing the required parameter $id when calling getLabelReallocation'); | ||
} | ||
|
||
|
||
// parse inputs | ||
$resourcePath = "/label-reallocations/{id}"; | ||
$resourcePath = str_replace("{format}", "json", $resourcePath); | ||
$method = "GET"; | ||
$httpBody = ''; | ||
$queryParams = array(); | ||
$headerParams = array(); | ||
$formParams = array(); | ||
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/vnd.dwolla.v1.hal+json')); | ||
if (!is_null($_header_accept)) { | ||
$headerParams['Accept'] = $_header_accept; | ||
} | ||
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/vnd.dwolla.v1.hal+json')); | ||
|
||
|
||
|
||
|
||
// Entire URL for ID | ||
if (filter_var($id, FILTER_VALIDATE_URL)) { | ||
$split = explode('/', $id); | ||
$id = end($split); | ||
} | ||
// path params | ||
if($id !== null) { | ||
$resourcePath = str_replace("{" . "id" . "}", | ||
$this->apiClient->toPathValue($id), $resourcePath); | ||
} | ||
|
||
|
||
|
||
// for model (json/xml) | ||
if (isset($_tempBody)) { | ||
$httpBody = $_tempBody; // $_tempBody is the method argument, if present | ||
} else if (count($formParams) > 0) { | ||
// for HTTP post (form) | ||
$httpBody = $formParams; | ||
} | ||
|
||
// make the API Call | ||
$response = $this->apiClient->callAPI($resourcePath, $method, | ||
$queryParams, $httpBody, | ||
$headerParams, $this->authSettings); | ||
|
||
if(!$response[1]) { | ||
return null; | ||
} | ||
|
||
return $response[0] == 201 ? $response[1] : $this->apiClient->deserialize($response[1],'LabelReallocation'); | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.