Skip to content

Commit 2eff458

Browse files
committed
Release v1.0.7
* Buried notifications can be released: added **releaseNotifications** method
1 parent 96ac3e0 commit 2eff458

File tree

81 files changed

+344
-81
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+344
-81
lines changed

docs/Api/APINotificationCallbacksApi.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Method | HTTP request | Description
66
------------- | ------------- | -------------
77
[**pullNotification**](APINotificationCallbacksApi.md#pullnotification) | **GET** /notifications |
88
[**pushNotifications**](APINotificationCallbacksApi.md#pushnotifications) | **POST** /{client-endpoint-url} |
9+
[**releaseNotifications**](APINotificationCallbacksApi.md#releasenotifications) | **POST** /notifications/release |
910

1011
# **pullNotification**
1112
> \DocPlanner\Client\Model\Notification pullNotification()
@@ -100,3 +101,51 @@ No authorization required
100101

101102
[[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)
102103

104+
# **releaseNotifications**
105+
> releaseNotifications()
106+
107+
108+
109+
Action allowing to trigger re-dispatching all the notifications that were not processed correctly. Call to this endpoint should be repeated periodically to ensure consistency between systems. Docplanner API allows to perform notifications release once per hour. Endpoint can be used only if Docplanner system is pushing events to the external endpoints.
110+
111+
### Example
112+
```php
113+
<?php
114+
require_once(__DIR__ . '/vendor/autoload.php');
115+
116+
// Configure OAuth2 access token for authorization: OAuth 2.0
117+
$config = DocPlanner\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
118+
119+
$apiInstance = new DocPlanner\Client\Api\APINotificationCallbacksApi(
120+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
121+
// This is optional, `GuzzleHttp\Client` will be used as default.
122+
new GuzzleHttp\Client(),
123+
$config
124+
);
125+
126+
try {
127+
$apiInstance->releaseNotifications();
128+
} catch (Exception $e) {
129+
echo 'Exception when calling APINotificationCallbacksApi->releaseNotifications: ', $e->getMessage(), PHP_EOL;
130+
}
131+
?>
132+
```
133+
134+
### Parameters
135+
This endpoint does not need any parameter.
136+
137+
### Return type
138+
139+
void (empty response body)
140+
141+
### Authorization
142+
143+
[OAuth 2.0](../../README.md#OAuth 2.0)
144+
145+
### HTTP request headers
146+
147+
- **Content-Type**: Not defined
148+
- **Accept**: application/vnd.error+docplanner+json
149+
150+
[[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)
151+

lib/Api/APINotificationCallbacksApi.php

Lines changed: 215 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* Welcome to Docplanner Integrations [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) API! This API gives You the ability to build Your own application and integrate it with Docplanner services.
1616
*
17-
* OpenAPI spec version: 1.0.6
17+
* OpenAPI spec version: 1.0.7
1818
*
1919
* Generated by: https://github.com/swagger-api/swagger-codegen.git
2020
* Swagger Codegen version: 3.0.24
@@ -539,6 +539,220 @@ protected function pushNotificationsRequest()
539539
);
540540
}
541541

542+
/**
543+
* Operation releaseNotifications
544+
*
545+
*
546+
* @throws \DocPlanner\Client\ApiException on non-2xx response
547+
* @throws \InvalidArgumentException
548+
* @return void
549+
*/
550+
public function releaseNotifications()
551+
{
552+
$this->releaseNotificationsWithHttpInfo();
553+
}
554+
555+
/**
556+
* Operation releaseNotificationsWithHttpInfo
557+
*
558+
*
559+
* @throws \DocPlanner\Client\ApiException on non-2xx response
560+
* @throws \InvalidArgumentException
561+
* @return array of null, HTTP status code, HTTP response headers (array of strings)
562+
*/
563+
public function releaseNotificationsWithHttpInfo()
564+
{
565+
$returnType = '';
566+
$request = $this->releaseNotificationsRequest();
567+
568+
try {
569+
$options = $this->createHttpClientOption();
570+
try {
571+
$response = $this->client->send($request, $options);
572+
} catch (RequestException $e) {
573+
throw new ApiException(
574+
"[{$e->getCode()}] {$e->getMessage()}",
575+
$e->getCode(),
576+
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
577+
$e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
578+
);
579+
}
580+
581+
$statusCode = $response->getStatusCode();
582+
583+
if ($statusCode < 200 || $statusCode > 299) {
584+
throw new ApiException(
585+
sprintf(
586+
'[%d] Error connecting to the API (%s)',
587+
$statusCode,
588+
$request->getUri()
589+
),
590+
$statusCode,
591+
$response->getHeaders(),
592+
$response->getBody()
593+
);
594+
}
595+
596+
return [null, $statusCode, $response->getHeaders()];
597+
598+
} catch (ApiException $e) {
599+
switch ($e->getCode()) {
600+
case 403:
601+
$data = ObjectSerializer::deserialize(
602+
$e->getResponseBody(),
603+
'\DocPlanner\Client\Model\Error',
604+
$e->getResponseHeaders()
605+
);
606+
$e->setResponseObject($data);
607+
break;
608+
}
609+
throw $e;
610+
}
611+
}
612+
613+
/**
614+
* Operation releaseNotificationsAsync
615+
*
616+
*
617+
*
618+
*
619+
* @throws \InvalidArgumentException
620+
* @return \GuzzleHttp\Promise\PromiseInterface
621+
*/
622+
public function releaseNotificationsAsync()
623+
{
624+
return $this->releaseNotificationsAsyncWithHttpInfo()
625+
->then(
626+
function ($response) {
627+
return $response[0];
628+
}
629+
);
630+
}
631+
632+
/**
633+
* Operation releaseNotificationsAsyncWithHttpInfo
634+
*
635+
*
636+
*
637+
*
638+
* @throws \InvalidArgumentException
639+
* @return \GuzzleHttp\Promise\PromiseInterface
640+
*/
641+
public function releaseNotificationsAsyncWithHttpInfo()
642+
{
643+
$returnType = '';
644+
$request = $this->releaseNotificationsRequest();
645+
646+
return $this->client
647+
->sendAsync($request, $this->createHttpClientOption())
648+
->then(
649+
function ($response) use ($returnType) {
650+
return [null, $response->getStatusCode(), $response->getHeaders()];
651+
},
652+
function ($exception) {
653+
$response = $exception->getResponse();
654+
$statusCode = $response->getStatusCode();
655+
throw new ApiException(
656+
sprintf(
657+
'[%d] Error connecting to the API (%s)',
658+
$statusCode,
659+
$exception->getRequest()->getUri()
660+
),
661+
$statusCode,
662+
$response->getHeaders(),
663+
$response->getBody()
664+
);
665+
}
666+
);
667+
}
668+
669+
/**
670+
* Create request for operation 'releaseNotifications'
671+
*
672+
*
673+
* @throws \InvalidArgumentException
674+
* @return \GuzzleHttp\Psr7\Request
675+
*/
676+
protected function releaseNotificationsRequest()
677+
{
678+
679+
$resourcePath = '/notifications/release';
680+
$formParams = [];
681+
$queryParams = [];
682+
$headerParams = [];
683+
$httpBody = '';
684+
$multipart = false;
685+
686+
687+
688+
// body params
689+
$_tempBody = null;
690+
691+
if ($multipart) {
692+
$headers = $this->headerSelector->selectHeadersForMultipart(
693+
['application/vnd.error+docplanner+json']
694+
);
695+
} else {
696+
$headers = $this->headerSelector->selectHeaders(
697+
['application/vnd.error+docplanner+json'],
698+
[]
699+
);
700+
}
701+
702+
// for model (json/xml)
703+
if (isset($_tempBody)) {
704+
// $_tempBody is the method argument, if present
705+
$httpBody = $_tempBody;
706+
// \stdClass has no __toString(), so we should encode it manually
707+
if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
708+
$httpBody = \GuzzleHttp\json_encode($httpBody);
709+
}
710+
} elseif (count($formParams) > 0) {
711+
if ($multipart) {
712+
$multipartContents = [];
713+
foreach ($formParams as $formParamName => $formParamValue) {
714+
$multipartContents[] = [
715+
'name' => $formParamName,
716+
'contents' => $formParamValue
717+
];
718+
}
719+
// for HTTP post (form)
720+
$httpBody = new MultipartStream($multipartContents);
721+
722+
} elseif ($headers['Content-Type'] === 'application/json') {
723+
$httpBody = \GuzzleHttp\json_encode($formParams);
724+
725+
} else {
726+
// for HTTP post (form)
727+
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
728+
}
729+
}
730+
731+
// this endpoint requires OAuth (access token)
732+
if ($this->config->getAccessToken() !== null) {
733+
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
734+
}
735+
736+
$defaultHeaders = [];
737+
if ($this->config->getUserAgent()) {
738+
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
739+
}
740+
741+
$headers = array_merge(
742+
$defaultHeaders,
743+
$headerParams,
744+
$headers
745+
);
746+
747+
$query = \GuzzleHttp\Psr7\build_query($queryParams);
748+
return new Request(
749+
'POST',
750+
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
751+
$headers,
752+
$httpBody
753+
);
754+
}
755+
542756
/**
543757
* Create http client option
544758
*

lib/Api/AddressesApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* Welcome to Docplanner Integrations [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) API! This API gives You the ability to build Your own application and integrate it with Docplanner services.
1616
*
17-
* OpenAPI spec version: 1.0.6
17+
* OpenAPI spec version: 1.0.7
1818
*
1919
* Generated by: https://github.com/swagger-api/swagger-codegen.git
2020
* Swagger Codegen version: 3.0.24

lib/Api/BookingsApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* Welcome to Docplanner Integrations [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) API! This API gives You the ability to build Your own application and integrate it with Docplanner services.
1616
*
17-
* OpenAPI spec version: 1.0.6
17+
* OpenAPI spec version: 1.0.7
1818
*
1919
* Generated by: https://github.com/swagger-api/swagger-codegen.git
2020
* Swagger Codegen version: 3.0.24

lib/Api/CalendarBreaksApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* Welcome to Docplanner Integrations [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) API! This API gives You the ability to build Your own application and integrate it with Docplanner services.
1616
*
17-
* OpenAPI spec version: 1.0.6
17+
* OpenAPI spec version: 1.0.7
1818
*
1919
* Generated by: https://github.com/swagger-api/swagger-codegen.git
2020
* Swagger Codegen version: 3.0.24

lib/Api/DoctorsApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* Welcome to Docplanner Integrations [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) API! This API gives You the ability to build Your own application and integrate it with Docplanner services.
1616
*
17-
* OpenAPI spec version: 1.0.6
17+
* OpenAPI spec version: 1.0.7
1818
*
1919
* Generated by: https://github.com/swagger-api/swagger-codegen.git
2020
* Swagger Codegen version: 3.0.24

lib/Api/FacilitiesApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* Welcome to Docplanner Integrations [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) API! This API gives You the ability to build Your own application and integrate it with Docplanner services.
1616
*
17-
* OpenAPI spec version: 1.0.6
17+
* OpenAPI spec version: 1.0.7
1818
*
1919
* Generated by: https://github.com/swagger-api/swagger-codegen.git
2020
* Swagger Codegen version: 3.0.24

lib/Api/InsurancesApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* Welcome to Docplanner Integrations [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) API! This API gives You the ability to build Your own application and integrate it with Docplanner services.
1616
*
17-
* OpenAPI spec version: 1.0.6
17+
* OpenAPI spec version: 1.0.7
1818
*
1919
* Generated by: https://github.com/swagger-api/swagger-codegen.git
2020
* Swagger Codegen version: 3.0.24

lib/Api/PatientPresenceApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* Welcome to Docplanner Integrations [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) API! This API gives You the ability to build Your own application and integrate it with Docplanner services.
1616
*
17-
* OpenAPI spec version: 1.0.6
17+
* OpenAPI spec version: 1.0.7
1818
*
1919
* Generated by: https://github.com/swagger-api/swagger-codegen.git
2020
* Swagger Codegen version: 3.0.24

lib/Api/ServicesApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* Welcome to Docplanner Integrations [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) API! This API gives You the ability to build Your own application and integrate it with Docplanner services.
1616
*
17-
* OpenAPI spec version: 1.0.6
17+
* OpenAPI spec version: 1.0.7
1818
*
1919
* Generated by: https://github.com/swagger-api/swagger-codegen.git
2020
* Swagger Codegen version: 3.0.24

0 commit comments

Comments
 (0)