Skip to content

Commit 61b9615

Browse files
committed
Release v1.4.7
* Fixed **addAddressService** and **addCalendarBreak** response not having body
1 parent 96c3c25 commit 61b9615

File tree

2 files changed

+51
-13
lines changed

2 files changed

+51
-13
lines changed

docs/Api/ServicesApi.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Method | HTTP request | Description
1212
[**updateAddressService**](ServicesApi.md#updateaddressservice) | **PATCH** /facilities/{facility_id}/doctors/{doctor_id}/addresses/{address_id}/services/{address_service_id} |
1313

1414
# **addAddressService**
15-
> addAddressService($body, $facility_id, $doctor_id, $address_id)
15+
> \DocPlanner\Client\Model\AddressService addAddressService($body, $facility_id, $doctor_id, $address_id)
1616
1717

1818

@@ -38,7 +38,8 @@ $doctor_id = "doctor_id_example"; // string | ID of a doctor in a facility
3838
$address_id = "address_id_example"; // string | ID of a doctor`s address in a facility
3939

4040
try {
41-
$apiInstance->addAddressService($body, $facility_id, $doctor_id, $address_id);
41+
$result = $apiInstance->addAddressService($body, $facility_id, $doctor_id, $address_id);
42+
print_r($result);
4243
} catch (Exception $e) {
4344
echo 'Exception when calling ServicesApi->addAddressService: ', $e->getMessage(), PHP_EOL;
4445
}
@@ -56,7 +57,7 @@ Name | Type | Description | Notes
5657

5758
### Return type
5859

59-
void (empty response body)
60+
[**\DocPlanner\Client\Model\AddressService**](../Model/AddressService.md)
6061

6162
### Authorization
6263

@@ -65,7 +66,7 @@ void (empty response body)
6566
### HTTP request headers
6667

6768
- **Content-Type**: application/json
68-
- **Accept**: application/vnd.error+docplanner+json
69+
- **Accept**: application/vnd.docplanner+json; charset=UTF-8, application/vnd.error+docplanner+json
6970

7071
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
7172

lib/Api/ServicesApi.php

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,12 @@ public function getConfig()
9696
*
9797
* @throws \DocPlanner\Client\ApiException on non-2xx response
9898
* @throws \InvalidArgumentException
99-
* @return void
99+
* @return \DocPlanner\Client\Model\AddressService
100100
*/
101101
public function addAddressService($body, $facility_id, $doctor_id, $address_id)
102102
{
103-
$this->addAddressServiceWithHttpInfo($body, $facility_id, $doctor_id, $address_id);
103+
list($response) = $this->addAddressServiceWithHttpInfo($body, $facility_id, $doctor_id, $address_id);
104+
return $response;
104105
}
105106

106107
/**
@@ -113,11 +114,11 @@ public function addAddressService($body, $facility_id, $doctor_id, $address_id)
113114
*
114115
* @throws \DocPlanner\Client\ApiException on non-2xx response
115116
* @throws \InvalidArgumentException
116-
* @return array of null, HTTP status code, HTTP response headers (array of strings)
117+
* @return array of \DocPlanner\Client\Model\AddressService, HTTP status code, HTTP response headers (array of strings)
117118
*/
118119
public function addAddressServiceWithHttpInfo($body, $facility_id, $doctor_id, $address_id)
119120
{
120-
$returnType = '';
121+
$returnType = '\DocPlanner\Client\Model\AddressService';
121122
$request = $this->addAddressServiceRequest($body, $facility_id, $doctor_id, $address_id);
122123

123124
try {
@@ -148,10 +149,32 @@ public function addAddressServiceWithHttpInfo($body, $facility_id, $doctor_id, $
148149
);
149150
}
150151

151-
return [null, $statusCode, $response->getHeaders()];
152+
$responseBody = $response->getBody();
153+
if ($returnType === '\SplFileObject') {
154+
$content = $responseBody; //stream goes to serializer
155+
} else {
156+
$content = $responseBody->getContents();
157+
if (!in_array($returnType, ['string','integer','bool'])) {
158+
$content = json_decode($content);
159+
}
160+
}
161+
162+
return [
163+
ObjectSerializer::deserialize($content, $returnType, []),
164+
$response->getStatusCode(),
165+
$response->getHeaders()
166+
];
152167

153168
} catch (ApiException $e) {
154169
switch ($e->getCode()) {
170+
case 201:
171+
$data = ObjectSerializer::deserialize(
172+
$e->getResponseBody(),
173+
'\DocPlanner\Client\Model\AddressService',
174+
$e->getResponseHeaders()
175+
);
176+
$e->setResponseObject($data);
177+
break;
155178
case 400:
156179
$data = ObjectSerializer::deserialize(
157180
$e->getResponseBody(),
@@ -227,14 +250,28 @@ function ($response) {
227250
*/
228251
public function addAddressServiceAsyncWithHttpInfo($body, $facility_id, $doctor_id, $address_id)
229252
{
230-
$returnType = '';
253+
$returnType = '\DocPlanner\Client\Model\AddressService';
231254
$request = $this->addAddressServiceRequest($body, $facility_id, $doctor_id, $address_id);
232255

233256
return $this->client
234257
->sendAsync($request, $this->createHttpClientOption())
235258
->then(
236259
function ($response) use ($returnType) {
237-
return [null, $response->getStatusCode(), $response->getHeaders()];
260+
$responseBody = $response->getBody();
261+
if ($returnType === '\SplFileObject') {
262+
$content = $responseBody; //stream goes to serializer
263+
} else {
264+
$content = $responseBody->getContents();
265+
if ($returnType !== 'string') {
266+
$content = json_decode($content);
267+
}
268+
}
269+
270+
return [
271+
ObjectSerializer::deserialize($content, $returnType, []),
272+
$response->getStatusCode(),
273+
$response->getHeaders()
274+
];
238275
},
239276
function ($exception) {
240277
$response = $exception->getResponse();
@@ -332,11 +369,11 @@ protected function addAddressServiceRequest($body, $facility_id, $doctor_id, $ad
332369

333370
if ($multipart) {
334371
$headers = $this->headerSelector->selectHeadersForMultipart(
335-
['application/vnd.error+docplanner+json']
372+
['application/vnd.docplanner+json; charset=UTF-8', 'application/vnd.error+docplanner+json']
336373
);
337374
} else {
338375
$headers = $this->headerSelector->selectHeaders(
339-
['application/vnd.error+docplanner+json'],
376+
['application/vnd.docplanner+json; charset=UTF-8', 'application/vnd.error+docplanner+json'],
340377
['application/json']
341378
);
342379
}

0 commit comments

Comments
 (0)