From c0a8a9a170f7588b9ead98bd144182e5d26d75cb Mon Sep 17 00:00:00 2001 From: Andre Date: Thu, 8 Apr 2021 11:24:27 +0100 Subject: [PATCH] Adds IntegrationsClient --- src/Integration/IntegrationsClient.php | 45 ++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/Integration/IntegrationsClient.php diff --git a/src/Integration/IntegrationsClient.php b/src/Integration/IntegrationsClient.php new file mode 100644 index 0000000..ee493c8 --- /dev/null +++ b/src/Integration/IntegrationsClient.php @@ -0,0 +1,45 @@ +httpClient->post($this->getPathByType($type), [ + 'body' => json_encode($payload), + 'headers' => $this->getHeaders() + ]); + } catch (BadResponseException $e) { + throw new EntityFetchException($e->getMessage(), $e->getCode(), $e); + } + + return json_decode($response->getBody()->getContents(), true); + } + + /** + * @param string $type + * @return string + */ + private function getPathByType(string $type) + { + return $this->getPath().'/run_by_type/'.$type; + } +}