@@ -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