|
14 | 14 | * |
15 | 15 | * 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. |
16 | 16 | * |
17 | | - * OpenAPI spec version: 1.10.0 |
| 17 | + * OpenAPI spec version: 1.11.0 |
18 | 18 | * |
19 | 19 | * Generated by: https://github.com/swagger-api/swagger-codegen.git |
20 | 20 | * Swagger Codegen version: 3.0.24 |
@@ -717,6 +717,285 @@ protected function getAddressesRequest($facility_id, $doctor_id, $with = null) |
717 | 717 | ); |
718 | 718 | } |
719 | 719 |
|
| 720 | + /** |
| 721 | + * Operation removeAddressIntegration |
| 722 | + * |
| 723 | + * @param string $facility_id ID of the Facility (required) |
| 724 | + * @param string $doctor_id ID of a doctor in a facility (required) |
| 725 | + * @param string $address_id ID of a doctor`s address in a facility (required) |
| 726 | + * |
| 727 | + * @throws \DocPlanner\Client\ApiException on non-2xx response |
| 728 | + * @throws \InvalidArgumentException |
| 729 | + * @return void |
| 730 | + */ |
| 731 | + public function removeAddressIntegration($facility_id, $doctor_id, $address_id) |
| 732 | + { |
| 733 | + $this->removeAddressIntegrationWithHttpInfo($facility_id, $doctor_id, $address_id); |
| 734 | + } |
| 735 | + |
| 736 | + /** |
| 737 | + * Operation removeAddressIntegrationWithHttpInfo |
| 738 | + * |
| 739 | + * @param string $facility_id ID of the Facility (required) |
| 740 | + * @param string $doctor_id ID of a doctor in a facility (required) |
| 741 | + * @param string $address_id ID of a doctor`s address in a facility (required) |
| 742 | + * |
| 743 | + * @throws \DocPlanner\Client\ApiException on non-2xx response |
| 744 | + * @throws \InvalidArgumentException |
| 745 | + * @return array of null, HTTP status code, HTTP response headers (array of strings) |
| 746 | + */ |
| 747 | + public function removeAddressIntegrationWithHttpInfo($facility_id, $doctor_id, $address_id) |
| 748 | + { |
| 749 | + $returnType = ''; |
| 750 | + $request = $this->removeAddressIntegrationRequest($facility_id, $doctor_id, $address_id); |
| 751 | + |
| 752 | + try { |
| 753 | + $options = $this->createHttpClientOption(); |
| 754 | + try { |
| 755 | + $response = $this->client->send($request, $options); |
| 756 | + } catch (RequestException $e) { |
| 757 | + throw new ApiException( |
| 758 | + "[{$e->getCode()}] {$e->getMessage()}", |
| 759 | + $e->getCode(), |
| 760 | + $e->getResponse() ? $e->getResponse()->getHeaders() : null, |
| 761 | + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null |
| 762 | + ); |
| 763 | + } |
| 764 | + |
| 765 | + $statusCode = $response->getStatusCode(); |
| 766 | + |
| 767 | + if ($statusCode < 200 || $statusCode > 299) { |
| 768 | + throw new ApiException( |
| 769 | + sprintf( |
| 770 | + '[%d] Error connecting to the API (%s)', |
| 771 | + $statusCode, |
| 772 | + $request->getUri() |
| 773 | + ), |
| 774 | + $statusCode, |
| 775 | + $response->getHeaders(), |
| 776 | + $response->getBody() |
| 777 | + ); |
| 778 | + } |
| 779 | + |
| 780 | + return [null, $statusCode, $response->getHeaders()]; |
| 781 | + |
| 782 | + } catch (ApiException $e) { |
| 783 | + switch ($e->getCode()) { |
| 784 | + case 403: |
| 785 | + $data = ObjectSerializer::deserialize( |
| 786 | + $e->getResponseBody(), |
| 787 | + '\DocPlanner\Client\Model\Error', |
| 788 | + $e->getResponseHeaders() |
| 789 | + ); |
| 790 | + $e->setResponseObject($data); |
| 791 | + break; |
| 792 | + case 404: |
| 793 | + $data = ObjectSerializer::deserialize( |
| 794 | + $e->getResponseBody(), |
| 795 | + '\DocPlanner\Client\Model\Error', |
| 796 | + $e->getResponseHeaders() |
| 797 | + ); |
| 798 | + $e->setResponseObject($data); |
| 799 | + break; |
| 800 | + } |
| 801 | + throw $e; |
| 802 | + } |
| 803 | + } |
| 804 | + |
| 805 | + /** |
| 806 | + * Operation removeAddressIntegrationAsync |
| 807 | + * |
| 808 | + * |
| 809 | + * |
| 810 | + * @param string $facility_id ID of the Facility (required) |
| 811 | + * @param string $doctor_id ID of a doctor in a facility (required) |
| 812 | + * @param string $address_id ID of a doctor`s address in a facility (required) |
| 813 | + * |
| 814 | + * @throws \InvalidArgumentException |
| 815 | + * @return \GuzzleHttp\Promise\PromiseInterface |
| 816 | + */ |
| 817 | + public function removeAddressIntegrationAsync($facility_id, $doctor_id, $address_id) |
| 818 | + { |
| 819 | + return $this->removeAddressIntegrationAsyncWithHttpInfo($facility_id, $doctor_id, $address_id) |
| 820 | + ->then( |
| 821 | + function ($response) { |
| 822 | + return $response[0]; |
| 823 | + } |
| 824 | + ); |
| 825 | + } |
| 826 | + |
| 827 | + /** |
| 828 | + * Operation removeAddressIntegrationAsyncWithHttpInfo |
| 829 | + * |
| 830 | + * |
| 831 | + * |
| 832 | + * @param string $facility_id ID of the Facility (required) |
| 833 | + * @param string $doctor_id ID of a doctor in a facility (required) |
| 834 | + * @param string $address_id ID of a doctor`s address in a facility (required) |
| 835 | + * |
| 836 | + * @throws \InvalidArgumentException |
| 837 | + * @return \GuzzleHttp\Promise\PromiseInterface |
| 838 | + */ |
| 839 | + public function removeAddressIntegrationAsyncWithHttpInfo($facility_id, $doctor_id, $address_id) |
| 840 | + { |
| 841 | + $returnType = ''; |
| 842 | + $request = $this->removeAddressIntegrationRequest($facility_id, $doctor_id, $address_id); |
| 843 | + |
| 844 | + return $this->client |
| 845 | + ->sendAsync($request, $this->createHttpClientOption()) |
| 846 | + ->then( |
| 847 | + function ($response) use ($returnType) { |
| 848 | + return [null, $response->getStatusCode(), $response->getHeaders()]; |
| 849 | + }, |
| 850 | + function ($exception) { |
| 851 | + $response = $exception->getResponse(); |
| 852 | + $statusCode = $response->getStatusCode(); |
| 853 | + throw new ApiException( |
| 854 | + sprintf( |
| 855 | + '[%d] Error connecting to the API (%s)', |
| 856 | + $statusCode, |
| 857 | + $exception->getRequest()->getUri() |
| 858 | + ), |
| 859 | + $statusCode, |
| 860 | + $response->getHeaders(), |
| 861 | + $response->getBody() |
| 862 | + ); |
| 863 | + } |
| 864 | + ); |
| 865 | + } |
| 866 | + |
| 867 | + /** |
| 868 | + * Create request for operation 'removeAddressIntegration' |
| 869 | + * |
| 870 | + * @param string $facility_id ID of the Facility (required) |
| 871 | + * @param string $doctor_id ID of a doctor in a facility (required) |
| 872 | + * @param string $address_id ID of a doctor`s address in a facility (required) |
| 873 | + * |
| 874 | + * @throws \InvalidArgumentException |
| 875 | + * @return \GuzzleHttp\Psr7\Request |
| 876 | + */ |
| 877 | + protected function removeAddressIntegrationRequest($facility_id, $doctor_id, $address_id) |
| 878 | + { |
| 879 | + // verify the required parameter 'facility_id' is set |
| 880 | + if ($facility_id === null || (is_array($facility_id) && count($facility_id) === 0)) { |
| 881 | + throw new \InvalidArgumentException( |
| 882 | + 'Missing the required parameter $facility_id when calling removeAddressIntegration' |
| 883 | + ); |
| 884 | + } |
| 885 | + // verify the required parameter 'doctor_id' is set |
| 886 | + if ($doctor_id === null || (is_array($doctor_id) && count($doctor_id) === 0)) { |
| 887 | + throw new \InvalidArgumentException( |
| 888 | + 'Missing the required parameter $doctor_id when calling removeAddressIntegration' |
| 889 | + ); |
| 890 | + } |
| 891 | + // verify the required parameter 'address_id' is set |
| 892 | + if ($address_id === null || (is_array($address_id) && count($address_id) === 0)) { |
| 893 | + throw new \InvalidArgumentException( |
| 894 | + 'Missing the required parameter $address_id when calling removeAddressIntegration' |
| 895 | + ); |
| 896 | + } |
| 897 | + |
| 898 | + $resourcePath = '/facilities/{facility_id}/doctors/{doctor_id}/addresses/{address_id}/integration'; |
| 899 | + $formParams = []; |
| 900 | + $queryParams = []; |
| 901 | + $headerParams = []; |
| 902 | + $httpBody = ''; |
| 903 | + $multipart = false; |
| 904 | + |
| 905 | + |
| 906 | + // path params |
| 907 | + if ($facility_id !== null) { |
| 908 | + $resourcePath = str_replace( |
| 909 | + '{' . 'facility_id' . '}', |
| 910 | + ObjectSerializer::toPathValue($facility_id), |
| 911 | + $resourcePath |
| 912 | + ); |
| 913 | + } |
| 914 | + // path params |
| 915 | + if ($doctor_id !== null) { |
| 916 | + $resourcePath = str_replace( |
| 917 | + '{' . 'doctor_id' . '}', |
| 918 | + ObjectSerializer::toPathValue($doctor_id), |
| 919 | + $resourcePath |
| 920 | + ); |
| 921 | + } |
| 922 | + // path params |
| 923 | + if ($address_id !== null) { |
| 924 | + $resourcePath = str_replace( |
| 925 | + '{' . 'address_id' . '}', |
| 926 | + ObjectSerializer::toPathValue($address_id), |
| 927 | + $resourcePath |
| 928 | + ); |
| 929 | + } |
| 930 | + |
| 931 | + // body params |
| 932 | + $_tempBody = null; |
| 933 | + |
| 934 | + if ($multipart) { |
| 935 | + $headers = $this->headerSelector->selectHeadersForMultipart( |
| 936 | + ['application/vnd.error+docplanner+json'] |
| 937 | + ); |
| 938 | + } else { |
| 939 | + $headers = $this->headerSelector->selectHeaders( |
| 940 | + ['application/vnd.error+docplanner+json'], |
| 941 | + [] |
| 942 | + ); |
| 943 | + } |
| 944 | + |
| 945 | + // for model (json/xml) |
| 946 | + if (isset($_tempBody)) { |
| 947 | + // $_tempBody is the method argument, if present |
| 948 | + $httpBody = $_tempBody; |
| 949 | + // \stdClass has no __toString(), so we should encode it manually |
| 950 | + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { |
| 951 | + $httpBody = \GuzzleHttp\json_encode($httpBody); |
| 952 | + } |
| 953 | + } elseif (count($formParams) > 0) { |
| 954 | + if ($multipart) { |
| 955 | + $multipartContents = []; |
| 956 | + foreach ($formParams as $formParamName => $formParamValue) { |
| 957 | + $multipartContents[] = [ |
| 958 | + 'name' => $formParamName, |
| 959 | + 'contents' => $formParamValue |
| 960 | + ]; |
| 961 | + } |
| 962 | + // for HTTP post (form) |
| 963 | + $httpBody = new MultipartStream($multipartContents); |
| 964 | + |
| 965 | + } elseif ($headers['Content-Type'] === 'application/json') { |
| 966 | + $httpBody = \GuzzleHttp\json_encode($formParams); |
| 967 | + |
| 968 | + } else { |
| 969 | + // for HTTP post (form) |
| 970 | + $httpBody = $this->buildQuery($formParams); |
| 971 | + } |
| 972 | + } |
| 973 | + |
| 974 | + // this endpoint requires OAuth (access token) |
| 975 | + if ($this->config->getAccessToken() !== null) { |
| 976 | + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); |
| 977 | + } |
| 978 | + |
| 979 | + $defaultHeaders = []; |
| 980 | + if ($this->config->getUserAgent()) { |
| 981 | + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); |
| 982 | + } |
| 983 | + |
| 984 | + $headers = array_merge( |
| 985 | + $defaultHeaders, |
| 986 | + $headerParams, |
| 987 | + $headers |
| 988 | + ); |
| 989 | + |
| 990 | + $query = $this->buildQuery($queryParams); |
| 991 | + return new Request( |
| 992 | + 'DELETE', |
| 993 | + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), |
| 994 | + $headers, |
| 995 | + $httpBody |
| 996 | + ); |
| 997 | + } |
| 998 | + |
720 | 999 | /** |
721 | 1000 | * Operation updateAddress |
722 | 1001 | * |
|
0 commit comments