diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9f1681c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,15 @@
+# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore
+
+composer.phar
+/vendor/
+
+# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
+# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
+# composer.lock
+
+# php-cs-fixer cache
+.php_cs.cache
+.php-cs-fixer.cache
+
+# PHPUnit cache
+.phpunit.result.cache
diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore
new file mode 100644
index 0000000..7484ee5
--- /dev/null
+++ b/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES
new file mode 100644
index 0000000..8250ccd
--- /dev/null
+++ b/.openapi-generator/FILES
@@ -0,0 +1,226 @@
+.gitignore
+.php-cs-fixer.dist.php
+.travis.yml
+README.md
+composer.json
+docs/Api/ApplicationApi.md
+docs/Api/AuthenticationApi.md
+docs/Api/BackgroundTasksApi.md
+docs/Api/EndpointApi.md
+docs/Api/EventTypeApi.md
+docs/Api/HealthApi.md
+docs/Api/IntegrationApi.md
+docs/Api/MessageApi.md
+docs/Api/MessageAttemptApi.md
+docs/Api/StatisticsApi.md
+docs/Model/AppPortalAccessIn.md
+docs/Model/AppPortalAccessOut.md
+docs/Model/AppUsageStatsIn.md
+docs/Model/AppUsageStatsOut.md
+docs/Model/ApplicationIn.md
+docs/Model/ApplicationOut.md
+docs/Model/ApplicationPatch.md
+docs/Model/ApplicationTokenExpireIn.md
+docs/Model/BackgroundTaskOut.md
+docs/Model/BackgroundTaskStatus.md
+docs/Model/BackgroundTaskType.md
+docs/Model/DashboardAccessOut.md
+docs/Model/EndpointCreatedEvent.md
+docs/Model/EndpointCreatedEventData.md
+docs/Model/EndpointDeletedEvent.md
+docs/Model/EndpointDeletedEventData.md
+docs/Model/EndpointDisabledEvent.md
+docs/Model/EndpointDisabledEventData.md
+docs/Model/EndpointHeadersIn.md
+docs/Model/EndpointHeadersOut.md
+docs/Model/EndpointHeadersPatchIn.md
+docs/Model/EndpointIn.md
+docs/Model/EndpointMessageOut.md
+docs/Model/EndpointOut.md
+docs/Model/EndpointPatch.md
+docs/Model/EndpointSecretOut.md
+docs/Model/EndpointSecretRotateIn.md
+docs/Model/EndpointStats.md
+docs/Model/EndpointTransformationIn.md
+docs/Model/EndpointTransformationOut.md
+docs/Model/EndpointTransformationSimulateIn.md
+docs/Model/EndpointTransformationSimulateOut.md
+docs/Model/EndpointUpdate.md
+docs/Model/EndpointUpdatedEvent.md
+docs/Model/EndpointUpdatedEventData.md
+docs/Model/EventExampleIn.md
+docs/Model/EventTypeImportOpenApiIn.md
+docs/Model/EventTypeImportOpenApiOut.md
+docs/Model/EventTypeImportOpenApiOutData.md
+docs/Model/EventTypeIn.md
+docs/Model/EventTypeOut.md
+docs/Model/EventTypePatch.md
+docs/Model/EventTypeUpdate.md
+docs/Model/ExportEventTypeOut.md
+docs/Model/HTTPValidationError.md
+docs/Model/HttpErrorOut.md
+docs/Model/IntegrationIn.md
+docs/Model/IntegrationKeyOut.md
+docs/Model/IntegrationOut.md
+docs/Model/IntegrationUpdate.md
+docs/Model/ListResponseApplicationOut.md
+docs/Model/ListResponseBackgroundTaskOut.md
+docs/Model/ListResponseEndpointMessageOut.md
+docs/Model/ListResponseEndpointOut.md
+docs/Model/ListResponseEventTypeOut.md
+docs/Model/ListResponseIntegrationOut.md
+docs/Model/ListResponseMessageAttemptEndpointOut.md
+docs/Model/ListResponseMessageAttemptOut.md
+docs/Model/ListResponseMessageEndpointOut.md
+docs/Model/ListResponseMessageOut.md
+docs/Model/ListResponseTemplateOut.md
+docs/Model/MessageAttemptEndpointOut.md
+docs/Model/MessageAttemptExhaustedEvent.md
+docs/Model/MessageAttemptExhaustedEventData.md
+docs/Model/MessageAttemptFailedData.md
+docs/Model/MessageAttemptFailingEvent.md
+docs/Model/MessageAttemptFailingEventData.md
+docs/Model/MessageAttemptOut.md
+docs/Model/MessageAttemptRecoveredEvent.md
+docs/Model/MessageAttemptRecoveredEventData.md
+docs/Model/MessageAttemptTriggerType.md
+docs/Model/MessageBroadcastIn.md
+docs/Model/MessageBroadcastOut.md
+docs/Model/MessageEndpointOut.md
+docs/Model/MessageIn.md
+docs/Model/MessageOut.md
+docs/Model/MessageRawPayloadOut.md
+docs/Model/MessageStatus.md
+docs/Model/OauthPayloadIn.md
+docs/Model/OauthPayloadOut.md
+docs/Model/OneTimeTokenIn.md
+docs/Model/OneTimeTokenOut.md
+docs/Model/Ordering.md
+docs/Model/RecoverIn.md
+docs/Model/RecoverOut.md
+docs/Model/ReplayIn.md
+docs/Model/ReplayOut.md
+docs/Model/StatusCodeClass.md
+docs/Model/TemplateIn.md
+docs/Model/TemplateOut.md
+docs/Model/TemplatePatch.md
+docs/Model/TemplateUpdate.md
+docs/Model/TransformationHttpMethod.md
+docs/Model/TransformationSimulateIn.md
+docs/Model/TransformationSimulateOut.md
+docs/Model/TransformationTemplateKind.md
+docs/Model/ValidationError.md
+git_push.sh
+lib/Api/ApplicationApi.php
+lib/Api/AuthenticationApi.php
+lib/Api/BackgroundTasksApi.php
+lib/Api/EndpointApi.php
+lib/Api/EventTypeApi.php
+lib/Api/HealthApi.php
+lib/Api/IntegrationApi.php
+lib/Api/MessageApi.php
+lib/Api/MessageAttemptApi.php
+lib/Api/StatisticsApi.php
+lib/ApiException.php
+lib/Configuration.php
+lib/HeaderSelector.php
+lib/Model/AppPortalAccessIn.php
+lib/Model/AppPortalAccessOut.php
+lib/Model/AppUsageStatsIn.php
+lib/Model/AppUsageStatsOut.php
+lib/Model/ApplicationIn.php
+lib/Model/ApplicationOut.php
+lib/Model/ApplicationPatch.php
+lib/Model/ApplicationTokenExpireIn.php
+lib/Model/BackgroundTaskOut.php
+lib/Model/BackgroundTaskStatus.php
+lib/Model/BackgroundTaskType.php
+lib/Model/DashboardAccessOut.php
+lib/Model/EndpointCreatedEvent.php
+lib/Model/EndpointCreatedEventData.php
+lib/Model/EndpointDeletedEvent.php
+lib/Model/EndpointDeletedEventData.php
+lib/Model/EndpointDisabledEvent.php
+lib/Model/EndpointDisabledEventData.php
+lib/Model/EndpointHeadersIn.php
+lib/Model/EndpointHeadersOut.php
+lib/Model/EndpointHeadersPatchIn.php
+lib/Model/EndpointIn.php
+lib/Model/EndpointMessageOut.php
+lib/Model/EndpointOut.php
+lib/Model/EndpointPatch.php
+lib/Model/EndpointSecretOut.php
+lib/Model/EndpointSecretRotateIn.php
+lib/Model/EndpointStats.php
+lib/Model/EndpointTransformationIn.php
+lib/Model/EndpointTransformationOut.php
+lib/Model/EndpointTransformationSimulateIn.php
+lib/Model/EndpointTransformationSimulateOut.php
+lib/Model/EndpointUpdate.php
+lib/Model/EndpointUpdatedEvent.php
+lib/Model/EndpointUpdatedEventData.php
+lib/Model/EventExampleIn.php
+lib/Model/EventTypeImportOpenApiIn.php
+lib/Model/EventTypeImportOpenApiOut.php
+lib/Model/EventTypeImportOpenApiOutData.php
+lib/Model/EventTypeIn.php
+lib/Model/EventTypeOut.php
+lib/Model/EventTypePatch.php
+lib/Model/EventTypeUpdate.php
+lib/Model/ExportEventTypeOut.php
+lib/Model/HTTPValidationError.php
+lib/Model/HttpErrorOut.php
+lib/Model/IntegrationIn.php
+lib/Model/IntegrationKeyOut.php
+lib/Model/IntegrationOut.php
+lib/Model/IntegrationUpdate.php
+lib/Model/ListResponseApplicationOut.php
+lib/Model/ListResponseBackgroundTaskOut.php
+lib/Model/ListResponseEndpointMessageOut.php
+lib/Model/ListResponseEndpointOut.php
+lib/Model/ListResponseEventTypeOut.php
+lib/Model/ListResponseIntegrationOut.php
+lib/Model/ListResponseMessageAttemptEndpointOut.php
+lib/Model/ListResponseMessageAttemptOut.php
+lib/Model/ListResponseMessageEndpointOut.php
+lib/Model/ListResponseMessageOut.php
+lib/Model/ListResponseTemplateOut.php
+lib/Model/MessageAttemptEndpointOut.php
+lib/Model/MessageAttemptExhaustedEvent.php
+lib/Model/MessageAttemptExhaustedEventData.php
+lib/Model/MessageAttemptFailedData.php
+lib/Model/MessageAttemptFailingEvent.php
+lib/Model/MessageAttemptFailingEventData.php
+lib/Model/MessageAttemptOut.php
+lib/Model/MessageAttemptRecoveredEvent.php
+lib/Model/MessageAttemptRecoveredEventData.php
+lib/Model/MessageAttemptTriggerType.php
+lib/Model/MessageBroadcastIn.php
+lib/Model/MessageBroadcastOut.php
+lib/Model/MessageEndpointOut.php
+lib/Model/MessageIn.php
+lib/Model/MessageOut.php
+lib/Model/MessageRawPayloadOut.php
+lib/Model/MessageStatus.php
+lib/Model/ModelInterface.php
+lib/Model/OauthPayloadIn.php
+lib/Model/OauthPayloadOut.php
+lib/Model/OneTimeTokenIn.php
+lib/Model/OneTimeTokenOut.php
+lib/Model/Ordering.php
+lib/Model/RecoverIn.php
+lib/Model/RecoverOut.php
+lib/Model/ReplayIn.php
+lib/Model/ReplayOut.php
+lib/Model/StatusCodeClass.php
+lib/Model/TemplateIn.php
+lib/Model/TemplateOut.php
+lib/Model/TemplatePatch.php
+lib/Model/TemplateUpdate.php
+lib/Model/TransformationHttpMethod.php
+lib/Model/TransformationSimulateIn.php
+lib/Model/TransformationSimulateOut.php
+lib/Model/TransformationTemplateKind.php
+lib/Model/ValidationError.php
+lib/ObjectSerializer.php
+phpunit.xml.dist
diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION
new file mode 100644
index 0000000..40e3636
--- /dev/null
+++ b/.openapi-generator/VERSION
@@ -0,0 +1 @@
+7.1.0-SNAPSHOT
\ No newline at end of file
diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php
new file mode 100644
index 0000000..af9cf39
--- /dev/null
+++ b/.php-cs-fixer.dist.php
@@ -0,0 +1,29 @@
+in(__DIR__)
+ ->exclude('vendor')
+ ->exclude('test')
+ ->exclude('tests')
+;
+
+$config = new PhpCsFixer\Config();
+return $config->setRules([
+ '@PSR12' => true,
+ 'phpdoc_order' => true,
+ 'array_syntax' => [ 'syntax' => 'short' ],
+ 'strict_comparison' => true,
+ 'strict_param' => true,
+ 'no_trailing_whitespace' => false,
+ 'no_trailing_whitespace_in_comment' => false,
+ 'braces' => false,
+ 'single_blank_line_at_eof' => false,
+ 'blank_line_after_namespace' => false,
+ 'no_leading_import_slash' => false,
+ ])
+ ->setFinder($finder)
+;
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..667b815
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,8 @@
+language: php
+# Bionic environment has preinstalled PHP from 7.1 to 7.4
+# https://docs.travis-ci.com/user/reference/bionic/#php-support
+dist: bionic
+php:
+ - 7.4
+before_install: "composer install"
+script: "vendor/bin/phpunit"
diff --git a/README.md b/README.md
index 2085951..c1a828a 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,309 @@
-# svix-client
-PHP Svix Client
+# OpenAPIClient-php
+
+Welcome to the Svix API documentation!
+
+Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/)
+
+# Introduction
+
+This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com).
+
+## Main concepts
+
+In Svix you have four important entities you will be interacting with:
+
+- `messages`: these are the webhooks being sent. They can have contents and a few other properties.
+- `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform.
+- `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type).
+- `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint.
+
+
+## Authentication
+
+Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. For more information on authentication, please refer to the [authentication token docs](https://docs.svix.com/api-keys).
+
+
+
+
+## Code samples
+
+The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/).
+
+
+## Idempotency
+
+Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response.
+
+To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions.
+
+Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result.
+
+Please note that idempotency is only supported for `POST` requests.
+
+
+## Cross-Origin Resource Sharing
+
+This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+
+
+
+## Installation & Usage
+
+### Requirements
+
+PHP 7.4 and later.
+Should also work with PHP 8.0.
+
+### Composer
+
+To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`:
+
+```json
+{
+ "repositories": [
+ {
+ "type": "vcs",
+ "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
+ }
+ ],
+ "require": {
+ "GIT_USER_ID/GIT_REPO_ID": "*@dev"
+ }
+}
+```
+
+Then run `composer install`
+
+### Manual Installation
+
+Download the files and include `autoload.php`:
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\ApplicationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$application_in = new \Svix\ApiClient\Model\ApplicationIn(); // \Svix\ApiClient\Model\ApplicationIn
+$get_if_exists = false; // bool | Get an existing application, or create a new one if doesn't exist. It's two separate functions in the libs.
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $result = $apiInstance->v1ApplicationCreate($application_in, $get_if_exists, $idempotency_key);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling ApplicationApi->v1ApplicationCreate: ', $e->getMessage(), PHP_EOL;
+}
+
+```
+
+## API Endpoints
+
+All URIs are relative to *https://api.eu.svix.com*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*ApplicationApi* | [**v1ApplicationCreate**](docs/Api/ApplicationApi.md#v1applicationcreate) | **POST** /api/v1/app/ | Create Application
+*ApplicationApi* | [**v1ApplicationDelete**](docs/Api/ApplicationApi.md#v1applicationdelete) | **DELETE** /api/v1/app/{app_id}/ | Delete Application
+*ApplicationApi* | [**v1ApplicationGet**](docs/Api/ApplicationApi.md#v1applicationget) | **GET** /api/v1/app/{app_id}/ | Get Application
+*ApplicationApi* | [**v1ApplicationList**](docs/Api/ApplicationApi.md#v1applicationlist) | **GET** /api/v1/app/ | List Applications
+*ApplicationApi* | [**v1ApplicationPatch**](docs/Api/ApplicationApi.md#v1applicationpatch) | **PATCH** /api/v1/app/{app_id}/ | Patch Application
+*ApplicationApi* | [**v1ApplicationUpdate**](docs/Api/ApplicationApi.md#v1applicationupdate) | **PUT** /api/v1/app/{app_id}/ | Update Application
+*AuthenticationApi* | [**v1AuthenticationAppPortalAccess**](docs/Api/AuthenticationApi.md#v1authenticationappportalaccess) | **POST** /api/v1/auth/app-portal-access/{app_id}/ | Get Consumer App Portal Access
+*AuthenticationApi* | [**v1AuthenticationDashboardAccess**](docs/Api/AuthenticationApi.md#v1authenticationdashboardaccess) | **POST** /api/v1/auth/dashboard-access/{app_id}/ | Dashboard Access
+*AuthenticationApi* | [**v1AuthenticationExpireAll**](docs/Api/AuthenticationApi.md#v1authenticationexpireall) | **POST** /api/v1/auth/app/{app_id}/expire-all/ | Expire All
+*AuthenticationApi* | [**v1AuthenticationLogout**](docs/Api/AuthenticationApi.md#v1authenticationlogout) | **POST** /api/v1/auth/logout/ | Logout
+*BackgroundTasksApi* | [**getBackgroundTask**](docs/Api/BackgroundTasksApi.md#getbackgroundtask) | **GET** /api/v1/background-task/{task_id}/ | Get Background Task
+*BackgroundTasksApi* | [**listBackgroundTasks**](docs/Api/BackgroundTasksApi.md#listbackgroundtasks) | **GET** /api/v1/background-task/ | List Background Tasks
+*EndpointApi* | [**v1EndpointCreate**](docs/Api/EndpointApi.md#v1endpointcreate) | **POST** /api/v1/app/{app_id}/endpoint/ | Create Endpoint
+*EndpointApi* | [**v1EndpointDelete**](docs/Api/EndpointApi.md#v1endpointdelete) | **DELETE** /api/v1/app/{app_id}/endpoint/{endpoint_id}/ | Delete Endpoint
+*EndpointApi* | [**v1EndpointGet**](docs/Api/EndpointApi.md#v1endpointget) | **GET** /api/v1/app/{app_id}/endpoint/{endpoint_id}/ | Get Endpoint
+*EndpointApi* | [**v1EndpointGetHeaders**](docs/Api/EndpointApi.md#v1endpointgetheaders) | **GET** /api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/ | Get Endpoint Headers
+*EndpointApi* | [**v1EndpointGetSecret**](docs/Api/EndpointApi.md#v1endpointgetsecret) | **GET** /api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/ | Get Endpoint Secret
+*EndpointApi* | [**v1EndpointGetStats**](docs/Api/EndpointApi.md#v1endpointgetstats) | **GET** /api/v1/app/{app_id}/endpoint/{endpoint_id}/stats/ | Endpoint Stats
+*EndpointApi* | [**v1EndpointList**](docs/Api/EndpointApi.md#v1endpointlist) | **GET** /api/v1/app/{app_id}/endpoint/ | List Endpoints
+*EndpointApi* | [**v1EndpointPatch**](docs/Api/EndpointApi.md#v1endpointpatch) | **PATCH** /api/v1/app/{app_id}/endpoint/{endpoint_id}/ | Patch Endpoint
+*EndpointApi* | [**v1EndpointPatchHeaders**](docs/Api/EndpointApi.md#v1endpointpatchheaders) | **PATCH** /api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/ | Patch Endpoint Headers
+*EndpointApi* | [**v1EndpointRecover**](docs/Api/EndpointApi.md#v1endpointrecover) | **POST** /api/v1/app/{app_id}/endpoint/{endpoint_id}/recover/ | Recover Failed Webhooks
+*EndpointApi* | [**v1EndpointReplay**](docs/Api/EndpointApi.md#v1endpointreplay) | **POST** /api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing/ | Replay Missing Webhooks
+*EndpointApi* | [**v1EndpointRotateSecret**](docs/Api/EndpointApi.md#v1endpointrotatesecret) | **POST** /api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate/ | Rotate Endpoint Secret
+*EndpointApi* | [**v1EndpointSendExample**](docs/Api/EndpointApi.md#v1endpointsendexample) | **POST** /api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example/ | Send Event Type Example Message
+*EndpointApi* | [**v1EndpointTransformationGet**](docs/Api/EndpointApi.md#v1endpointtransformationget) | **GET** /api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/ | Get Endpoint Transformation
+*EndpointApi* | [**v1EndpointTransformationPartialUpdate**](docs/Api/EndpointApi.md#v1endpointtransformationpartialupdate) | **PATCH** /api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/ | Set Endpoint Transformation
+*EndpointApi* | [**v1EndpointUpdate**](docs/Api/EndpointApi.md#v1endpointupdate) | **PUT** /api/v1/app/{app_id}/endpoint/{endpoint_id}/ | Update Endpoint
+*EndpointApi* | [**v1EndpointUpdateHeaders**](docs/Api/EndpointApi.md#v1endpointupdateheaders) | **PUT** /api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/ | Update Endpoint Headers
+*EventTypeApi* | [**v1EventTypeCreate**](docs/Api/EventTypeApi.md#v1eventtypecreate) | **POST** /api/v1/event-type/ | Create Event Type
+*EventTypeApi* | [**v1EventTypeDelete**](docs/Api/EventTypeApi.md#v1eventtypedelete) | **DELETE** /api/v1/event-type/{event_type_name}/ | Delete Event Type
+*EventTypeApi* | [**v1EventTypeGet**](docs/Api/EventTypeApi.md#v1eventtypeget) | **GET** /api/v1/event-type/{event_type_name}/ | Get Event Type
+*EventTypeApi* | [**v1EventTypeImportOpenapi**](docs/Api/EventTypeApi.md#v1eventtypeimportopenapi) | **POST** /api/v1/event-type/import/openapi/ | Event Type Import From Openapi
+*EventTypeApi* | [**v1EventTypeList**](docs/Api/EventTypeApi.md#v1eventtypelist) | **GET** /api/v1/event-type/ | List Event Types
+*EventTypeApi* | [**v1EventTypePatch**](docs/Api/EventTypeApi.md#v1eventtypepatch) | **PATCH** /api/v1/event-type/{event_type_name}/ | Patch Event Type
+*EventTypeApi* | [**v1EventTypeUpdate**](docs/Api/EventTypeApi.md#v1eventtypeupdate) | **PUT** /api/v1/event-type/{event_type_name}/ | Update Event Type
+*HealthApi* | [**v1HealthGet**](docs/Api/HealthApi.md#v1healthget) | **GET** /api/v1/health/ | Health
+*IntegrationApi* | [**v1IntegrationCreate**](docs/Api/IntegrationApi.md#v1integrationcreate) | **POST** /api/v1/app/{app_id}/integration/ | Create Integration
+*IntegrationApi* | [**v1IntegrationDelete**](docs/Api/IntegrationApi.md#v1integrationdelete) | **DELETE** /api/v1/app/{app_id}/integration/{integ_id}/ | Delete Integration
+*IntegrationApi* | [**v1IntegrationGet**](docs/Api/IntegrationApi.md#v1integrationget) | **GET** /api/v1/app/{app_id}/integration/{integ_id}/ | Get Integration
+*IntegrationApi* | [**v1IntegrationGetKey**](docs/Api/IntegrationApi.md#v1integrationgetkey) | **GET** /api/v1/app/{app_id}/integration/{integ_id}/key/ | Get Integration Key
+*IntegrationApi* | [**v1IntegrationList**](docs/Api/IntegrationApi.md#v1integrationlist) | **GET** /api/v1/app/{app_id}/integration/ | List Integrations
+*IntegrationApi* | [**v1IntegrationRotateKey**](docs/Api/IntegrationApi.md#v1integrationrotatekey) | **POST** /api/v1/app/{app_id}/integration/{integ_id}/key/rotate/ | Rotate Integration Key
+*IntegrationApi* | [**v1IntegrationUpdate**](docs/Api/IntegrationApi.md#v1integrationupdate) | **PUT** /api/v1/app/{app_id}/integration/{integ_id}/ | Update Integration
+*MessageApi* | [**v1MessageCreate**](docs/Api/MessageApi.md#v1messagecreate) | **POST** /api/v1/app/{app_id}/msg/ | Create Message
+*MessageApi* | [**v1MessageExpungeContent**](docs/Api/MessageApi.md#v1messageexpungecontent) | **DELETE** /api/v1/app/{app_id}/msg/{msg_id}/content/ | Delete message payload
+*MessageApi* | [**v1MessageGet**](docs/Api/MessageApi.md#v1messageget) | **GET** /api/v1/app/{app_id}/msg/{msg_id}/ | Get Message
+*MessageApi* | [**v1MessageList**](docs/Api/MessageApi.md#v1messagelist) | **GET** /api/v1/app/{app_id}/msg/ | List Messages
+*MessageAttemptApi* | [**v1MessageAttemptExpungeContent**](docs/Api/MessageAttemptApi.md#v1messageattemptexpungecontent) | **DELETE** /api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content/ | Delete attempt response body
+*MessageAttemptApi* | [**v1MessageAttemptGet**](docs/Api/MessageAttemptApi.md#v1messageattemptget) | **GET** /api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/ | Get Attempt
+*MessageAttemptApi* | [**v1MessageAttemptListAttemptedDestinations**](docs/Api/MessageAttemptApi.md#v1messageattemptlistattempteddestinations) | **GET** /api/v1/app/{app_id}/msg/{msg_id}/endpoint/ | List Attempted Destinations
+*MessageAttemptApi* | [**v1MessageAttemptListAttemptedMessages**](docs/Api/MessageAttemptApi.md#v1messageattemptlistattemptedmessages) | **GET** /api/v1/app/{app_id}/endpoint/{endpoint_id}/msg/ | List Attempted Messages
+*MessageAttemptApi* | [**v1MessageAttemptListByEndpoint**](docs/Api/MessageAttemptApi.md#v1messageattemptlistbyendpoint) | **GET** /api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}/ | List Attempts By Endpoint
+*MessageAttemptApi* | [**v1MessageAttemptListByEndpointDeprecated**](docs/Api/MessageAttemptApi.md#v1messageattemptlistbyendpointdeprecated) | **GET** /api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/attempt/ | List Attempts For Endpoint
+*MessageAttemptApi* | [**v1MessageAttemptListByMsg**](docs/Api/MessageAttemptApi.md#v1messageattemptlistbymsg) | **GET** /api/v1/app/{app_id}/attempt/msg/{msg_id}/ | List Attempts By Msg
+*MessageAttemptApi* | [**v1MessageAttemptListByMsgDeprecated**](docs/Api/MessageAttemptApi.md#v1messageattemptlistbymsgdeprecated) | **GET** /api/v1/app/{app_id}/msg/{msg_id}/attempt/ | List Attempts
+*MessageAttemptApi* | [**v1MessageAttemptResend**](docs/Api/MessageAttemptApi.md#v1messageattemptresend) | **POST** /api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend/ | Resend Webhook
+*StatisticsApi* | [**calculateAggregateAppStats**](docs/Api/StatisticsApi.md#calculateaggregateappstats) | **POST** /api/v1/stats/usage/app/ | Calculate Aggregate App Stats
+
+## Models
+
+- [AppPortalAccessIn](docs/Model/AppPortalAccessIn.md)
+- [AppPortalAccessOut](docs/Model/AppPortalAccessOut.md)
+- [AppUsageStatsIn](docs/Model/AppUsageStatsIn.md)
+- [AppUsageStatsOut](docs/Model/AppUsageStatsOut.md)
+- [ApplicationIn](docs/Model/ApplicationIn.md)
+- [ApplicationOut](docs/Model/ApplicationOut.md)
+- [ApplicationPatch](docs/Model/ApplicationPatch.md)
+- [ApplicationTokenExpireIn](docs/Model/ApplicationTokenExpireIn.md)
+- [BackgroundTaskOut](docs/Model/BackgroundTaskOut.md)
+- [BackgroundTaskStatus](docs/Model/BackgroundTaskStatus.md)
+- [BackgroundTaskType](docs/Model/BackgroundTaskType.md)
+- [DashboardAccessOut](docs/Model/DashboardAccessOut.md)
+- [EndpointCreatedEvent](docs/Model/EndpointCreatedEvent.md)
+- [EndpointCreatedEventData](docs/Model/EndpointCreatedEventData.md)
+- [EndpointDeletedEvent](docs/Model/EndpointDeletedEvent.md)
+- [EndpointDeletedEventData](docs/Model/EndpointDeletedEventData.md)
+- [EndpointDisabledEvent](docs/Model/EndpointDisabledEvent.md)
+- [EndpointDisabledEventData](docs/Model/EndpointDisabledEventData.md)
+- [EndpointHeadersIn](docs/Model/EndpointHeadersIn.md)
+- [EndpointHeadersOut](docs/Model/EndpointHeadersOut.md)
+- [EndpointHeadersPatchIn](docs/Model/EndpointHeadersPatchIn.md)
+- [EndpointIn](docs/Model/EndpointIn.md)
+- [EndpointMessageOut](docs/Model/EndpointMessageOut.md)
+- [EndpointOut](docs/Model/EndpointOut.md)
+- [EndpointPatch](docs/Model/EndpointPatch.md)
+- [EndpointSecretOut](docs/Model/EndpointSecretOut.md)
+- [EndpointSecretRotateIn](docs/Model/EndpointSecretRotateIn.md)
+- [EndpointStats](docs/Model/EndpointStats.md)
+- [EndpointTransformationIn](docs/Model/EndpointTransformationIn.md)
+- [EndpointTransformationOut](docs/Model/EndpointTransformationOut.md)
+- [EndpointTransformationSimulateIn](docs/Model/EndpointTransformationSimulateIn.md)
+- [EndpointTransformationSimulateOut](docs/Model/EndpointTransformationSimulateOut.md)
+- [EndpointUpdate](docs/Model/EndpointUpdate.md)
+- [EndpointUpdatedEvent](docs/Model/EndpointUpdatedEvent.md)
+- [EndpointUpdatedEventData](docs/Model/EndpointUpdatedEventData.md)
+- [EventExampleIn](docs/Model/EventExampleIn.md)
+- [EventTypeImportOpenApiIn](docs/Model/EventTypeImportOpenApiIn.md)
+- [EventTypeImportOpenApiOut](docs/Model/EventTypeImportOpenApiOut.md)
+- [EventTypeImportOpenApiOutData](docs/Model/EventTypeImportOpenApiOutData.md)
+- [EventTypeIn](docs/Model/EventTypeIn.md)
+- [EventTypeOut](docs/Model/EventTypeOut.md)
+- [EventTypePatch](docs/Model/EventTypePatch.md)
+- [EventTypeUpdate](docs/Model/EventTypeUpdate.md)
+- [ExportEventTypeOut](docs/Model/ExportEventTypeOut.md)
+- [HTTPValidationError](docs/Model/HTTPValidationError.md)
+- [HttpErrorOut](docs/Model/HttpErrorOut.md)
+- [IntegrationIn](docs/Model/IntegrationIn.md)
+- [IntegrationKeyOut](docs/Model/IntegrationKeyOut.md)
+- [IntegrationOut](docs/Model/IntegrationOut.md)
+- [IntegrationUpdate](docs/Model/IntegrationUpdate.md)
+- [ListResponseApplicationOut](docs/Model/ListResponseApplicationOut.md)
+- [ListResponseBackgroundTaskOut](docs/Model/ListResponseBackgroundTaskOut.md)
+- [ListResponseEndpointMessageOut](docs/Model/ListResponseEndpointMessageOut.md)
+- [ListResponseEndpointOut](docs/Model/ListResponseEndpointOut.md)
+- [ListResponseEventTypeOut](docs/Model/ListResponseEventTypeOut.md)
+- [ListResponseIntegrationOut](docs/Model/ListResponseIntegrationOut.md)
+- [ListResponseMessageAttemptEndpointOut](docs/Model/ListResponseMessageAttemptEndpointOut.md)
+- [ListResponseMessageAttemptOut](docs/Model/ListResponseMessageAttemptOut.md)
+- [ListResponseMessageEndpointOut](docs/Model/ListResponseMessageEndpointOut.md)
+- [ListResponseMessageOut](docs/Model/ListResponseMessageOut.md)
+- [ListResponseTemplateOut](docs/Model/ListResponseTemplateOut.md)
+- [MessageAttemptEndpointOut](docs/Model/MessageAttemptEndpointOut.md)
+- [MessageAttemptExhaustedEvent](docs/Model/MessageAttemptExhaustedEvent.md)
+- [MessageAttemptExhaustedEventData](docs/Model/MessageAttemptExhaustedEventData.md)
+- [MessageAttemptFailedData](docs/Model/MessageAttemptFailedData.md)
+- [MessageAttemptFailingEvent](docs/Model/MessageAttemptFailingEvent.md)
+- [MessageAttemptFailingEventData](docs/Model/MessageAttemptFailingEventData.md)
+- [MessageAttemptOut](docs/Model/MessageAttemptOut.md)
+- [MessageAttemptRecoveredEvent](docs/Model/MessageAttemptRecoveredEvent.md)
+- [MessageAttemptRecoveredEventData](docs/Model/MessageAttemptRecoveredEventData.md)
+- [MessageAttemptTriggerType](docs/Model/MessageAttemptTriggerType.md)
+- [MessageBroadcastIn](docs/Model/MessageBroadcastIn.md)
+- [MessageBroadcastOut](docs/Model/MessageBroadcastOut.md)
+- [MessageEndpointOut](docs/Model/MessageEndpointOut.md)
+- [MessageIn](docs/Model/MessageIn.md)
+- [MessageOut](docs/Model/MessageOut.md)
+- [MessageRawPayloadOut](docs/Model/MessageRawPayloadOut.md)
+- [MessageStatus](docs/Model/MessageStatus.md)
+- [OauthPayloadIn](docs/Model/OauthPayloadIn.md)
+- [OauthPayloadOut](docs/Model/OauthPayloadOut.md)
+- [OneTimeTokenIn](docs/Model/OneTimeTokenIn.md)
+- [OneTimeTokenOut](docs/Model/OneTimeTokenOut.md)
+- [Ordering](docs/Model/Ordering.md)
+- [RecoverIn](docs/Model/RecoverIn.md)
+- [RecoverOut](docs/Model/RecoverOut.md)
+- [ReplayIn](docs/Model/ReplayIn.md)
+- [ReplayOut](docs/Model/ReplayOut.md)
+- [StatusCodeClass](docs/Model/StatusCodeClass.md)
+- [TemplateIn](docs/Model/TemplateIn.md)
+- [TemplateOut](docs/Model/TemplateOut.md)
+- [TemplatePatch](docs/Model/TemplatePatch.md)
+- [TemplateUpdate](docs/Model/TemplateUpdate.md)
+- [TransformationHttpMethod](docs/Model/TransformationHttpMethod.md)
+- [TransformationSimulateIn](docs/Model/TransformationSimulateIn.md)
+- [TransformationSimulateOut](docs/Model/TransformationSimulateOut.md)
+- [TransformationTemplateKind](docs/Model/TransformationTemplateKind.md)
+- [ValidationError](docs/Model/ValidationError.md)
+
+## Authorization
+
+Authentication schemes defined for the API:
+### HTTPBearer
+
+- **Type**: Bearer authentication
+
+## Tests
+
+To run the tests, use:
+
+```bash
+composer install
+vendor/bin/phpunit
+```
+
+## Author
+
+
+
+## About this package
+
+This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: `1.13.0`
+- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..ecac9c9
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,39 @@
+{
+ "name": "paypaplane/svix-client",
+ "description": "Welcome to the Svix API documentation! Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/) # Introduction This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com). ## Main concepts In Svix you have four important entities you will be interacting with: - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. For more information on authentication, please refer to the [authentication token docs](https://docs.svix.com/api-keys). ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.",
+ "keywords": [
+ "openapitools",
+ "openapi-generator",
+ "openapi",
+ "php",
+ "sdk",
+ "rest",
+ "api"
+ ],
+ "homepage": "https://openapi-generator.tech",
+ "license": "unlicense",
+ "authors": [
+ {
+ "name": "OpenAPI",
+ "homepage": "https://openapi-generator.tech"
+ }
+ ],
+ "require": {
+ "php": "^7.4 || ^8.0",
+ "ext-curl": "*",
+ "ext-json": "*",
+ "ext-mbstring": "*",
+ "guzzlehttp/guzzle": "^7.3",
+ "guzzlehttp/psr7": "^1.7 || ^2.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^8.0 || ^9.0",
+ "friendsofphp/php-cs-fixer": "^3.5"
+ },
+ "autoload": {
+ "psr-4": { "Svix\\ApiClient\\" : "lib/" }
+ },
+ "autoload-dev": {
+ "psr-4": { "Svix\\ApiClient\\Test\\" : "test/" }
+ }
+}
diff --git a/docs/Api/ApplicationApi.md b/docs/Api/ApplicationApi.md
new file mode 100644
index 0000000..019be41
--- /dev/null
+++ b/docs/Api/ApplicationApi.md
@@ -0,0 +1,384 @@
+# Svix\ApiClient\ApplicationApi
+
+All URIs are relative to https://api.eu.svix.com, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**v1ApplicationCreate()**](ApplicationApi.md#v1ApplicationCreate) | **POST** /api/v1/app/ | Create Application |
+| [**v1ApplicationDelete()**](ApplicationApi.md#v1ApplicationDelete) | **DELETE** /api/v1/app/{app_id}/ | Delete Application |
+| [**v1ApplicationGet()**](ApplicationApi.md#v1ApplicationGet) | **GET** /api/v1/app/{app_id}/ | Get Application |
+| [**v1ApplicationList()**](ApplicationApi.md#v1ApplicationList) | **GET** /api/v1/app/ | List Applications |
+| [**v1ApplicationPatch()**](ApplicationApi.md#v1ApplicationPatch) | **PATCH** /api/v1/app/{app_id}/ | Patch Application |
+| [**v1ApplicationUpdate()**](ApplicationApi.md#v1ApplicationUpdate) | **PUT** /api/v1/app/{app_id}/ | Update Application |
+
+
+## `v1ApplicationCreate()`
+
+```php
+v1ApplicationCreate($application_in, $get_if_exists, $idempotency_key): \Svix\ApiClient\Model\ApplicationOut
+```
+
+Create Application
+
+Create a new application.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\ApplicationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$application_in = new \Svix\ApiClient\Model\ApplicationIn(); // \Svix\ApiClient\Model\ApplicationIn
+$get_if_exists = false; // bool | Get an existing application, or create a new one if doesn't exist. It's two separate functions in the libs.
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $result = $apiInstance->v1ApplicationCreate($application_in, $get_if_exists, $idempotency_key);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling ApplicationApi->v1ApplicationCreate: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **application_in** | [**\Svix\ApiClient\Model\ApplicationIn**](../Model/ApplicationIn.md)| | |
+| **get_if_exists** | **bool**| Get an existing application, or create a new one if doesn't exist. It's two separate functions in the libs. | [optional] [default to false] |
+| **idempotency_key** | **string**| The request's idempotency key | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\ApplicationOut**](../Model/ApplicationOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1ApplicationDelete()`
+
+```php
+v1ApplicationDelete($app_id)
+```
+
+Delete Application
+
+Delete an application.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\ApplicationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+
+try {
+ $apiInstance->v1ApplicationDelete($app_id);
+} catch (Exception $e) {
+ echo 'Exception when calling ApplicationApi->v1ApplicationDelete: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1ApplicationGet()`
+
+```php
+v1ApplicationGet($app_id): \Svix\ApiClient\Model\ApplicationOut
+```
+
+Get Application
+
+Get an application.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\ApplicationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+
+try {
+ $result = $apiInstance->v1ApplicationGet($app_id);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling ApplicationApi->v1ApplicationGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+
+### Return type
+
+[**\Svix\ApiClient\Model\ApplicationOut**](../Model/ApplicationOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1ApplicationList()`
+
+```php
+v1ApplicationList($limit, $iterator, $order): \Svix\ApiClient\Model\ListResponseApplicationOut
+```
+
+List Applications
+
+List of all the organization's applications.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\ApplicationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$limit = 56; // int | Limit the number of returned items
+$iterator = app_1srOrx2ZWZBpBUvZwXKQmoEYga2; // string | The iterator returned from a prior invocation
+$order = new \Svix\ApiClient\Model\Ordering(); // Ordering | The sorting order of the returned items
+
+try {
+ $result = $apiInstance->v1ApplicationList($limit, $iterator, $order);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling ApplicationApi->v1ApplicationList: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **limit** | **int**| Limit the number of returned items | [optional] |
+| **iterator** | **string**| The iterator returned from a prior invocation | [optional] |
+| **order** | [**Ordering**](../Model/.md)| The sorting order of the returned items | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\ListResponseApplicationOut**](../Model/ListResponseApplicationOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1ApplicationPatch()`
+
+```php
+v1ApplicationPatch($app_id, $application_patch): \Svix\ApiClient\Model\ApplicationOut
+```
+
+Patch Application
+
+Partially update an application.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\ApplicationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$application_patch = new \Svix\ApiClient\Model\ApplicationPatch(); // \Svix\ApiClient\Model\ApplicationPatch
+
+try {
+ $result = $apiInstance->v1ApplicationPatch($app_id, $application_patch);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling ApplicationApi->v1ApplicationPatch: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **application_patch** | [**\Svix\ApiClient\Model\ApplicationPatch**](../Model/ApplicationPatch.md)| | |
+
+### Return type
+
+[**\Svix\ApiClient\Model\ApplicationOut**](../Model/ApplicationOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1ApplicationUpdate()`
+
+```php
+v1ApplicationUpdate($app_id, $application_in): \Svix\ApiClient\Model\ApplicationOut
+```
+
+Update Application
+
+Update an application.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\ApplicationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$application_in = new \Svix\ApiClient\Model\ApplicationIn(); // \Svix\ApiClient\Model\ApplicationIn
+
+try {
+ $result = $apiInstance->v1ApplicationUpdate($app_id, $application_in);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling ApplicationApi->v1ApplicationUpdate: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **application_in** | [**\Svix\ApiClient\Model\ApplicationIn**](../Model/ApplicationIn.md)| | |
+
+### Return type
+
+[**\Svix\ApiClient\Model\ApplicationOut**](../Model/ApplicationOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
diff --git a/docs/Api/AuthenticationApi.md b/docs/Api/AuthenticationApi.md
new file mode 100644
index 0000000..1e32eb6
--- /dev/null
+++ b/docs/Api/AuthenticationApi.md
@@ -0,0 +1,259 @@
+# Svix\ApiClient\AuthenticationApi
+
+All URIs are relative to https://api.eu.svix.com, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**v1AuthenticationAppPortalAccess()**](AuthenticationApi.md#v1AuthenticationAppPortalAccess) | **POST** /api/v1/auth/app-portal-access/{app_id}/ | Get Consumer App Portal Access |
+| [**v1AuthenticationDashboardAccess()**](AuthenticationApi.md#v1AuthenticationDashboardAccess) | **POST** /api/v1/auth/dashboard-access/{app_id}/ | Dashboard Access |
+| [**v1AuthenticationExpireAll()**](AuthenticationApi.md#v1AuthenticationExpireAll) | **POST** /api/v1/auth/app/{app_id}/expire-all/ | Expire All |
+| [**v1AuthenticationLogout()**](AuthenticationApi.md#v1AuthenticationLogout) | **POST** /api/v1/auth/logout/ | Logout |
+
+
+## `v1AuthenticationAppPortalAccess()`
+
+```php
+v1AuthenticationAppPortalAccess($app_id, $app_portal_access_in, $idempotency_key): \Svix\ApiClient\Model\AppPortalAccessOut
+```
+
+Get Consumer App Portal Access
+
+Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\AuthenticationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$app_portal_access_in = new \Svix\ApiClient\Model\AppPortalAccessIn(); // \Svix\ApiClient\Model\AppPortalAccessIn
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $result = $apiInstance->v1AuthenticationAppPortalAccess($app_id, $app_portal_access_in, $idempotency_key);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling AuthenticationApi->v1AuthenticationAppPortalAccess: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **app_portal_access_in** | [**\Svix\ApiClient\Model\AppPortalAccessIn**](../Model/AppPortalAccessIn.md)| | |
+| **idempotency_key** | **string**| The request's idempotency key | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\AppPortalAccessOut**](../Model/AppPortalAccessOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1AuthenticationDashboardAccess()`
+
+```php
+v1AuthenticationDashboardAccess($app_id, $idempotency_key): \Svix\ApiClient\Model\DashboardAccessOut
+```
+
+Dashboard Access
+
+DEPRECATED: Please use `app-portal-access` instead. Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\AuthenticationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $result = $apiInstance->v1AuthenticationDashboardAccess($app_id, $idempotency_key);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling AuthenticationApi->v1AuthenticationDashboardAccess: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **idempotency_key** | **string**| The request's idempotency key | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\DashboardAccessOut**](../Model/DashboardAccessOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1AuthenticationExpireAll()`
+
+```php
+v1AuthenticationExpireAll($app_id, $application_token_expire_in, $idempotency_key)
+```
+
+Expire All
+
+Expire all of the tokens associated with a specific Application
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\AuthenticationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$application_token_expire_in = new \Svix\ApiClient\Model\ApplicationTokenExpireIn(); // \Svix\ApiClient\Model\ApplicationTokenExpireIn
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $apiInstance->v1AuthenticationExpireAll($app_id, $application_token_expire_in, $idempotency_key);
+} catch (Exception $e) {
+ echo 'Exception when calling AuthenticationApi->v1AuthenticationExpireAll: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **application_token_expire_in** | [**\Svix\ApiClient\Model\ApplicationTokenExpireIn**](../Model/ApplicationTokenExpireIn.md)| | |
+| **idempotency_key** | **string**| The request's idempotency key | [optional] |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1AuthenticationLogout()`
+
+```php
+v1AuthenticationLogout($idempotency_key)
+```
+
+Logout
+
+Logout an app token. Trying to log out other tokens will fail.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\AuthenticationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $apiInstance->v1AuthenticationLogout($idempotency_key);
+} catch (Exception $e) {
+ echo 'Exception when calling AuthenticationApi->v1AuthenticationLogout: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **idempotency_key** | **string**| The request's idempotency key | [optional] |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
diff --git a/docs/Api/BackgroundTasksApi.md b/docs/Api/BackgroundTasksApi.md
new file mode 100644
index 0000000..3e84bc6
--- /dev/null
+++ b/docs/Api/BackgroundTasksApi.md
@@ -0,0 +1,137 @@
+# Svix\ApiClient\BackgroundTasksApi
+
+All URIs are relative to https://api.eu.svix.com, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**getBackgroundTask()**](BackgroundTasksApi.md#getBackgroundTask) | **GET** /api/v1/background-task/{task_id}/ | Get Background Task |
+| [**listBackgroundTasks()**](BackgroundTasksApi.md#listBackgroundTasks) | **GET** /api/v1/background-task/ | List Background Tasks |
+
+
+## `getBackgroundTask()`
+
+```php
+getBackgroundTask($task_id): \Svix\ApiClient\Model\BackgroundTaskOut
+```
+
+Get Background Task
+
+Get a background task by ID.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\BackgroundTasksApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$task_id = 'task_id_example'; // string
+
+try {
+ $result = $apiInstance->getBackgroundTask($task_id);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling BackgroundTasksApi->getBackgroundTask: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **task_id** | **string**| | |
+
+### Return type
+
+[**\Svix\ApiClient\Model\BackgroundTaskOut**](../Model/BackgroundTaskOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `listBackgroundTasks()`
+
+```php
+listBackgroundTasks($status, $task, $limit, $iterator, $order): \Svix\ApiClient\Model\ListResponseBackgroundTaskOut
+```
+
+List Background Tasks
+
+List background tasks executed in the past 90 days.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\BackgroundTasksApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$status = new \Svix\ApiClient\Model\BackgroundTaskStatus(); // BackgroundTaskStatus | Filter the response based on the status
+$task = new \Svix\ApiClient\Model\BackgroundTaskType(); // BackgroundTaskType | Filter the response based on the type
+$limit = 56; // int | Limit the number of returned items
+$iterator = 'iterator_example'; // string | The iterator returned from a prior invocation
+$order = new \Svix\ApiClient\Model\Ordering(); // Ordering | The sorting order of the returned items
+
+try {
+ $result = $apiInstance->listBackgroundTasks($status, $task, $limit, $iterator, $order);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling BackgroundTasksApi->listBackgroundTasks: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **status** | [**BackgroundTaskStatus**](../Model/.md)| Filter the response based on the status | [optional] |
+| **task** | [**BackgroundTaskType**](../Model/.md)| Filter the response based on the type | [optional] |
+| **limit** | **int**| Limit the number of returned items | [optional] |
+| **iterator** | **string**| The iterator returned from a prior invocation | [optional] |
+| **order** | [**Ordering**](../Model/.md)| The sorting order of the returned items | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\ListResponseBackgroundTaskOut**](../Model/ListResponseBackgroundTaskOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
diff --git a/docs/Api/EndpointApi.md b/docs/Api/EndpointApi.md
new file mode 100644
index 0000000..0afaec5
--- /dev/null
+++ b/docs/Api/EndpointApi.md
@@ -0,0 +1,1109 @@
+# Svix\ApiClient\EndpointApi
+
+All URIs are relative to https://api.eu.svix.com, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**v1EndpointCreate()**](EndpointApi.md#v1EndpointCreate) | **POST** /api/v1/app/{app_id}/endpoint/ | Create Endpoint |
+| [**v1EndpointDelete()**](EndpointApi.md#v1EndpointDelete) | **DELETE** /api/v1/app/{app_id}/endpoint/{endpoint_id}/ | Delete Endpoint |
+| [**v1EndpointGet()**](EndpointApi.md#v1EndpointGet) | **GET** /api/v1/app/{app_id}/endpoint/{endpoint_id}/ | Get Endpoint |
+| [**v1EndpointGetHeaders()**](EndpointApi.md#v1EndpointGetHeaders) | **GET** /api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/ | Get Endpoint Headers |
+| [**v1EndpointGetSecret()**](EndpointApi.md#v1EndpointGetSecret) | **GET** /api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/ | Get Endpoint Secret |
+| [**v1EndpointGetStats()**](EndpointApi.md#v1EndpointGetStats) | **GET** /api/v1/app/{app_id}/endpoint/{endpoint_id}/stats/ | Endpoint Stats |
+| [**v1EndpointList()**](EndpointApi.md#v1EndpointList) | **GET** /api/v1/app/{app_id}/endpoint/ | List Endpoints |
+| [**v1EndpointPatch()**](EndpointApi.md#v1EndpointPatch) | **PATCH** /api/v1/app/{app_id}/endpoint/{endpoint_id}/ | Patch Endpoint |
+| [**v1EndpointPatchHeaders()**](EndpointApi.md#v1EndpointPatchHeaders) | **PATCH** /api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/ | Patch Endpoint Headers |
+| [**v1EndpointRecover()**](EndpointApi.md#v1EndpointRecover) | **POST** /api/v1/app/{app_id}/endpoint/{endpoint_id}/recover/ | Recover Failed Webhooks |
+| [**v1EndpointReplay()**](EndpointApi.md#v1EndpointReplay) | **POST** /api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing/ | Replay Missing Webhooks |
+| [**v1EndpointRotateSecret()**](EndpointApi.md#v1EndpointRotateSecret) | **POST** /api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate/ | Rotate Endpoint Secret |
+| [**v1EndpointSendExample()**](EndpointApi.md#v1EndpointSendExample) | **POST** /api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example/ | Send Event Type Example Message |
+| [**v1EndpointTransformationGet()**](EndpointApi.md#v1EndpointTransformationGet) | **GET** /api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/ | Get Endpoint Transformation |
+| [**v1EndpointTransformationPartialUpdate()**](EndpointApi.md#v1EndpointTransformationPartialUpdate) | **PATCH** /api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/ | Set Endpoint Transformation |
+| [**v1EndpointUpdate()**](EndpointApi.md#v1EndpointUpdate) | **PUT** /api/v1/app/{app_id}/endpoint/{endpoint_id}/ | Update Endpoint |
+| [**v1EndpointUpdateHeaders()**](EndpointApi.md#v1EndpointUpdateHeaders) | **PUT** /api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/ | Update Endpoint Headers |
+
+
+## `v1EndpointCreate()`
+
+```php
+v1EndpointCreate($app_id, $endpoint_in, $idempotency_key): \Svix\ApiClient\Model\EndpointOut
+```
+
+Create Endpoint
+
+Create a new endpoint for the application. When `secret` is `null` the secret is automatically generated (recommended)
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EndpointApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_in = new \Svix\ApiClient\Model\EndpointIn(); // \Svix\ApiClient\Model\EndpointIn
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $result = $apiInstance->v1EndpointCreate($app_id, $endpoint_in, $idempotency_key);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EndpointApi->v1EndpointCreate: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_in** | [**\Svix\ApiClient\Model\EndpointIn**](../Model/EndpointIn.md)| | |
+| **idempotency_key** | **string**| The request's idempotency key | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\EndpointOut**](../Model/EndpointOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EndpointDelete()`
+
+```php
+v1EndpointDelete($app_id, $endpoint_id)
+```
+
+Delete Endpoint
+
+Delete an endpoint.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EndpointApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+
+try {
+ $apiInstance->v1EndpointDelete($app_id, $endpoint_id);
+} catch (Exception $e) {
+ echo 'Exception when calling EndpointApi->v1EndpointDelete: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EndpointGet()`
+
+```php
+v1EndpointGet($app_id, $endpoint_id): \Svix\ApiClient\Model\EndpointOut
+```
+
+Get Endpoint
+
+Get an endpoint.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EndpointApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+
+try {
+ $result = $apiInstance->v1EndpointGet($app_id, $endpoint_id);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EndpointApi->v1EndpointGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+
+### Return type
+
+[**\Svix\ApiClient\Model\EndpointOut**](../Model/EndpointOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EndpointGetHeaders()`
+
+```php
+v1EndpointGetHeaders($app_id, $endpoint_id): \Svix\ApiClient\Model\EndpointHeadersOut
+```
+
+Get Endpoint Headers
+
+Get the additional headers to be sent with the webhook
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EndpointApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+
+try {
+ $result = $apiInstance->v1EndpointGetHeaders($app_id, $endpoint_id);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EndpointApi->v1EndpointGetHeaders: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+
+### Return type
+
+[**\Svix\ApiClient\Model\EndpointHeadersOut**](../Model/EndpointHeadersOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EndpointGetSecret()`
+
+```php
+v1EndpointGetSecret($app_id, $endpoint_id): \Svix\ApiClient\Model\EndpointSecretOut
+```
+
+Get Endpoint Secret
+
+Get the endpoint's signing secret. This is used to verify the authenticity of the webhook. For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EndpointApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+
+try {
+ $result = $apiInstance->v1EndpointGetSecret($app_id, $endpoint_id);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EndpointApi->v1EndpointGetSecret: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+
+### Return type
+
+[**\Svix\ApiClient\Model\EndpointSecretOut**](../Model/EndpointSecretOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EndpointGetStats()`
+
+```php
+v1EndpointGetStats($app_id, $endpoint_id, $since, $until): \Svix\ApiClient\Model\EndpointStats
+```
+
+Endpoint Stats
+
+Get basic statistics for the endpoint.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EndpointApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+$since = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter the range to data starting from this date
+$until = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter the range to data ending by this date
+
+try {
+ $result = $apiInstance->v1EndpointGetStats($app_id, $endpoint_id, $since, $until);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EndpointApi->v1EndpointGetStats: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+| **since** | **\DateTime**| Filter the range to data starting from this date | [optional] |
+| **until** | **\DateTime**| Filter the range to data ending by this date | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\EndpointStats**](../Model/EndpointStats.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EndpointList()`
+
+```php
+v1EndpointList($app_id, $limit, $iterator, $order): \Svix\ApiClient\Model\ListResponseEndpointOut
+```
+
+List Endpoints
+
+List the application's endpoints.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EndpointApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$limit = 56; // int | Limit the number of returned items
+$iterator = ep_1srOrx2ZWZBpBUvZwXKQmoEYga2; // string | The iterator returned from a prior invocation
+$order = new \Svix\ApiClient\Model\Ordering(); // Ordering | The sorting order of the returned items
+
+try {
+ $result = $apiInstance->v1EndpointList($app_id, $limit, $iterator, $order);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EndpointApi->v1EndpointList: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **limit** | **int**| Limit the number of returned items | [optional] |
+| **iterator** | **string**| The iterator returned from a prior invocation | [optional] |
+| **order** | [**Ordering**](../Model/.md)| The sorting order of the returned items | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\ListResponseEndpointOut**](../Model/ListResponseEndpointOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EndpointPatch()`
+
+```php
+v1EndpointPatch($app_id, $endpoint_id, $endpoint_patch): \Svix\ApiClient\Model\EndpointOut
+```
+
+Patch Endpoint
+
+Partially update an endpoint.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EndpointApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+$endpoint_patch = new \Svix\ApiClient\Model\EndpointPatch(); // \Svix\ApiClient\Model\EndpointPatch
+
+try {
+ $result = $apiInstance->v1EndpointPatch($app_id, $endpoint_id, $endpoint_patch);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EndpointApi->v1EndpointPatch: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+| **endpoint_patch** | [**\Svix\ApiClient\Model\EndpointPatch**](../Model/EndpointPatch.md)| | |
+
+### Return type
+
+[**\Svix\ApiClient\Model\EndpointOut**](../Model/EndpointOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EndpointPatchHeaders()`
+
+```php
+v1EndpointPatchHeaders($app_id, $endpoint_id, $endpoint_headers_patch_in)
+```
+
+Patch Endpoint Headers
+
+Partially set the additional headers to be sent with the webhook
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EndpointApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+$endpoint_headers_patch_in = new \Svix\ApiClient\Model\EndpointHeadersPatchIn(); // \Svix\ApiClient\Model\EndpointHeadersPatchIn
+
+try {
+ $apiInstance->v1EndpointPatchHeaders($app_id, $endpoint_id, $endpoint_headers_patch_in);
+} catch (Exception $e) {
+ echo 'Exception when calling EndpointApi->v1EndpointPatchHeaders: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+| **endpoint_headers_patch_in** | [**\Svix\ApiClient\Model\EndpointHeadersPatchIn**](../Model/EndpointHeadersPatchIn.md)| | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EndpointRecover()`
+
+```php
+v1EndpointRecover($app_id, $endpoint_id, $recover_in, $idempotency_key): \Svix\ApiClient\Model\RecoverOut
+```
+
+Recover Failed Webhooks
+
+Resend all failed messages since a given time.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EndpointApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+$recover_in = new \Svix\ApiClient\Model\RecoverIn(); // \Svix\ApiClient\Model\RecoverIn
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $result = $apiInstance->v1EndpointRecover($app_id, $endpoint_id, $recover_in, $idempotency_key);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EndpointApi->v1EndpointRecover: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+| **recover_in** | [**\Svix\ApiClient\Model\RecoverIn**](../Model/RecoverIn.md)| | |
+| **idempotency_key** | **string**| The request's idempotency key | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\RecoverOut**](../Model/RecoverOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EndpointReplay()`
+
+```php
+v1EndpointReplay($app_id, $endpoint_id, $replay_in, $idempotency_key): \Svix\ApiClient\Model\ReplayOut
+```
+
+Replay Missing Webhooks
+
+Replays messages to the endpoint. Only messages that were created after `since` will be sent. Messages that were previously sent to the endpoint are not resent.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EndpointApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+$replay_in = new \Svix\ApiClient\Model\ReplayIn(); // \Svix\ApiClient\Model\ReplayIn
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $result = $apiInstance->v1EndpointReplay($app_id, $endpoint_id, $replay_in, $idempotency_key);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EndpointApi->v1EndpointReplay: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+| **replay_in** | [**\Svix\ApiClient\Model\ReplayIn**](../Model/ReplayIn.md)| | |
+| **idempotency_key** | **string**| The request's idempotency key | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\ReplayOut**](../Model/ReplayOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EndpointRotateSecret()`
+
+```php
+v1EndpointRotateSecret($app_id, $endpoint_id, $endpoint_secret_rotate_in, $idempotency_key)
+```
+
+Rotate Endpoint Secret
+
+Rotates the endpoint's signing secret. The previous secret will be valid for the next 24 hours.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EndpointApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+$endpoint_secret_rotate_in = new \Svix\ApiClient\Model\EndpointSecretRotateIn(); // \Svix\ApiClient\Model\EndpointSecretRotateIn
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $apiInstance->v1EndpointRotateSecret($app_id, $endpoint_id, $endpoint_secret_rotate_in, $idempotency_key);
+} catch (Exception $e) {
+ echo 'Exception when calling EndpointApi->v1EndpointRotateSecret: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+| **endpoint_secret_rotate_in** | [**\Svix\ApiClient\Model\EndpointSecretRotateIn**](../Model/EndpointSecretRotateIn.md)| | |
+| **idempotency_key** | **string**| The request's idempotency key | [optional] |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EndpointSendExample()`
+
+```php
+v1EndpointSendExample($app_id, $endpoint_id, $event_example_in, $idempotency_key): \Svix\ApiClient\Model\MessageOut
+```
+
+Send Event Type Example Message
+
+Send an example message for event
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EndpointApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+$event_example_in = new \Svix\ApiClient\Model\EventExampleIn(); // \Svix\ApiClient\Model\EventExampleIn
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $result = $apiInstance->v1EndpointSendExample($app_id, $endpoint_id, $event_example_in, $idempotency_key);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EndpointApi->v1EndpointSendExample: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+| **event_example_in** | [**\Svix\ApiClient\Model\EventExampleIn**](../Model/EventExampleIn.md)| | |
+| **idempotency_key** | **string**| The request's idempotency key | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\MessageOut**](../Model/MessageOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EndpointTransformationGet()`
+
+```php
+v1EndpointTransformationGet($app_id, $endpoint_id): \Svix\ApiClient\Model\EndpointTransformationOut
+```
+
+Get Endpoint Transformation
+
+Get the transformation code associated with this endpoint
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EndpointApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+
+try {
+ $result = $apiInstance->v1EndpointTransformationGet($app_id, $endpoint_id);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EndpointApi->v1EndpointTransformationGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+
+### Return type
+
+[**\Svix\ApiClient\Model\EndpointTransformationOut**](../Model/EndpointTransformationOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EndpointTransformationPartialUpdate()`
+
+```php
+v1EndpointTransformationPartialUpdate($app_id, $endpoint_id, $endpoint_transformation_in)
+```
+
+Set Endpoint Transformation
+
+Set or unset the transformation code associated with this endpoint
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EndpointApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+$endpoint_transformation_in = new \Svix\ApiClient\Model\EndpointTransformationIn(); // \Svix\ApiClient\Model\EndpointTransformationIn
+
+try {
+ $apiInstance->v1EndpointTransformationPartialUpdate($app_id, $endpoint_id, $endpoint_transformation_in);
+} catch (Exception $e) {
+ echo 'Exception when calling EndpointApi->v1EndpointTransformationPartialUpdate: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+| **endpoint_transformation_in** | [**\Svix\ApiClient\Model\EndpointTransformationIn**](../Model/EndpointTransformationIn.md)| | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EndpointUpdate()`
+
+```php
+v1EndpointUpdate($app_id, $endpoint_id, $endpoint_update): \Svix\ApiClient\Model\EndpointOut
+```
+
+Update Endpoint
+
+Update an endpoint.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EndpointApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+$endpoint_update = new \Svix\ApiClient\Model\EndpointUpdate(); // \Svix\ApiClient\Model\EndpointUpdate
+
+try {
+ $result = $apiInstance->v1EndpointUpdate($app_id, $endpoint_id, $endpoint_update);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EndpointApi->v1EndpointUpdate: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+| **endpoint_update** | [**\Svix\ApiClient\Model\EndpointUpdate**](../Model/EndpointUpdate.md)| | |
+
+### Return type
+
+[**\Svix\ApiClient\Model\EndpointOut**](../Model/EndpointOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EndpointUpdateHeaders()`
+
+```php
+v1EndpointUpdateHeaders($app_id, $endpoint_id, $endpoint_headers_in)
+```
+
+Update Endpoint Headers
+
+Set the additional headers to be sent with the webhook
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EndpointApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+$endpoint_headers_in = new \Svix\ApiClient\Model\EndpointHeadersIn(); // \Svix\ApiClient\Model\EndpointHeadersIn
+
+try {
+ $apiInstance->v1EndpointUpdateHeaders($app_id, $endpoint_id, $endpoint_headers_in);
+} catch (Exception $e) {
+ echo 'Exception when calling EndpointApi->v1EndpointUpdateHeaders: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+| **endpoint_headers_in** | [**\Svix\ApiClient\Model\EndpointHeadersIn**](../Model/EndpointHeadersIn.md)| | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
diff --git a/docs/Api/EventTypeApi.md b/docs/Api/EventTypeApi.md
new file mode 100644
index 0000000..bbe6c94
--- /dev/null
+++ b/docs/Api/EventTypeApi.md
@@ -0,0 +1,451 @@
+# Svix\ApiClient\EventTypeApi
+
+All URIs are relative to https://api.eu.svix.com, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**v1EventTypeCreate()**](EventTypeApi.md#v1EventTypeCreate) | **POST** /api/v1/event-type/ | Create Event Type |
+| [**v1EventTypeDelete()**](EventTypeApi.md#v1EventTypeDelete) | **DELETE** /api/v1/event-type/{event_type_name}/ | Delete Event Type |
+| [**v1EventTypeGet()**](EventTypeApi.md#v1EventTypeGet) | **GET** /api/v1/event-type/{event_type_name}/ | Get Event Type |
+| [**v1EventTypeImportOpenapi()**](EventTypeApi.md#v1EventTypeImportOpenapi) | **POST** /api/v1/event-type/import/openapi/ | Event Type Import From Openapi |
+| [**v1EventTypeList()**](EventTypeApi.md#v1EventTypeList) | **GET** /api/v1/event-type/ | List Event Types |
+| [**v1EventTypePatch()**](EventTypeApi.md#v1EventTypePatch) | **PATCH** /api/v1/event-type/{event_type_name}/ | Patch Event Type |
+| [**v1EventTypeUpdate()**](EventTypeApi.md#v1EventTypeUpdate) | **PUT** /api/v1/event-type/{event_type_name}/ | Update Event Type |
+
+
+## `v1EventTypeCreate()`
+
+```php
+v1EventTypeCreate($event_type_in, $idempotency_key): \Svix\ApiClient\Model\EventTypeOut
+```
+
+Create Event Type
+
+Create new or unarchive existing event type. Unarchiving an event type will allow endpoints to filter on it and messages to be sent with it. Endpoints filtering on the event type before archival will continue to filter on it. This operation does not preserve the description and schemas.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EventTypeApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$event_type_in = new \Svix\ApiClient\Model\EventTypeIn(); // \Svix\ApiClient\Model\EventTypeIn
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $result = $apiInstance->v1EventTypeCreate($event_type_in, $idempotency_key);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EventTypeApi->v1EventTypeCreate: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **event_type_in** | [**\Svix\ApiClient\Model\EventTypeIn**](../Model/EventTypeIn.md)| | |
+| **idempotency_key** | **string**| The request's idempotency key | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\EventTypeOut**](../Model/EventTypeOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EventTypeDelete()`
+
+```php
+v1EventTypeDelete($event_type_name, $expunge)
+```
+
+Delete Event Type
+
+Archive an event type. Endpoints already configured to filter on an event type will continue to do so after archival. However, new messages can not be sent with it and endpoints can not filter on it. An event type can be unarchived with the [create operation](#operation/create_event_type_api_v1_event_type__post).
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EventTypeApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$event_type_name = user.signup; // string | The event type's name
+$expunge = false; // bool | By default event types are archived when \"deleted\". Passing this to `true` deletes them entirely.
+
+try {
+ $apiInstance->v1EventTypeDelete($event_type_name, $expunge);
+} catch (Exception $e) {
+ echo 'Exception when calling EventTypeApi->v1EventTypeDelete: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **event_type_name** | **string**| The event type's name | |
+| **expunge** | **bool**| By default event types are archived when \"deleted\". Passing this to `true` deletes them entirely. | [optional] [default to false] |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EventTypeGet()`
+
+```php
+v1EventTypeGet($event_type_name): \Svix\ApiClient\Model\EventTypeOut
+```
+
+Get Event Type
+
+Get an event type.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EventTypeApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$event_type_name = user.signup; // string | The event type's name
+
+try {
+ $result = $apiInstance->v1EventTypeGet($event_type_name);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EventTypeApi->v1EventTypeGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **event_type_name** | **string**| The event type's name | |
+
+### Return type
+
+[**\Svix\ApiClient\Model\EventTypeOut**](../Model/EventTypeOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EventTypeImportOpenapi()`
+
+```php
+v1EventTypeImportOpenapi($event_type_import_open_api_in, $idempotency_key): \Svix\ApiClient\Model\EventTypeImportOpenApiOut
+```
+
+Event Type Import From Openapi
+
+Given an OpenAPI spec, create new or update existing event types. If an existing `archived` event type is updated, it will be unarchvied. The importer will convert all webhooks found in the either the `webhooks` or `x-webhooks` top-level.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EventTypeApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$event_type_import_open_api_in = new \Svix\ApiClient\Model\EventTypeImportOpenApiIn(); // \Svix\ApiClient\Model\EventTypeImportOpenApiIn | Import a list of event types from webhooks defined in an OpenAPI spec. The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**.
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $result = $apiInstance->v1EventTypeImportOpenapi($event_type_import_open_api_in, $idempotency_key);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EventTypeApi->v1EventTypeImportOpenapi: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **event_type_import_open_api_in** | [**\Svix\ApiClient\Model\EventTypeImportOpenApiIn**](../Model/EventTypeImportOpenApiIn.md)| Import a list of event types from webhooks defined in an OpenAPI spec. The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**. | |
+| **idempotency_key** | **string**| The request's idempotency key | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\EventTypeImportOpenApiOut**](../Model/EventTypeImportOpenApiOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EventTypeList()`
+
+```php
+v1EventTypeList($limit, $iterator, $order, $include_archived, $with_content): \Svix\ApiClient\Model\ListResponseEventTypeOut
+```
+
+List Event Types
+
+Return the list of event types.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EventTypeApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$limit = 56; // int | Limit the number of returned items
+$iterator = user.signup; // string | The iterator returned from a prior invocation
+$order = new \Svix\ApiClient\Model\Ordering(); // Ordering | The sorting order of the returned items
+$include_archived = false; // bool | When `true` archived (deleted but not expunged) items are included in the response
+$with_content = false; // bool | When `true` the full item (including the schema) is included in the response
+
+try {
+ $result = $apiInstance->v1EventTypeList($limit, $iterator, $order, $include_archived, $with_content);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EventTypeApi->v1EventTypeList: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **limit** | **int**| Limit the number of returned items | [optional] |
+| **iterator** | **string**| The iterator returned from a prior invocation | [optional] |
+| **order** | [**Ordering**](../Model/.md)| The sorting order of the returned items | [optional] |
+| **include_archived** | **bool**| When `true` archived (deleted but not expunged) items are included in the response | [optional] [default to false] |
+| **with_content** | **bool**| When `true` the full item (including the schema) is included in the response | [optional] [default to false] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\ListResponseEventTypeOut**](../Model/ListResponseEventTypeOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EventTypePatch()`
+
+```php
+v1EventTypePatch($event_type_name, $event_type_patch): \Svix\ApiClient\Model\EventTypeOut
+```
+
+Patch Event Type
+
+Partially update an event type.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EventTypeApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$event_type_name = user.signup; // string | The event type's name
+$event_type_patch = new \Svix\ApiClient\Model\EventTypePatch(); // \Svix\ApiClient\Model\EventTypePatch
+
+try {
+ $result = $apiInstance->v1EventTypePatch($event_type_name, $event_type_patch);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EventTypeApi->v1EventTypePatch: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **event_type_name** | **string**| The event type's name | |
+| **event_type_patch** | [**\Svix\ApiClient\Model\EventTypePatch**](../Model/EventTypePatch.md)| | |
+
+### Return type
+
+[**\Svix\ApiClient\Model\EventTypeOut**](../Model/EventTypeOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1EventTypeUpdate()`
+
+```php
+v1EventTypeUpdate($event_type_name, $event_type_update): \Svix\ApiClient\Model\EventTypeOut
+```
+
+Update Event Type
+
+Update an event type.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\EventTypeApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$event_type_name = user.signup; // string | The event type's name
+$event_type_update = new \Svix\ApiClient\Model\EventTypeUpdate(); // \Svix\ApiClient\Model\EventTypeUpdate
+
+try {
+ $result = $apiInstance->v1EventTypeUpdate($event_type_name, $event_type_update);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling EventTypeApi->v1EventTypeUpdate: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **event_type_name** | **string**| The event type's name | |
+| **event_type_update** | [**\Svix\ApiClient\Model\EventTypeUpdate**](../Model/EventTypeUpdate.md)| | |
+
+### Return type
+
+[**\Svix\ApiClient\Model\EventTypeOut**](../Model/EventTypeOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
diff --git a/docs/Api/HealthApi.md b/docs/Api/HealthApi.md
new file mode 100644
index 0000000..089c2a7
--- /dev/null
+++ b/docs/Api/HealthApi.md
@@ -0,0 +1,60 @@
+# Svix\ApiClient\HealthApi
+
+All URIs are relative to https://api.eu.svix.com, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**v1HealthGet()**](HealthApi.md#v1HealthGet) | **GET** /api/v1/health/ | Health |
+
+
+## `v1HealthGet()`
+
+```php
+v1HealthGet()
+```
+
+Health
+
+Verify the API server is up and running.
+
+### Example
+
+```php
+v1HealthGet();
+} catch (Exception $e) {
+ echo 'Exception when calling HealthApi->v1HealthGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
diff --git a/docs/Api/IntegrationApi.md b/docs/Api/IntegrationApi.md
new file mode 100644
index 0000000..5ee66e7
--- /dev/null
+++ b/docs/Api/IntegrationApi.md
@@ -0,0 +1,455 @@
+# Svix\ApiClient\IntegrationApi
+
+All URIs are relative to https://api.eu.svix.com, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**v1IntegrationCreate()**](IntegrationApi.md#v1IntegrationCreate) | **POST** /api/v1/app/{app_id}/integration/ | Create Integration |
+| [**v1IntegrationDelete()**](IntegrationApi.md#v1IntegrationDelete) | **DELETE** /api/v1/app/{app_id}/integration/{integ_id}/ | Delete Integration |
+| [**v1IntegrationGet()**](IntegrationApi.md#v1IntegrationGet) | **GET** /api/v1/app/{app_id}/integration/{integ_id}/ | Get Integration |
+| [**v1IntegrationGetKey()**](IntegrationApi.md#v1IntegrationGetKey) | **GET** /api/v1/app/{app_id}/integration/{integ_id}/key/ | Get Integration Key |
+| [**v1IntegrationList()**](IntegrationApi.md#v1IntegrationList) | **GET** /api/v1/app/{app_id}/integration/ | List Integrations |
+| [**v1IntegrationRotateKey()**](IntegrationApi.md#v1IntegrationRotateKey) | **POST** /api/v1/app/{app_id}/integration/{integ_id}/key/rotate/ | Rotate Integration Key |
+| [**v1IntegrationUpdate()**](IntegrationApi.md#v1IntegrationUpdate) | **PUT** /api/v1/app/{app_id}/integration/{integ_id}/ | Update Integration |
+
+
+## `v1IntegrationCreate()`
+
+```php
+v1IntegrationCreate($app_id, $integration_in, $idempotency_key): \Svix\ApiClient\Model\IntegrationOut
+```
+
+Create Integration
+
+Create an integration.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\IntegrationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$integration_in = new \Svix\ApiClient\Model\IntegrationIn(); // \Svix\ApiClient\Model\IntegrationIn
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $result = $apiInstance->v1IntegrationCreate($app_id, $integration_in, $idempotency_key);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling IntegrationApi->v1IntegrationCreate: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **integration_in** | [**\Svix\ApiClient\Model\IntegrationIn**](../Model/IntegrationIn.md)| | |
+| **idempotency_key** | **string**| The request's idempotency key | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\IntegrationOut**](../Model/IntegrationOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1IntegrationDelete()`
+
+```php
+v1IntegrationDelete($app_id, $integ_id)
+```
+
+Delete Integration
+
+Delete an integration.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\IntegrationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$integ_id = integ_1srOrx2ZWZBpBUvZwXKQmoEYga2; // string | The integ's ID
+
+try {
+ $apiInstance->v1IntegrationDelete($app_id, $integ_id);
+} catch (Exception $e) {
+ echo 'Exception when calling IntegrationApi->v1IntegrationDelete: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **integ_id** | **string**| The integ's ID | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1IntegrationGet()`
+
+```php
+v1IntegrationGet($app_id, $integ_id): \Svix\ApiClient\Model\IntegrationOut
+```
+
+Get Integration
+
+Get an integration.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\IntegrationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$integ_id = integ_1srOrx2ZWZBpBUvZwXKQmoEYga2; // string | The integ's ID
+
+try {
+ $result = $apiInstance->v1IntegrationGet($app_id, $integ_id);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling IntegrationApi->v1IntegrationGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **integ_id** | **string**| The integ's ID | |
+
+### Return type
+
+[**\Svix\ApiClient\Model\IntegrationOut**](../Model/IntegrationOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1IntegrationGetKey()`
+
+```php
+v1IntegrationGetKey($app_id, $integ_id): \Svix\ApiClient\Model\IntegrationKeyOut
+```
+
+Get Integration Key
+
+Get an integration's key.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\IntegrationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$integ_id = integ_1srOrx2ZWZBpBUvZwXKQmoEYga2; // string | The integ's ID
+
+try {
+ $result = $apiInstance->v1IntegrationGetKey($app_id, $integ_id);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling IntegrationApi->v1IntegrationGetKey: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **integ_id** | **string**| The integ's ID | |
+
+### Return type
+
+[**\Svix\ApiClient\Model\IntegrationKeyOut**](../Model/IntegrationKeyOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1IntegrationList()`
+
+```php
+v1IntegrationList($app_id, $limit, $iterator): \Svix\ApiClient\Model\ListResponseIntegrationOut
+```
+
+List Integrations
+
+List the application's integrations.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\IntegrationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$limit = 56; // int | Limit the number of returned items
+$iterator = integ_1srOrx2ZWZBpBUvZwXKQmoEYga2; // string | The iterator returned from a prior invocation
+
+try {
+ $result = $apiInstance->v1IntegrationList($app_id, $limit, $iterator);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling IntegrationApi->v1IntegrationList: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **limit** | **int**| Limit the number of returned items | [optional] |
+| **iterator** | **string**| The iterator returned from a prior invocation | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\ListResponseIntegrationOut**](../Model/ListResponseIntegrationOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1IntegrationRotateKey()`
+
+```php
+v1IntegrationRotateKey($app_id, $integ_id, $idempotency_key): \Svix\ApiClient\Model\IntegrationKeyOut
+```
+
+Rotate Integration Key
+
+Rotate the integration's key. The previous key will be immediately revoked.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\IntegrationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$integ_id = integ_1srOrx2ZWZBpBUvZwXKQmoEYga2; // string | The integ's ID
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $result = $apiInstance->v1IntegrationRotateKey($app_id, $integ_id, $idempotency_key);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling IntegrationApi->v1IntegrationRotateKey: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **integ_id** | **string**| The integ's ID | |
+| **idempotency_key** | **string**| The request's idempotency key | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\IntegrationKeyOut**](../Model/IntegrationKeyOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1IntegrationUpdate()`
+
+```php
+v1IntegrationUpdate($app_id, $integ_id, $integration_update): \Svix\ApiClient\Model\IntegrationOut
+```
+
+Update Integration
+
+Update an integration.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\IntegrationApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$integ_id = integ_1srOrx2ZWZBpBUvZwXKQmoEYga2; // string | The integ's ID
+$integration_update = new \Svix\ApiClient\Model\IntegrationUpdate(); // \Svix\ApiClient\Model\IntegrationUpdate
+
+try {
+ $result = $apiInstance->v1IntegrationUpdate($app_id, $integ_id, $integration_update);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling IntegrationApi->v1IntegrationUpdate: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **integ_id** | **string**| The integ's ID | |
+| **integration_update** | [**\Svix\ApiClient\Model\IntegrationUpdate**](../Model/IntegrationUpdate.md)| | |
+
+### Return type
+
+[**\Svix\ApiClient\Model\IntegrationOut**](../Model/IntegrationOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
diff --git a/docs/Api/MessageApi.md b/docs/Api/MessageApi.md
new file mode 100644
index 0000000..0c96f59
--- /dev/null
+++ b/docs/Api/MessageApi.md
@@ -0,0 +1,276 @@
+# Svix\ApiClient\MessageApi
+
+All URIs are relative to https://api.eu.svix.com, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**v1MessageCreate()**](MessageApi.md#v1MessageCreate) | **POST** /api/v1/app/{app_id}/msg/ | Create Message |
+| [**v1MessageExpungeContent()**](MessageApi.md#v1MessageExpungeContent) | **DELETE** /api/v1/app/{app_id}/msg/{msg_id}/content/ | Delete message payload |
+| [**v1MessageGet()**](MessageApi.md#v1MessageGet) | **GET** /api/v1/app/{app_id}/msg/{msg_id}/ | Get Message |
+| [**v1MessageList()**](MessageApi.md#v1MessageList) | **GET** /api/v1/app/{app_id}/msg/ | List Messages |
+
+
+## `v1MessageCreate()`
+
+```php
+v1MessageCreate($app_id, $message_in, $with_content, $idempotency_key): \Svix\ApiClient\Model\MessageOut
+```
+
+Create Message
+
+Creates a new message and dispatches it to all of the application's endpoints. The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made. If a message with the same `eventId` already exists for any application in your environment, a 409 conflict error will be returned. The `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types. Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema. The `payload` property is the webhook's body (the actual webhook message). Svix supports payload sizes of up to ~350kb, though it's generally a good idea to keep webhook payloads small, probably no larger than 40kb.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\MessageApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$message_in = new \Svix\ApiClient\Model\MessageIn(); // \Svix\ApiClient\Model\MessageIn
+$with_content = true; // bool | When `true` message payloads are included in the response
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $result = $apiInstance->v1MessageCreate($app_id, $message_in, $with_content, $idempotency_key);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling MessageApi->v1MessageCreate: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **message_in** | [**\Svix\ApiClient\Model\MessageIn**](../Model/MessageIn.md)| | |
+| **with_content** | **bool**| When `true` message payloads are included in the response | [optional] [default to true] |
+| **idempotency_key** | **string**| The request's idempotency key | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\MessageOut**](../Model/MessageOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1MessageExpungeContent()`
+
+```php
+v1MessageExpungeContent($app_id, $msg_id)
+```
+
+Delete message payload
+
+Delete the given message's payload. Useful in cases when a message was accidentally sent with sensitive content. The message can't be replayed or resent once its payload has been deleted or expired.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\MessageApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$msg_id = unique-msg-identifier; // string | The msg's ID or UID
+
+try {
+ $apiInstance->v1MessageExpungeContent($app_id, $msg_id);
+} catch (Exception $e) {
+ echo 'Exception when calling MessageApi->v1MessageExpungeContent: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **msg_id** | **string**| The msg's ID or UID | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1MessageGet()`
+
+```php
+v1MessageGet($app_id, $msg_id, $with_content): \Svix\ApiClient\Model\MessageOut
+```
+
+Get Message
+
+Get a message by its ID or eventID.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\MessageApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$msg_id = unique-msg-identifier; // string | The msg's ID or UID
+$with_content = true; // bool | When `true` message payloads are included in the response
+
+try {
+ $result = $apiInstance->v1MessageGet($app_id, $msg_id, $with_content);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling MessageApi->v1MessageGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **msg_id** | **string**| The msg's ID or UID | |
+| **with_content** | **bool**| When `true` message payloads are included in the response | [optional] [default to true] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\MessageOut**](../Model/MessageOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1MessageList()`
+
+```php
+v1MessageList($app_id, $limit, $iterator, $channel, $before, $after, $with_content, $event_types): \Svix\ApiClient\Model\ListResponseMessageOut
+```
+
+List Messages
+
+List all of the application's messages. The `before` and `after` parameters let you filter all items created before or after a certain date. These can be used alongside an iterator to paginate over results within a certain window. Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\MessageApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$limit = 56; // int | Limit the number of returned items
+$iterator = msg_1srOrx2ZWZBpBUvZwXKQmoEYga2; // string | The iterator returned from a prior invocation
+$channel = project_1337; // string | Filter response based on the channel
+$before = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only include items created before a certain date
+$after = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only include items created after a certain date
+$with_content = true; // bool | When `true` message payloads are included in the response
+$event_types = array('event_types_example'); // string[] | Filter response based on the event type
+
+try {
+ $result = $apiInstance->v1MessageList($app_id, $limit, $iterator, $channel, $before, $after, $with_content, $event_types);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling MessageApi->v1MessageList: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **limit** | **int**| Limit the number of returned items | [optional] |
+| **iterator** | **string**| The iterator returned from a prior invocation | [optional] |
+| **channel** | **string**| Filter response based on the channel | [optional] |
+| **before** | **\DateTime**| Only include items created before a certain date | [optional] |
+| **after** | **\DateTime**| Only include items created after a certain date | [optional] |
+| **with_content** | **bool**| When `true` message payloads are included in the response | [optional] [default to true] |
+| **event_types** | [**string[]**](../Model/string.md)| Filter response based on the event type | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\ListResponseMessageOut**](../Model/ListResponseMessageOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
diff --git a/docs/Api/MessageAttemptApi.md b/docs/Api/MessageAttemptApi.md
new file mode 100644
index 0000000..8dd8865
--- /dev/null
+++ b/docs/Api/MessageAttemptApi.md
@@ -0,0 +1,672 @@
+# Svix\ApiClient\MessageAttemptApi
+
+All URIs are relative to https://api.eu.svix.com, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**v1MessageAttemptExpungeContent()**](MessageAttemptApi.md#v1MessageAttemptExpungeContent) | **DELETE** /api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content/ | Delete attempt response body |
+| [**v1MessageAttemptGet()**](MessageAttemptApi.md#v1MessageAttemptGet) | **GET** /api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/ | Get Attempt |
+| [**v1MessageAttemptListAttemptedDestinations()**](MessageAttemptApi.md#v1MessageAttemptListAttemptedDestinations) | **GET** /api/v1/app/{app_id}/msg/{msg_id}/endpoint/ | List Attempted Destinations |
+| [**v1MessageAttemptListAttemptedMessages()**](MessageAttemptApi.md#v1MessageAttemptListAttemptedMessages) | **GET** /api/v1/app/{app_id}/endpoint/{endpoint_id}/msg/ | List Attempted Messages |
+| [**v1MessageAttemptListByEndpoint()**](MessageAttemptApi.md#v1MessageAttemptListByEndpoint) | **GET** /api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}/ | List Attempts By Endpoint |
+| [**v1MessageAttemptListByEndpointDeprecated()**](MessageAttemptApi.md#v1MessageAttemptListByEndpointDeprecated) | **GET** /api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/attempt/ | List Attempts For Endpoint |
+| [**v1MessageAttemptListByMsg()**](MessageAttemptApi.md#v1MessageAttemptListByMsg) | **GET** /api/v1/app/{app_id}/attempt/msg/{msg_id}/ | List Attempts By Msg |
+| [**v1MessageAttemptListByMsgDeprecated()**](MessageAttemptApi.md#v1MessageAttemptListByMsgDeprecated) | **GET** /api/v1/app/{app_id}/msg/{msg_id}/attempt/ | List Attempts |
+| [**v1MessageAttemptResend()**](MessageAttemptApi.md#v1MessageAttemptResend) | **POST** /api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend/ | Resend Webhook |
+
+
+## `v1MessageAttemptExpungeContent()`
+
+```php
+v1MessageAttemptExpungeContent($app_id, $msg_id, $attempt_id)
+```
+
+Delete attempt response body
+
+Deletes the given attempt's response body. Useful when an endpoint accidentally returned sensitive content.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\MessageAttemptApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$msg_id = unique-msg-identifier; // string | The msg's ID or UID
+$attempt_id = atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2; // string | The attempt's ID
+
+try {
+ $apiInstance->v1MessageAttemptExpungeContent($app_id, $msg_id, $attempt_id);
+} catch (Exception $e) {
+ echo 'Exception when calling MessageAttemptApi->v1MessageAttemptExpungeContent: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **msg_id** | **string**| The msg's ID or UID | |
+| **attempt_id** | **string**| The attempt's ID | |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1MessageAttemptGet()`
+
+```php
+v1MessageAttemptGet($app_id, $msg_id, $attempt_id): \Svix\ApiClient\Model\MessageAttemptOut
+```
+
+Get Attempt
+
+`msg_id`: Use a message id or a message `eventId`
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\MessageAttemptApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$msg_id = unique-msg-identifier; // string | The msg's ID or UID
+$attempt_id = atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2; // string | The attempt's ID
+
+try {
+ $result = $apiInstance->v1MessageAttemptGet($app_id, $msg_id, $attempt_id);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling MessageAttemptApi->v1MessageAttemptGet: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **msg_id** | **string**| The msg's ID or UID | |
+| **attempt_id** | **string**| The attempt's ID | |
+
+### Return type
+
+[**\Svix\ApiClient\Model\MessageAttemptOut**](../Model/MessageAttemptOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1MessageAttemptListAttemptedDestinations()`
+
+```php
+v1MessageAttemptListAttemptedDestinations($app_id, $msg_id, $limit, $iterator): \Svix\ApiClient\Model\ListResponseMessageEndpointOut
+```
+
+List Attempted Destinations
+
+List endpoints attempted by a given message. Additionally includes metadata about the latest message attempt. By default, endpoints are listed in ascending order by ID.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\MessageAttemptApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$msg_id = unique-msg-identifier; // string | The msg's ID or UID
+$limit = 56; // int | Limit the number of returned items
+$iterator = ep_1srOrx2ZWZBpBUvZwXKQmoEYga2; // string | The iterator returned from a prior invocation
+
+try {
+ $result = $apiInstance->v1MessageAttemptListAttemptedDestinations($app_id, $msg_id, $limit, $iterator);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling MessageAttemptApi->v1MessageAttemptListAttemptedDestinations: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **msg_id** | **string**| The msg's ID or UID | |
+| **limit** | **int**| Limit the number of returned items | [optional] |
+| **iterator** | **string**| The iterator returned from a prior invocation | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\ListResponseMessageEndpointOut**](../Model/ListResponseMessageEndpointOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1MessageAttemptListAttemptedMessages()`
+
+```php
+v1MessageAttemptListAttemptedMessages($app_id, $endpoint_id, $limit, $iterator, $channel, $status, $before, $after, $with_content, $event_types): \Svix\ApiClient\Model\ListResponseEndpointMessageOut
+```
+
+List Attempted Messages
+
+List messages for a particular endpoint. Additionally includes metadata about the latest message attempt. The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed. Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\MessageAttemptApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+$limit = 56; // int | Limit the number of returned items
+$iterator = msg_1srOrx2ZWZBpBUvZwXKQmoEYga2; // string | The iterator returned from a prior invocation
+$channel = project_1337; // string | Filter response based on the channel
+$status = new \Svix\ApiClient\Model\MessageStatus(); // MessageStatus | Filter response based on the delivery status
+$before = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only include items created before a certain date
+$after = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only include items created after a certain date
+$with_content = true; // bool | When `true` message payloads are included in the response
+$event_types = array('event_types_example'); // string[] | Filter response based on the event type
+
+try {
+ $result = $apiInstance->v1MessageAttemptListAttemptedMessages($app_id, $endpoint_id, $limit, $iterator, $channel, $status, $before, $after, $with_content, $event_types);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling MessageAttemptApi->v1MessageAttemptListAttemptedMessages: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+| **limit** | **int**| Limit the number of returned items | [optional] |
+| **iterator** | **string**| The iterator returned from a prior invocation | [optional] |
+| **channel** | **string**| Filter response based on the channel | [optional] |
+| **status** | [**MessageStatus**](../Model/.md)| Filter response based on the delivery status | [optional] |
+| **before** | **\DateTime**| Only include items created before a certain date | [optional] |
+| **after** | **\DateTime**| Only include items created after a certain date | [optional] |
+| **with_content** | **bool**| When `true` message payloads are included in the response | [optional] [default to true] |
+| **event_types** | [**string[]**](../Model/string.md)| Filter response based on the event type | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\ListResponseEndpointMessageOut**](../Model/ListResponseEndpointMessageOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1MessageAttemptListByEndpoint()`
+
+```php
+v1MessageAttemptListByEndpoint($app_id, $endpoint_id, $limit, $iterator, $status, $status_code_class, $channel, $before, $after, $with_content, $event_types): \Svix\ApiClient\Model\ListResponseMessageAttemptOut
+```
+
+List Attempts By Endpoint
+
+List attempts by endpoint id Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\MessageAttemptApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+$limit = 56; // int | Limit the number of returned items
+$iterator = atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2; // string | The iterator returned from a prior invocation
+$status = new \Svix\ApiClient\Model\MessageStatus(); // MessageStatus | Filter response based on the delivery status
+$status_code_class = new \Svix\ApiClient\Model\StatusCodeClass(); // StatusCodeClass | Filter response based on the HTTP status code
+$channel = project_1337; // string | Filter response based on the channel
+$before = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only include items created before a certain date
+$after = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only include items created after a certain date
+$with_content = true; // bool | When `true` attempt content is included in the response
+$event_types = array('event_types_example'); // string[] | Filter response based on the event type
+
+try {
+ $result = $apiInstance->v1MessageAttemptListByEndpoint($app_id, $endpoint_id, $limit, $iterator, $status, $status_code_class, $channel, $before, $after, $with_content, $event_types);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling MessageAttemptApi->v1MessageAttemptListByEndpoint: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+| **limit** | **int**| Limit the number of returned items | [optional] |
+| **iterator** | **string**| The iterator returned from a prior invocation | [optional] |
+| **status** | [**MessageStatus**](../Model/.md)| Filter response based on the delivery status | [optional] |
+| **status_code_class** | [**StatusCodeClass**](../Model/.md)| Filter response based on the HTTP status code | [optional] |
+| **channel** | **string**| Filter response based on the channel | [optional] |
+| **before** | **\DateTime**| Only include items created before a certain date | [optional] |
+| **after** | **\DateTime**| Only include items created after a certain date | [optional] |
+| **with_content** | **bool**| When `true` attempt content is included in the response | [optional] [default to true] |
+| **event_types** | [**string[]**](../Model/string.md)| Filter response based on the event type | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\ListResponseMessageAttemptOut**](../Model/ListResponseMessageAttemptOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1MessageAttemptListByEndpointDeprecated()`
+
+```php
+v1MessageAttemptListByEndpointDeprecated($app_id, $msg_id, $endpoint_id, $limit, $iterator, $channel, $status, $before, $after, $event_types): \Svix\ApiClient\Model\ListResponseMessageAttemptEndpointOut
+```
+
+List Attempts For Endpoint
+
+DEPRECATED: please use list_attempts with endpoint_id as a query parameter instead. List the message attempts for a particular endpoint. Returning the endpoint. The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed. Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\MessageAttemptApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$msg_id = unique-msg-identifier; // string | The msg's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+$limit = 56; // int | Limit the number of returned items
+$iterator = atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2; // string | The iterator returned from a prior invocation
+$channel = project_1337; // string | Filter response based on the channel
+$status = new \Svix\ApiClient\Model\MessageStatus(); // MessageStatus | Filter response based on the delivery status
+$before = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only include items created before a certain date
+$after = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only include items created after a certain date
+$event_types = array('event_types_example'); // string[] | Filter response based on the event type
+
+try {
+ $result = $apiInstance->v1MessageAttemptListByEndpointDeprecated($app_id, $msg_id, $endpoint_id, $limit, $iterator, $channel, $status, $before, $after, $event_types);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling MessageAttemptApi->v1MessageAttemptListByEndpointDeprecated: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **msg_id** | **string**| The msg's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+| **limit** | **int**| Limit the number of returned items | [optional] |
+| **iterator** | **string**| The iterator returned from a prior invocation | [optional] |
+| **channel** | **string**| Filter response based on the channel | [optional] |
+| **status** | [**MessageStatus**](../Model/.md)| Filter response based on the delivery status | [optional] |
+| **before** | **\DateTime**| Only include items created before a certain date | [optional] |
+| **after** | **\DateTime**| Only include items created after a certain date | [optional] |
+| **event_types** | [**string[]**](../Model/string.md)| Filter response based on the event type | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\ListResponseMessageAttemptEndpointOut**](../Model/ListResponseMessageAttemptEndpointOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1MessageAttemptListByMsg()`
+
+```php
+v1MessageAttemptListByMsg($app_id, $msg_id, $limit, $iterator, $status, $status_code_class, $channel, $endpoint_id, $before, $after, $with_content, $event_types): \Svix\ApiClient\Model\ListResponseMessageAttemptOut
+```
+
+List Attempts By Msg
+
+List attempts by message id Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\MessageAttemptApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$msg_id = unique-msg-identifier; // string | The msg's ID or UID
+$limit = 56; // int | Limit the number of returned items
+$iterator = atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2; // string | The iterator returned from a prior invocation
+$status = new \Svix\ApiClient\Model\MessageStatus(); // MessageStatus | Filter response based on the delivery status
+$status_code_class = new \Svix\ApiClient\Model\StatusCodeClass(); // StatusCodeClass | Filter response based on the HTTP status code
+$channel = project_1337; // string | Filter response based on the channel
+$endpoint_id = unique-ep-identifier; // string | Filter the attempts based on the attempted endpoint
+$before = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only include items created before a certain date
+$after = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only include items created after a certain date
+$with_content = true; // bool | When `true` attempt content is included in the response
+$event_types = array('event_types_example'); // string[] | Filter response based on the event type
+
+try {
+ $result = $apiInstance->v1MessageAttemptListByMsg($app_id, $msg_id, $limit, $iterator, $status, $status_code_class, $channel, $endpoint_id, $before, $after, $with_content, $event_types);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling MessageAttemptApi->v1MessageAttemptListByMsg: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **msg_id** | **string**| The msg's ID or UID | |
+| **limit** | **int**| Limit the number of returned items | [optional] |
+| **iterator** | **string**| The iterator returned from a prior invocation | [optional] |
+| **status** | [**MessageStatus**](../Model/.md)| Filter response based on the delivery status | [optional] |
+| **status_code_class** | [**StatusCodeClass**](../Model/.md)| Filter response based on the HTTP status code | [optional] |
+| **channel** | **string**| Filter response based on the channel | [optional] |
+| **endpoint_id** | **string**| Filter the attempts based on the attempted endpoint | [optional] |
+| **before** | **\DateTime**| Only include items created before a certain date | [optional] |
+| **after** | **\DateTime**| Only include items created after a certain date | [optional] |
+| **with_content** | **bool**| When `true` attempt content is included in the response | [optional] [default to true] |
+| **event_types** | [**string[]**](../Model/string.md)| Filter response based on the event type | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\ListResponseMessageAttemptOut**](../Model/ListResponseMessageAttemptOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1MessageAttemptListByMsgDeprecated()`
+
+```php
+v1MessageAttemptListByMsgDeprecated($app_id, $msg_id, $limit, $iterator, $endpoint_id, $channel, $status, $before, $after, $status_code_class, $event_types): \Svix\ApiClient\Model\ListResponseMessageAttemptOut
+```
+
+List Attempts
+
+Deprecated: Please use \"List Attempts by Endpoint\" and \"List Attempts by Msg\" instead. Note that by default this endpoint is limited to retrieving 90 days' worth of data relative to now or, if an iterator is provided, 90 days before/after the time indicated by the iterator ID. If you require data beyond those time ranges, you will need to explicitly set the `before` or `after` parameter as appropriate. `msg_id`: Use a message id or a message `eventId`
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\MessageAttemptApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$msg_id = unique-msg-identifier; // string | The msg's ID or UID
+$limit = 56; // int | Limit the number of returned items
+$iterator = atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2; // string | The iterator returned from a prior invocation
+$endpoint_id = unique-ep-identifier; // string | Filter the attempts based on the attempted endpoint
+$channel = project_1337; // string | Filter response based on the channel
+$status = new \Svix\ApiClient\Model\MessageStatus(); // MessageStatus | Filter response based on the delivery status
+$before = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only include items created before a certain date
+$after = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Only include items created after a certain date
+$status_code_class = new \Svix\ApiClient\Model\StatusCodeClass(); // StatusCodeClass | Filter response based on the HTTP status code
+$event_types = array('event_types_example'); // string[] | Filter response based on the event type
+
+try {
+ $result = $apiInstance->v1MessageAttemptListByMsgDeprecated($app_id, $msg_id, $limit, $iterator, $endpoint_id, $channel, $status, $before, $after, $status_code_class, $event_types);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling MessageAttemptApi->v1MessageAttemptListByMsgDeprecated: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **msg_id** | **string**| The msg's ID or UID | |
+| **limit** | **int**| Limit the number of returned items | [optional] |
+| **iterator** | **string**| The iterator returned from a prior invocation | [optional] |
+| **endpoint_id** | **string**| Filter the attempts based on the attempted endpoint | [optional] |
+| **channel** | **string**| Filter response based on the channel | [optional] |
+| **status** | [**MessageStatus**](../Model/.md)| Filter response based on the delivery status | [optional] |
+| **before** | **\DateTime**| Only include items created before a certain date | [optional] |
+| **after** | **\DateTime**| Only include items created after a certain date | [optional] |
+| **status_code_class** | [**StatusCodeClass**](../Model/.md)| Filter response based on the HTTP status code | [optional] |
+| **event_types** | [**string[]**](../Model/string.md)| Filter response based on the event type | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\ListResponseMessageAttemptOut**](../Model/ListResponseMessageAttemptOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
+
+## `v1MessageAttemptResend()`
+
+```php
+v1MessageAttemptResend($app_id, $msg_id, $endpoint_id, $idempotency_key)
+```
+
+Resend Webhook
+
+Resend a message to the specified endpoint.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\MessageAttemptApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_id = unique-app-identifier; // string | The app's ID or UID
+$msg_id = unique-msg-identifier; // string | The msg's ID or UID
+$endpoint_id = unique-ep-identifier; // string | The ep's ID or UID
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $apiInstance->v1MessageAttemptResend($app_id, $msg_id, $endpoint_id, $idempotency_key);
+} catch (Exception $e) {
+ echo 'Exception when calling MessageAttemptApi->v1MessageAttemptResend: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_id** | **string**| The app's ID or UID | |
+| **msg_id** | **string**| The msg's ID or UID | |
+| **endpoint_id** | **string**| The ep's ID or UID | |
+| **idempotency_key** | **string**| The request's idempotency key | [optional] |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
diff --git a/docs/Api/StatisticsApi.md b/docs/Api/StatisticsApi.md
new file mode 100644
index 0000000..62c27d9
--- /dev/null
+++ b/docs/Api/StatisticsApi.md
@@ -0,0 +1,70 @@
+# Svix\ApiClient\StatisticsApi
+
+All URIs are relative to https://api.eu.svix.com, except if the operation defines another base path.
+
+| Method | HTTP request | Description |
+| ------------- | ------------- | ------------- |
+| [**calculateAggregateAppStats()**](StatisticsApi.md#calculateAggregateAppStats) | **POST** /api/v1/stats/usage/app/ | Calculate Aggregate App Stats |
+
+
+## `calculateAggregateAppStats()`
+
+```php
+calculateAggregateAppStats($app_usage_stats_in, $idempotency_key): \Svix\ApiClient\Model\AppUsageStatsOut
+```
+
+Calculate Aggregate App Stats
+
+Creates a background task to calculate the message destinations for all applications in the environment.
+
+### Example
+
+```php
+setAccessToken('YOUR_ACCESS_TOKEN');
+
+
+$apiInstance = new Svix\ApiClient\Api\StatisticsApi(
+ // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
+ // This is optional, `GuzzleHttp\Client` will be used as default.
+ new GuzzleHttp\Client(),
+ $config
+);
+$app_usage_stats_in = new \Svix\ApiClient\Model\AppUsageStatsIn(); // \Svix\ApiClient\Model\AppUsageStatsIn
+$idempotency_key = 'idempotency_key_example'; // string | The request's idempotency key
+
+try {
+ $result = $apiInstance->calculateAggregateAppStats($app_usage_stats_in, $idempotency_key);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling StatisticsApi->calculateAggregateAppStats: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **app_usage_stats_in** | [**\Svix\ApiClient\Model\AppUsageStatsIn**](../Model/AppUsageStatsIn.md)| | |
+| **idempotency_key** | **string**| The request's idempotency key | [optional] |
+
+### Return type
+
+[**\Svix\ApiClient\Model\AppUsageStatsOut**](../Model/AppUsageStatsOut.md)
+
+### Authorization
+
+[HTTPBearer](../../README.md#HTTPBearer)
+
+### HTTP request headers
+
+- **Content-Type**: `application/json`
+- **Accept**: `application/json`
+
+[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
+[[Back to Model list]](../../README.md#models)
+[[Back to README]](../../README.md)
diff --git a/docs/Model/AppPortalAccessIn.md b/docs/Model/AppPortalAccessIn.md
new file mode 100644
index 0000000..3f8b0d6
--- /dev/null
+++ b/docs/Model/AppPortalAccessIn.md
@@ -0,0 +1,9 @@
+# # AppPortalAccessIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**feature_flags** | **string[]** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/AppPortalAccessOut.md b/docs/Model/AppPortalAccessOut.md
new file mode 100644
index 0000000..8054cc9
--- /dev/null
+++ b/docs/Model/AppPortalAccessOut.md
@@ -0,0 +1,10 @@
+# # AppPortalAccessOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**url** | **string** | |
+**token** | **string** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/AppUsageStatsIn.md b/docs/Model/AppUsageStatsIn.md
new file mode 100644
index 0000000..83a0a1c
--- /dev/null
+++ b/docs/Model/AppUsageStatsIn.md
@@ -0,0 +1,11 @@
+# # AppUsageStatsIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**since** | **\DateTime** | |
+**until** | **\DateTime** | |
+**app_ids** | **string[]** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/AppUsageStatsOut.md b/docs/Model/AppUsageStatsOut.md
new file mode 100644
index 0000000..161fc9a
--- /dev/null
+++ b/docs/Model/AppUsageStatsOut.md
@@ -0,0 +1,11 @@
+# # AppUsageStatsOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | |
+**status** | [**\Svix\ApiClient\Model\BackgroundTaskStatus**](BackgroundTaskStatus.md) | |
+**task** | [**\Svix\ApiClient\Model\BackgroundTaskType**](BackgroundTaskType.md) | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ApplicationIn.md b/docs/Model/ApplicationIn.md
new file mode 100644
index 0000000..30833a9
--- /dev/null
+++ b/docs/Model/ApplicationIn.md
@@ -0,0 +1,12 @@
+# # ApplicationIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | |
+**rate_limit** | **int** | | [optional]
+**uid** | **string** | Optional unique identifier for the application | [optional]
+**metadata** | **array** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ApplicationOut.md b/docs/Model/ApplicationOut.md
new file mode 100644
index 0000000..45ae900
--- /dev/null
+++ b/docs/Model/ApplicationOut.md
@@ -0,0 +1,15 @@
+# # ApplicationOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uid** | **string** | The app's UID | [optional]
+**name** | **string** | |
+**rate_limit** | **int** | | [optional]
+**id** | **string** | The app's ID |
+**created_at** | **\DateTime** | |
+**updated_at** | **\DateTime** | |
+**metadata** | **array** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ApplicationPatch.md b/docs/Model/ApplicationPatch.md
new file mode 100644
index 0000000..dc07d85
--- /dev/null
+++ b/docs/Model/ApplicationPatch.md
@@ -0,0 +1,12 @@
+# # ApplicationPatch
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | | [optional]
+**rate_limit** | **int** | | [optional]
+**uid** | **string** | The app's UID | [optional]
+**metadata** | **array** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ApplicationTokenExpireIn.md b/docs/Model/ApplicationTokenExpireIn.md
new file mode 100644
index 0000000..0dbccae
--- /dev/null
+++ b/docs/Model/ApplicationTokenExpireIn.md
@@ -0,0 +1,9 @@
+# # ApplicationTokenExpireIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**expiry** | **int** | How many seconds until the old key is expired. | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/BackgroundTaskOut.md b/docs/Model/BackgroundTaskOut.md
new file mode 100644
index 0000000..a77f6b6
--- /dev/null
+++ b/docs/Model/BackgroundTaskOut.md
@@ -0,0 +1,12 @@
+# # BackgroundTaskOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | **object** | |
+**id** | **string** | |
+**status** | [**\Svix\ApiClient\Model\BackgroundTaskStatus**](BackgroundTaskStatus.md) | |
+**task** | [**\Svix\ApiClient\Model\BackgroundTaskType**](BackgroundTaskType.md) | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/BackgroundTaskStatus.md b/docs/Model/BackgroundTaskStatus.md
new file mode 100644
index 0000000..886fcce
--- /dev/null
+++ b/docs/Model/BackgroundTaskStatus.md
@@ -0,0 +1,8 @@
+# # BackgroundTaskStatus
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/BackgroundTaskType.md b/docs/Model/BackgroundTaskType.md
new file mode 100644
index 0000000..35562ce
--- /dev/null
+++ b/docs/Model/BackgroundTaskType.md
@@ -0,0 +1,8 @@
+# # BackgroundTaskType
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/DashboardAccessOut.md b/docs/Model/DashboardAccessOut.md
new file mode 100644
index 0000000..176e2fd
--- /dev/null
+++ b/docs/Model/DashboardAccessOut.md
@@ -0,0 +1,10 @@
+# # DashboardAccessOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**url** | **string** | |
+**token** | **string** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointCreatedEvent.md b/docs/Model/EndpointCreatedEvent.md
new file mode 100644
index 0000000..039710f
--- /dev/null
+++ b/docs/Model/EndpointCreatedEvent.md
@@ -0,0 +1,10 @@
+# # EndpointCreatedEvent
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\EndpointCreatedEventData**](EndpointCreatedEventData.md) | |
+**type** | **string** | | [default to 'endpoint.created']
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointCreatedEventData.md b/docs/Model/EndpointCreatedEventData.md
new file mode 100644
index 0000000..5713198
--- /dev/null
+++ b/docs/Model/EndpointCreatedEventData.md
@@ -0,0 +1,12 @@
+# # EndpointCreatedEventData
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**app_id** | **string** | The app's ID |
+**app_uid** | **string** | The app's UID | [optional]
+**endpoint_id** | **string** | The ep's ID |
+**endpoint_uid** | **string** | The ep's UID | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointDeletedEvent.md b/docs/Model/EndpointDeletedEvent.md
new file mode 100644
index 0000000..382ce53
--- /dev/null
+++ b/docs/Model/EndpointDeletedEvent.md
@@ -0,0 +1,10 @@
+# # EndpointDeletedEvent
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\EndpointDeletedEventData**](EndpointDeletedEventData.md) | |
+**type** | **string** | | [default to 'endpoint.deleted']
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointDeletedEventData.md b/docs/Model/EndpointDeletedEventData.md
new file mode 100644
index 0000000..41ed74f
--- /dev/null
+++ b/docs/Model/EndpointDeletedEventData.md
@@ -0,0 +1,12 @@
+# # EndpointDeletedEventData
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**app_id** | **string** | The app's ID |
+**app_uid** | **string** | The app's UID | [optional]
+**endpoint_id** | **string** | The ep's ID |
+**endpoint_uid** | **string** | The ep's UID | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointDisabledEvent.md b/docs/Model/EndpointDisabledEvent.md
new file mode 100644
index 0000000..cd9ac70
--- /dev/null
+++ b/docs/Model/EndpointDisabledEvent.md
@@ -0,0 +1,10 @@
+# # EndpointDisabledEvent
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\EndpointDisabledEventData**](EndpointDisabledEventData.md) | |
+**type** | **string** | | [default to 'endpoint.disabled']
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointDisabledEventData.md b/docs/Model/EndpointDisabledEventData.md
new file mode 100644
index 0000000..1c2b231
--- /dev/null
+++ b/docs/Model/EndpointDisabledEventData.md
@@ -0,0 +1,13 @@
+# # EndpointDisabledEventData
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**app_id** | **string** | The app's ID |
+**app_uid** | **string** | The app's UID | [optional]
+**endpoint_id** | **string** | The ep's ID |
+**endpoint_uid** | **string** | The ep's UID | [optional]
+**fail_since** | **\DateTime** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointHeadersIn.md b/docs/Model/EndpointHeadersIn.md
new file mode 100644
index 0000000..ac17d43
--- /dev/null
+++ b/docs/Model/EndpointHeadersIn.md
@@ -0,0 +1,9 @@
+# # EndpointHeadersIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**headers** | **array** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointHeadersOut.md b/docs/Model/EndpointHeadersOut.md
new file mode 100644
index 0000000..230a778
--- /dev/null
+++ b/docs/Model/EndpointHeadersOut.md
@@ -0,0 +1,10 @@
+# # EndpointHeadersOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**headers** | **array** | |
+**sensitive** | **string[]** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointHeadersPatchIn.md b/docs/Model/EndpointHeadersPatchIn.md
new file mode 100644
index 0000000..c1df86a
--- /dev/null
+++ b/docs/Model/EndpointHeadersPatchIn.md
@@ -0,0 +1,9 @@
+# # EndpointHeadersPatchIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**headers** | **array** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointIn.md b/docs/Model/EndpointIn.md
new file mode 100644
index 0000000..5d3fd8b
--- /dev/null
+++ b/docs/Model/EndpointIn.md
@@ -0,0 +1,18 @@
+# # EndpointIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**description** | **string** | | [optional] [default to '']
+**rate_limit** | **int** | | [optional]
+**uid** | **string** | Optional unique identifier for the endpoint | [optional]
+**url** | **string** | |
+**version** | **int** | | [optional] [default to 1]
+**disabled** | **bool** | | [optional] [default to false]
+**filter_types** | **string[]** | | [optional]
+**channels** | **string[]** | | [optional]
+**secret** | **string** | The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24. | [optional]
+**metadata** | **array** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointMessageOut.md b/docs/Model/EndpointMessageOut.md
new file mode 100644
index 0000000..d8a5a3b
--- /dev/null
+++ b/docs/Model/EndpointMessageOut.md
@@ -0,0 +1,16 @@
+# # EndpointMessageOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**status** | [**\Svix\ApiClient\Model\MessageStatus**](MessageStatus.md) | |
+**next_attempt** | **\DateTime** | | [optional]
+**event_id** | **string** | Optional unique identifier for the message | [optional]
+**event_type** | **string** | The event type's name |
+**payload** | **object** | |
+**channels** | **string[]** | | [optional]
+**id** | **string** | The msg's ID |
+**timestamp** | **\DateTime** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointOut.md b/docs/Model/EndpointOut.md
new file mode 100644
index 0000000..f4e8921
--- /dev/null
+++ b/docs/Model/EndpointOut.md
@@ -0,0 +1,20 @@
+# # EndpointOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | The ep's ID |
+**metadata** | **array** | |
+**description** | **string** | An example endpoint name |
+**rate_limit** | **int** | | [optional]
+**uid** | **string** | Optional unique identifier for the endpoint | [optional]
+**url** | **string** | |
+**version** | **int** | |
+**disabled** | **bool** | | [optional] [default to false]
+**filter_types** | **string[]** | | [optional]
+**channels** | **string[]** | | [optional]
+**created_at** | **\DateTime** | |
+**updated_at** | **\DateTime** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointPatch.md b/docs/Model/EndpointPatch.md
new file mode 100644
index 0000000..e572071
--- /dev/null
+++ b/docs/Model/EndpointPatch.md
@@ -0,0 +1,18 @@
+# # EndpointPatch
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**description** | **string** | | [optional]
+**rate_limit** | **int** | | [optional]
+**uid** | **string** | The ep's UID | [optional]
+**url** | **string** | | [optional]
+**version** | **int** | | [optional]
+**disabled** | **bool** | | [optional]
+**filter_types** | **string[]** | | [optional]
+**channels** | **string[]** | | [optional]
+**secret** | **string** | The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24. | [optional]
+**metadata** | **array** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointSecretOut.md b/docs/Model/EndpointSecretOut.md
new file mode 100644
index 0000000..85b3c3e
--- /dev/null
+++ b/docs/Model/EndpointSecretOut.md
@@ -0,0 +1,9 @@
+# # EndpointSecretOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **string** | The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24. |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointSecretRotateIn.md b/docs/Model/EndpointSecretRotateIn.md
new file mode 100644
index 0000000..a971af8
--- /dev/null
+++ b/docs/Model/EndpointSecretRotateIn.md
@@ -0,0 +1,9 @@
+# # EndpointSecretRotateIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **string** | The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24. | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointStats.md b/docs/Model/EndpointStats.md
new file mode 100644
index 0000000..b0d57bf
--- /dev/null
+++ b/docs/Model/EndpointStats.md
@@ -0,0 +1,12 @@
+# # EndpointStats
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**success** | **int** | |
+**pending** | **int** | |
+**sending** | **int** | |
+**fail** | **int** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointTransformationIn.md b/docs/Model/EndpointTransformationIn.md
new file mode 100644
index 0000000..d24945f
--- /dev/null
+++ b/docs/Model/EndpointTransformationIn.md
@@ -0,0 +1,10 @@
+# # EndpointTransformationIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **string** | | [optional]
+**enabled** | **bool** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointTransformationOut.md b/docs/Model/EndpointTransformationOut.md
new file mode 100644
index 0000000..f194e06
--- /dev/null
+++ b/docs/Model/EndpointTransformationOut.md
@@ -0,0 +1,10 @@
+# # EndpointTransformationOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **string** | | [optional]
+**enabled** | **bool** | | [optional] [default to false]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointTransformationSimulateIn.md b/docs/Model/EndpointTransformationSimulateIn.md
new file mode 100644
index 0000000..5b66cde
--- /dev/null
+++ b/docs/Model/EndpointTransformationSimulateIn.md
@@ -0,0 +1,12 @@
+# # EndpointTransformationSimulateIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **string** | |
+**event_type** | **string** | The event type's name |
+**channels** | **string[]** | | [optional]
+**payload** | **object** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointTransformationSimulateOut.md b/docs/Model/EndpointTransformationSimulateOut.md
new file mode 100644
index 0000000..fe42fea
--- /dev/null
+++ b/docs/Model/EndpointTransformationSimulateOut.md
@@ -0,0 +1,11 @@
+# # EndpointTransformationSimulateOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**url** | **string** | |
+**payload** | **string** | |
+**method** | [**\Svix\ApiClient\Model\TransformationHttpMethod**](TransformationHttpMethod.md) | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointUpdate.md b/docs/Model/EndpointUpdate.md
new file mode 100644
index 0000000..9438bae
--- /dev/null
+++ b/docs/Model/EndpointUpdate.md
@@ -0,0 +1,17 @@
+# # EndpointUpdate
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**description** | **string** | | [optional] [default to '']
+**rate_limit** | **int** | | [optional]
+**uid** | **string** | Optional unique identifier for the endpoint | [optional]
+**url** | **string** | |
+**version** | **int** | | [optional] [default to 1]
+**disabled** | **bool** | | [optional] [default to false]
+**filter_types** | **string[]** | | [optional]
+**channels** | **string[]** | | [optional]
+**metadata** | **array** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointUpdatedEvent.md b/docs/Model/EndpointUpdatedEvent.md
new file mode 100644
index 0000000..15ac8e1
--- /dev/null
+++ b/docs/Model/EndpointUpdatedEvent.md
@@ -0,0 +1,10 @@
+# # EndpointUpdatedEvent
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\EndpointUpdatedEventData**](EndpointUpdatedEventData.md) | |
+**type** | **string** | | [default to 'endpoint.updated']
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EndpointUpdatedEventData.md b/docs/Model/EndpointUpdatedEventData.md
new file mode 100644
index 0000000..c1d6d49
--- /dev/null
+++ b/docs/Model/EndpointUpdatedEventData.md
@@ -0,0 +1,12 @@
+# # EndpointUpdatedEventData
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**app_id** | **string** | The app's ID |
+**app_uid** | **string** | The app's UID | [optional]
+**endpoint_id** | **string** | The ep's ID |
+**endpoint_uid** | **string** | The ep's UID | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EventExampleIn.md b/docs/Model/EventExampleIn.md
new file mode 100644
index 0000000..42420c4
--- /dev/null
+++ b/docs/Model/EventExampleIn.md
@@ -0,0 +1,9 @@
+# # EventExampleIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_type** | **string** | The event type's name |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EventTypeImportOpenApiIn.md b/docs/Model/EventTypeImportOpenApiIn.md
new file mode 100644
index 0000000..21fae2f
--- /dev/null
+++ b/docs/Model/EventTypeImportOpenApiIn.md
@@ -0,0 +1,10 @@
+# # EventTypeImportOpenApiIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**spec** | **array** | A pre-parsed JSON spec. | [optional]
+**spec_raw** | **string** | A string, parsed by the server as YAML or JSON. | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EventTypeImportOpenApiOut.md b/docs/Model/EventTypeImportOpenApiOut.md
new file mode 100644
index 0000000..4448e27
--- /dev/null
+++ b/docs/Model/EventTypeImportOpenApiOut.md
@@ -0,0 +1,9 @@
+# # EventTypeImportOpenApiOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\EventTypeImportOpenApiOutData**](EventTypeImportOpenApiOutData.md) | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EventTypeImportOpenApiOutData.md b/docs/Model/EventTypeImportOpenApiOutData.md
new file mode 100644
index 0000000..d866836
--- /dev/null
+++ b/docs/Model/EventTypeImportOpenApiOutData.md
@@ -0,0 +1,9 @@
+# # EventTypeImportOpenApiOutData
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**modified** | **string[]** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EventTypeIn.md b/docs/Model/EventTypeIn.md
new file mode 100644
index 0000000..7678276
--- /dev/null
+++ b/docs/Model/EventTypeIn.md
@@ -0,0 +1,13 @@
+# # EventTypeIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | The event type's name |
+**description** | **string** | |
+**archived** | **bool** | | [optional] [default to false]
+**schemas** | **array** | The schema for the event type for a specific version as a JSON schema. | [optional]
+**feature_flag** | **string** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EventTypeOut.md b/docs/Model/EventTypeOut.md
new file mode 100644
index 0000000..dfbeab4
--- /dev/null
+++ b/docs/Model/EventTypeOut.md
@@ -0,0 +1,15 @@
+# # EventTypeOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | The event type's name |
+**description** | **string** | |
+**archived** | **bool** | | [optional] [default to false]
+**schemas** | **array** | The schema for the event type for a specific version as a JSON schema. | [optional]
+**created_at** | **\DateTime** | |
+**updated_at** | **\DateTime** | |
+**feature_flag** | **string** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EventTypePatch.md b/docs/Model/EventTypePatch.md
new file mode 100644
index 0000000..3d78307
--- /dev/null
+++ b/docs/Model/EventTypePatch.md
@@ -0,0 +1,12 @@
+# # EventTypePatch
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**description** | **string** | | [optional]
+**archived** | **bool** | | [optional]
+**schemas** | **array** | | [optional]
+**feature_flag** | **string** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/EventTypeUpdate.md b/docs/Model/EventTypeUpdate.md
new file mode 100644
index 0000000..cfcf5e2
--- /dev/null
+++ b/docs/Model/EventTypeUpdate.md
@@ -0,0 +1,12 @@
+# # EventTypeUpdate
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**description** | **string** | |
+**archived** | **bool** | | [optional] [default to false]
+**schemas** | **array** | The schema for the event type for a specific version as a JSON schema. | [optional]
+**feature_flag** | **string** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ExportEventTypeOut.md b/docs/Model/ExportEventTypeOut.md
new file mode 100644
index 0000000..4dcd0f8
--- /dev/null
+++ b/docs/Model/ExportEventTypeOut.md
@@ -0,0 +1,11 @@
+# # ExportEventTypeOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | |
+**status** | [**\Svix\ApiClient\Model\BackgroundTaskStatus**](BackgroundTaskStatus.md) | |
+**task** | [**\Svix\ApiClient\Model\BackgroundTaskType**](BackgroundTaskType.md) | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/HTTPValidationError.md b/docs/Model/HTTPValidationError.md
new file mode 100644
index 0000000..f70607a
--- /dev/null
+++ b/docs/Model/HTTPValidationError.md
@@ -0,0 +1,9 @@
+# # HTTPValidationError
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**detail** | [**\Svix\ApiClient\Model\ValidationError[]**](ValidationError.md) | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/HttpErrorOut.md b/docs/Model/HttpErrorOut.md
new file mode 100644
index 0000000..dd5dbe1
--- /dev/null
+++ b/docs/Model/HttpErrorOut.md
@@ -0,0 +1,10 @@
+# # HttpErrorOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **string** | |
+**detail** | **string** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/IntegrationIn.md b/docs/Model/IntegrationIn.md
new file mode 100644
index 0000000..efa9ead
--- /dev/null
+++ b/docs/Model/IntegrationIn.md
@@ -0,0 +1,9 @@
+# # IntegrationIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/IntegrationKeyOut.md b/docs/Model/IntegrationKeyOut.md
new file mode 100644
index 0000000..63e2afe
--- /dev/null
+++ b/docs/Model/IntegrationKeyOut.md
@@ -0,0 +1,9 @@
+# # IntegrationKeyOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**key** | **string** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/IntegrationOut.md b/docs/Model/IntegrationOut.md
new file mode 100644
index 0000000..7d69648
--- /dev/null
+++ b/docs/Model/IntegrationOut.md
@@ -0,0 +1,12 @@
+# # IntegrationOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | |
+**id** | **string** | The integ's ID |
+**created_at** | **\DateTime** | |
+**updated_at** | **\DateTime** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/IntegrationUpdate.md b/docs/Model/IntegrationUpdate.md
new file mode 100644
index 0000000..fc121b4
--- /dev/null
+++ b/docs/Model/IntegrationUpdate.md
@@ -0,0 +1,9 @@
+# # IntegrationUpdate
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ListResponseApplicationOut.md b/docs/Model/ListResponseApplicationOut.md
new file mode 100644
index 0000000..60ddab0
--- /dev/null
+++ b/docs/Model/ListResponseApplicationOut.md
@@ -0,0 +1,12 @@
+# # ListResponseApplicationOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\ApplicationOut[]**](ApplicationOut.md) | |
+**iterator** | **string** | | [optional]
+**prev_iterator** | **string** | | [optional]
+**done** | **bool** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ListResponseBackgroundTaskOut.md b/docs/Model/ListResponseBackgroundTaskOut.md
new file mode 100644
index 0000000..98078e6
--- /dev/null
+++ b/docs/Model/ListResponseBackgroundTaskOut.md
@@ -0,0 +1,12 @@
+# # ListResponseBackgroundTaskOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\BackgroundTaskOut[]**](BackgroundTaskOut.md) | |
+**iterator** | **string** | | [optional]
+**prev_iterator** | **string** | | [optional]
+**done** | **bool** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ListResponseEndpointMessageOut.md b/docs/Model/ListResponseEndpointMessageOut.md
new file mode 100644
index 0000000..ab2f77b
--- /dev/null
+++ b/docs/Model/ListResponseEndpointMessageOut.md
@@ -0,0 +1,12 @@
+# # ListResponseEndpointMessageOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\EndpointMessageOut[]**](EndpointMessageOut.md) | |
+**iterator** | **string** | | [optional]
+**prev_iterator** | **string** | | [optional]
+**done** | **bool** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ListResponseEndpointOut.md b/docs/Model/ListResponseEndpointOut.md
new file mode 100644
index 0000000..1a23545
--- /dev/null
+++ b/docs/Model/ListResponseEndpointOut.md
@@ -0,0 +1,12 @@
+# # ListResponseEndpointOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\EndpointOut[]**](EndpointOut.md) | |
+**iterator** | **string** | | [optional]
+**prev_iterator** | **string** | | [optional]
+**done** | **bool** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ListResponseEventTypeOut.md b/docs/Model/ListResponseEventTypeOut.md
new file mode 100644
index 0000000..df89861
--- /dev/null
+++ b/docs/Model/ListResponseEventTypeOut.md
@@ -0,0 +1,12 @@
+# # ListResponseEventTypeOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\EventTypeOut[]**](EventTypeOut.md) | |
+**iterator** | **string** | | [optional]
+**prev_iterator** | **string** | | [optional]
+**done** | **bool** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ListResponseIntegrationOut.md b/docs/Model/ListResponseIntegrationOut.md
new file mode 100644
index 0000000..f12eec3
--- /dev/null
+++ b/docs/Model/ListResponseIntegrationOut.md
@@ -0,0 +1,12 @@
+# # ListResponseIntegrationOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\IntegrationOut[]**](IntegrationOut.md) | |
+**iterator** | **string** | | [optional]
+**prev_iterator** | **string** | | [optional]
+**done** | **bool** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ListResponseMessageAttemptEndpointOut.md b/docs/Model/ListResponseMessageAttemptEndpointOut.md
new file mode 100644
index 0000000..7f12fe9
--- /dev/null
+++ b/docs/Model/ListResponseMessageAttemptEndpointOut.md
@@ -0,0 +1,12 @@
+# # ListResponseMessageAttemptEndpointOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\MessageAttemptEndpointOut[]**](MessageAttemptEndpointOut.md) | |
+**iterator** | **string** | | [optional]
+**prev_iterator** | **string** | | [optional]
+**done** | **bool** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ListResponseMessageAttemptOut.md b/docs/Model/ListResponseMessageAttemptOut.md
new file mode 100644
index 0000000..953820f
--- /dev/null
+++ b/docs/Model/ListResponseMessageAttemptOut.md
@@ -0,0 +1,12 @@
+# # ListResponseMessageAttemptOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\MessageAttemptOut[]**](MessageAttemptOut.md) | |
+**iterator** | **string** | | [optional]
+**prev_iterator** | **string** | | [optional]
+**done** | **bool** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ListResponseMessageEndpointOut.md b/docs/Model/ListResponseMessageEndpointOut.md
new file mode 100644
index 0000000..05c488d
--- /dev/null
+++ b/docs/Model/ListResponseMessageEndpointOut.md
@@ -0,0 +1,12 @@
+# # ListResponseMessageEndpointOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\MessageEndpointOut[]**](MessageEndpointOut.md) | |
+**iterator** | **string** | | [optional]
+**prev_iterator** | **string** | | [optional]
+**done** | **bool** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ListResponseMessageOut.md b/docs/Model/ListResponseMessageOut.md
new file mode 100644
index 0000000..3febcbb
--- /dev/null
+++ b/docs/Model/ListResponseMessageOut.md
@@ -0,0 +1,12 @@
+# # ListResponseMessageOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\MessageOut[]**](MessageOut.md) | |
+**iterator** | **string** | | [optional]
+**prev_iterator** | **string** | | [optional]
+**done** | **bool** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ListResponseTemplateOut.md b/docs/Model/ListResponseTemplateOut.md
new file mode 100644
index 0000000..0f9bca4
--- /dev/null
+++ b/docs/Model/ListResponseTemplateOut.md
@@ -0,0 +1,12 @@
+# # ListResponseTemplateOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\TemplateOut[]**](TemplateOut.md) | |
+**iterator** | **string** | | [optional]
+**prev_iterator** | **string** | | [optional]
+**done** | **bool** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/MessageAttemptEndpointOut.md b/docs/Model/MessageAttemptEndpointOut.md
new file mode 100644
index 0000000..75df076
--- /dev/null
+++ b/docs/Model/MessageAttemptEndpointOut.md
@@ -0,0 +1,17 @@
+# # MessageAttemptEndpointOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**url** | **string** | |
+**response** | **string** | |
+**response_status_code** | **int** | |
+**status** | [**\Svix\ApiClient\Model\MessageStatus**](MessageStatus.md) | |
+**trigger_type** | [**\Svix\ApiClient\Model\MessageAttemptTriggerType**](MessageAttemptTriggerType.md) | |
+**msg_id** | **string** | The msg's ID |
+**endpoint_id** | **string** | The ep's ID |
+**id** | **string** | The attempt's ID |
+**timestamp** | **\DateTime** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/MessageAttemptExhaustedEvent.md b/docs/Model/MessageAttemptExhaustedEvent.md
new file mode 100644
index 0000000..cce6066
--- /dev/null
+++ b/docs/Model/MessageAttemptExhaustedEvent.md
@@ -0,0 +1,10 @@
+# # MessageAttemptExhaustedEvent
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\MessageAttemptExhaustedEventData**](MessageAttemptExhaustedEventData.md) | |
+**type** | **string** | | [default to 'message.attempt.exhausted']
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/MessageAttemptExhaustedEventData.md b/docs/Model/MessageAttemptExhaustedEventData.md
new file mode 100644
index 0000000..5274d80
--- /dev/null
+++ b/docs/Model/MessageAttemptExhaustedEventData.md
@@ -0,0 +1,14 @@
+# # MessageAttemptExhaustedEventData
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**app_id** | **string** | The app's ID |
+**app_uid** | **string** | The app's UID | [optional]
+**msg_id** | **string** | The msg's ID |
+**msg_event_id** | **string** | The msg's UID | [optional]
+**endpoint_id** | **string** | The ep's ID |
+**last_attempt** | [**\Svix\ApiClient\Model\MessageAttemptFailedData**](MessageAttemptFailedData.md) | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/MessageAttemptFailedData.md b/docs/Model/MessageAttemptFailedData.md
new file mode 100644
index 0000000..12de059
--- /dev/null
+++ b/docs/Model/MessageAttemptFailedData.md
@@ -0,0 +1,11 @@
+# # MessageAttemptFailedData
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | The attempt's ID |
+**response_status_code** | **int** | |
+**timestamp** | **\DateTime** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/MessageAttemptFailingEvent.md b/docs/Model/MessageAttemptFailingEvent.md
new file mode 100644
index 0000000..661445f
--- /dev/null
+++ b/docs/Model/MessageAttemptFailingEvent.md
@@ -0,0 +1,10 @@
+# # MessageAttemptFailingEvent
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\MessageAttemptFailingEventData**](MessageAttemptFailingEventData.md) | |
+**type** | **string** | | [default to 'message.attempt.failing']
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/MessageAttemptFailingEventData.md b/docs/Model/MessageAttemptFailingEventData.md
new file mode 100644
index 0000000..7ffecbc
--- /dev/null
+++ b/docs/Model/MessageAttemptFailingEventData.md
@@ -0,0 +1,14 @@
+# # MessageAttemptFailingEventData
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**app_id** | **string** | The app's ID |
+**app_uid** | **string** | The app's UID | [optional]
+**msg_id** | **string** | The msg's ID |
+**msg_event_id** | **string** | The msg's UID | [optional]
+**endpoint_id** | **string** | The ep's ID |
+**last_attempt** | [**\Svix\ApiClient\Model\MessageAttemptFailedData**](MessageAttemptFailedData.md) | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/MessageAttemptOut.md b/docs/Model/MessageAttemptOut.md
new file mode 100644
index 0000000..76c841b
--- /dev/null
+++ b/docs/Model/MessageAttemptOut.md
@@ -0,0 +1,17 @@
+# # MessageAttemptOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**url** | **string** | |
+**response** | **string** | |
+**response_status_code** | **int** | |
+**status** | [**\Svix\ApiClient\Model\MessageStatus**](MessageStatus.md) | |
+**trigger_type** | [**\Svix\ApiClient\Model\MessageAttemptTriggerType**](MessageAttemptTriggerType.md) | |
+**msg_id** | **string** | The msg's ID |
+**endpoint_id** | **string** | The ep's ID |
+**id** | **string** | The attempt's ID |
+**timestamp** | **\DateTime** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/MessageAttemptRecoveredEvent.md b/docs/Model/MessageAttemptRecoveredEvent.md
new file mode 100644
index 0000000..a92e0ec
--- /dev/null
+++ b/docs/Model/MessageAttemptRecoveredEvent.md
@@ -0,0 +1,10 @@
+# # MessageAttemptRecoveredEvent
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**data** | [**\Svix\ApiClient\Model\MessageAttemptRecoveredEventData**](MessageAttemptRecoveredEventData.md) | |
+**type** | **string** | | [default to 'message.attempt.recovered']
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/MessageAttemptRecoveredEventData.md b/docs/Model/MessageAttemptRecoveredEventData.md
new file mode 100644
index 0000000..dbe1f50
--- /dev/null
+++ b/docs/Model/MessageAttemptRecoveredEventData.md
@@ -0,0 +1,14 @@
+# # MessageAttemptRecoveredEventData
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**app_id** | **string** | The app's ID |
+**app_uid** | **string** | The app's UID | [optional]
+**msg_id** | **string** | The msg's ID |
+**msg_event_id** | **string** | The msg's UID | [optional]
+**endpoint_id** | **string** | The ep's ID |
+**last_attempt** | [**\Svix\ApiClient\Model\MessageAttemptFailedData**](MessageAttemptFailedData.md) | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/MessageAttemptTriggerType.md b/docs/Model/MessageAttemptTriggerType.md
new file mode 100644
index 0000000..ce94659
--- /dev/null
+++ b/docs/Model/MessageAttemptTriggerType.md
@@ -0,0 +1,8 @@
+# # MessageAttemptTriggerType
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/MessageBroadcastIn.md b/docs/Model/MessageBroadcastIn.md
new file mode 100644
index 0000000..3aed7bd
--- /dev/null
+++ b/docs/Model/MessageBroadcastIn.md
@@ -0,0 +1,13 @@
+# # MessageBroadcastIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_id** | **string** | Optional unique identifier for the message | [optional]
+**event_type** | **string** | The event type's name |
+**payload** | **object** | |
+**channels** | **string[]** | | [optional]
+**payload_retention_period** | **int** | | [optional] [default to 90]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/MessageBroadcastOut.md b/docs/Model/MessageBroadcastOut.md
new file mode 100644
index 0000000..fec9a06
--- /dev/null
+++ b/docs/Model/MessageBroadcastOut.md
@@ -0,0 +1,11 @@
+# # MessageBroadcastOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | |
+**status** | [**\Svix\ApiClient\Model\BackgroundTaskStatus**](BackgroundTaskStatus.md) | |
+**task** | [**\Svix\ApiClient\Model\BackgroundTaskType**](BackgroundTaskType.md) | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/MessageEndpointOut.md b/docs/Model/MessageEndpointOut.md
new file mode 100644
index 0000000..d2a4f84
--- /dev/null
+++ b/docs/Model/MessageEndpointOut.md
@@ -0,0 +1,21 @@
+# # MessageEndpointOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | The ep's ID |
+**status** | [**\Svix\ApiClient\Model\MessageStatus**](MessageStatus.md) | |
+**next_attempt** | **\DateTime** | | [optional]
+**description** | **string** | An example endpoint name |
+**rate_limit** | **int** | | [optional]
+**uid** | **string** | Optional unique identifier for the endpoint | [optional]
+**url** | **string** | |
+**version** | **int** | |
+**disabled** | **bool** | | [optional] [default to false]
+**filter_types** | **string[]** | | [optional]
+**channels** | **string[]** | | [optional]
+**created_at** | **\DateTime** | |
+**updated_at** | **\DateTime** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/MessageIn.md b/docs/Model/MessageIn.md
new file mode 100644
index 0000000..795dfeb
--- /dev/null
+++ b/docs/Model/MessageIn.md
@@ -0,0 +1,14 @@
+# # MessageIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_id** | **string** | Optional unique identifier for the message | [optional]
+**event_type** | **string** | The event type's name |
+**payload** | **object** | |
+**channels** | **string[]** | | [optional]
+**payload_retention_period** | **int** | | [optional] [default to 90]
+**application** | [**\Svix\ApiClient\Model\ApplicationIn**](ApplicationIn.md) | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/MessageOut.md b/docs/Model/MessageOut.md
new file mode 100644
index 0000000..b61c605
--- /dev/null
+++ b/docs/Model/MessageOut.md
@@ -0,0 +1,14 @@
+# # MessageOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**event_id** | **string** | Optional unique identifier for the message | [optional]
+**event_type** | **string** | The event type's name |
+**payload** | **object** | |
+**channels** | **string[]** | | [optional]
+**id** | **string** | The msg's ID |
+**timestamp** | **\DateTime** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/MessageRawPayloadOut.md b/docs/Model/MessageRawPayloadOut.md
new file mode 100644
index 0000000..fa691ca
--- /dev/null
+++ b/docs/Model/MessageRawPayloadOut.md
@@ -0,0 +1,9 @@
+# # MessageRawPayloadOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**payload** | **string** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/MessageStatus.md b/docs/Model/MessageStatus.md
new file mode 100644
index 0000000..822f4e2
--- /dev/null
+++ b/docs/Model/MessageStatus.md
@@ -0,0 +1,8 @@
+# # MessageStatus
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/OauthPayloadIn.md b/docs/Model/OauthPayloadIn.md
new file mode 100644
index 0000000..294a3b9
--- /dev/null
+++ b/docs/Model/OauthPayloadIn.md
@@ -0,0 +1,10 @@
+# # OauthPayloadIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **string** | |
+**redirect_uri** | **string** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/OauthPayloadOut.md b/docs/Model/OauthPayloadOut.md
new file mode 100644
index 0000000..51b32e3
--- /dev/null
+++ b/docs/Model/OauthPayloadOut.md
@@ -0,0 +1,11 @@
+# # OauthPayloadOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**error** | **string** | | [optional]
+**incoming_webhook_url** | **string** | | [optional]
+**channel** | **string** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/OneTimeTokenIn.md b/docs/Model/OneTimeTokenIn.md
new file mode 100644
index 0000000..de6180c
--- /dev/null
+++ b/docs/Model/OneTimeTokenIn.md
@@ -0,0 +1,9 @@
+# # OneTimeTokenIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**one_time_token** | **string** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/OneTimeTokenOut.md b/docs/Model/OneTimeTokenOut.md
new file mode 100644
index 0000000..502c575
--- /dev/null
+++ b/docs/Model/OneTimeTokenOut.md
@@ -0,0 +1,9 @@
+# # OneTimeTokenOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**token** | **string** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/Ordering.md b/docs/Model/Ordering.md
new file mode 100644
index 0000000..4d6d600
--- /dev/null
+++ b/docs/Model/Ordering.md
@@ -0,0 +1,8 @@
+# # Ordering
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/RecoverIn.md b/docs/Model/RecoverIn.md
new file mode 100644
index 0000000..419726a
--- /dev/null
+++ b/docs/Model/RecoverIn.md
@@ -0,0 +1,10 @@
+# # RecoverIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**since** | **\DateTime** | |
+**until** | **\DateTime** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/RecoverOut.md b/docs/Model/RecoverOut.md
new file mode 100644
index 0000000..c9814f1
--- /dev/null
+++ b/docs/Model/RecoverOut.md
@@ -0,0 +1,11 @@
+# # RecoverOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | |
+**status** | [**\Svix\ApiClient\Model\BackgroundTaskStatus**](BackgroundTaskStatus.md) | |
+**task** | [**\Svix\ApiClient\Model\BackgroundTaskType**](BackgroundTaskType.md) | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ReplayIn.md b/docs/Model/ReplayIn.md
new file mode 100644
index 0000000..fa9d5fe
--- /dev/null
+++ b/docs/Model/ReplayIn.md
@@ -0,0 +1,10 @@
+# # ReplayIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**since** | **\DateTime** | |
+**until** | **\DateTime** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ReplayOut.md b/docs/Model/ReplayOut.md
new file mode 100644
index 0000000..39f705a
--- /dev/null
+++ b/docs/Model/ReplayOut.md
@@ -0,0 +1,11 @@
+# # ReplayOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | |
+**status** | [**\Svix\ApiClient\Model\BackgroundTaskStatus**](BackgroundTaskStatus.md) | |
+**task** | [**\Svix\ApiClient\Model\BackgroundTaskType**](BackgroundTaskType.md) | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/StatusCodeClass.md b/docs/Model/StatusCodeClass.md
new file mode 100644
index 0000000..fe34cb0
--- /dev/null
+++ b/docs/Model/StatusCodeClass.md
@@ -0,0 +1,8 @@
+# # StatusCodeClass
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/TemplateIn.md b/docs/Model/TemplateIn.md
new file mode 100644
index 0000000..1930044
--- /dev/null
+++ b/docs/Model/TemplateIn.md
@@ -0,0 +1,17 @@
+# # TemplateIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | |
+**logo** | **string** | |
+**description** | **string** | | [optional] [default to '']
+**kind** | [**\Svix\ApiClient\Model\TransformationTemplateKind**](TransformationTemplateKind.md) | | [optional]
+**instructions** | **string** | | [optional] [default to '']
+**instructions_link** | **string** | | [optional] [default to 'null']
+**filter_types** | **string[]** | | [optional]
+**transformation** | **string** | |
+**feature_flag** | **string** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/TemplateOut.md b/docs/Model/TemplateOut.md
new file mode 100644
index 0000000..41e0ae3
--- /dev/null
+++ b/docs/Model/TemplateOut.md
@@ -0,0 +1,21 @@
+# # TemplateOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **string** | |
+**org_id** | **string** | |
+**kind** | [**\Svix\ApiClient\Model\TransformationTemplateKind**](TransformationTemplateKind.md) | |
+**name** | **string** | |
+**logo** | **string** | |
+**description** | **string** | |
+**instructions** | **string** | |
+**instructions_link** | **string** | | [optional]
+**filter_types** | **string[]** | | [optional]
+**transformation** | **string** | |
+**created_at** | **\DateTime** | |
+**updated_at** | **\DateTime** | |
+**feature_flag** | **string** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/TemplatePatch.md b/docs/Model/TemplatePatch.md
new file mode 100644
index 0000000..6073629
--- /dev/null
+++ b/docs/Model/TemplatePatch.md
@@ -0,0 +1,17 @@
+# # TemplatePatch
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | | [optional]
+**logo** | **string** | | [optional]
+**description** | **string** | | [optional]
+**kind** | [**\Svix\ApiClient\Model\TransformationTemplateKind**](TransformationTemplateKind.md) | | [optional]
+**instructions** | **string** | | [optional]
+**instructions_link** | **string** | | [optional]
+**filter_types** | **string[]** | | [optional]
+**transformation** | **string** | | [optional]
+**feature_flag** | **string** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/TemplateUpdate.md b/docs/Model/TemplateUpdate.md
new file mode 100644
index 0000000..6a85033
--- /dev/null
+++ b/docs/Model/TemplateUpdate.md
@@ -0,0 +1,17 @@
+# # TemplateUpdate
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **string** | | [optional] [default to '']
+**logo** | **string** | |
+**description** | **string** | | [optional] [default to '']
+**kind** | [**\Svix\ApiClient\Model\TransformationTemplateKind**](TransformationTemplateKind.md) | | [optional]
+**instructions** | **string** | | [optional] [default to '']
+**instructions_link** | **string** | | [optional]
+**filter_types** | **string[]** | | [optional]
+**transformation** | **string** | |
+**feature_flag** | **string** | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/TransformationHttpMethod.md b/docs/Model/TransformationHttpMethod.md
new file mode 100644
index 0000000..83e02ca
--- /dev/null
+++ b/docs/Model/TransformationHttpMethod.md
@@ -0,0 +1,8 @@
+# # TransformationHttpMethod
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/TransformationSimulateIn.md b/docs/Model/TransformationSimulateIn.md
new file mode 100644
index 0000000..6f2c54c
--- /dev/null
+++ b/docs/Model/TransformationSimulateIn.md
@@ -0,0 +1,12 @@
+# # TransformationSimulateIn
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **string** | |
+**event_type** | **string** | The event type's name |
+**channels** | **string[]** | | [optional]
+**payload** | **object** | |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/TransformationSimulateOut.md b/docs/Model/TransformationSimulateOut.md
new file mode 100644
index 0000000..24e287c
--- /dev/null
+++ b/docs/Model/TransformationSimulateOut.md
@@ -0,0 +1,11 @@
+# # TransformationSimulateOut
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**url** | **string** | |
+**payload** | **string** | |
+**method** | [**\Svix\ApiClient\Model\TransformationHttpMethod**](TransformationHttpMethod.md) | | [optional]
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/TransformationTemplateKind.md b/docs/Model/TransformationTemplateKind.md
new file mode 100644
index 0000000..4ceb342
--- /dev/null
+++ b/docs/Model/TransformationTemplateKind.md
@@ -0,0 +1,8 @@
+# # TransformationTemplateKind
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/docs/Model/ValidationError.md b/docs/Model/ValidationError.md
new file mode 100644
index 0000000..dbefafe
--- /dev/null
+++ b/docs/Model/ValidationError.md
@@ -0,0 +1,11 @@
+# # ValidationError
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**loc** | **string[]** | |
+**msg** | **string** | The message accompanying the validation error item. |
+**type** | **string** | The type of error, often \"type_error\" or \"value_error\", but sometimes with more context like as \"value_error.number.not_ge\" |
+
+[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
diff --git a/generate.sh b/generate.sh
new file mode 100755
index 0000000..0b08985
--- /dev/null
+++ b/generate.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -c /local/spec/config.yaml -i /local/spec/svix.json -g php -o /local/
diff --git a/git_push.sh b/git_push.sh
new file mode 100644
index 0000000..f53a75d
--- /dev/null
+++ b/git_push.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
+
+git_user_id=$1
+git_repo_id=$2
+release_note=$3
+git_host=$4
+
+if [ "$git_host" = "" ]; then
+ git_host="github.com"
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
+fi
+
+if [ "$git_user_id" = "" ]; then
+ git_user_id="GIT_USER_ID"
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+ git_repo_id="GIT_REPO_ID"
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+ release_note="Minor update"
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
+fi
+
+# Initialize the local directory as a Git repository
+git init
+
+# Adds the files in the local repository and stages them for commit.
+git add .
+
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
+git commit -m "$release_note"
+
+# Sets the new remote
+git_remote=$(git remote)
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+ if [ "$GIT_TOKEN" = "" ]; then
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
+ else
+ git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
+ fi
+
+fi
+
+git pull origin master
+
+# Pushes (Forces) the changes in the local repository up to the remote repository
+echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
+git push origin master 2>&1 | grep -v 'To https'
diff --git a/lib/Api/ApplicationApi.php b/lib/Api/ApplicationApi.php
new file mode 100644
index 0000000..9aff726
--- /dev/null
+++ b/lib/Api/ApplicationApi.php
@@ -0,0 +1,2862 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Api;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Psr7\MultipartStream;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\RequestOptions;
+use Svix\ApiClient\ApiException;
+use Svix\ApiClient\Configuration;
+use Svix\ApiClient\HeaderSelector;
+use Svix\ApiClient\ObjectSerializer;
+
+/**
+ * ApplicationApi Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ */
+class ApplicationApi
+{
+ /**
+ * @var ClientInterface
+ */
+ protected $client;
+
+ /**
+ * @var Configuration
+ */
+ protected $config;
+
+ /**
+ * @var HeaderSelector
+ */
+ protected $headerSelector;
+
+ /**
+ * @var int Host index
+ */
+ protected $hostIndex;
+
+ /** @var string[] $contentTypes **/
+ public const contentTypes = [
+ 'v1ApplicationCreate' => [
+ 'application/json',
+ ],
+ 'v1ApplicationDelete' => [
+ 'application/json',
+ ],
+ 'v1ApplicationGet' => [
+ 'application/json',
+ ],
+ 'v1ApplicationList' => [
+ 'application/json',
+ ],
+ 'v1ApplicationPatch' => [
+ 'application/json',
+ ],
+ 'v1ApplicationUpdate' => [
+ 'application/json',
+ ],
+ ];
+
+/**
+ * @param ClientInterface $client
+ * @param Configuration $config
+ * @param HeaderSelector $selector
+ * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
+ */
+ public function __construct(
+ ClientInterface $client = null,
+ Configuration $config = null,
+ HeaderSelector $selector = null,
+ $hostIndex = 0
+ ) {
+ $this->client = $client ?: new Client();
+ $this->config = $config ?: new Configuration();
+ $this->headerSelector = $selector ?: new HeaderSelector();
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Set the host index
+ *
+ * @param int $hostIndex Host index (required)
+ */
+ public function setHostIndex($hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex()
+ {
+ return $this->hostIndex;
+ }
+
+ /**
+ * @return Configuration
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ /**
+ * Operation v1ApplicationCreate
+ *
+ * Create Application
+ *
+ * @param \Svix\ApiClient\Model\ApplicationIn $application_in application_in (required)
+ * @param bool $get_if_exists Get an existing application, or create a new one if doesn't exist. It's two separate functions in the libs. (optional, default to false)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationCreate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\ApplicationOut|\Svix\ApiClient\Model\ApplicationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1ApplicationCreate($application_in, $get_if_exists = false, $idempotency_key = null, string $contentType = self::contentTypes['v1ApplicationCreate'][0])
+ {
+ list($response) = $this->v1ApplicationCreateWithHttpInfo($application_in, $get_if_exists, $idempotency_key, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1ApplicationCreateWithHttpInfo
+ *
+ * Create Application
+ *
+ * @param \Svix\ApiClient\Model\ApplicationIn $application_in (required)
+ * @param bool $get_if_exists Get an existing application, or create a new one if doesn't exist. It's two separate functions in the libs. (optional, default to false)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationCreate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\ApplicationOut|\Svix\ApiClient\Model\ApplicationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1ApplicationCreateWithHttpInfo($application_in, $get_if_exists = false, $idempotency_key = null, string $contentType = self::contentTypes['v1ApplicationCreate'][0])
+ {
+ $request = $this->v1ApplicationCreateRequest($application_in, $get_if_exists, $idempotency_key, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\ApplicationOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ApplicationOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ApplicationOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 201:
+ if ('\Svix\ApiClient\Model\ApplicationOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ApplicationOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ApplicationOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\ApplicationOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ApplicationOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ApplicationOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1ApplicationCreateAsync
+ *
+ * Create Application
+ *
+ * @param \Svix\ApiClient\Model\ApplicationIn $application_in (required)
+ * @param bool $get_if_exists Get an existing application, or create a new one if doesn't exist. It's two separate functions in the libs. (optional, default to false)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationCreate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1ApplicationCreateAsync($application_in, $get_if_exists = false, $idempotency_key = null, string $contentType = self::contentTypes['v1ApplicationCreate'][0])
+ {
+ return $this->v1ApplicationCreateAsyncWithHttpInfo($application_in, $get_if_exists, $idempotency_key, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1ApplicationCreateAsyncWithHttpInfo
+ *
+ * Create Application
+ *
+ * @param \Svix\ApiClient\Model\ApplicationIn $application_in (required)
+ * @param bool $get_if_exists Get an existing application, or create a new one if doesn't exist. It's two separate functions in the libs. (optional, default to false)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationCreate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1ApplicationCreateAsyncWithHttpInfo($application_in, $get_if_exists = false, $idempotency_key = null, string $contentType = self::contentTypes['v1ApplicationCreate'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\ApplicationOut';
+ $request = $this->v1ApplicationCreateRequest($application_in, $get_if_exists, $idempotency_key, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1ApplicationCreate'
+ *
+ * @param \Svix\ApiClient\Model\ApplicationIn $application_in (required)
+ * @param bool $get_if_exists Get an existing application, or create a new one if doesn't exist. It's two separate functions in the libs. (optional, default to false)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationCreate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1ApplicationCreateRequest($application_in, $get_if_exists = false, $idempotency_key = null, string $contentType = self::contentTypes['v1ApplicationCreate'][0])
+ {
+
+ // verify the required parameter 'application_in' is set
+ if ($application_in === null || (is_array($application_in) && count($application_in) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $application_in when calling v1ApplicationCreate'
+ );
+ }
+
+
+
+
+ $resourcePath = '/api/v1/app/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $get_if_exists,
+ 'get_if_exists', // param base name
+ 'boolean', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+ // header params
+ if ($idempotency_key !== null) {
+ $headerParams['idempotency-key'] = ObjectSerializer::toHeaderValue($idempotency_key);
+ }
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($application_in)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($application_in));
+ } else {
+ $httpBody = $application_in;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1ApplicationDelete
+ *
+ * Delete Application
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationDelete'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return void
+ */
+ public function v1ApplicationDelete($app_id, string $contentType = self::contentTypes['v1ApplicationDelete'][0])
+ {
+ $this->v1ApplicationDeleteWithHttpInfo($app_id, $contentType);
+ }
+
+ /**
+ * Operation v1ApplicationDeleteWithHttpInfo
+ *
+ * Delete Application
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationDelete'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1ApplicationDeleteWithHttpInfo($app_id, string $contentType = self::contentTypes['v1ApplicationDelete'][0])
+ {
+ $request = $this->v1ApplicationDeleteRequest($app_id, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1ApplicationDeleteAsync
+ *
+ * Delete Application
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationDelete'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1ApplicationDeleteAsync($app_id, string $contentType = self::contentTypes['v1ApplicationDelete'][0])
+ {
+ return $this->v1ApplicationDeleteAsyncWithHttpInfo($app_id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1ApplicationDeleteAsyncWithHttpInfo
+ *
+ * Delete Application
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationDelete'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1ApplicationDeleteAsyncWithHttpInfo($app_id, string $contentType = self::contentTypes['v1ApplicationDelete'][0])
+ {
+ $returnType = '';
+ $request = $this->v1ApplicationDeleteRequest($app_id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $response->getStatusCode(), $response->getHeaders()];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1ApplicationDelete'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationDelete'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1ApplicationDeleteRequest($app_id, string $contentType = self::contentTypes['v1ApplicationDelete'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1ApplicationDelete'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling ApplicationApi.v1ApplicationDelete, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling ApplicationApi.v1ApplicationDelete, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling ApplicationApi.v1ApplicationDelete, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'DELETE',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1ApplicationGet
+ *
+ * Get Application
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationGet'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\ApplicationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1ApplicationGet($app_id, string $contentType = self::contentTypes['v1ApplicationGet'][0])
+ {
+ list($response) = $this->v1ApplicationGetWithHttpInfo($app_id, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1ApplicationGetWithHttpInfo
+ *
+ * Get Application
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationGet'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\ApplicationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1ApplicationGetWithHttpInfo($app_id, string $contentType = self::contentTypes['v1ApplicationGet'][0])
+ {
+ $request = $this->v1ApplicationGetRequest($app_id, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\ApplicationOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ApplicationOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ApplicationOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\ApplicationOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ApplicationOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1ApplicationGetAsync
+ *
+ * Get Application
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1ApplicationGetAsync($app_id, string $contentType = self::contentTypes['v1ApplicationGet'][0])
+ {
+ return $this->v1ApplicationGetAsyncWithHttpInfo($app_id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1ApplicationGetAsyncWithHttpInfo
+ *
+ * Get Application
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1ApplicationGetAsyncWithHttpInfo($app_id, string $contentType = self::contentTypes['v1ApplicationGet'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\ApplicationOut';
+ $request = $this->v1ApplicationGetRequest($app_id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1ApplicationGet'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1ApplicationGetRequest($app_id, string $contentType = self::contentTypes['v1ApplicationGet'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1ApplicationGet'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling ApplicationApi.v1ApplicationGet, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling ApplicationApi.v1ApplicationGet, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling ApplicationApi.v1ApplicationGet, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1ApplicationList
+ *
+ * List Applications
+ *
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationList'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\ListResponseApplicationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1ApplicationList($limit = null, $iterator = null, $order = null, string $contentType = self::contentTypes['v1ApplicationList'][0])
+ {
+ list($response) = $this->v1ApplicationListWithHttpInfo($limit, $iterator, $order, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1ApplicationListWithHttpInfo
+ *
+ * List Applications
+ *
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationList'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\ListResponseApplicationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1ApplicationListWithHttpInfo($limit = null, $iterator = null, $order = null, string $contentType = self::contentTypes['v1ApplicationList'][0])
+ {
+ $request = $this->v1ApplicationListRequest($limit, $iterator, $order, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\ListResponseApplicationOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ListResponseApplicationOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ListResponseApplicationOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\ListResponseApplicationOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ListResponseApplicationOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1ApplicationListAsync
+ *
+ * List Applications
+ *
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationList'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1ApplicationListAsync($limit = null, $iterator = null, $order = null, string $contentType = self::contentTypes['v1ApplicationList'][0])
+ {
+ return $this->v1ApplicationListAsyncWithHttpInfo($limit, $iterator, $order, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1ApplicationListAsyncWithHttpInfo
+ *
+ * List Applications
+ *
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationList'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1ApplicationListAsyncWithHttpInfo($limit = null, $iterator = null, $order = null, string $contentType = self::contentTypes['v1ApplicationList'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\ListResponseApplicationOut';
+ $request = $this->v1ApplicationListRequest($limit, $iterator, $order, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1ApplicationList'
+ *
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationList'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1ApplicationListRequest($limit = null, $iterator = null, $order = null, string $contentType = self::contentTypes['v1ApplicationList'][0])
+ {
+
+ if ($limit !== null && $limit > 250) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling ApplicationApi.v1ApplicationList, must be smaller than or equal to 250.');
+ }
+ if ($limit !== null && $limit < 1) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling ApplicationApi.v1ApplicationList, must be bigger than or equal to 1.');
+ }
+
+
+
+
+ $resourcePath = '/api/v1/app/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $iterator,
+ 'iterator', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $order,
+ 'order', // param base name
+ 'Ordering', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1ApplicationPatch
+ *
+ * Patch Application
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ApplicationPatch $application_patch application_patch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationPatch'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\ApplicationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1ApplicationPatch($app_id, $application_patch, string $contentType = self::contentTypes['v1ApplicationPatch'][0])
+ {
+ list($response) = $this->v1ApplicationPatchWithHttpInfo($app_id, $application_patch, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1ApplicationPatchWithHttpInfo
+ *
+ * Patch Application
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ApplicationPatch $application_patch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationPatch'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\ApplicationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1ApplicationPatchWithHttpInfo($app_id, $application_patch, string $contentType = self::contentTypes['v1ApplicationPatch'][0])
+ {
+ $request = $this->v1ApplicationPatchRequest($app_id, $application_patch, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\ApplicationOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ApplicationOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ApplicationOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\ApplicationOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ApplicationOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1ApplicationPatchAsync
+ *
+ * Patch Application
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ApplicationPatch $application_patch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationPatch'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1ApplicationPatchAsync($app_id, $application_patch, string $contentType = self::contentTypes['v1ApplicationPatch'][0])
+ {
+ return $this->v1ApplicationPatchAsyncWithHttpInfo($app_id, $application_patch, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1ApplicationPatchAsyncWithHttpInfo
+ *
+ * Patch Application
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ApplicationPatch $application_patch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationPatch'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1ApplicationPatchAsyncWithHttpInfo($app_id, $application_patch, string $contentType = self::contentTypes['v1ApplicationPatch'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\ApplicationOut';
+ $request = $this->v1ApplicationPatchRequest($app_id, $application_patch, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1ApplicationPatch'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ApplicationPatch $application_patch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationPatch'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1ApplicationPatchRequest($app_id, $application_patch, string $contentType = self::contentTypes['v1ApplicationPatch'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1ApplicationPatch'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling ApplicationApi.v1ApplicationPatch, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling ApplicationApi.v1ApplicationPatch, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling ApplicationApi.v1ApplicationPatch, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'application_patch' is set
+ if ($application_patch === null || (is_array($application_patch) && count($application_patch) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $application_patch when calling v1ApplicationPatch'
+ );
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($application_patch)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($application_patch));
+ } else {
+ $httpBody = $application_patch;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'PATCH',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1ApplicationUpdate
+ *
+ * Update Application
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ApplicationIn $application_in application_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationUpdate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\ApplicationOut|\Svix\ApiClient\Model\ApplicationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1ApplicationUpdate($app_id, $application_in, string $contentType = self::contentTypes['v1ApplicationUpdate'][0])
+ {
+ list($response) = $this->v1ApplicationUpdateWithHttpInfo($app_id, $application_in, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1ApplicationUpdateWithHttpInfo
+ *
+ * Update Application
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ApplicationIn $application_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationUpdate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\ApplicationOut|\Svix\ApiClient\Model\ApplicationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1ApplicationUpdateWithHttpInfo($app_id, $application_in, string $contentType = self::contentTypes['v1ApplicationUpdate'][0])
+ {
+ $request = $this->v1ApplicationUpdateRequest($app_id, $application_in, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\ApplicationOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ApplicationOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ApplicationOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 201:
+ if ('\Svix\ApiClient\Model\ApplicationOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ApplicationOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ApplicationOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\ApplicationOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ApplicationOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ApplicationOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1ApplicationUpdateAsync
+ *
+ * Update Application
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ApplicationIn $application_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationUpdate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1ApplicationUpdateAsync($app_id, $application_in, string $contentType = self::contentTypes['v1ApplicationUpdate'][0])
+ {
+ return $this->v1ApplicationUpdateAsyncWithHttpInfo($app_id, $application_in, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1ApplicationUpdateAsyncWithHttpInfo
+ *
+ * Update Application
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ApplicationIn $application_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationUpdate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1ApplicationUpdateAsyncWithHttpInfo($app_id, $application_in, string $contentType = self::contentTypes['v1ApplicationUpdate'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\ApplicationOut';
+ $request = $this->v1ApplicationUpdateRequest($app_id, $application_in, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1ApplicationUpdate'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ApplicationIn $application_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1ApplicationUpdate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1ApplicationUpdateRequest($app_id, $application_in, string $contentType = self::contentTypes['v1ApplicationUpdate'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1ApplicationUpdate'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling ApplicationApi.v1ApplicationUpdate, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling ApplicationApi.v1ApplicationUpdate, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling ApplicationApi.v1ApplicationUpdate, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'application_in' is set
+ if ($application_in === null || (is_array($application_in) && count($application_in) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $application_in when calling v1ApplicationUpdate'
+ );
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($application_in)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($application_in));
+ } else {
+ $httpBody = $application_in;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'PUT',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Create http client option
+ *
+ * @throws \RuntimeException on file opening failure
+ * @return array of http client options
+ */
+ protected function createHttpClientOption()
+ {
+ $options = [];
+ if ($this->config->getDebug()) {
+ $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
+ if (!$options[RequestOptions::DEBUG]) {
+ throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
+ }
+ }
+
+ return $options;
+ }
+}
diff --git a/lib/Api/AuthenticationApi.php b/lib/Api/AuthenticationApi.php
new file mode 100644
index 0000000..eb91bc7
--- /dev/null
+++ b/lib/Api/AuthenticationApi.php
@@ -0,0 +1,1716 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Api;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Psr7\MultipartStream;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\RequestOptions;
+use Svix\ApiClient\ApiException;
+use Svix\ApiClient\Configuration;
+use Svix\ApiClient\HeaderSelector;
+use Svix\ApiClient\ObjectSerializer;
+
+/**
+ * AuthenticationApi Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ */
+class AuthenticationApi
+{
+ /**
+ * @var ClientInterface
+ */
+ protected $client;
+
+ /**
+ * @var Configuration
+ */
+ protected $config;
+
+ /**
+ * @var HeaderSelector
+ */
+ protected $headerSelector;
+
+ /**
+ * @var int Host index
+ */
+ protected $hostIndex;
+
+ /** @var string[] $contentTypes **/
+ public const contentTypes = [
+ 'v1AuthenticationAppPortalAccess' => [
+ 'application/json',
+ ],
+ 'v1AuthenticationDashboardAccess' => [
+ 'application/json',
+ ],
+ 'v1AuthenticationExpireAll' => [
+ 'application/json',
+ ],
+ 'v1AuthenticationLogout' => [
+ 'application/json',
+ ],
+ ];
+
+/**
+ * @param ClientInterface $client
+ * @param Configuration $config
+ * @param HeaderSelector $selector
+ * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
+ */
+ public function __construct(
+ ClientInterface $client = null,
+ Configuration $config = null,
+ HeaderSelector $selector = null,
+ $hostIndex = 0
+ ) {
+ $this->client = $client ?: new Client();
+ $this->config = $config ?: new Configuration();
+ $this->headerSelector = $selector ?: new HeaderSelector();
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Set the host index
+ *
+ * @param int $hostIndex Host index (required)
+ */
+ public function setHostIndex($hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex()
+ {
+ return $this->hostIndex;
+ }
+
+ /**
+ * @return Configuration
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ /**
+ * Operation v1AuthenticationAppPortalAccess
+ *
+ * Get Consumer App Portal Access
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\AppPortalAccessIn $app_portal_access_in app_portal_access_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationAppPortalAccess'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\AppPortalAccessOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1AuthenticationAppPortalAccess($app_id, $app_portal_access_in, $idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationAppPortalAccess'][0])
+ {
+ list($response) = $this->v1AuthenticationAppPortalAccessWithHttpInfo($app_id, $app_portal_access_in, $idempotency_key, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1AuthenticationAppPortalAccessWithHttpInfo
+ *
+ * Get Consumer App Portal Access
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\AppPortalAccessIn $app_portal_access_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationAppPortalAccess'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\AppPortalAccessOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1AuthenticationAppPortalAccessWithHttpInfo($app_id, $app_portal_access_in, $idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationAppPortalAccess'][0])
+ {
+ $request = $this->v1AuthenticationAppPortalAccessRequest($app_id, $app_portal_access_in, $idempotency_key, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\AppPortalAccessOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\AppPortalAccessOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\AppPortalAccessOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\AppPortalAccessOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\AppPortalAccessOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1AuthenticationAppPortalAccessAsync
+ *
+ * Get Consumer App Portal Access
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\AppPortalAccessIn $app_portal_access_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationAppPortalAccess'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1AuthenticationAppPortalAccessAsync($app_id, $app_portal_access_in, $idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationAppPortalAccess'][0])
+ {
+ return $this->v1AuthenticationAppPortalAccessAsyncWithHttpInfo($app_id, $app_portal_access_in, $idempotency_key, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1AuthenticationAppPortalAccessAsyncWithHttpInfo
+ *
+ * Get Consumer App Portal Access
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\AppPortalAccessIn $app_portal_access_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationAppPortalAccess'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1AuthenticationAppPortalAccessAsyncWithHttpInfo($app_id, $app_portal_access_in, $idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationAppPortalAccess'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\AppPortalAccessOut';
+ $request = $this->v1AuthenticationAppPortalAccessRequest($app_id, $app_portal_access_in, $idempotency_key, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1AuthenticationAppPortalAccess'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\AppPortalAccessIn $app_portal_access_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationAppPortalAccess'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1AuthenticationAppPortalAccessRequest($app_id, $app_portal_access_in, $idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationAppPortalAccess'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1AuthenticationAppPortalAccess'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling AuthenticationApi.v1AuthenticationAppPortalAccess, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling AuthenticationApi.v1AuthenticationAppPortalAccess, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling AuthenticationApi.v1AuthenticationAppPortalAccess, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'app_portal_access_in' is set
+ if ($app_portal_access_in === null || (is_array($app_portal_access_in) && count($app_portal_access_in) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_portal_access_in when calling v1AuthenticationAppPortalAccess'
+ );
+ }
+
+
+
+ $resourcePath = '/api/v1/auth/app-portal-access/{app_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+ // header params
+ if ($idempotency_key !== null) {
+ $headerParams['idempotency-key'] = ObjectSerializer::toHeaderValue($idempotency_key);
+ }
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($app_portal_access_in)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($app_portal_access_in));
+ } else {
+ $httpBody = $app_portal_access_in;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1AuthenticationDashboardAccess
+ *
+ * Dashboard Access
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationDashboardAccess'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\DashboardAccessOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ * @deprecated
+ */
+ public function v1AuthenticationDashboardAccess($app_id, $idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationDashboardAccess'][0])
+ {
+ list($response) = $this->v1AuthenticationDashboardAccessWithHttpInfo($app_id, $idempotency_key, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1AuthenticationDashboardAccessWithHttpInfo
+ *
+ * Dashboard Access
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationDashboardAccess'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\DashboardAccessOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ * @deprecated
+ */
+ public function v1AuthenticationDashboardAccessWithHttpInfo($app_id, $idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationDashboardAccess'][0])
+ {
+ $request = $this->v1AuthenticationDashboardAccessRequest($app_id, $idempotency_key, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\DashboardAccessOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\DashboardAccessOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\DashboardAccessOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\DashboardAccessOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\DashboardAccessOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1AuthenticationDashboardAccessAsync
+ *
+ * Dashboard Access
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationDashboardAccess'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ * @deprecated
+ */
+ public function v1AuthenticationDashboardAccessAsync($app_id, $idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationDashboardAccess'][0])
+ {
+ return $this->v1AuthenticationDashboardAccessAsyncWithHttpInfo($app_id, $idempotency_key, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1AuthenticationDashboardAccessAsyncWithHttpInfo
+ *
+ * Dashboard Access
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationDashboardAccess'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ * @deprecated
+ */
+ public function v1AuthenticationDashboardAccessAsyncWithHttpInfo($app_id, $idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationDashboardAccess'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\DashboardAccessOut';
+ $request = $this->v1AuthenticationDashboardAccessRequest($app_id, $idempotency_key, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1AuthenticationDashboardAccess'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationDashboardAccess'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ * @deprecated
+ */
+ public function v1AuthenticationDashboardAccessRequest($app_id, $idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationDashboardAccess'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1AuthenticationDashboardAccess'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling AuthenticationApi.v1AuthenticationDashboardAccess, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling AuthenticationApi.v1AuthenticationDashboardAccess, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling AuthenticationApi.v1AuthenticationDashboardAccess, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+
+ $resourcePath = '/api/v1/auth/dashboard-access/{app_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+ // header params
+ if ($idempotency_key !== null) {
+ $headerParams['idempotency-key'] = ObjectSerializer::toHeaderValue($idempotency_key);
+ }
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1AuthenticationExpireAll
+ *
+ * Expire All
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ApplicationTokenExpireIn $application_token_expire_in application_token_expire_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationExpireAll'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return void
+ */
+ public function v1AuthenticationExpireAll($app_id, $application_token_expire_in, $idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationExpireAll'][0])
+ {
+ $this->v1AuthenticationExpireAllWithHttpInfo($app_id, $application_token_expire_in, $idempotency_key, $contentType);
+ }
+
+ /**
+ * Operation v1AuthenticationExpireAllWithHttpInfo
+ *
+ * Expire All
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ApplicationTokenExpireIn $application_token_expire_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationExpireAll'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1AuthenticationExpireAllWithHttpInfo($app_id, $application_token_expire_in, $idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationExpireAll'][0])
+ {
+ $request = $this->v1AuthenticationExpireAllRequest($app_id, $application_token_expire_in, $idempotency_key, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1AuthenticationExpireAllAsync
+ *
+ * Expire All
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ApplicationTokenExpireIn $application_token_expire_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationExpireAll'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1AuthenticationExpireAllAsync($app_id, $application_token_expire_in, $idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationExpireAll'][0])
+ {
+ return $this->v1AuthenticationExpireAllAsyncWithHttpInfo($app_id, $application_token_expire_in, $idempotency_key, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1AuthenticationExpireAllAsyncWithHttpInfo
+ *
+ * Expire All
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ApplicationTokenExpireIn $application_token_expire_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationExpireAll'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1AuthenticationExpireAllAsyncWithHttpInfo($app_id, $application_token_expire_in, $idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationExpireAll'][0])
+ {
+ $returnType = '';
+ $request = $this->v1AuthenticationExpireAllRequest($app_id, $application_token_expire_in, $idempotency_key, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $response->getStatusCode(), $response->getHeaders()];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1AuthenticationExpireAll'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ApplicationTokenExpireIn $application_token_expire_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationExpireAll'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1AuthenticationExpireAllRequest($app_id, $application_token_expire_in, $idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationExpireAll'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1AuthenticationExpireAll'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling AuthenticationApi.v1AuthenticationExpireAll, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling AuthenticationApi.v1AuthenticationExpireAll, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling AuthenticationApi.v1AuthenticationExpireAll, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'application_token_expire_in' is set
+ if ($application_token_expire_in === null || (is_array($application_token_expire_in) && count($application_token_expire_in) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $application_token_expire_in when calling v1AuthenticationExpireAll'
+ );
+ }
+
+
+
+ $resourcePath = '/api/v1/auth/app/{app_id}/expire-all/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+ // header params
+ if ($idempotency_key !== null) {
+ $headerParams['idempotency-key'] = ObjectSerializer::toHeaderValue($idempotency_key);
+ }
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($application_token_expire_in)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($application_token_expire_in));
+ } else {
+ $httpBody = $application_token_expire_in;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1AuthenticationLogout
+ *
+ * Logout
+ *
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationLogout'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return void
+ */
+ public function v1AuthenticationLogout($idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationLogout'][0])
+ {
+ $this->v1AuthenticationLogoutWithHttpInfo($idempotency_key, $contentType);
+ }
+
+ /**
+ * Operation v1AuthenticationLogoutWithHttpInfo
+ *
+ * Logout
+ *
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationLogout'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1AuthenticationLogoutWithHttpInfo($idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationLogout'][0])
+ {
+ $request = $this->v1AuthenticationLogoutRequest($idempotency_key, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1AuthenticationLogoutAsync
+ *
+ * Logout
+ *
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationLogout'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1AuthenticationLogoutAsync($idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationLogout'][0])
+ {
+ return $this->v1AuthenticationLogoutAsyncWithHttpInfo($idempotency_key, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1AuthenticationLogoutAsyncWithHttpInfo
+ *
+ * Logout
+ *
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationLogout'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1AuthenticationLogoutAsyncWithHttpInfo($idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationLogout'][0])
+ {
+ $returnType = '';
+ $request = $this->v1AuthenticationLogoutRequest($idempotency_key, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $response->getStatusCode(), $response->getHeaders()];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1AuthenticationLogout'
+ *
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1AuthenticationLogout'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1AuthenticationLogoutRequest($idempotency_key = null, string $contentType = self::contentTypes['v1AuthenticationLogout'][0])
+ {
+
+
+
+ $resourcePath = '/api/v1/auth/logout/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+ // header params
+ if ($idempotency_key !== null) {
+ $headerParams['idempotency-key'] = ObjectSerializer::toHeaderValue($idempotency_key);
+ }
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Create http client option
+ *
+ * @throws \RuntimeException on file opening failure
+ * @return array of http client options
+ */
+ protected function createHttpClientOption()
+ {
+ $options = [];
+ if ($this->config->getDebug()) {
+ $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
+ if (!$options[RequestOptions::DEBUG]) {
+ throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
+ }
+ }
+
+ return $options;
+ }
+}
diff --git a/lib/Api/BackgroundTasksApi.php b/lib/Api/BackgroundTasksApi.php
new file mode 100644
index 0000000..5380d1c
--- /dev/null
+++ b/lib/Api/BackgroundTasksApi.php
@@ -0,0 +1,1103 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Api;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Psr7\MultipartStream;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\RequestOptions;
+use Svix\ApiClient\ApiException;
+use Svix\ApiClient\Configuration;
+use Svix\ApiClient\HeaderSelector;
+use Svix\ApiClient\ObjectSerializer;
+
+/**
+ * BackgroundTasksApi Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ */
+class BackgroundTasksApi
+{
+ /**
+ * @var ClientInterface
+ */
+ protected $client;
+
+ /**
+ * @var Configuration
+ */
+ protected $config;
+
+ /**
+ * @var HeaderSelector
+ */
+ protected $headerSelector;
+
+ /**
+ * @var int Host index
+ */
+ protected $hostIndex;
+
+ /** @var string[] $contentTypes **/
+ public const contentTypes = [
+ 'getBackgroundTask' => [
+ 'application/json',
+ ],
+ 'listBackgroundTasks' => [
+ 'application/json',
+ ],
+ ];
+
+/**
+ * @param ClientInterface $client
+ * @param Configuration $config
+ * @param HeaderSelector $selector
+ * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
+ */
+ public function __construct(
+ ClientInterface $client = null,
+ Configuration $config = null,
+ HeaderSelector $selector = null,
+ $hostIndex = 0
+ ) {
+ $this->client = $client ?: new Client();
+ $this->config = $config ?: new Configuration();
+ $this->headerSelector = $selector ?: new HeaderSelector();
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Set the host index
+ *
+ * @param int $hostIndex Host index (required)
+ */
+ public function setHostIndex($hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex()
+ {
+ return $this->hostIndex;
+ }
+
+ /**
+ * @return Configuration
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ /**
+ * Operation getBackgroundTask
+ *
+ * Get Background Task
+ *
+ * @param string $task_id task_id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBackgroundTask'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\BackgroundTaskOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function getBackgroundTask($task_id, string $contentType = self::contentTypes['getBackgroundTask'][0])
+ {
+ list($response) = $this->getBackgroundTaskWithHttpInfo($task_id, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation getBackgroundTaskWithHttpInfo
+ *
+ * Get Background Task
+ *
+ * @param string $task_id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBackgroundTask'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\BackgroundTaskOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function getBackgroundTaskWithHttpInfo($task_id, string $contentType = self::contentTypes['getBackgroundTask'][0])
+ {
+ $request = $this->getBackgroundTaskRequest($task_id, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\BackgroundTaskOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\BackgroundTaskOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\BackgroundTaskOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\BackgroundTaskOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\BackgroundTaskOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation getBackgroundTaskAsync
+ *
+ * Get Background Task
+ *
+ * @param string $task_id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBackgroundTask'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function getBackgroundTaskAsync($task_id, string $contentType = self::contentTypes['getBackgroundTask'][0])
+ {
+ return $this->getBackgroundTaskAsyncWithHttpInfo($task_id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation getBackgroundTaskAsyncWithHttpInfo
+ *
+ * Get Background Task
+ *
+ * @param string $task_id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBackgroundTask'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function getBackgroundTaskAsyncWithHttpInfo($task_id, string $contentType = self::contentTypes['getBackgroundTask'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\BackgroundTaskOut';
+ $request = $this->getBackgroundTaskRequest($task_id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'getBackgroundTask'
+ *
+ * @param string $task_id (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBackgroundTask'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function getBackgroundTaskRequest($task_id, string $contentType = self::contentTypes['getBackgroundTask'][0])
+ {
+
+ // verify the required parameter 'task_id' is set
+ if ($task_id === null || (is_array($task_id) && count($task_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $task_id when calling getBackgroundTask'
+ );
+ }
+
+
+ $resourcePath = '/api/v1/background-task/{task_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($task_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'task_id' . '}',
+ ObjectSerializer::toPathValue($task_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation listBackgroundTasks
+ *
+ * List Background Tasks
+ *
+ * @param BackgroundTaskStatus $status Filter the response based on the status (optional)
+ * @param BackgroundTaskType $task Filter the response based on the type (optional)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBackgroundTasks'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\ListResponseBackgroundTaskOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function listBackgroundTasks($status = null, $task = null, $limit = null, $iterator = null, $order = null, string $contentType = self::contentTypes['listBackgroundTasks'][0])
+ {
+ list($response) = $this->listBackgroundTasksWithHttpInfo($status, $task, $limit, $iterator, $order, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation listBackgroundTasksWithHttpInfo
+ *
+ * List Background Tasks
+ *
+ * @param BackgroundTaskStatus $status Filter the response based on the status (optional)
+ * @param BackgroundTaskType $task Filter the response based on the type (optional)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBackgroundTasks'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\ListResponseBackgroundTaskOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function listBackgroundTasksWithHttpInfo($status = null, $task = null, $limit = null, $iterator = null, $order = null, string $contentType = self::contentTypes['listBackgroundTasks'][0])
+ {
+ $request = $this->listBackgroundTasksRequest($status, $task, $limit, $iterator, $order, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\ListResponseBackgroundTaskOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ListResponseBackgroundTaskOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ListResponseBackgroundTaskOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\ListResponseBackgroundTaskOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ListResponseBackgroundTaskOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation listBackgroundTasksAsync
+ *
+ * List Background Tasks
+ *
+ * @param BackgroundTaskStatus $status Filter the response based on the status (optional)
+ * @param BackgroundTaskType $task Filter the response based on the type (optional)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBackgroundTasks'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function listBackgroundTasksAsync($status = null, $task = null, $limit = null, $iterator = null, $order = null, string $contentType = self::contentTypes['listBackgroundTasks'][0])
+ {
+ return $this->listBackgroundTasksAsyncWithHttpInfo($status, $task, $limit, $iterator, $order, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation listBackgroundTasksAsyncWithHttpInfo
+ *
+ * List Background Tasks
+ *
+ * @param BackgroundTaskStatus $status Filter the response based on the status (optional)
+ * @param BackgroundTaskType $task Filter the response based on the type (optional)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBackgroundTasks'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function listBackgroundTasksAsyncWithHttpInfo($status = null, $task = null, $limit = null, $iterator = null, $order = null, string $contentType = self::contentTypes['listBackgroundTasks'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\ListResponseBackgroundTaskOut';
+ $request = $this->listBackgroundTasksRequest($status, $task, $limit, $iterator, $order, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'listBackgroundTasks'
+ *
+ * @param BackgroundTaskStatus $status Filter the response based on the status (optional)
+ * @param BackgroundTaskType $task Filter the response based on the type (optional)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBackgroundTasks'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function listBackgroundTasksRequest($status = null, $task = null, $limit = null, $iterator = null, $order = null, string $contentType = self::contentTypes['listBackgroundTasks'][0])
+ {
+
+
+
+ if ($limit !== null && $limit > 250) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling BackgroundTasksApi.listBackgroundTasks, must be smaller than or equal to 250.');
+ }
+ if ($limit !== null && $limit < 1) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling BackgroundTasksApi.listBackgroundTasks, must be bigger than or equal to 1.');
+ }
+
+
+
+
+ $resourcePath = '/api/v1/background-task/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $status,
+ 'status', // param base name
+ 'BackgroundTaskStatus', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $task,
+ 'task', // param base name
+ 'BackgroundTaskType', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $iterator,
+ 'iterator', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $order,
+ 'order', // param base name
+ 'Ordering', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Create http client option
+ *
+ * @throws \RuntimeException on file opening failure
+ * @return array of http client options
+ */
+ protected function createHttpClientOption()
+ {
+ $options = [];
+ if ($this->config->getDebug()) {
+ $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
+ if (!$options[RequestOptions::DEBUG]) {
+ throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
+ }
+ }
+
+ return $options;
+ }
+}
diff --git a/lib/Api/EndpointApi.php b/lib/Api/EndpointApi.php
new file mode 100644
index 0000000..5640769
--- /dev/null
+++ b/lib/Api/EndpointApi.php
@@ -0,0 +1,7944 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Api;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Psr7\MultipartStream;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\RequestOptions;
+use Svix\ApiClient\ApiException;
+use Svix\ApiClient\Configuration;
+use Svix\ApiClient\HeaderSelector;
+use Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointApi Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ */
+class EndpointApi
+{
+ /**
+ * @var ClientInterface
+ */
+ protected $client;
+
+ /**
+ * @var Configuration
+ */
+ protected $config;
+
+ /**
+ * @var HeaderSelector
+ */
+ protected $headerSelector;
+
+ /**
+ * @var int Host index
+ */
+ protected $hostIndex;
+
+ /** @var string[] $contentTypes **/
+ public const contentTypes = [
+ 'v1EndpointCreate' => [
+ 'application/json',
+ ],
+ 'v1EndpointDelete' => [
+ 'application/json',
+ ],
+ 'v1EndpointGet' => [
+ 'application/json',
+ ],
+ 'v1EndpointGetHeaders' => [
+ 'application/json',
+ ],
+ 'v1EndpointGetSecret' => [
+ 'application/json',
+ ],
+ 'v1EndpointGetStats' => [
+ 'application/json',
+ ],
+ 'v1EndpointList' => [
+ 'application/json',
+ ],
+ 'v1EndpointPatch' => [
+ 'application/json',
+ ],
+ 'v1EndpointPatchHeaders' => [
+ 'application/json',
+ ],
+ 'v1EndpointRecover' => [
+ 'application/json',
+ ],
+ 'v1EndpointReplay' => [
+ 'application/json',
+ ],
+ 'v1EndpointRotateSecret' => [
+ 'application/json',
+ ],
+ 'v1EndpointSendExample' => [
+ 'application/json',
+ ],
+ 'v1EndpointTransformationGet' => [
+ 'application/json',
+ ],
+ 'v1EndpointTransformationPartialUpdate' => [
+ 'application/json',
+ ],
+ 'v1EndpointUpdate' => [
+ 'application/json',
+ ],
+ 'v1EndpointUpdateHeaders' => [
+ 'application/json',
+ ],
+ ];
+
+/**
+ * @param ClientInterface $client
+ * @param Configuration $config
+ * @param HeaderSelector $selector
+ * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
+ */
+ public function __construct(
+ ClientInterface $client = null,
+ Configuration $config = null,
+ HeaderSelector $selector = null,
+ $hostIndex = 0
+ ) {
+ $this->client = $client ?: new Client();
+ $this->config = $config ?: new Configuration();
+ $this->headerSelector = $selector ?: new HeaderSelector();
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Set the host index
+ *
+ * @param int $hostIndex Host index (required)
+ */
+ public function setHostIndex($hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex()
+ {
+ return $this->hostIndex;
+ }
+
+ /**
+ * @return Configuration
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ /**
+ * Operation v1EndpointCreate
+ *
+ * Create Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointIn $endpoint_in endpoint_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointCreate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\EndpointOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EndpointCreate($app_id, $endpoint_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointCreate'][0])
+ {
+ list($response) = $this->v1EndpointCreateWithHttpInfo($app_id, $endpoint_in, $idempotency_key, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EndpointCreateWithHttpInfo
+ *
+ * Create Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointIn $endpoint_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointCreate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\EndpointOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EndpointCreateWithHttpInfo($app_id, $endpoint_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointCreate'][0])
+ {
+ $request = $this->v1EndpointCreateRequest($app_id, $endpoint_in, $idempotency_key, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 201:
+ if ('\Svix\ApiClient\Model\EndpointOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\EndpointOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\EndpointOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\EndpointOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\EndpointOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EndpointCreateAsync
+ *
+ * Create Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointIn $endpoint_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointCreate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointCreateAsync($app_id, $endpoint_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointCreate'][0])
+ {
+ return $this->v1EndpointCreateAsyncWithHttpInfo($app_id, $endpoint_in, $idempotency_key, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EndpointCreateAsyncWithHttpInfo
+ *
+ * Create Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointIn $endpoint_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointCreate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointCreateAsyncWithHttpInfo($app_id, $endpoint_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointCreate'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\EndpointOut';
+ $request = $this->v1EndpointCreateRequest($app_id, $endpoint_in, $idempotency_key, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EndpointCreate'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointIn $endpoint_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointCreate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EndpointCreateRequest($app_id, $endpoint_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointCreate'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1EndpointCreate'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointCreate, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointCreate, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling EndpointApi.v1EndpointCreate, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_in' is set
+ if ($endpoint_in === null || (is_array($endpoint_in) && count($endpoint_in) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_in when calling v1EndpointCreate'
+ );
+ }
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+ // header params
+ if ($idempotency_key !== null) {
+ $headerParams['idempotency-key'] = ObjectSerializer::toHeaderValue($idempotency_key);
+ }
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($endpoint_in)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($endpoint_in));
+ } else {
+ $httpBody = $endpoint_in;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EndpointDelete
+ *
+ * Delete Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointDelete'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return void
+ */
+ public function v1EndpointDelete($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointDelete'][0])
+ {
+ $this->v1EndpointDeleteWithHttpInfo($app_id, $endpoint_id, $contentType);
+ }
+
+ /**
+ * Operation v1EndpointDeleteWithHttpInfo
+ *
+ * Delete Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointDelete'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EndpointDeleteWithHttpInfo($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointDelete'][0])
+ {
+ $request = $this->v1EndpointDeleteRequest($app_id, $endpoint_id, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EndpointDeleteAsync
+ *
+ * Delete Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointDelete'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointDeleteAsync($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointDelete'][0])
+ {
+ return $this->v1EndpointDeleteAsyncWithHttpInfo($app_id, $endpoint_id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EndpointDeleteAsyncWithHttpInfo
+ *
+ * Delete Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointDelete'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointDeleteAsyncWithHttpInfo($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointDelete'][0])
+ {
+ $returnType = '';
+ $request = $this->v1EndpointDeleteRequest($app_id, $endpoint_id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $response->getStatusCode(), $response->getHeaders()];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EndpointDelete'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointDelete'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EndpointDeleteRequest($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointDelete'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1EndpointDelete'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointDelete, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointDelete, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling EndpointApi.v1EndpointDelete, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1EndpointDelete'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointDelete, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointDelete, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling EndpointApi.v1EndpointDelete, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'DELETE',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EndpointGet
+ *
+ * Get Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGet'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\EndpointOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EndpointGet($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointGet'][0])
+ {
+ list($response) = $this->v1EndpointGetWithHttpInfo($app_id, $endpoint_id, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EndpointGetWithHttpInfo
+ *
+ * Get Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGet'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\EndpointOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EndpointGetWithHttpInfo($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointGet'][0])
+ {
+ $request = $this->v1EndpointGetRequest($app_id, $endpoint_id, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\EndpointOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\EndpointOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\EndpointOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\EndpointOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\EndpointOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EndpointGetAsync
+ *
+ * Get Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointGetAsync($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointGet'][0])
+ {
+ return $this->v1EndpointGetAsyncWithHttpInfo($app_id, $endpoint_id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EndpointGetAsyncWithHttpInfo
+ *
+ * Get Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointGetAsyncWithHttpInfo($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointGet'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\EndpointOut';
+ $request = $this->v1EndpointGetRequest($app_id, $endpoint_id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EndpointGet'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EndpointGetRequest($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointGet'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1EndpointGet'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointGet, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointGet, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling EndpointApi.v1EndpointGet, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1EndpointGet'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointGet, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointGet, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling EndpointApi.v1EndpointGet, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EndpointGetHeaders
+ *
+ * Get Endpoint Headers
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGetHeaders'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\EndpointHeadersOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EndpointGetHeaders($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointGetHeaders'][0])
+ {
+ list($response) = $this->v1EndpointGetHeadersWithHttpInfo($app_id, $endpoint_id, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EndpointGetHeadersWithHttpInfo
+ *
+ * Get Endpoint Headers
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGetHeaders'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\EndpointHeadersOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EndpointGetHeadersWithHttpInfo($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointGetHeaders'][0])
+ {
+ $request = $this->v1EndpointGetHeadersRequest($app_id, $endpoint_id, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\EndpointHeadersOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\EndpointHeadersOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\EndpointHeadersOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\EndpointHeadersOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\EndpointHeadersOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EndpointGetHeadersAsync
+ *
+ * Get Endpoint Headers
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGetHeaders'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointGetHeadersAsync($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointGetHeaders'][0])
+ {
+ return $this->v1EndpointGetHeadersAsyncWithHttpInfo($app_id, $endpoint_id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EndpointGetHeadersAsyncWithHttpInfo
+ *
+ * Get Endpoint Headers
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGetHeaders'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointGetHeadersAsyncWithHttpInfo($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointGetHeaders'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\EndpointHeadersOut';
+ $request = $this->v1EndpointGetHeadersRequest($app_id, $endpoint_id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EndpointGetHeaders'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGetHeaders'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EndpointGetHeadersRequest($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointGetHeaders'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1EndpointGetHeaders'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointGetHeaders, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointGetHeaders, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling EndpointApi.v1EndpointGetHeaders, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1EndpointGetHeaders'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointGetHeaders, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointGetHeaders, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling EndpointApi.v1EndpointGetHeaders, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EndpointGetSecret
+ *
+ * Get Endpoint Secret
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGetSecret'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\EndpointSecretOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EndpointGetSecret($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointGetSecret'][0])
+ {
+ list($response) = $this->v1EndpointGetSecretWithHttpInfo($app_id, $endpoint_id, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EndpointGetSecretWithHttpInfo
+ *
+ * Get Endpoint Secret
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGetSecret'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\EndpointSecretOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EndpointGetSecretWithHttpInfo($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointGetSecret'][0])
+ {
+ $request = $this->v1EndpointGetSecretRequest($app_id, $endpoint_id, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\EndpointSecretOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\EndpointSecretOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\EndpointSecretOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\EndpointSecretOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\EndpointSecretOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EndpointGetSecretAsync
+ *
+ * Get Endpoint Secret
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGetSecret'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointGetSecretAsync($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointGetSecret'][0])
+ {
+ return $this->v1EndpointGetSecretAsyncWithHttpInfo($app_id, $endpoint_id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EndpointGetSecretAsyncWithHttpInfo
+ *
+ * Get Endpoint Secret
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGetSecret'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointGetSecretAsyncWithHttpInfo($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointGetSecret'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\EndpointSecretOut';
+ $request = $this->v1EndpointGetSecretRequest($app_id, $endpoint_id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EndpointGetSecret'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGetSecret'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EndpointGetSecretRequest($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointGetSecret'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1EndpointGetSecret'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointGetSecret, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointGetSecret, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling EndpointApi.v1EndpointGetSecret, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1EndpointGetSecret'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointGetSecret, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointGetSecret, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling EndpointApi.v1EndpointGetSecret, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EndpointGetStats
+ *
+ * Endpoint Stats
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \DateTime $since Filter the range to data starting from this date (optional)
+ * @param \DateTime $until Filter the range to data ending by this date (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGetStats'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\EndpointStats|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EndpointGetStats($app_id, $endpoint_id, $since = null, $until = null, string $contentType = self::contentTypes['v1EndpointGetStats'][0])
+ {
+ list($response) = $this->v1EndpointGetStatsWithHttpInfo($app_id, $endpoint_id, $since, $until, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EndpointGetStatsWithHttpInfo
+ *
+ * Endpoint Stats
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \DateTime $since Filter the range to data starting from this date (optional)
+ * @param \DateTime $until Filter the range to data ending by this date (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGetStats'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\EndpointStats|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EndpointGetStatsWithHttpInfo($app_id, $endpoint_id, $since = null, $until = null, string $contentType = self::contentTypes['v1EndpointGetStats'][0])
+ {
+ $request = $this->v1EndpointGetStatsRequest($app_id, $endpoint_id, $since, $until, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\EndpointStats' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\EndpointStats' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\EndpointStats', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\EndpointStats';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\EndpointStats',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EndpointGetStatsAsync
+ *
+ * Endpoint Stats
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \DateTime $since Filter the range to data starting from this date (optional)
+ * @param \DateTime $until Filter the range to data ending by this date (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGetStats'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointGetStatsAsync($app_id, $endpoint_id, $since = null, $until = null, string $contentType = self::contentTypes['v1EndpointGetStats'][0])
+ {
+ return $this->v1EndpointGetStatsAsyncWithHttpInfo($app_id, $endpoint_id, $since, $until, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EndpointGetStatsAsyncWithHttpInfo
+ *
+ * Endpoint Stats
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \DateTime $since Filter the range to data starting from this date (optional)
+ * @param \DateTime $until Filter the range to data ending by this date (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGetStats'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointGetStatsAsyncWithHttpInfo($app_id, $endpoint_id, $since = null, $until = null, string $contentType = self::contentTypes['v1EndpointGetStats'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\EndpointStats';
+ $request = $this->v1EndpointGetStatsRequest($app_id, $endpoint_id, $since, $until, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EndpointGetStats'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \DateTime $since Filter the range to data starting from this date (optional)
+ * @param \DateTime $until Filter the range to data ending by this date (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointGetStats'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EndpointGetStatsRequest($app_id, $endpoint_id, $since = null, $until = null, string $contentType = self::contentTypes['v1EndpointGetStats'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1EndpointGetStats'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointGetStats, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointGetStats, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling EndpointApi.v1EndpointGetStats, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1EndpointGetStats'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointGetStats, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointGetStats, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling EndpointApi.v1EndpointGetStats, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $since,
+ 'since', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $until,
+ 'until', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EndpointList
+ *
+ * List Endpoints
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointList'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\ListResponseEndpointOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EndpointList($app_id, $limit = null, $iterator = null, $order = null, string $contentType = self::contentTypes['v1EndpointList'][0])
+ {
+ list($response) = $this->v1EndpointListWithHttpInfo($app_id, $limit, $iterator, $order, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EndpointListWithHttpInfo
+ *
+ * List Endpoints
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointList'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\ListResponseEndpointOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EndpointListWithHttpInfo($app_id, $limit = null, $iterator = null, $order = null, string $contentType = self::contentTypes['v1EndpointList'][0])
+ {
+ $request = $this->v1EndpointListRequest($app_id, $limit, $iterator, $order, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\ListResponseEndpointOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ListResponseEndpointOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ListResponseEndpointOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\ListResponseEndpointOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ListResponseEndpointOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EndpointListAsync
+ *
+ * List Endpoints
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointList'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointListAsync($app_id, $limit = null, $iterator = null, $order = null, string $contentType = self::contentTypes['v1EndpointList'][0])
+ {
+ return $this->v1EndpointListAsyncWithHttpInfo($app_id, $limit, $iterator, $order, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EndpointListAsyncWithHttpInfo
+ *
+ * List Endpoints
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointList'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointListAsyncWithHttpInfo($app_id, $limit = null, $iterator = null, $order = null, string $contentType = self::contentTypes['v1EndpointList'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\ListResponseEndpointOut';
+ $request = $this->v1EndpointListRequest($app_id, $limit, $iterator, $order, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EndpointList'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointList'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EndpointListRequest($app_id, $limit = null, $iterator = null, $order = null, string $contentType = self::contentTypes['v1EndpointList'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1EndpointList'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointList, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointList, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling EndpointApi.v1EndpointList, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ if ($limit !== null && $limit > 250) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling EndpointApi.v1EndpointList, must be smaller than or equal to 250.');
+ }
+ if ($limit !== null && $limit < 1) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling EndpointApi.v1EndpointList, must be bigger than or equal to 1.');
+ }
+
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $iterator,
+ 'iterator', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $order,
+ 'order', // param base name
+ 'Ordering', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EndpointPatch
+ *
+ * Patch Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointPatch $endpoint_patch endpoint_patch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointPatch'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\EndpointOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EndpointPatch($app_id, $endpoint_id, $endpoint_patch, string $contentType = self::contentTypes['v1EndpointPatch'][0])
+ {
+ list($response) = $this->v1EndpointPatchWithHttpInfo($app_id, $endpoint_id, $endpoint_patch, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EndpointPatchWithHttpInfo
+ *
+ * Patch Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointPatch $endpoint_patch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointPatch'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\EndpointOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EndpointPatchWithHttpInfo($app_id, $endpoint_id, $endpoint_patch, string $contentType = self::contentTypes['v1EndpointPatch'][0])
+ {
+ $request = $this->v1EndpointPatchRequest($app_id, $endpoint_id, $endpoint_patch, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\EndpointOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\EndpointOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\EndpointOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\EndpointOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\EndpointOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EndpointPatchAsync
+ *
+ * Patch Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointPatch $endpoint_patch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointPatch'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointPatchAsync($app_id, $endpoint_id, $endpoint_patch, string $contentType = self::contentTypes['v1EndpointPatch'][0])
+ {
+ return $this->v1EndpointPatchAsyncWithHttpInfo($app_id, $endpoint_id, $endpoint_patch, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EndpointPatchAsyncWithHttpInfo
+ *
+ * Patch Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointPatch $endpoint_patch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointPatch'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointPatchAsyncWithHttpInfo($app_id, $endpoint_id, $endpoint_patch, string $contentType = self::contentTypes['v1EndpointPatch'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\EndpointOut';
+ $request = $this->v1EndpointPatchRequest($app_id, $endpoint_id, $endpoint_patch, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EndpointPatch'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointPatch $endpoint_patch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointPatch'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EndpointPatchRequest($app_id, $endpoint_id, $endpoint_patch, string $contentType = self::contentTypes['v1EndpointPatch'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1EndpointPatch'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointPatch, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointPatch, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling EndpointApi.v1EndpointPatch, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1EndpointPatch'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointPatch, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointPatch, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling EndpointApi.v1EndpointPatch, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_patch' is set
+ if ($endpoint_patch === null || (is_array($endpoint_patch) && count($endpoint_patch) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_patch when calling v1EndpointPatch'
+ );
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($endpoint_patch)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($endpoint_patch));
+ } else {
+ $httpBody = $endpoint_patch;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'PATCH',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EndpointPatchHeaders
+ *
+ * Patch Endpoint Headers
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointHeadersPatchIn $endpoint_headers_patch_in endpoint_headers_patch_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointPatchHeaders'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return void
+ */
+ public function v1EndpointPatchHeaders($app_id, $endpoint_id, $endpoint_headers_patch_in, string $contentType = self::contentTypes['v1EndpointPatchHeaders'][0])
+ {
+ $this->v1EndpointPatchHeadersWithHttpInfo($app_id, $endpoint_id, $endpoint_headers_patch_in, $contentType);
+ }
+
+ /**
+ * Operation v1EndpointPatchHeadersWithHttpInfo
+ *
+ * Patch Endpoint Headers
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointHeadersPatchIn $endpoint_headers_patch_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointPatchHeaders'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EndpointPatchHeadersWithHttpInfo($app_id, $endpoint_id, $endpoint_headers_patch_in, string $contentType = self::contentTypes['v1EndpointPatchHeaders'][0])
+ {
+ $request = $this->v1EndpointPatchHeadersRequest($app_id, $endpoint_id, $endpoint_headers_patch_in, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EndpointPatchHeadersAsync
+ *
+ * Patch Endpoint Headers
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointHeadersPatchIn $endpoint_headers_patch_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointPatchHeaders'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointPatchHeadersAsync($app_id, $endpoint_id, $endpoint_headers_patch_in, string $contentType = self::contentTypes['v1EndpointPatchHeaders'][0])
+ {
+ return $this->v1EndpointPatchHeadersAsyncWithHttpInfo($app_id, $endpoint_id, $endpoint_headers_patch_in, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EndpointPatchHeadersAsyncWithHttpInfo
+ *
+ * Patch Endpoint Headers
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointHeadersPatchIn $endpoint_headers_patch_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointPatchHeaders'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointPatchHeadersAsyncWithHttpInfo($app_id, $endpoint_id, $endpoint_headers_patch_in, string $contentType = self::contentTypes['v1EndpointPatchHeaders'][0])
+ {
+ $returnType = '';
+ $request = $this->v1EndpointPatchHeadersRequest($app_id, $endpoint_id, $endpoint_headers_patch_in, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $response->getStatusCode(), $response->getHeaders()];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EndpointPatchHeaders'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointHeadersPatchIn $endpoint_headers_patch_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointPatchHeaders'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EndpointPatchHeadersRequest($app_id, $endpoint_id, $endpoint_headers_patch_in, string $contentType = self::contentTypes['v1EndpointPatchHeaders'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1EndpointPatchHeaders'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointPatchHeaders, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointPatchHeaders, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling EndpointApi.v1EndpointPatchHeaders, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1EndpointPatchHeaders'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointPatchHeaders, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointPatchHeaders, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling EndpointApi.v1EndpointPatchHeaders, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_headers_patch_in' is set
+ if ($endpoint_headers_patch_in === null || (is_array($endpoint_headers_patch_in) && count($endpoint_headers_patch_in) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_headers_patch_in when calling v1EndpointPatchHeaders'
+ );
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($endpoint_headers_patch_in)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($endpoint_headers_patch_in));
+ } else {
+ $httpBody = $endpoint_headers_patch_in;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'PATCH',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EndpointRecover
+ *
+ * Recover Failed Webhooks
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\RecoverIn $recover_in recover_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointRecover'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\RecoverOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EndpointRecover($app_id, $endpoint_id, $recover_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointRecover'][0])
+ {
+ list($response) = $this->v1EndpointRecoverWithHttpInfo($app_id, $endpoint_id, $recover_in, $idempotency_key, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EndpointRecoverWithHttpInfo
+ *
+ * Recover Failed Webhooks
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\RecoverIn $recover_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointRecover'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\RecoverOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EndpointRecoverWithHttpInfo($app_id, $endpoint_id, $recover_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointRecover'][0])
+ {
+ $request = $this->v1EndpointRecoverRequest($app_id, $endpoint_id, $recover_in, $idempotency_key, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 202:
+ if ('\Svix\ApiClient\Model\RecoverOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\RecoverOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\RecoverOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\RecoverOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 202:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\RecoverOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EndpointRecoverAsync
+ *
+ * Recover Failed Webhooks
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\RecoverIn $recover_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointRecover'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointRecoverAsync($app_id, $endpoint_id, $recover_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointRecover'][0])
+ {
+ return $this->v1EndpointRecoverAsyncWithHttpInfo($app_id, $endpoint_id, $recover_in, $idempotency_key, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EndpointRecoverAsyncWithHttpInfo
+ *
+ * Recover Failed Webhooks
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\RecoverIn $recover_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointRecover'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointRecoverAsyncWithHttpInfo($app_id, $endpoint_id, $recover_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointRecover'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\RecoverOut';
+ $request = $this->v1EndpointRecoverRequest($app_id, $endpoint_id, $recover_in, $idempotency_key, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EndpointRecover'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\RecoverIn $recover_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointRecover'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EndpointRecoverRequest($app_id, $endpoint_id, $recover_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointRecover'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1EndpointRecover'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointRecover, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointRecover, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling EndpointApi.v1EndpointRecover, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1EndpointRecover'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointRecover, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointRecover, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling EndpointApi.v1EndpointRecover, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'recover_in' is set
+ if ($recover_in === null || (is_array($recover_in) && count($recover_in) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $recover_in when calling v1EndpointRecover'
+ );
+ }
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+ // header params
+ if ($idempotency_key !== null) {
+ $headerParams['idempotency-key'] = ObjectSerializer::toHeaderValue($idempotency_key);
+ }
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($recover_in)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($recover_in));
+ } else {
+ $httpBody = $recover_in;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EndpointReplay
+ *
+ * Replay Missing Webhooks
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ReplayIn $replay_in replay_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointReplay'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\ReplayOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EndpointReplay($app_id, $endpoint_id, $replay_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointReplay'][0])
+ {
+ list($response) = $this->v1EndpointReplayWithHttpInfo($app_id, $endpoint_id, $replay_in, $idempotency_key, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EndpointReplayWithHttpInfo
+ *
+ * Replay Missing Webhooks
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ReplayIn $replay_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointReplay'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\ReplayOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EndpointReplayWithHttpInfo($app_id, $endpoint_id, $replay_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointReplay'][0])
+ {
+ $request = $this->v1EndpointReplayRequest($app_id, $endpoint_id, $replay_in, $idempotency_key, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 202:
+ if ('\Svix\ApiClient\Model\ReplayOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ReplayOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ReplayOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\ReplayOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 202:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ReplayOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EndpointReplayAsync
+ *
+ * Replay Missing Webhooks
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ReplayIn $replay_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointReplay'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointReplayAsync($app_id, $endpoint_id, $replay_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointReplay'][0])
+ {
+ return $this->v1EndpointReplayAsyncWithHttpInfo($app_id, $endpoint_id, $replay_in, $idempotency_key, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EndpointReplayAsyncWithHttpInfo
+ *
+ * Replay Missing Webhooks
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ReplayIn $replay_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointReplay'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointReplayAsyncWithHttpInfo($app_id, $endpoint_id, $replay_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointReplay'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\ReplayOut';
+ $request = $this->v1EndpointReplayRequest($app_id, $endpoint_id, $replay_in, $idempotency_key, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EndpointReplay'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\ReplayIn $replay_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointReplay'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EndpointReplayRequest($app_id, $endpoint_id, $replay_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointReplay'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1EndpointReplay'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointReplay, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointReplay, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling EndpointApi.v1EndpointReplay, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1EndpointReplay'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointReplay, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointReplay, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling EndpointApi.v1EndpointReplay, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'replay_in' is set
+ if ($replay_in === null || (is_array($replay_in) && count($replay_in) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $replay_in when calling v1EndpointReplay'
+ );
+ }
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+ // header params
+ if ($idempotency_key !== null) {
+ $headerParams['idempotency-key'] = ObjectSerializer::toHeaderValue($idempotency_key);
+ }
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($replay_in)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($replay_in));
+ } else {
+ $httpBody = $replay_in;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EndpointRotateSecret
+ *
+ * Rotate Endpoint Secret
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointSecretRotateIn $endpoint_secret_rotate_in endpoint_secret_rotate_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointRotateSecret'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return void
+ */
+ public function v1EndpointRotateSecret($app_id, $endpoint_id, $endpoint_secret_rotate_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointRotateSecret'][0])
+ {
+ $this->v1EndpointRotateSecretWithHttpInfo($app_id, $endpoint_id, $endpoint_secret_rotate_in, $idempotency_key, $contentType);
+ }
+
+ /**
+ * Operation v1EndpointRotateSecretWithHttpInfo
+ *
+ * Rotate Endpoint Secret
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointSecretRotateIn $endpoint_secret_rotate_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointRotateSecret'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EndpointRotateSecretWithHttpInfo($app_id, $endpoint_id, $endpoint_secret_rotate_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointRotateSecret'][0])
+ {
+ $request = $this->v1EndpointRotateSecretRequest($app_id, $endpoint_id, $endpoint_secret_rotate_in, $idempotency_key, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EndpointRotateSecretAsync
+ *
+ * Rotate Endpoint Secret
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointSecretRotateIn $endpoint_secret_rotate_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointRotateSecret'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointRotateSecretAsync($app_id, $endpoint_id, $endpoint_secret_rotate_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointRotateSecret'][0])
+ {
+ return $this->v1EndpointRotateSecretAsyncWithHttpInfo($app_id, $endpoint_id, $endpoint_secret_rotate_in, $idempotency_key, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EndpointRotateSecretAsyncWithHttpInfo
+ *
+ * Rotate Endpoint Secret
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointSecretRotateIn $endpoint_secret_rotate_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointRotateSecret'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointRotateSecretAsyncWithHttpInfo($app_id, $endpoint_id, $endpoint_secret_rotate_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointRotateSecret'][0])
+ {
+ $returnType = '';
+ $request = $this->v1EndpointRotateSecretRequest($app_id, $endpoint_id, $endpoint_secret_rotate_in, $idempotency_key, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $response->getStatusCode(), $response->getHeaders()];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EndpointRotateSecret'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointSecretRotateIn $endpoint_secret_rotate_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointRotateSecret'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EndpointRotateSecretRequest($app_id, $endpoint_id, $endpoint_secret_rotate_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointRotateSecret'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1EndpointRotateSecret'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointRotateSecret, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointRotateSecret, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling EndpointApi.v1EndpointRotateSecret, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1EndpointRotateSecret'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointRotateSecret, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointRotateSecret, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling EndpointApi.v1EndpointRotateSecret, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_secret_rotate_in' is set
+ if ($endpoint_secret_rotate_in === null || (is_array($endpoint_secret_rotate_in) && count($endpoint_secret_rotate_in) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_secret_rotate_in when calling v1EndpointRotateSecret'
+ );
+ }
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+ // header params
+ if ($idempotency_key !== null) {
+ $headerParams['idempotency-key'] = ObjectSerializer::toHeaderValue($idempotency_key);
+ }
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($endpoint_secret_rotate_in)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($endpoint_secret_rotate_in));
+ } else {
+ $httpBody = $endpoint_secret_rotate_in;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EndpointSendExample
+ *
+ * Send Event Type Example Message
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EventExampleIn $event_example_in event_example_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointSendExample'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\MessageOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EndpointSendExample($app_id, $endpoint_id, $event_example_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointSendExample'][0])
+ {
+ list($response) = $this->v1EndpointSendExampleWithHttpInfo($app_id, $endpoint_id, $event_example_in, $idempotency_key, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EndpointSendExampleWithHttpInfo
+ *
+ * Send Event Type Example Message
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EventExampleIn $event_example_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointSendExample'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\MessageOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EndpointSendExampleWithHttpInfo($app_id, $endpoint_id, $event_example_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointSendExample'][0])
+ {
+ $request = $this->v1EndpointSendExampleRequest($app_id, $endpoint_id, $event_example_in, $idempotency_key, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 202:
+ if ('\Svix\ApiClient\Model\MessageOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\MessageOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\MessageOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\MessageOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 202:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\MessageOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EndpointSendExampleAsync
+ *
+ * Send Event Type Example Message
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EventExampleIn $event_example_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointSendExample'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointSendExampleAsync($app_id, $endpoint_id, $event_example_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointSendExample'][0])
+ {
+ return $this->v1EndpointSendExampleAsyncWithHttpInfo($app_id, $endpoint_id, $event_example_in, $idempotency_key, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EndpointSendExampleAsyncWithHttpInfo
+ *
+ * Send Event Type Example Message
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EventExampleIn $event_example_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointSendExample'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointSendExampleAsyncWithHttpInfo($app_id, $endpoint_id, $event_example_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointSendExample'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\MessageOut';
+ $request = $this->v1EndpointSendExampleRequest($app_id, $endpoint_id, $event_example_in, $idempotency_key, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EndpointSendExample'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EventExampleIn $event_example_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointSendExample'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EndpointSendExampleRequest($app_id, $endpoint_id, $event_example_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EndpointSendExample'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1EndpointSendExample'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointSendExample, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointSendExample, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling EndpointApi.v1EndpointSendExample, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1EndpointSendExample'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointSendExample, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointSendExample, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling EndpointApi.v1EndpointSendExample, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'event_example_in' is set
+ if ($event_example_in === null || (is_array($event_example_in) && count($event_example_in) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $event_example_in when calling v1EndpointSendExample'
+ );
+ }
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+ // header params
+ if ($idempotency_key !== null) {
+ $headerParams['idempotency-key'] = ObjectSerializer::toHeaderValue($idempotency_key);
+ }
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($event_example_in)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($event_example_in));
+ } else {
+ $httpBody = $event_example_in;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EndpointTransformationGet
+ *
+ * Get Endpoint Transformation
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointTransformationGet'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\EndpointTransformationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EndpointTransformationGet($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointTransformationGet'][0])
+ {
+ list($response) = $this->v1EndpointTransformationGetWithHttpInfo($app_id, $endpoint_id, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EndpointTransformationGetWithHttpInfo
+ *
+ * Get Endpoint Transformation
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointTransformationGet'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\EndpointTransformationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EndpointTransformationGetWithHttpInfo($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointTransformationGet'][0])
+ {
+ $request = $this->v1EndpointTransformationGetRequest($app_id, $endpoint_id, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\EndpointTransformationOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\EndpointTransformationOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\EndpointTransformationOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\EndpointTransformationOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\EndpointTransformationOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EndpointTransformationGetAsync
+ *
+ * Get Endpoint Transformation
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointTransformationGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointTransformationGetAsync($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointTransformationGet'][0])
+ {
+ return $this->v1EndpointTransformationGetAsyncWithHttpInfo($app_id, $endpoint_id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EndpointTransformationGetAsyncWithHttpInfo
+ *
+ * Get Endpoint Transformation
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointTransformationGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointTransformationGetAsyncWithHttpInfo($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointTransformationGet'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\EndpointTransformationOut';
+ $request = $this->v1EndpointTransformationGetRequest($app_id, $endpoint_id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EndpointTransformationGet'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointTransformationGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EndpointTransformationGetRequest($app_id, $endpoint_id, string $contentType = self::contentTypes['v1EndpointTransformationGet'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1EndpointTransformationGet'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointTransformationGet, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointTransformationGet, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling EndpointApi.v1EndpointTransformationGet, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1EndpointTransformationGet'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointTransformationGet, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointTransformationGet, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling EndpointApi.v1EndpointTransformationGet, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EndpointTransformationPartialUpdate
+ *
+ * Set Endpoint Transformation
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointTransformationIn $endpoint_transformation_in endpoint_transformation_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointTransformationPartialUpdate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return void
+ */
+ public function v1EndpointTransformationPartialUpdate($app_id, $endpoint_id, $endpoint_transformation_in, string $contentType = self::contentTypes['v1EndpointTransformationPartialUpdate'][0])
+ {
+ $this->v1EndpointTransformationPartialUpdateWithHttpInfo($app_id, $endpoint_id, $endpoint_transformation_in, $contentType);
+ }
+
+ /**
+ * Operation v1EndpointTransformationPartialUpdateWithHttpInfo
+ *
+ * Set Endpoint Transformation
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointTransformationIn $endpoint_transformation_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointTransformationPartialUpdate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EndpointTransformationPartialUpdateWithHttpInfo($app_id, $endpoint_id, $endpoint_transformation_in, string $contentType = self::contentTypes['v1EndpointTransformationPartialUpdate'][0])
+ {
+ $request = $this->v1EndpointTransformationPartialUpdateRequest($app_id, $endpoint_id, $endpoint_transformation_in, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EndpointTransformationPartialUpdateAsync
+ *
+ * Set Endpoint Transformation
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointTransformationIn $endpoint_transformation_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointTransformationPartialUpdate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointTransformationPartialUpdateAsync($app_id, $endpoint_id, $endpoint_transformation_in, string $contentType = self::contentTypes['v1EndpointTransformationPartialUpdate'][0])
+ {
+ return $this->v1EndpointTransformationPartialUpdateAsyncWithHttpInfo($app_id, $endpoint_id, $endpoint_transformation_in, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EndpointTransformationPartialUpdateAsyncWithHttpInfo
+ *
+ * Set Endpoint Transformation
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointTransformationIn $endpoint_transformation_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointTransformationPartialUpdate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointTransformationPartialUpdateAsyncWithHttpInfo($app_id, $endpoint_id, $endpoint_transformation_in, string $contentType = self::contentTypes['v1EndpointTransformationPartialUpdate'][0])
+ {
+ $returnType = '';
+ $request = $this->v1EndpointTransformationPartialUpdateRequest($app_id, $endpoint_id, $endpoint_transformation_in, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $response->getStatusCode(), $response->getHeaders()];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EndpointTransformationPartialUpdate'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointTransformationIn $endpoint_transformation_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointTransformationPartialUpdate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EndpointTransformationPartialUpdateRequest($app_id, $endpoint_id, $endpoint_transformation_in, string $contentType = self::contentTypes['v1EndpointTransformationPartialUpdate'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1EndpointTransformationPartialUpdate'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointTransformationPartialUpdate, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointTransformationPartialUpdate, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling EndpointApi.v1EndpointTransformationPartialUpdate, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1EndpointTransformationPartialUpdate'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointTransformationPartialUpdate, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointTransformationPartialUpdate, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling EndpointApi.v1EndpointTransformationPartialUpdate, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_transformation_in' is set
+ if ($endpoint_transformation_in === null || (is_array($endpoint_transformation_in) && count($endpoint_transformation_in) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_transformation_in when calling v1EndpointTransformationPartialUpdate'
+ );
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($endpoint_transformation_in)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($endpoint_transformation_in));
+ } else {
+ $httpBody = $endpoint_transformation_in;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'PATCH',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EndpointUpdate
+ *
+ * Update Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointUpdate $endpoint_update endpoint_update (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointUpdate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\EndpointOut|\Svix\ApiClient\Model\EndpointOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EndpointUpdate($app_id, $endpoint_id, $endpoint_update, string $contentType = self::contentTypes['v1EndpointUpdate'][0])
+ {
+ list($response) = $this->v1EndpointUpdateWithHttpInfo($app_id, $endpoint_id, $endpoint_update, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EndpointUpdateWithHttpInfo
+ *
+ * Update Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointUpdate $endpoint_update (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointUpdate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\EndpointOut|\Svix\ApiClient\Model\EndpointOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EndpointUpdateWithHttpInfo($app_id, $endpoint_id, $endpoint_update, string $contentType = self::contentTypes['v1EndpointUpdate'][0])
+ {
+ $request = $this->v1EndpointUpdateRequest($app_id, $endpoint_id, $endpoint_update, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\EndpointOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\EndpointOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\EndpointOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 201:
+ if ('\Svix\ApiClient\Model\EndpointOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\EndpointOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\EndpointOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\EndpointOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\EndpointOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\EndpointOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EndpointUpdateAsync
+ *
+ * Update Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointUpdate $endpoint_update (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointUpdate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointUpdateAsync($app_id, $endpoint_id, $endpoint_update, string $contentType = self::contentTypes['v1EndpointUpdate'][0])
+ {
+ return $this->v1EndpointUpdateAsyncWithHttpInfo($app_id, $endpoint_id, $endpoint_update, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EndpointUpdateAsyncWithHttpInfo
+ *
+ * Update Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointUpdate $endpoint_update (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointUpdate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointUpdateAsyncWithHttpInfo($app_id, $endpoint_id, $endpoint_update, string $contentType = self::contentTypes['v1EndpointUpdate'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\EndpointOut';
+ $request = $this->v1EndpointUpdateRequest($app_id, $endpoint_id, $endpoint_update, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EndpointUpdate'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointUpdate $endpoint_update (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointUpdate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EndpointUpdateRequest($app_id, $endpoint_id, $endpoint_update, string $contentType = self::contentTypes['v1EndpointUpdate'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1EndpointUpdate'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointUpdate, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointUpdate, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling EndpointApi.v1EndpointUpdate, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1EndpointUpdate'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointUpdate, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointUpdate, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling EndpointApi.v1EndpointUpdate, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_update' is set
+ if ($endpoint_update === null || (is_array($endpoint_update) && count($endpoint_update) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_update when calling v1EndpointUpdate'
+ );
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($endpoint_update)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($endpoint_update));
+ } else {
+ $httpBody = $endpoint_update;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'PUT',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EndpointUpdateHeaders
+ *
+ * Update Endpoint Headers
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointHeadersIn $endpoint_headers_in endpoint_headers_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointUpdateHeaders'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return void
+ */
+ public function v1EndpointUpdateHeaders($app_id, $endpoint_id, $endpoint_headers_in, string $contentType = self::contentTypes['v1EndpointUpdateHeaders'][0])
+ {
+ $this->v1EndpointUpdateHeadersWithHttpInfo($app_id, $endpoint_id, $endpoint_headers_in, $contentType);
+ }
+
+ /**
+ * Operation v1EndpointUpdateHeadersWithHttpInfo
+ *
+ * Update Endpoint Headers
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointHeadersIn $endpoint_headers_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointUpdateHeaders'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EndpointUpdateHeadersWithHttpInfo($app_id, $endpoint_id, $endpoint_headers_in, string $contentType = self::contentTypes['v1EndpointUpdateHeaders'][0])
+ {
+ $request = $this->v1EndpointUpdateHeadersRequest($app_id, $endpoint_id, $endpoint_headers_in, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EndpointUpdateHeadersAsync
+ *
+ * Update Endpoint Headers
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointHeadersIn $endpoint_headers_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointUpdateHeaders'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointUpdateHeadersAsync($app_id, $endpoint_id, $endpoint_headers_in, string $contentType = self::contentTypes['v1EndpointUpdateHeaders'][0])
+ {
+ return $this->v1EndpointUpdateHeadersAsyncWithHttpInfo($app_id, $endpoint_id, $endpoint_headers_in, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EndpointUpdateHeadersAsyncWithHttpInfo
+ *
+ * Update Endpoint Headers
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointHeadersIn $endpoint_headers_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointUpdateHeaders'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EndpointUpdateHeadersAsyncWithHttpInfo($app_id, $endpoint_id, $endpoint_headers_in, string $contentType = self::contentTypes['v1EndpointUpdateHeaders'][0])
+ {
+ $returnType = '';
+ $request = $this->v1EndpointUpdateHeadersRequest($app_id, $endpoint_id, $endpoint_headers_in, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $response->getStatusCode(), $response->getHeaders()];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EndpointUpdateHeaders'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param \Svix\ApiClient\Model\EndpointHeadersIn $endpoint_headers_in (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EndpointUpdateHeaders'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EndpointUpdateHeadersRequest($app_id, $endpoint_id, $endpoint_headers_in, string $contentType = self::contentTypes['v1EndpointUpdateHeaders'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1EndpointUpdateHeaders'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointUpdateHeaders, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling EndpointApi.v1EndpointUpdateHeaders, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling EndpointApi.v1EndpointUpdateHeaders, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1EndpointUpdateHeaders'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointUpdateHeaders, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling EndpointApi.v1EndpointUpdateHeaders, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling EndpointApi.v1EndpointUpdateHeaders, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_headers_in' is set
+ if ($endpoint_headers_in === null || (is_array($endpoint_headers_in) && count($endpoint_headers_in) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_headers_in when calling v1EndpointUpdateHeaders'
+ );
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($endpoint_headers_in)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($endpoint_headers_in));
+ } else {
+ $httpBody = $endpoint_headers_in;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'PUT',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Create http client option
+ *
+ * @throws \RuntimeException on file opening failure
+ * @return array of http client options
+ */
+ protected function createHttpClientOption()
+ {
+ $options = [];
+ if ($this->config->getDebug()) {
+ $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
+ if (!$options[RequestOptions::DEBUG]) {
+ throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
+ }
+ }
+
+ return $options;
+ }
+}
diff --git a/lib/Api/EventTypeApi.php b/lib/Api/EventTypeApi.php
new file mode 100644
index 0000000..ae5b005
--- /dev/null
+++ b/lib/Api/EventTypeApi.php
@@ -0,0 +1,3323 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Api;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Psr7\MultipartStream;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\RequestOptions;
+use Svix\ApiClient\ApiException;
+use Svix\ApiClient\Configuration;
+use Svix\ApiClient\HeaderSelector;
+use Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EventTypeApi Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ */
+class EventTypeApi
+{
+ /**
+ * @var ClientInterface
+ */
+ protected $client;
+
+ /**
+ * @var Configuration
+ */
+ protected $config;
+
+ /**
+ * @var HeaderSelector
+ */
+ protected $headerSelector;
+
+ /**
+ * @var int Host index
+ */
+ protected $hostIndex;
+
+ /** @var string[] $contentTypes **/
+ public const contentTypes = [
+ 'v1EventTypeCreate' => [
+ 'application/json',
+ ],
+ 'v1EventTypeDelete' => [
+ 'application/json',
+ ],
+ 'v1EventTypeGet' => [
+ 'application/json',
+ ],
+ 'v1EventTypeImportOpenapi' => [
+ 'application/json',
+ ],
+ 'v1EventTypeList' => [
+ 'application/json',
+ ],
+ 'v1EventTypePatch' => [
+ 'application/json',
+ ],
+ 'v1EventTypeUpdate' => [
+ 'application/json',
+ ],
+ ];
+
+/**
+ * @param ClientInterface $client
+ * @param Configuration $config
+ * @param HeaderSelector $selector
+ * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
+ */
+ public function __construct(
+ ClientInterface $client = null,
+ Configuration $config = null,
+ HeaderSelector $selector = null,
+ $hostIndex = 0
+ ) {
+ $this->client = $client ?: new Client();
+ $this->config = $config ?: new Configuration();
+ $this->headerSelector = $selector ?: new HeaderSelector();
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Set the host index
+ *
+ * @param int $hostIndex Host index (required)
+ */
+ public function setHostIndex($hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex()
+ {
+ return $this->hostIndex;
+ }
+
+ /**
+ * @return Configuration
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ /**
+ * Operation v1EventTypeCreate
+ *
+ * Create Event Type
+ *
+ * @param \Svix\ApiClient\Model\EventTypeIn $event_type_in event_type_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeCreate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\EventTypeOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EventTypeCreate($event_type_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EventTypeCreate'][0])
+ {
+ list($response) = $this->v1EventTypeCreateWithHttpInfo($event_type_in, $idempotency_key, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EventTypeCreateWithHttpInfo
+ *
+ * Create Event Type
+ *
+ * @param \Svix\ApiClient\Model\EventTypeIn $event_type_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeCreate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\EventTypeOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EventTypeCreateWithHttpInfo($event_type_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EventTypeCreate'][0])
+ {
+ $request = $this->v1EventTypeCreateRequest($event_type_in, $idempotency_key, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 201:
+ if ('\Svix\ApiClient\Model\EventTypeOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\EventTypeOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\EventTypeOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\EventTypeOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\EventTypeOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EventTypeCreateAsync
+ *
+ * Create Event Type
+ *
+ * @param \Svix\ApiClient\Model\EventTypeIn $event_type_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeCreate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EventTypeCreateAsync($event_type_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EventTypeCreate'][0])
+ {
+ return $this->v1EventTypeCreateAsyncWithHttpInfo($event_type_in, $idempotency_key, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EventTypeCreateAsyncWithHttpInfo
+ *
+ * Create Event Type
+ *
+ * @param \Svix\ApiClient\Model\EventTypeIn $event_type_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeCreate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EventTypeCreateAsyncWithHttpInfo($event_type_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EventTypeCreate'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\EventTypeOut';
+ $request = $this->v1EventTypeCreateRequest($event_type_in, $idempotency_key, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EventTypeCreate'
+ *
+ * @param \Svix\ApiClient\Model\EventTypeIn $event_type_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeCreate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EventTypeCreateRequest($event_type_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EventTypeCreate'][0])
+ {
+
+ // verify the required parameter 'event_type_in' is set
+ if ($event_type_in === null || (is_array($event_type_in) && count($event_type_in) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $event_type_in when calling v1EventTypeCreate'
+ );
+ }
+
+
+
+ $resourcePath = '/api/v1/event-type/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+ // header params
+ if ($idempotency_key !== null) {
+ $headerParams['idempotency-key'] = ObjectSerializer::toHeaderValue($idempotency_key);
+ }
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($event_type_in)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($event_type_in));
+ } else {
+ $httpBody = $event_type_in;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EventTypeDelete
+ *
+ * Delete Event Type
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param bool $expunge By default event types are archived when \"deleted\". Passing this to `true` deletes them entirely. (optional, default to false)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeDelete'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return void
+ */
+ public function v1EventTypeDelete($event_type_name, $expunge = false, string $contentType = self::contentTypes['v1EventTypeDelete'][0])
+ {
+ $this->v1EventTypeDeleteWithHttpInfo($event_type_name, $expunge, $contentType);
+ }
+
+ /**
+ * Operation v1EventTypeDeleteWithHttpInfo
+ *
+ * Delete Event Type
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param bool $expunge By default event types are archived when \"deleted\". Passing this to `true` deletes them entirely. (optional, default to false)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeDelete'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EventTypeDeleteWithHttpInfo($event_type_name, $expunge = false, string $contentType = self::contentTypes['v1EventTypeDelete'][0])
+ {
+ $request = $this->v1EventTypeDeleteRequest($event_type_name, $expunge, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EventTypeDeleteAsync
+ *
+ * Delete Event Type
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param bool $expunge By default event types are archived when \"deleted\". Passing this to `true` deletes them entirely. (optional, default to false)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeDelete'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EventTypeDeleteAsync($event_type_name, $expunge = false, string $contentType = self::contentTypes['v1EventTypeDelete'][0])
+ {
+ return $this->v1EventTypeDeleteAsyncWithHttpInfo($event_type_name, $expunge, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EventTypeDeleteAsyncWithHttpInfo
+ *
+ * Delete Event Type
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param bool $expunge By default event types are archived when \"deleted\". Passing this to `true` deletes them entirely. (optional, default to false)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeDelete'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EventTypeDeleteAsyncWithHttpInfo($event_type_name, $expunge = false, string $contentType = self::contentTypes['v1EventTypeDelete'][0])
+ {
+ $returnType = '';
+ $request = $this->v1EventTypeDeleteRequest($event_type_name, $expunge, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $response->getStatusCode(), $response->getHeaders()];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EventTypeDelete'
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param bool $expunge By default event types are archived when \"deleted\". Passing this to `true` deletes them entirely. (optional, default to false)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeDelete'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EventTypeDeleteRequest($event_type_name, $expunge = false, string $contentType = self::contentTypes['v1EventTypeDelete'][0])
+ {
+
+ // verify the required parameter 'event_type_name' is set
+ if ($event_type_name === null || (is_array($event_type_name) && count($event_type_name) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $event_type_name when calling v1EventTypeDelete'
+ );
+ }
+ if (strlen($event_type_name) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$event_type_name" when calling EventTypeApi.v1EventTypeDelete, must be smaller than or equal to 256.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $event_type_name)) {
+ throw new \InvalidArgumentException("invalid value for \"event_type_name\" when calling EventTypeApi.v1EventTypeDelete, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+
+ $resourcePath = '/api/v1/event-type/{event_type_name}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $expunge,
+ 'expunge', // param base name
+ 'boolean', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($event_type_name !== null) {
+ $resourcePath = str_replace(
+ '{' . 'event_type_name' . '}',
+ ObjectSerializer::toPathValue($event_type_name),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'DELETE',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EventTypeGet
+ *
+ * Get Event Type
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeGet'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\EventTypeOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EventTypeGet($event_type_name, string $contentType = self::contentTypes['v1EventTypeGet'][0])
+ {
+ list($response) = $this->v1EventTypeGetWithHttpInfo($event_type_name, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EventTypeGetWithHttpInfo
+ *
+ * Get Event Type
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeGet'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\EventTypeOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EventTypeGetWithHttpInfo($event_type_name, string $contentType = self::contentTypes['v1EventTypeGet'][0])
+ {
+ $request = $this->v1EventTypeGetRequest($event_type_name, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\EventTypeOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\EventTypeOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\EventTypeOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\EventTypeOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\EventTypeOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EventTypeGetAsync
+ *
+ * Get Event Type
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EventTypeGetAsync($event_type_name, string $contentType = self::contentTypes['v1EventTypeGet'][0])
+ {
+ return $this->v1EventTypeGetAsyncWithHttpInfo($event_type_name, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EventTypeGetAsyncWithHttpInfo
+ *
+ * Get Event Type
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EventTypeGetAsyncWithHttpInfo($event_type_name, string $contentType = self::contentTypes['v1EventTypeGet'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\EventTypeOut';
+ $request = $this->v1EventTypeGetRequest($event_type_name, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EventTypeGet'
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EventTypeGetRequest($event_type_name, string $contentType = self::contentTypes['v1EventTypeGet'][0])
+ {
+
+ // verify the required parameter 'event_type_name' is set
+ if ($event_type_name === null || (is_array($event_type_name) && count($event_type_name) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $event_type_name when calling v1EventTypeGet'
+ );
+ }
+ if (strlen($event_type_name) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$event_type_name" when calling EventTypeApi.v1EventTypeGet, must be smaller than or equal to 256.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $event_type_name)) {
+ throw new \InvalidArgumentException("invalid value for \"event_type_name\" when calling EventTypeApi.v1EventTypeGet, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+ $resourcePath = '/api/v1/event-type/{event_type_name}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($event_type_name !== null) {
+ $resourcePath = str_replace(
+ '{' . 'event_type_name' . '}',
+ ObjectSerializer::toPathValue($event_type_name),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EventTypeImportOpenapi
+ *
+ * Event Type Import From Openapi
+ *
+ * @param \Svix\ApiClient\Model\EventTypeImportOpenApiIn $event_type_import_open_api_in Import a list of event types from webhooks defined in an OpenAPI spec. The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**. (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeImportOpenapi'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\EventTypeImportOpenApiOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EventTypeImportOpenapi($event_type_import_open_api_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EventTypeImportOpenapi'][0])
+ {
+ list($response) = $this->v1EventTypeImportOpenapiWithHttpInfo($event_type_import_open_api_in, $idempotency_key, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EventTypeImportOpenapiWithHttpInfo
+ *
+ * Event Type Import From Openapi
+ *
+ * @param \Svix\ApiClient\Model\EventTypeImportOpenApiIn $event_type_import_open_api_in Import a list of event types from webhooks defined in an OpenAPI spec. The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**. (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeImportOpenapi'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\EventTypeImportOpenApiOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EventTypeImportOpenapiWithHttpInfo($event_type_import_open_api_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EventTypeImportOpenapi'][0])
+ {
+ $request = $this->v1EventTypeImportOpenapiRequest($event_type_import_open_api_in, $idempotency_key, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\EventTypeImportOpenApiOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\EventTypeImportOpenApiOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\EventTypeImportOpenApiOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\EventTypeImportOpenApiOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\EventTypeImportOpenApiOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EventTypeImportOpenapiAsync
+ *
+ * Event Type Import From Openapi
+ *
+ * @param \Svix\ApiClient\Model\EventTypeImportOpenApiIn $event_type_import_open_api_in Import a list of event types from webhooks defined in an OpenAPI spec. The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**. (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeImportOpenapi'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EventTypeImportOpenapiAsync($event_type_import_open_api_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EventTypeImportOpenapi'][0])
+ {
+ return $this->v1EventTypeImportOpenapiAsyncWithHttpInfo($event_type_import_open_api_in, $idempotency_key, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EventTypeImportOpenapiAsyncWithHttpInfo
+ *
+ * Event Type Import From Openapi
+ *
+ * @param \Svix\ApiClient\Model\EventTypeImportOpenApiIn $event_type_import_open_api_in Import a list of event types from webhooks defined in an OpenAPI spec. The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**. (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeImportOpenapi'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EventTypeImportOpenapiAsyncWithHttpInfo($event_type_import_open_api_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EventTypeImportOpenapi'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\EventTypeImportOpenApiOut';
+ $request = $this->v1EventTypeImportOpenapiRequest($event_type_import_open_api_in, $idempotency_key, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EventTypeImportOpenapi'
+ *
+ * @param \Svix\ApiClient\Model\EventTypeImportOpenApiIn $event_type_import_open_api_in Import a list of event types from webhooks defined in an OpenAPI spec. The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**. (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeImportOpenapi'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EventTypeImportOpenapiRequest($event_type_import_open_api_in, $idempotency_key = null, string $contentType = self::contentTypes['v1EventTypeImportOpenapi'][0])
+ {
+
+ // verify the required parameter 'event_type_import_open_api_in' is set
+ if ($event_type_import_open_api_in === null || (is_array($event_type_import_open_api_in) && count($event_type_import_open_api_in) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $event_type_import_open_api_in when calling v1EventTypeImportOpenapi'
+ );
+ }
+
+
+
+ $resourcePath = '/api/v1/event-type/import/openapi/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+ // header params
+ if ($idempotency_key !== null) {
+ $headerParams['idempotency-key'] = ObjectSerializer::toHeaderValue($idempotency_key);
+ }
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($event_type_import_open_api_in)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($event_type_import_open_api_in));
+ } else {
+ $httpBody = $event_type_import_open_api_in;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EventTypeList
+ *
+ * List Event Types
+ *
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param bool $include_archived When `true` archived (deleted but not expunged) items are included in the response (optional, default to false)
+ * @param bool $with_content When `true` the full item (including the schema) is included in the response (optional, default to false)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeList'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\ListResponseEventTypeOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EventTypeList($limit = null, $iterator = null, $order = null, $include_archived = false, $with_content = false, string $contentType = self::contentTypes['v1EventTypeList'][0])
+ {
+ list($response) = $this->v1EventTypeListWithHttpInfo($limit, $iterator, $order, $include_archived, $with_content, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EventTypeListWithHttpInfo
+ *
+ * List Event Types
+ *
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param bool $include_archived When `true` archived (deleted but not expunged) items are included in the response (optional, default to false)
+ * @param bool $with_content When `true` the full item (including the schema) is included in the response (optional, default to false)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeList'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\ListResponseEventTypeOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EventTypeListWithHttpInfo($limit = null, $iterator = null, $order = null, $include_archived = false, $with_content = false, string $contentType = self::contentTypes['v1EventTypeList'][0])
+ {
+ $request = $this->v1EventTypeListRequest($limit, $iterator, $order, $include_archived, $with_content, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\ListResponseEventTypeOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ListResponseEventTypeOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ListResponseEventTypeOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\ListResponseEventTypeOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ListResponseEventTypeOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EventTypeListAsync
+ *
+ * List Event Types
+ *
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param bool $include_archived When `true` archived (deleted but not expunged) items are included in the response (optional, default to false)
+ * @param bool $with_content When `true` the full item (including the schema) is included in the response (optional, default to false)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeList'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EventTypeListAsync($limit = null, $iterator = null, $order = null, $include_archived = false, $with_content = false, string $contentType = self::contentTypes['v1EventTypeList'][0])
+ {
+ return $this->v1EventTypeListAsyncWithHttpInfo($limit, $iterator, $order, $include_archived, $with_content, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EventTypeListAsyncWithHttpInfo
+ *
+ * List Event Types
+ *
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param bool $include_archived When `true` archived (deleted but not expunged) items are included in the response (optional, default to false)
+ * @param bool $with_content When `true` the full item (including the schema) is included in the response (optional, default to false)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeList'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EventTypeListAsyncWithHttpInfo($limit = null, $iterator = null, $order = null, $include_archived = false, $with_content = false, string $contentType = self::contentTypes['v1EventTypeList'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\ListResponseEventTypeOut';
+ $request = $this->v1EventTypeListRequest($limit, $iterator, $order, $include_archived, $with_content, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EventTypeList'
+ *
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param Ordering $order The sorting order of the returned items (optional)
+ * @param bool $include_archived When `true` archived (deleted but not expunged) items are included in the response (optional, default to false)
+ * @param bool $with_content When `true` the full item (including the schema) is included in the response (optional, default to false)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeList'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EventTypeListRequest($limit = null, $iterator = null, $order = null, $include_archived = false, $with_content = false, string $contentType = self::contentTypes['v1EventTypeList'][0])
+ {
+
+ if ($limit !== null && $limit > 250) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling EventTypeApi.v1EventTypeList, must be smaller than or equal to 250.');
+ }
+ if ($limit !== null && $limit < 1) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling EventTypeApi.v1EventTypeList, must be bigger than or equal to 1.');
+ }
+
+ if ($iterator !== null && strlen($iterator) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$iterator" when calling EventTypeApi.v1EventTypeList, must be smaller than or equal to 256.');
+ }
+ if ($iterator !== null && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $iterator)) {
+ throw new \InvalidArgumentException("invalid value for \"iterator\" when calling EventTypeApi.v1EventTypeList, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+
+
+
+ $resourcePath = '/api/v1/event-type/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $iterator,
+ 'iterator', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $order,
+ 'order', // param base name
+ 'Ordering', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $include_archived,
+ 'include_archived', // param base name
+ 'boolean', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $with_content,
+ 'with_content', // param base name
+ 'boolean', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EventTypePatch
+ *
+ * Patch Event Type
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param \Svix\ApiClient\Model\EventTypePatch $event_type_patch event_type_patch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypePatch'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\EventTypeOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EventTypePatch($event_type_name, $event_type_patch, string $contentType = self::contentTypes['v1EventTypePatch'][0])
+ {
+ list($response) = $this->v1EventTypePatchWithHttpInfo($event_type_name, $event_type_patch, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EventTypePatchWithHttpInfo
+ *
+ * Patch Event Type
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param \Svix\ApiClient\Model\EventTypePatch $event_type_patch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypePatch'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\EventTypeOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EventTypePatchWithHttpInfo($event_type_name, $event_type_patch, string $contentType = self::contentTypes['v1EventTypePatch'][0])
+ {
+ $request = $this->v1EventTypePatchRequest($event_type_name, $event_type_patch, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\EventTypeOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\EventTypeOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\EventTypeOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\EventTypeOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\EventTypeOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EventTypePatchAsync
+ *
+ * Patch Event Type
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param \Svix\ApiClient\Model\EventTypePatch $event_type_patch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypePatch'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EventTypePatchAsync($event_type_name, $event_type_patch, string $contentType = self::contentTypes['v1EventTypePatch'][0])
+ {
+ return $this->v1EventTypePatchAsyncWithHttpInfo($event_type_name, $event_type_patch, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EventTypePatchAsyncWithHttpInfo
+ *
+ * Patch Event Type
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param \Svix\ApiClient\Model\EventTypePatch $event_type_patch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypePatch'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EventTypePatchAsyncWithHttpInfo($event_type_name, $event_type_patch, string $contentType = self::contentTypes['v1EventTypePatch'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\EventTypeOut';
+ $request = $this->v1EventTypePatchRequest($event_type_name, $event_type_patch, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EventTypePatch'
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param \Svix\ApiClient\Model\EventTypePatch $event_type_patch (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypePatch'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EventTypePatchRequest($event_type_name, $event_type_patch, string $contentType = self::contentTypes['v1EventTypePatch'][0])
+ {
+
+ // verify the required parameter 'event_type_name' is set
+ if ($event_type_name === null || (is_array($event_type_name) && count($event_type_name) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $event_type_name when calling v1EventTypePatch'
+ );
+ }
+ if (strlen($event_type_name) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$event_type_name" when calling EventTypeApi.v1EventTypePatch, must be smaller than or equal to 256.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $event_type_name)) {
+ throw new \InvalidArgumentException("invalid value for \"event_type_name\" when calling EventTypeApi.v1EventTypePatch, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'event_type_patch' is set
+ if ($event_type_patch === null || (is_array($event_type_patch) && count($event_type_patch) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $event_type_patch when calling v1EventTypePatch'
+ );
+ }
+
+
+ $resourcePath = '/api/v1/event-type/{event_type_name}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($event_type_name !== null) {
+ $resourcePath = str_replace(
+ '{' . 'event_type_name' . '}',
+ ObjectSerializer::toPathValue($event_type_name),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($event_type_patch)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($event_type_patch));
+ } else {
+ $httpBody = $event_type_patch;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'PATCH',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1EventTypeUpdate
+ *
+ * Update Event Type
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param \Svix\ApiClient\Model\EventTypeUpdate $event_type_update event_type_update (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeUpdate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\EventTypeOut|\Svix\ApiClient\Model\EventTypeOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1EventTypeUpdate($event_type_name, $event_type_update, string $contentType = self::contentTypes['v1EventTypeUpdate'][0])
+ {
+ list($response) = $this->v1EventTypeUpdateWithHttpInfo($event_type_name, $event_type_update, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1EventTypeUpdateWithHttpInfo
+ *
+ * Update Event Type
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param \Svix\ApiClient\Model\EventTypeUpdate $event_type_update (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeUpdate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\EventTypeOut|\Svix\ApiClient\Model\EventTypeOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1EventTypeUpdateWithHttpInfo($event_type_name, $event_type_update, string $contentType = self::contentTypes['v1EventTypeUpdate'][0])
+ {
+ $request = $this->v1EventTypeUpdateRequest($event_type_name, $event_type_update, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\EventTypeOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\EventTypeOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\EventTypeOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 201:
+ if ('\Svix\ApiClient\Model\EventTypeOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\EventTypeOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\EventTypeOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\EventTypeOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\EventTypeOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\EventTypeOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1EventTypeUpdateAsync
+ *
+ * Update Event Type
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param \Svix\ApiClient\Model\EventTypeUpdate $event_type_update (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeUpdate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EventTypeUpdateAsync($event_type_name, $event_type_update, string $contentType = self::contentTypes['v1EventTypeUpdate'][0])
+ {
+ return $this->v1EventTypeUpdateAsyncWithHttpInfo($event_type_name, $event_type_update, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1EventTypeUpdateAsyncWithHttpInfo
+ *
+ * Update Event Type
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param \Svix\ApiClient\Model\EventTypeUpdate $event_type_update (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeUpdate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1EventTypeUpdateAsyncWithHttpInfo($event_type_name, $event_type_update, string $contentType = self::contentTypes['v1EventTypeUpdate'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\EventTypeOut';
+ $request = $this->v1EventTypeUpdateRequest($event_type_name, $event_type_update, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1EventTypeUpdate'
+ *
+ * @param string $event_type_name The event type's name (required)
+ * @param \Svix\ApiClient\Model\EventTypeUpdate $event_type_update (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1EventTypeUpdate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1EventTypeUpdateRequest($event_type_name, $event_type_update, string $contentType = self::contentTypes['v1EventTypeUpdate'][0])
+ {
+
+ // verify the required parameter 'event_type_name' is set
+ if ($event_type_name === null || (is_array($event_type_name) && count($event_type_name) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $event_type_name when calling v1EventTypeUpdate'
+ );
+ }
+ if (strlen($event_type_name) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$event_type_name" when calling EventTypeApi.v1EventTypeUpdate, must be smaller than or equal to 256.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $event_type_name)) {
+ throw new \InvalidArgumentException("invalid value for \"event_type_name\" when calling EventTypeApi.v1EventTypeUpdate, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'event_type_update' is set
+ if ($event_type_update === null || (is_array($event_type_update) && count($event_type_update) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $event_type_update when calling v1EventTypeUpdate'
+ );
+ }
+
+
+ $resourcePath = '/api/v1/event-type/{event_type_name}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($event_type_name !== null) {
+ $resourcePath = str_replace(
+ '{' . 'event_type_name' . '}',
+ ObjectSerializer::toPathValue($event_type_name),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($event_type_update)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($event_type_update));
+ } else {
+ $httpBody = $event_type_update;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'PUT',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Create http client option
+ *
+ * @throws \RuntimeException on file opening failure
+ * @return array of http client options
+ */
+ protected function createHttpClientOption()
+ {
+ $options = [];
+ if ($this->config->getDebug()) {
+ $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
+ if (!$options[RequestOptions::DEBUG]) {
+ throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
+ }
+ }
+
+ return $options;
+ }
+}
diff --git a/lib/Api/HealthApi.php b/lib/Api/HealthApi.php
new file mode 100644
index 0000000..0e609db
--- /dev/null
+++ b/lib/Api/HealthApi.php
@@ -0,0 +1,408 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Api;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Psr7\MultipartStream;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\RequestOptions;
+use Svix\ApiClient\ApiException;
+use Svix\ApiClient\Configuration;
+use Svix\ApiClient\HeaderSelector;
+use Svix\ApiClient\ObjectSerializer;
+
+/**
+ * HealthApi Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ */
+class HealthApi
+{
+ /**
+ * @var ClientInterface
+ */
+ protected $client;
+
+ /**
+ * @var Configuration
+ */
+ protected $config;
+
+ /**
+ * @var HeaderSelector
+ */
+ protected $headerSelector;
+
+ /**
+ * @var int Host index
+ */
+ protected $hostIndex;
+
+ /** @var string[] $contentTypes **/
+ public const contentTypes = [
+ 'v1HealthGet' => [
+ 'application/json',
+ ],
+ ];
+
+/**
+ * @param ClientInterface $client
+ * @param Configuration $config
+ * @param HeaderSelector $selector
+ * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
+ */
+ public function __construct(
+ ClientInterface $client = null,
+ Configuration $config = null,
+ HeaderSelector $selector = null,
+ $hostIndex = 0
+ ) {
+ $this->client = $client ?: new Client();
+ $this->config = $config ?: new Configuration();
+ $this->headerSelector = $selector ?: new HeaderSelector();
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Set the host index
+ *
+ * @param int $hostIndex Host index (required)
+ */
+ public function setHostIndex($hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex()
+ {
+ return $this->hostIndex;
+ }
+
+ /**
+ * @return Configuration
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ /**
+ * Operation v1HealthGet
+ *
+ * Health
+ *
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1HealthGet'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return void
+ */
+ public function v1HealthGet(string $contentType = self::contentTypes['v1HealthGet'][0])
+ {
+ $this->v1HealthGetWithHttpInfo($contentType);
+ }
+
+ /**
+ * Operation v1HealthGetWithHttpInfo
+ *
+ * Health
+ *
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1HealthGet'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1HealthGetWithHttpInfo(string $contentType = self::contentTypes['v1HealthGet'][0])
+ {
+ $request = $this->v1HealthGetRequest($contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1HealthGetAsync
+ *
+ * Health
+ *
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1HealthGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1HealthGetAsync(string $contentType = self::contentTypes['v1HealthGet'][0])
+ {
+ return $this->v1HealthGetAsyncWithHttpInfo($contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1HealthGetAsyncWithHttpInfo
+ *
+ * Health
+ *
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1HealthGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1HealthGetAsyncWithHttpInfo(string $contentType = self::contentTypes['v1HealthGet'][0])
+ {
+ $returnType = '';
+ $request = $this->v1HealthGetRequest($contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $response->getStatusCode(), $response->getHeaders()];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1HealthGet'
+ *
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1HealthGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1HealthGetRequest(string $contentType = self::contentTypes['v1HealthGet'][0])
+ {
+
+
+ $resourcePath = '/api/v1/health/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Create http client option
+ *
+ * @throws \RuntimeException on file opening failure
+ * @return array of http client options
+ */
+ protected function createHttpClientOption()
+ {
+ $options = [];
+ if ($this->config->getDebug()) {
+ $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
+ if (!$options[RequestOptions::DEBUG]) {
+ throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
+ }
+ }
+
+ return $options;
+ }
+}
diff --git a/lib/Api/IntegrationApi.php b/lib/Api/IntegrationApi.php
new file mode 100644
index 0000000..f5851bd
--- /dev/null
+++ b/lib/Api/IntegrationApi.php
@@ -0,0 +1,3395 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Api;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Psr7\MultipartStream;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\RequestOptions;
+use Svix\ApiClient\ApiException;
+use Svix\ApiClient\Configuration;
+use Svix\ApiClient\HeaderSelector;
+use Svix\ApiClient\ObjectSerializer;
+
+/**
+ * IntegrationApi Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ */
+class IntegrationApi
+{
+ /**
+ * @var ClientInterface
+ */
+ protected $client;
+
+ /**
+ * @var Configuration
+ */
+ protected $config;
+
+ /**
+ * @var HeaderSelector
+ */
+ protected $headerSelector;
+
+ /**
+ * @var int Host index
+ */
+ protected $hostIndex;
+
+ /** @var string[] $contentTypes **/
+ public const contentTypes = [
+ 'v1IntegrationCreate' => [
+ 'application/json',
+ ],
+ 'v1IntegrationDelete' => [
+ 'application/json',
+ ],
+ 'v1IntegrationGet' => [
+ 'application/json',
+ ],
+ 'v1IntegrationGetKey' => [
+ 'application/json',
+ ],
+ 'v1IntegrationList' => [
+ 'application/json',
+ ],
+ 'v1IntegrationRotateKey' => [
+ 'application/json',
+ ],
+ 'v1IntegrationUpdate' => [
+ 'application/json',
+ ],
+ ];
+
+/**
+ * @param ClientInterface $client
+ * @param Configuration $config
+ * @param HeaderSelector $selector
+ * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
+ */
+ public function __construct(
+ ClientInterface $client = null,
+ Configuration $config = null,
+ HeaderSelector $selector = null,
+ $hostIndex = 0
+ ) {
+ $this->client = $client ?: new Client();
+ $this->config = $config ?: new Configuration();
+ $this->headerSelector = $selector ?: new HeaderSelector();
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Set the host index
+ *
+ * @param int $hostIndex Host index (required)
+ */
+ public function setHostIndex($hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex()
+ {
+ return $this->hostIndex;
+ }
+
+ /**
+ * @return Configuration
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ /**
+ * Operation v1IntegrationCreate
+ *
+ * Create Integration
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\IntegrationIn $integration_in integration_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationCreate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\IntegrationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1IntegrationCreate($app_id, $integration_in, $idempotency_key = null, string $contentType = self::contentTypes['v1IntegrationCreate'][0])
+ {
+ list($response) = $this->v1IntegrationCreateWithHttpInfo($app_id, $integration_in, $idempotency_key, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1IntegrationCreateWithHttpInfo
+ *
+ * Create Integration
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\IntegrationIn $integration_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationCreate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\IntegrationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1IntegrationCreateWithHttpInfo($app_id, $integration_in, $idempotency_key = null, string $contentType = self::contentTypes['v1IntegrationCreate'][0])
+ {
+ $request = $this->v1IntegrationCreateRequest($app_id, $integration_in, $idempotency_key, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 201:
+ if ('\Svix\ApiClient\Model\IntegrationOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\IntegrationOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\IntegrationOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\IntegrationOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 201:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\IntegrationOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1IntegrationCreateAsync
+ *
+ * Create Integration
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\IntegrationIn $integration_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationCreate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1IntegrationCreateAsync($app_id, $integration_in, $idempotency_key = null, string $contentType = self::contentTypes['v1IntegrationCreate'][0])
+ {
+ return $this->v1IntegrationCreateAsyncWithHttpInfo($app_id, $integration_in, $idempotency_key, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1IntegrationCreateAsyncWithHttpInfo
+ *
+ * Create Integration
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\IntegrationIn $integration_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationCreate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1IntegrationCreateAsyncWithHttpInfo($app_id, $integration_in, $idempotency_key = null, string $contentType = self::contentTypes['v1IntegrationCreate'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\IntegrationOut';
+ $request = $this->v1IntegrationCreateRequest($app_id, $integration_in, $idempotency_key, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1IntegrationCreate'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\IntegrationIn $integration_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationCreate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1IntegrationCreateRequest($app_id, $integration_in, $idempotency_key = null, string $contentType = self::contentTypes['v1IntegrationCreate'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1IntegrationCreate'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling IntegrationApi.v1IntegrationCreate, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling IntegrationApi.v1IntegrationCreate, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling IntegrationApi.v1IntegrationCreate, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'integration_in' is set
+ if ($integration_in === null || (is_array($integration_in) && count($integration_in) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $integration_in when calling v1IntegrationCreate'
+ );
+ }
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/integration/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+ // header params
+ if ($idempotency_key !== null) {
+ $headerParams['idempotency-key'] = ObjectSerializer::toHeaderValue($idempotency_key);
+ }
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($integration_in)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($integration_in));
+ } else {
+ $httpBody = $integration_in;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1IntegrationDelete
+ *
+ * Delete Integration
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationDelete'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return void
+ */
+ public function v1IntegrationDelete($app_id, $integ_id, string $contentType = self::contentTypes['v1IntegrationDelete'][0])
+ {
+ $this->v1IntegrationDeleteWithHttpInfo($app_id, $integ_id, $contentType);
+ }
+
+ /**
+ * Operation v1IntegrationDeleteWithHttpInfo
+ *
+ * Delete Integration
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationDelete'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1IntegrationDeleteWithHttpInfo($app_id, $integ_id, string $contentType = self::contentTypes['v1IntegrationDelete'][0])
+ {
+ $request = $this->v1IntegrationDeleteRequest($app_id, $integ_id, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1IntegrationDeleteAsync
+ *
+ * Delete Integration
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationDelete'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1IntegrationDeleteAsync($app_id, $integ_id, string $contentType = self::contentTypes['v1IntegrationDelete'][0])
+ {
+ return $this->v1IntegrationDeleteAsyncWithHttpInfo($app_id, $integ_id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1IntegrationDeleteAsyncWithHttpInfo
+ *
+ * Delete Integration
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationDelete'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1IntegrationDeleteAsyncWithHttpInfo($app_id, $integ_id, string $contentType = self::contentTypes['v1IntegrationDelete'][0])
+ {
+ $returnType = '';
+ $request = $this->v1IntegrationDeleteRequest($app_id, $integ_id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $response->getStatusCode(), $response->getHeaders()];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1IntegrationDelete'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationDelete'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1IntegrationDeleteRequest($app_id, $integ_id, string $contentType = self::contentTypes['v1IntegrationDelete'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1IntegrationDelete'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling IntegrationApi.v1IntegrationDelete, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling IntegrationApi.v1IntegrationDelete, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling IntegrationApi.v1IntegrationDelete, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'integ_id' is set
+ if ($integ_id === null || (is_array($integ_id) && count($integ_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $integ_id when calling v1IntegrationDelete'
+ );
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/integration/{integ_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($integ_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'integ_id' . '}',
+ ObjectSerializer::toPathValue($integ_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'DELETE',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1IntegrationGet
+ *
+ * Get Integration
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationGet'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\IntegrationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1IntegrationGet($app_id, $integ_id, string $contentType = self::contentTypes['v1IntegrationGet'][0])
+ {
+ list($response) = $this->v1IntegrationGetWithHttpInfo($app_id, $integ_id, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1IntegrationGetWithHttpInfo
+ *
+ * Get Integration
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationGet'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\IntegrationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1IntegrationGetWithHttpInfo($app_id, $integ_id, string $contentType = self::contentTypes['v1IntegrationGet'][0])
+ {
+ $request = $this->v1IntegrationGetRequest($app_id, $integ_id, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\IntegrationOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\IntegrationOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\IntegrationOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\IntegrationOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\IntegrationOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1IntegrationGetAsync
+ *
+ * Get Integration
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1IntegrationGetAsync($app_id, $integ_id, string $contentType = self::contentTypes['v1IntegrationGet'][0])
+ {
+ return $this->v1IntegrationGetAsyncWithHttpInfo($app_id, $integ_id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1IntegrationGetAsyncWithHttpInfo
+ *
+ * Get Integration
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1IntegrationGetAsyncWithHttpInfo($app_id, $integ_id, string $contentType = self::contentTypes['v1IntegrationGet'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\IntegrationOut';
+ $request = $this->v1IntegrationGetRequest($app_id, $integ_id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1IntegrationGet'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1IntegrationGetRequest($app_id, $integ_id, string $contentType = self::contentTypes['v1IntegrationGet'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1IntegrationGet'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling IntegrationApi.v1IntegrationGet, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling IntegrationApi.v1IntegrationGet, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling IntegrationApi.v1IntegrationGet, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'integ_id' is set
+ if ($integ_id === null || (is_array($integ_id) && count($integ_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $integ_id when calling v1IntegrationGet'
+ );
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/integration/{integ_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($integ_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'integ_id' . '}',
+ ObjectSerializer::toPathValue($integ_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1IntegrationGetKey
+ *
+ * Get Integration Key
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationGetKey'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\IntegrationKeyOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1IntegrationGetKey($app_id, $integ_id, string $contentType = self::contentTypes['v1IntegrationGetKey'][0])
+ {
+ list($response) = $this->v1IntegrationGetKeyWithHttpInfo($app_id, $integ_id, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1IntegrationGetKeyWithHttpInfo
+ *
+ * Get Integration Key
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationGetKey'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\IntegrationKeyOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1IntegrationGetKeyWithHttpInfo($app_id, $integ_id, string $contentType = self::contentTypes['v1IntegrationGetKey'][0])
+ {
+ $request = $this->v1IntegrationGetKeyRequest($app_id, $integ_id, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\IntegrationKeyOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\IntegrationKeyOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\IntegrationKeyOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\IntegrationKeyOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\IntegrationKeyOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1IntegrationGetKeyAsync
+ *
+ * Get Integration Key
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationGetKey'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1IntegrationGetKeyAsync($app_id, $integ_id, string $contentType = self::contentTypes['v1IntegrationGetKey'][0])
+ {
+ return $this->v1IntegrationGetKeyAsyncWithHttpInfo($app_id, $integ_id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1IntegrationGetKeyAsyncWithHttpInfo
+ *
+ * Get Integration Key
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationGetKey'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1IntegrationGetKeyAsyncWithHttpInfo($app_id, $integ_id, string $contentType = self::contentTypes['v1IntegrationGetKey'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\IntegrationKeyOut';
+ $request = $this->v1IntegrationGetKeyRequest($app_id, $integ_id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1IntegrationGetKey'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationGetKey'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1IntegrationGetKeyRequest($app_id, $integ_id, string $contentType = self::contentTypes['v1IntegrationGetKey'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1IntegrationGetKey'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling IntegrationApi.v1IntegrationGetKey, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling IntegrationApi.v1IntegrationGetKey, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling IntegrationApi.v1IntegrationGetKey, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'integ_id' is set
+ if ($integ_id === null || (is_array($integ_id) && count($integ_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $integ_id when calling v1IntegrationGetKey'
+ );
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/integration/{integ_id}/key/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($integ_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'integ_id' . '}',
+ ObjectSerializer::toPathValue($integ_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1IntegrationList
+ *
+ * List Integrations
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationList'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\ListResponseIntegrationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1IntegrationList($app_id, $limit = null, $iterator = null, string $contentType = self::contentTypes['v1IntegrationList'][0])
+ {
+ list($response) = $this->v1IntegrationListWithHttpInfo($app_id, $limit, $iterator, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1IntegrationListWithHttpInfo
+ *
+ * List Integrations
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationList'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\ListResponseIntegrationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1IntegrationListWithHttpInfo($app_id, $limit = null, $iterator = null, string $contentType = self::contentTypes['v1IntegrationList'][0])
+ {
+ $request = $this->v1IntegrationListRequest($app_id, $limit, $iterator, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\ListResponseIntegrationOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ListResponseIntegrationOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ListResponseIntegrationOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\ListResponseIntegrationOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ListResponseIntegrationOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1IntegrationListAsync
+ *
+ * List Integrations
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationList'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1IntegrationListAsync($app_id, $limit = null, $iterator = null, string $contentType = self::contentTypes['v1IntegrationList'][0])
+ {
+ return $this->v1IntegrationListAsyncWithHttpInfo($app_id, $limit, $iterator, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1IntegrationListAsyncWithHttpInfo
+ *
+ * List Integrations
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationList'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1IntegrationListAsyncWithHttpInfo($app_id, $limit = null, $iterator = null, string $contentType = self::contentTypes['v1IntegrationList'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\ListResponseIntegrationOut';
+ $request = $this->v1IntegrationListRequest($app_id, $limit, $iterator, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1IntegrationList'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationList'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1IntegrationListRequest($app_id, $limit = null, $iterator = null, string $contentType = self::contentTypes['v1IntegrationList'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1IntegrationList'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling IntegrationApi.v1IntegrationList, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling IntegrationApi.v1IntegrationList, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling IntegrationApi.v1IntegrationList, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ if ($limit !== null && $limit > 250) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling IntegrationApi.v1IntegrationList, must be smaller than or equal to 250.');
+ }
+ if ($limit !== null && $limit < 1) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling IntegrationApi.v1IntegrationList, must be bigger than or equal to 1.');
+ }
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/integration/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $iterator,
+ 'iterator', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1IntegrationRotateKey
+ *
+ * Rotate Integration Key
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationRotateKey'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\IntegrationKeyOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1IntegrationRotateKey($app_id, $integ_id, $idempotency_key = null, string $contentType = self::contentTypes['v1IntegrationRotateKey'][0])
+ {
+ list($response) = $this->v1IntegrationRotateKeyWithHttpInfo($app_id, $integ_id, $idempotency_key, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1IntegrationRotateKeyWithHttpInfo
+ *
+ * Rotate Integration Key
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationRotateKey'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\IntegrationKeyOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1IntegrationRotateKeyWithHttpInfo($app_id, $integ_id, $idempotency_key = null, string $contentType = self::contentTypes['v1IntegrationRotateKey'][0])
+ {
+ $request = $this->v1IntegrationRotateKeyRequest($app_id, $integ_id, $idempotency_key, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\IntegrationKeyOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\IntegrationKeyOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\IntegrationKeyOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\IntegrationKeyOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\IntegrationKeyOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1IntegrationRotateKeyAsync
+ *
+ * Rotate Integration Key
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationRotateKey'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1IntegrationRotateKeyAsync($app_id, $integ_id, $idempotency_key = null, string $contentType = self::contentTypes['v1IntegrationRotateKey'][0])
+ {
+ return $this->v1IntegrationRotateKeyAsyncWithHttpInfo($app_id, $integ_id, $idempotency_key, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1IntegrationRotateKeyAsyncWithHttpInfo
+ *
+ * Rotate Integration Key
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationRotateKey'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1IntegrationRotateKeyAsyncWithHttpInfo($app_id, $integ_id, $idempotency_key = null, string $contentType = self::contentTypes['v1IntegrationRotateKey'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\IntegrationKeyOut';
+ $request = $this->v1IntegrationRotateKeyRequest($app_id, $integ_id, $idempotency_key, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1IntegrationRotateKey'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationRotateKey'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1IntegrationRotateKeyRequest($app_id, $integ_id, $idempotency_key = null, string $contentType = self::contentTypes['v1IntegrationRotateKey'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1IntegrationRotateKey'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling IntegrationApi.v1IntegrationRotateKey, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling IntegrationApi.v1IntegrationRotateKey, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling IntegrationApi.v1IntegrationRotateKey, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'integ_id' is set
+ if ($integ_id === null || (is_array($integ_id) && count($integ_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $integ_id when calling v1IntegrationRotateKey'
+ );
+ }
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/integration/{integ_id}/key/rotate/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+ // header params
+ if ($idempotency_key !== null) {
+ $headerParams['idempotency-key'] = ObjectSerializer::toHeaderValue($idempotency_key);
+ }
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($integ_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'integ_id' . '}',
+ ObjectSerializer::toPathValue($integ_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1IntegrationUpdate
+ *
+ * Update Integration
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param \Svix\ApiClient\Model\IntegrationUpdate $integration_update integration_update (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationUpdate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\IntegrationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1IntegrationUpdate($app_id, $integ_id, $integration_update, string $contentType = self::contentTypes['v1IntegrationUpdate'][0])
+ {
+ list($response) = $this->v1IntegrationUpdateWithHttpInfo($app_id, $integ_id, $integration_update, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1IntegrationUpdateWithHttpInfo
+ *
+ * Update Integration
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param \Svix\ApiClient\Model\IntegrationUpdate $integration_update (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationUpdate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\IntegrationOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1IntegrationUpdateWithHttpInfo($app_id, $integ_id, $integration_update, string $contentType = self::contentTypes['v1IntegrationUpdate'][0])
+ {
+ $request = $this->v1IntegrationUpdateRequest($app_id, $integ_id, $integration_update, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\IntegrationOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\IntegrationOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\IntegrationOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\IntegrationOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\IntegrationOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1IntegrationUpdateAsync
+ *
+ * Update Integration
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param \Svix\ApiClient\Model\IntegrationUpdate $integration_update (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationUpdate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1IntegrationUpdateAsync($app_id, $integ_id, $integration_update, string $contentType = self::contentTypes['v1IntegrationUpdate'][0])
+ {
+ return $this->v1IntegrationUpdateAsyncWithHttpInfo($app_id, $integ_id, $integration_update, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1IntegrationUpdateAsyncWithHttpInfo
+ *
+ * Update Integration
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param \Svix\ApiClient\Model\IntegrationUpdate $integration_update (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationUpdate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1IntegrationUpdateAsyncWithHttpInfo($app_id, $integ_id, $integration_update, string $contentType = self::contentTypes['v1IntegrationUpdate'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\IntegrationOut';
+ $request = $this->v1IntegrationUpdateRequest($app_id, $integ_id, $integration_update, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1IntegrationUpdate'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $integ_id The integ's ID (required)
+ * @param \Svix\ApiClient\Model\IntegrationUpdate $integration_update (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1IntegrationUpdate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1IntegrationUpdateRequest($app_id, $integ_id, $integration_update, string $contentType = self::contentTypes['v1IntegrationUpdate'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1IntegrationUpdate'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling IntegrationApi.v1IntegrationUpdate, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling IntegrationApi.v1IntegrationUpdate, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling IntegrationApi.v1IntegrationUpdate, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'integ_id' is set
+ if ($integ_id === null || (is_array($integ_id) && count($integ_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $integ_id when calling v1IntegrationUpdate'
+ );
+ }
+
+ // verify the required parameter 'integration_update' is set
+ if ($integration_update === null || (is_array($integration_update) && count($integration_update) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $integration_update when calling v1IntegrationUpdate'
+ );
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/integration/{integ_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($integ_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'integ_id' . '}',
+ ObjectSerializer::toPathValue($integ_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($integration_update)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($integration_update));
+ } else {
+ $httpBody = $integration_update;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'PUT',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Create http client option
+ *
+ * @throws \RuntimeException on file opening failure
+ * @return array of http client options
+ */
+ protected function createHttpClientOption()
+ {
+ $options = [];
+ if ($this->config->getDebug()) {
+ $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
+ if (!$options[RequestOptions::DEBUG]) {
+ throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
+ }
+ }
+
+ return $options;
+ }
+}
diff --git a/lib/Api/MessageApi.php b/lib/Api/MessageApi.php
new file mode 100644
index 0000000..8d89d04
--- /dev/null
+++ b/lib/Api/MessageApi.php
@@ -0,0 +1,2078 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Api;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Psr7\MultipartStream;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\RequestOptions;
+use Svix\ApiClient\ApiException;
+use Svix\ApiClient\Configuration;
+use Svix\ApiClient\HeaderSelector;
+use Svix\ApiClient\ObjectSerializer;
+
+/**
+ * MessageApi Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ */
+class MessageApi
+{
+ /**
+ * @var ClientInterface
+ */
+ protected $client;
+
+ /**
+ * @var Configuration
+ */
+ protected $config;
+
+ /**
+ * @var HeaderSelector
+ */
+ protected $headerSelector;
+
+ /**
+ * @var int Host index
+ */
+ protected $hostIndex;
+
+ /** @var string[] $contentTypes **/
+ public const contentTypes = [
+ 'v1MessageCreate' => [
+ 'application/json',
+ ],
+ 'v1MessageExpungeContent' => [
+ 'application/json',
+ ],
+ 'v1MessageGet' => [
+ 'application/json',
+ ],
+ 'v1MessageList' => [
+ 'application/json',
+ ],
+ ];
+
+/**
+ * @param ClientInterface $client
+ * @param Configuration $config
+ * @param HeaderSelector $selector
+ * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
+ */
+ public function __construct(
+ ClientInterface $client = null,
+ Configuration $config = null,
+ HeaderSelector $selector = null,
+ $hostIndex = 0
+ ) {
+ $this->client = $client ?: new Client();
+ $this->config = $config ?: new Configuration();
+ $this->headerSelector = $selector ?: new HeaderSelector();
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Set the host index
+ *
+ * @param int $hostIndex Host index (required)
+ */
+ public function setHostIndex($hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex()
+ {
+ return $this->hostIndex;
+ }
+
+ /**
+ * @return Configuration
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ /**
+ * Operation v1MessageCreate
+ *
+ * Create Message
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\MessageIn $message_in message_in (required)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageCreate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\MessageOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1MessageCreate($app_id, $message_in, $with_content = true, $idempotency_key = null, string $contentType = self::contentTypes['v1MessageCreate'][0])
+ {
+ list($response) = $this->v1MessageCreateWithHttpInfo($app_id, $message_in, $with_content, $idempotency_key, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1MessageCreateWithHttpInfo
+ *
+ * Create Message
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\MessageIn $message_in (required)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageCreate'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\MessageOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1MessageCreateWithHttpInfo($app_id, $message_in, $with_content = true, $idempotency_key = null, string $contentType = self::contentTypes['v1MessageCreate'][0])
+ {
+ $request = $this->v1MessageCreateRequest($app_id, $message_in, $with_content, $idempotency_key, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 202:
+ if ('\Svix\ApiClient\Model\MessageOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\MessageOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\MessageOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 413:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\MessageOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 202:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\MessageOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 413:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1MessageCreateAsync
+ *
+ * Create Message
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\MessageIn $message_in (required)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageCreate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageCreateAsync($app_id, $message_in, $with_content = true, $idempotency_key = null, string $contentType = self::contentTypes['v1MessageCreate'][0])
+ {
+ return $this->v1MessageCreateAsyncWithHttpInfo($app_id, $message_in, $with_content, $idempotency_key, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1MessageCreateAsyncWithHttpInfo
+ *
+ * Create Message
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\MessageIn $message_in (required)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageCreate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageCreateAsyncWithHttpInfo($app_id, $message_in, $with_content = true, $idempotency_key = null, string $contentType = self::contentTypes['v1MessageCreate'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\MessageOut';
+ $request = $this->v1MessageCreateRequest($app_id, $message_in, $with_content, $idempotency_key, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1MessageCreate'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param \Svix\ApiClient\Model\MessageIn $message_in (required)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageCreate'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1MessageCreateRequest($app_id, $message_in, $with_content = true, $idempotency_key = null, string $contentType = self::contentTypes['v1MessageCreate'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1MessageCreate'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageApi.v1MessageCreate, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageApi.v1MessageCreate, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling MessageApi.v1MessageCreate, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'message_in' is set
+ if ($message_in === null || (is_array($message_in) && count($message_in) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $message_in when calling v1MessageCreate'
+ );
+ }
+
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/msg/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $with_content,
+ 'with_content', // param base name
+ 'boolean', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+ // header params
+ if ($idempotency_key !== null) {
+ $headerParams['idempotency-key'] = ObjectSerializer::toHeaderValue($idempotency_key);
+ }
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($message_in)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($message_in));
+ } else {
+ $httpBody = $message_in;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1MessageExpungeContent
+ *
+ * Delete message payload
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageExpungeContent'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return void
+ */
+ public function v1MessageExpungeContent($app_id, $msg_id, string $contentType = self::contentTypes['v1MessageExpungeContent'][0])
+ {
+ $this->v1MessageExpungeContentWithHttpInfo($app_id, $msg_id, $contentType);
+ }
+
+ /**
+ * Operation v1MessageExpungeContentWithHttpInfo
+ *
+ * Delete message payload
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageExpungeContent'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1MessageExpungeContentWithHttpInfo($app_id, $msg_id, string $contentType = self::contentTypes['v1MessageExpungeContent'][0])
+ {
+ $request = $this->v1MessageExpungeContentRequest($app_id, $msg_id, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1MessageExpungeContentAsync
+ *
+ * Delete message payload
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageExpungeContent'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageExpungeContentAsync($app_id, $msg_id, string $contentType = self::contentTypes['v1MessageExpungeContent'][0])
+ {
+ return $this->v1MessageExpungeContentAsyncWithHttpInfo($app_id, $msg_id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1MessageExpungeContentAsyncWithHttpInfo
+ *
+ * Delete message payload
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageExpungeContent'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageExpungeContentAsyncWithHttpInfo($app_id, $msg_id, string $contentType = self::contentTypes['v1MessageExpungeContent'][0])
+ {
+ $returnType = '';
+ $request = $this->v1MessageExpungeContentRequest($app_id, $msg_id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $response->getStatusCode(), $response->getHeaders()];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1MessageExpungeContent'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageExpungeContent'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1MessageExpungeContentRequest($app_id, $msg_id, string $contentType = self::contentTypes['v1MessageExpungeContent'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1MessageExpungeContent'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageApi.v1MessageExpungeContent, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageApi.v1MessageExpungeContent, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling MessageApi.v1MessageExpungeContent, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'msg_id' is set
+ if ($msg_id === null || (is_array($msg_id) && count($msg_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $msg_id when calling v1MessageExpungeContent'
+ );
+ }
+ if (strlen($msg_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageApi.v1MessageExpungeContent, must be smaller than or equal to 256.');
+ }
+ if (strlen($msg_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageApi.v1MessageExpungeContent, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $msg_id)) {
+ throw new \InvalidArgumentException("invalid value for \"msg_id\" when calling MessageApi.v1MessageExpungeContent, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/msg/{msg_id}/content/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($msg_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'msg_id' . '}',
+ ObjectSerializer::toPathValue($msg_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'DELETE',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1MessageGet
+ *
+ * Get Message
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageGet'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\MessageOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1MessageGet($app_id, $msg_id, $with_content = true, string $contentType = self::contentTypes['v1MessageGet'][0])
+ {
+ list($response) = $this->v1MessageGetWithHttpInfo($app_id, $msg_id, $with_content, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1MessageGetWithHttpInfo
+ *
+ * Get Message
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageGet'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\MessageOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1MessageGetWithHttpInfo($app_id, $msg_id, $with_content = true, string $contentType = self::contentTypes['v1MessageGet'][0])
+ {
+ $request = $this->v1MessageGetRequest($app_id, $msg_id, $with_content, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\MessageOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\MessageOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\MessageOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\MessageOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\MessageOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1MessageGetAsync
+ *
+ * Get Message
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageGetAsync($app_id, $msg_id, $with_content = true, string $contentType = self::contentTypes['v1MessageGet'][0])
+ {
+ return $this->v1MessageGetAsyncWithHttpInfo($app_id, $msg_id, $with_content, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1MessageGetAsyncWithHttpInfo
+ *
+ * Get Message
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageGetAsyncWithHttpInfo($app_id, $msg_id, $with_content = true, string $contentType = self::contentTypes['v1MessageGet'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\MessageOut';
+ $request = $this->v1MessageGetRequest($app_id, $msg_id, $with_content, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1MessageGet'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1MessageGetRequest($app_id, $msg_id, $with_content = true, string $contentType = self::contentTypes['v1MessageGet'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1MessageGet'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageApi.v1MessageGet, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageApi.v1MessageGet, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling MessageApi.v1MessageGet, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'msg_id' is set
+ if ($msg_id === null || (is_array($msg_id) && count($msg_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $msg_id when calling v1MessageGet'
+ );
+ }
+ if (strlen($msg_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageApi.v1MessageGet, must be smaller than or equal to 256.');
+ }
+ if (strlen($msg_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageApi.v1MessageGet, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $msg_id)) {
+ throw new \InvalidArgumentException("invalid value for \"msg_id\" when calling MessageApi.v1MessageGet, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/msg/{msg_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $with_content,
+ 'with_content', // param base name
+ 'boolean', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($msg_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'msg_id' . '}',
+ ObjectSerializer::toPathValue($msg_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1MessageList
+ *
+ * List Messages
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageList'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\ListResponseMessageOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1MessageList($app_id, $limit = null, $iterator = null, $channel = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageList'][0])
+ {
+ list($response) = $this->v1MessageListWithHttpInfo($app_id, $limit, $iterator, $channel, $before, $after, $with_content, $event_types, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1MessageListWithHttpInfo
+ *
+ * List Messages
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageList'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\ListResponseMessageOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1MessageListWithHttpInfo($app_id, $limit = null, $iterator = null, $channel = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageList'][0])
+ {
+ $request = $this->v1MessageListRequest($app_id, $limit, $iterator, $channel, $before, $after, $with_content, $event_types, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\ListResponseMessageOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ListResponseMessageOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ListResponseMessageOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\ListResponseMessageOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ListResponseMessageOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1MessageListAsync
+ *
+ * List Messages
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageList'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageListAsync($app_id, $limit = null, $iterator = null, $channel = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageList'][0])
+ {
+ return $this->v1MessageListAsyncWithHttpInfo($app_id, $limit, $iterator, $channel, $before, $after, $with_content, $event_types, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1MessageListAsyncWithHttpInfo
+ *
+ * List Messages
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageList'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageListAsyncWithHttpInfo($app_id, $limit = null, $iterator = null, $channel = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageList'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\ListResponseMessageOut';
+ $request = $this->v1MessageListRequest($app_id, $limit, $iterator, $channel, $before, $after, $with_content, $event_types, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1MessageList'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageList'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1MessageListRequest($app_id, $limit = null, $iterator = null, $channel = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageList'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1MessageList'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageApi.v1MessageList, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageApi.v1MessageList, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling MessageApi.v1MessageList, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ if ($limit !== null && $limit > 250) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling MessageApi.v1MessageList, must be smaller than or equal to 250.');
+ }
+ if ($limit !== null && $limit < 1) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling MessageApi.v1MessageList, must be bigger than or equal to 1.');
+ }
+
+
+ if ($channel !== null && strlen($channel) > 128) {
+ throw new \InvalidArgumentException('invalid length for "$channel" when calling MessageApi.v1MessageList, must be smaller than or equal to 128.');
+ }
+ if ($channel !== null && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $channel)) {
+ throw new \InvalidArgumentException("invalid value for \"channel\" when calling MessageApi.v1MessageList, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/msg/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $iterator,
+ 'iterator', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $channel,
+ 'channel', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $before,
+ 'before', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $after,
+ 'after', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $with_content,
+ 'with_content', // param base name
+ 'boolean', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $event_types,
+ 'event_types', // param base name
+ 'array', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Create http client option
+ *
+ * @throws \RuntimeException on file opening failure
+ * @return array of http client options
+ */
+ protected function createHttpClientOption()
+ {
+ $options = [];
+ if ($this->config->getDebug()) {
+ $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
+ if (!$options[RequestOptions::DEBUG]) {
+ throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
+ }
+ }
+
+ return $options;
+ }
+}
diff --git a/lib/Api/MessageAttemptApi.php b/lib/Api/MessageAttemptApi.php
new file mode 100644
index 0000000..19ae70e
--- /dev/null
+++ b/lib/Api/MessageAttemptApi.php
@@ -0,0 +1,5100 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Api;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Psr7\MultipartStream;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\RequestOptions;
+use Svix\ApiClient\ApiException;
+use Svix\ApiClient\Configuration;
+use Svix\ApiClient\HeaderSelector;
+use Svix\ApiClient\ObjectSerializer;
+
+/**
+ * MessageAttemptApi Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ */
+class MessageAttemptApi
+{
+ /**
+ * @var ClientInterface
+ */
+ protected $client;
+
+ /**
+ * @var Configuration
+ */
+ protected $config;
+
+ /**
+ * @var HeaderSelector
+ */
+ protected $headerSelector;
+
+ /**
+ * @var int Host index
+ */
+ protected $hostIndex;
+
+ /** @var string[] $contentTypes **/
+ public const contentTypes = [
+ 'v1MessageAttemptExpungeContent' => [
+ 'application/json',
+ ],
+ 'v1MessageAttemptGet' => [
+ 'application/json',
+ ],
+ 'v1MessageAttemptListAttemptedDestinations' => [
+ 'application/json',
+ ],
+ 'v1MessageAttemptListAttemptedMessages' => [
+ 'application/json',
+ ],
+ 'v1MessageAttemptListByEndpoint' => [
+ 'application/json',
+ ],
+ 'v1MessageAttemptListByEndpointDeprecated' => [
+ 'application/json',
+ ],
+ 'v1MessageAttemptListByMsg' => [
+ 'application/json',
+ ],
+ 'v1MessageAttemptListByMsgDeprecated' => [
+ 'application/json',
+ ],
+ 'v1MessageAttemptResend' => [
+ 'application/json',
+ ],
+ ];
+
+/**
+ * @param ClientInterface $client
+ * @param Configuration $config
+ * @param HeaderSelector $selector
+ * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
+ */
+ public function __construct(
+ ClientInterface $client = null,
+ Configuration $config = null,
+ HeaderSelector $selector = null,
+ $hostIndex = 0
+ ) {
+ $this->client = $client ?: new Client();
+ $this->config = $config ?: new Configuration();
+ $this->headerSelector = $selector ?: new HeaderSelector();
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Set the host index
+ *
+ * @param int $hostIndex Host index (required)
+ */
+ public function setHostIndex($hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex()
+ {
+ return $this->hostIndex;
+ }
+
+ /**
+ * @return Configuration
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ /**
+ * Operation v1MessageAttemptExpungeContent
+ *
+ * Delete attempt response body
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $attempt_id The attempt's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptExpungeContent'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return void
+ */
+ public function v1MessageAttemptExpungeContent($app_id, $msg_id, $attempt_id, string $contentType = self::contentTypes['v1MessageAttemptExpungeContent'][0])
+ {
+ $this->v1MessageAttemptExpungeContentWithHttpInfo($app_id, $msg_id, $attempt_id, $contentType);
+ }
+
+ /**
+ * Operation v1MessageAttemptExpungeContentWithHttpInfo
+ *
+ * Delete attempt response body
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $attempt_id The attempt's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptExpungeContent'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1MessageAttemptExpungeContentWithHttpInfo($app_id, $msg_id, $attempt_id, string $contentType = self::contentTypes['v1MessageAttemptExpungeContent'][0])
+ {
+ $request = $this->v1MessageAttemptExpungeContentRequest($app_id, $msg_id, $attempt_id, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1MessageAttemptExpungeContentAsync
+ *
+ * Delete attempt response body
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $attempt_id The attempt's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptExpungeContent'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageAttemptExpungeContentAsync($app_id, $msg_id, $attempt_id, string $contentType = self::contentTypes['v1MessageAttemptExpungeContent'][0])
+ {
+ return $this->v1MessageAttemptExpungeContentAsyncWithHttpInfo($app_id, $msg_id, $attempt_id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1MessageAttemptExpungeContentAsyncWithHttpInfo
+ *
+ * Delete attempt response body
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $attempt_id The attempt's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptExpungeContent'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageAttemptExpungeContentAsyncWithHttpInfo($app_id, $msg_id, $attempt_id, string $contentType = self::contentTypes['v1MessageAttemptExpungeContent'][0])
+ {
+ $returnType = '';
+ $request = $this->v1MessageAttemptExpungeContentRequest($app_id, $msg_id, $attempt_id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $response->getStatusCode(), $response->getHeaders()];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1MessageAttemptExpungeContent'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $attempt_id The attempt's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptExpungeContent'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1MessageAttemptExpungeContentRequest($app_id, $msg_id, $attempt_id, string $contentType = self::contentTypes['v1MessageAttemptExpungeContent'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1MessageAttemptExpungeContent'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptExpungeContent, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptExpungeContent, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling MessageAttemptApi.v1MessageAttemptExpungeContent, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'msg_id' is set
+ if ($msg_id === null || (is_array($msg_id) && count($msg_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $msg_id when calling v1MessageAttemptExpungeContent'
+ );
+ }
+ if (strlen($msg_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageAttemptApi.v1MessageAttemptExpungeContent, must be smaller than or equal to 256.');
+ }
+ if (strlen($msg_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageAttemptApi.v1MessageAttemptExpungeContent, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $msg_id)) {
+ throw new \InvalidArgumentException("invalid value for \"msg_id\" when calling MessageAttemptApi.v1MessageAttemptExpungeContent, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'attempt_id' is set
+ if ($attempt_id === null || (is_array($attempt_id) && count($attempt_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $attempt_id when calling v1MessageAttemptExpungeContent'
+ );
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($msg_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'msg_id' . '}',
+ ObjectSerializer::toPathValue($msg_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($attempt_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'attempt_id' . '}',
+ ObjectSerializer::toPathValue($attempt_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'DELETE',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1MessageAttemptGet
+ *
+ * Get Attempt
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $attempt_id The attempt's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptGet'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\MessageAttemptOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1MessageAttemptGet($app_id, $msg_id, $attempt_id, string $contentType = self::contentTypes['v1MessageAttemptGet'][0])
+ {
+ list($response) = $this->v1MessageAttemptGetWithHttpInfo($app_id, $msg_id, $attempt_id, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1MessageAttemptGetWithHttpInfo
+ *
+ * Get Attempt
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $attempt_id The attempt's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptGet'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\MessageAttemptOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1MessageAttemptGetWithHttpInfo($app_id, $msg_id, $attempt_id, string $contentType = self::contentTypes['v1MessageAttemptGet'][0])
+ {
+ $request = $this->v1MessageAttemptGetRequest($app_id, $msg_id, $attempt_id, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\MessageAttemptOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\MessageAttemptOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\MessageAttemptOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\MessageAttemptOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\MessageAttemptOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1MessageAttemptGetAsync
+ *
+ * Get Attempt
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $attempt_id The attempt's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageAttemptGetAsync($app_id, $msg_id, $attempt_id, string $contentType = self::contentTypes['v1MessageAttemptGet'][0])
+ {
+ return $this->v1MessageAttemptGetAsyncWithHttpInfo($app_id, $msg_id, $attempt_id, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1MessageAttemptGetAsyncWithHttpInfo
+ *
+ * Get Attempt
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $attempt_id The attempt's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageAttemptGetAsyncWithHttpInfo($app_id, $msg_id, $attempt_id, string $contentType = self::contentTypes['v1MessageAttemptGet'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\MessageAttemptOut';
+ $request = $this->v1MessageAttemptGetRequest($app_id, $msg_id, $attempt_id, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1MessageAttemptGet'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $attempt_id The attempt's ID (required)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptGet'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1MessageAttemptGetRequest($app_id, $msg_id, $attempt_id, string $contentType = self::contentTypes['v1MessageAttemptGet'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1MessageAttemptGet'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptGet, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptGet, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling MessageAttemptApi.v1MessageAttemptGet, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'msg_id' is set
+ if ($msg_id === null || (is_array($msg_id) && count($msg_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $msg_id when calling v1MessageAttemptGet'
+ );
+ }
+ if (strlen($msg_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageAttemptApi.v1MessageAttemptGet, must be smaller than or equal to 256.');
+ }
+ if (strlen($msg_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageAttemptApi.v1MessageAttemptGet, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $msg_id)) {
+ throw new \InvalidArgumentException("invalid value for \"msg_id\" when calling MessageAttemptApi.v1MessageAttemptGet, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'attempt_id' is set
+ if ($attempt_id === null || (is_array($attempt_id) && count($attempt_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $attempt_id when calling v1MessageAttemptGet'
+ );
+ }
+
+
+ $resourcePath = '/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($msg_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'msg_id' . '}',
+ ObjectSerializer::toPathValue($msg_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($attempt_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'attempt_id' . '}',
+ ObjectSerializer::toPathValue($attempt_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1MessageAttemptListAttemptedDestinations
+ *
+ * List Attempted Destinations
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListAttemptedDestinations'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\ListResponseMessageEndpointOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1MessageAttemptListAttemptedDestinations($app_id, $msg_id, $limit = null, $iterator = null, string $contentType = self::contentTypes['v1MessageAttemptListAttemptedDestinations'][0])
+ {
+ list($response) = $this->v1MessageAttemptListAttemptedDestinationsWithHttpInfo($app_id, $msg_id, $limit, $iterator, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1MessageAttemptListAttemptedDestinationsWithHttpInfo
+ *
+ * List Attempted Destinations
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListAttemptedDestinations'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\ListResponseMessageEndpointOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1MessageAttemptListAttemptedDestinationsWithHttpInfo($app_id, $msg_id, $limit = null, $iterator = null, string $contentType = self::contentTypes['v1MessageAttemptListAttemptedDestinations'][0])
+ {
+ $request = $this->v1MessageAttemptListAttemptedDestinationsRequest($app_id, $msg_id, $limit, $iterator, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\ListResponseMessageEndpointOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ListResponseMessageEndpointOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ListResponseMessageEndpointOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\ListResponseMessageEndpointOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ListResponseMessageEndpointOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1MessageAttemptListAttemptedDestinationsAsync
+ *
+ * List Attempted Destinations
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListAttemptedDestinations'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageAttemptListAttemptedDestinationsAsync($app_id, $msg_id, $limit = null, $iterator = null, string $contentType = self::contentTypes['v1MessageAttemptListAttemptedDestinations'][0])
+ {
+ return $this->v1MessageAttemptListAttemptedDestinationsAsyncWithHttpInfo($app_id, $msg_id, $limit, $iterator, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1MessageAttemptListAttemptedDestinationsAsyncWithHttpInfo
+ *
+ * List Attempted Destinations
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListAttemptedDestinations'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageAttemptListAttemptedDestinationsAsyncWithHttpInfo($app_id, $msg_id, $limit = null, $iterator = null, string $contentType = self::contentTypes['v1MessageAttemptListAttemptedDestinations'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\ListResponseMessageEndpointOut';
+ $request = $this->v1MessageAttemptListAttemptedDestinationsRequest($app_id, $msg_id, $limit, $iterator, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1MessageAttemptListAttemptedDestinations'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListAttemptedDestinations'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1MessageAttemptListAttemptedDestinationsRequest($app_id, $msg_id, $limit = null, $iterator = null, string $contentType = self::contentTypes['v1MessageAttemptListAttemptedDestinations'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1MessageAttemptListAttemptedDestinations'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptListAttemptedDestinations, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptListAttemptedDestinations, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling MessageAttemptApi.v1MessageAttemptListAttemptedDestinations, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'msg_id' is set
+ if ($msg_id === null || (is_array($msg_id) && count($msg_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $msg_id when calling v1MessageAttemptListAttemptedDestinations'
+ );
+ }
+ if (strlen($msg_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageAttemptApi.v1MessageAttemptListAttemptedDestinations, must be smaller than or equal to 256.');
+ }
+ if (strlen($msg_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageAttemptApi.v1MessageAttemptListAttemptedDestinations, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $msg_id)) {
+ throw new \InvalidArgumentException("invalid value for \"msg_id\" when calling MessageAttemptApi.v1MessageAttemptListAttemptedDestinations, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ if ($limit !== null && $limit > 250) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling MessageAttemptApi.v1MessageAttemptListAttemptedDestinations, must be smaller than or equal to 250.');
+ }
+ if ($limit !== null && $limit < 1) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling MessageAttemptApi.v1MessageAttemptListAttemptedDestinations, must be bigger than or equal to 1.');
+ }
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/msg/{msg_id}/endpoint/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $iterator,
+ 'iterator', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($msg_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'msg_id' . '}',
+ ObjectSerializer::toPathValue($msg_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1MessageAttemptListAttemptedMessages
+ *
+ * List Attempted Messages
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListAttemptedMessages'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\ListResponseEndpointMessageOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1MessageAttemptListAttemptedMessages($app_id, $endpoint_id, $limit = null, $iterator = null, $channel = null, $status = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListAttemptedMessages'][0])
+ {
+ list($response) = $this->v1MessageAttemptListAttemptedMessagesWithHttpInfo($app_id, $endpoint_id, $limit, $iterator, $channel, $status, $before, $after, $with_content, $event_types, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1MessageAttemptListAttemptedMessagesWithHttpInfo
+ *
+ * List Attempted Messages
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListAttemptedMessages'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\ListResponseEndpointMessageOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1MessageAttemptListAttemptedMessagesWithHttpInfo($app_id, $endpoint_id, $limit = null, $iterator = null, $channel = null, $status = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListAttemptedMessages'][0])
+ {
+ $request = $this->v1MessageAttemptListAttemptedMessagesRequest($app_id, $endpoint_id, $limit, $iterator, $channel, $status, $before, $after, $with_content, $event_types, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\ListResponseEndpointMessageOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ListResponseEndpointMessageOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ListResponseEndpointMessageOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\ListResponseEndpointMessageOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ListResponseEndpointMessageOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1MessageAttemptListAttemptedMessagesAsync
+ *
+ * List Attempted Messages
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListAttemptedMessages'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageAttemptListAttemptedMessagesAsync($app_id, $endpoint_id, $limit = null, $iterator = null, $channel = null, $status = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListAttemptedMessages'][0])
+ {
+ return $this->v1MessageAttemptListAttemptedMessagesAsyncWithHttpInfo($app_id, $endpoint_id, $limit, $iterator, $channel, $status, $before, $after, $with_content, $event_types, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1MessageAttemptListAttemptedMessagesAsyncWithHttpInfo
+ *
+ * List Attempted Messages
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListAttemptedMessages'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageAttemptListAttemptedMessagesAsyncWithHttpInfo($app_id, $endpoint_id, $limit = null, $iterator = null, $channel = null, $status = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListAttemptedMessages'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\ListResponseEndpointMessageOut';
+ $request = $this->v1MessageAttemptListAttemptedMessagesRequest($app_id, $endpoint_id, $limit, $iterator, $channel, $status, $before, $after, $with_content, $event_types, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1MessageAttemptListAttemptedMessages'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` message payloads are included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListAttemptedMessages'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1MessageAttemptListAttemptedMessagesRequest($app_id, $endpoint_id, $limit = null, $iterator = null, $channel = null, $status = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListAttemptedMessages'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1MessageAttemptListAttemptedMessages'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptListAttemptedMessages, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptListAttemptedMessages, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling MessageAttemptApi.v1MessageAttemptListAttemptedMessages, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1MessageAttemptListAttemptedMessages'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling MessageAttemptApi.v1MessageAttemptListAttemptedMessages, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling MessageAttemptApi.v1MessageAttemptListAttemptedMessages, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling MessageAttemptApi.v1MessageAttemptListAttemptedMessages, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ if ($limit !== null && $limit > 250) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling MessageAttemptApi.v1MessageAttemptListAttemptedMessages, must be smaller than or equal to 250.');
+ }
+ if ($limit !== null && $limit < 1) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling MessageAttemptApi.v1MessageAttemptListAttemptedMessages, must be bigger than or equal to 1.');
+ }
+
+
+ if ($channel !== null && strlen($channel) > 128) {
+ throw new \InvalidArgumentException('invalid length for "$channel" when calling MessageAttemptApi.v1MessageAttemptListAttemptedMessages, must be smaller than or equal to 128.');
+ }
+ if ($channel !== null && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $channel)) {
+ throw new \InvalidArgumentException("invalid value for \"channel\" when calling MessageAttemptApi.v1MessageAttemptListAttemptedMessages, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+
+
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $iterator,
+ 'iterator', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $channel,
+ 'channel', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $status,
+ 'status', // param base name
+ 'MessageStatus', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $before,
+ 'before', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $after,
+ 'after', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $with_content,
+ 'with_content', // param base name
+ 'boolean', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $event_types,
+ 'event_types', // param base name
+ 'array', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1MessageAttemptListByEndpoint
+ *
+ * List Attempts By Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param StatusCodeClass $status_code_class Filter response based on the HTTP status code (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` attempt content is included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByEndpoint'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\ListResponseMessageAttemptOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1MessageAttemptListByEndpoint($app_id, $endpoint_id, $limit = null, $iterator = null, $status = null, $status_code_class = null, $channel = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByEndpoint'][0])
+ {
+ list($response) = $this->v1MessageAttemptListByEndpointWithHttpInfo($app_id, $endpoint_id, $limit, $iterator, $status, $status_code_class, $channel, $before, $after, $with_content, $event_types, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1MessageAttemptListByEndpointWithHttpInfo
+ *
+ * List Attempts By Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param StatusCodeClass $status_code_class Filter response based on the HTTP status code (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` attempt content is included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByEndpoint'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\ListResponseMessageAttemptOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1MessageAttemptListByEndpointWithHttpInfo($app_id, $endpoint_id, $limit = null, $iterator = null, $status = null, $status_code_class = null, $channel = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByEndpoint'][0])
+ {
+ $request = $this->v1MessageAttemptListByEndpointRequest($app_id, $endpoint_id, $limit, $iterator, $status, $status_code_class, $channel, $before, $after, $with_content, $event_types, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\ListResponseMessageAttemptOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ListResponseMessageAttemptOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ListResponseMessageAttemptOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\ListResponseMessageAttemptOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ListResponseMessageAttemptOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1MessageAttemptListByEndpointAsync
+ *
+ * List Attempts By Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param StatusCodeClass $status_code_class Filter response based on the HTTP status code (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` attempt content is included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByEndpoint'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageAttemptListByEndpointAsync($app_id, $endpoint_id, $limit = null, $iterator = null, $status = null, $status_code_class = null, $channel = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByEndpoint'][0])
+ {
+ return $this->v1MessageAttemptListByEndpointAsyncWithHttpInfo($app_id, $endpoint_id, $limit, $iterator, $status, $status_code_class, $channel, $before, $after, $with_content, $event_types, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1MessageAttemptListByEndpointAsyncWithHttpInfo
+ *
+ * List Attempts By Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param StatusCodeClass $status_code_class Filter response based on the HTTP status code (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` attempt content is included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByEndpoint'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageAttemptListByEndpointAsyncWithHttpInfo($app_id, $endpoint_id, $limit = null, $iterator = null, $status = null, $status_code_class = null, $channel = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByEndpoint'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\ListResponseMessageAttemptOut';
+ $request = $this->v1MessageAttemptListByEndpointRequest($app_id, $endpoint_id, $limit, $iterator, $status, $status_code_class, $channel, $before, $after, $with_content, $event_types, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1MessageAttemptListByEndpoint'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param StatusCodeClass $status_code_class Filter response based on the HTTP status code (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` attempt content is included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByEndpoint'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1MessageAttemptListByEndpointRequest($app_id, $endpoint_id, $limit = null, $iterator = null, $status = null, $status_code_class = null, $channel = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByEndpoint'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1MessageAttemptListByEndpoint'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptListByEndpoint, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptListByEndpoint, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling MessageAttemptApi.v1MessageAttemptListByEndpoint, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1MessageAttemptListByEndpoint'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling MessageAttemptApi.v1MessageAttemptListByEndpoint, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling MessageAttemptApi.v1MessageAttemptListByEndpoint, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling MessageAttemptApi.v1MessageAttemptListByEndpoint, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ if ($limit !== null && $limit > 250) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling MessageAttemptApi.v1MessageAttemptListByEndpoint, must be smaller than or equal to 250.');
+ }
+ if ($limit !== null && $limit < 1) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling MessageAttemptApi.v1MessageAttemptListByEndpoint, must be bigger than or equal to 1.');
+ }
+
+
+
+
+ if ($channel !== null && strlen($channel) > 128) {
+ throw new \InvalidArgumentException('invalid length for "$channel" when calling MessageAttemptApi.v1MessageAttemptListByEndpoint, must be smaller than or equal to 128.');
+ }
+ if ($channel !== null && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $channel)) {
+ throw new \InvalidArgumentException("invalid value for \"channel\" when calling MessageAttemptApi.v1MessageAttemptListByEndpoint, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $iterator,
+ 'iterator', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $status,
+ 'status', // param base name
+ 'MessageStatus', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $status_code_class,
+ 'status_code_class', // param base name
+ 'StatusCodeClass', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $channel,
+ 'channel', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $before,
+ 'before', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $after,
+ 'after', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $with_content,
+ 'with_content', // param base name
+ 'boolean', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $event_types,
+ 'event_types', // param base name
+ 'array', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1MessageAttemptListByEndpointDeprecated
+ *
+ * List Attempts For Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByEndpointDeprecated'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\ListResponseMessageAttemptEndpointOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ * @deprecated
+ */
+ public function v1MessageAttemptListByEndpointDeprecated($app_id, $msg_id, $endpoint_id, $limit = null, $iterator = null, $channel = null, $status = null, $before = null, $after = null, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByEndpointDeprecated'][0])
+ {
+ list($response) = $this->v1MessageAttemptListByEndpointDeprecatedWithHttpInfo($app_id, $msg_id, $endpoint_id, $limit, $iterator, $channel, $status, $before, $after, $event_types, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1MessageAttemptListByEndpointDeprecatedWithHttpInfo
+ *
+ * List Attempts For Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByEndpointDeprecated'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\ListResponseMessageAttemptEndpointOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ * @deprecated
+ */
+ public function v1MessageAttemptListByEndpointDeprecatedWithHttpInfo($app_id, $msg_id, $endpoint_id, $limit = null, $iterator = null, $channel = null, $status = null, $before = null, $after = null, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByEndpointDeprecated'][0])
+ {
+ $request = $this->v1MessageAttemptListByEndpointDeprecatedRequest($app_id, $msg_id, $endpoint_id, $limit, $iterator, $channel, $status, $before, $after, $event_types, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\ListResponseMessageAttemptEndpointOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ListResponseMessageAttemptEndpointOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ListResponseMessageAttemptEndpointOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\ListResponseMessageAttemptEndpointOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ListResponseMessageAttemptEndpointOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1MessageAttemptListByEndpointDeprecatedAsync
+ *
+ * List Attempts For Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByEndpointDeprecated'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ * @deprecated
+ */
+ public function v1MessageAttemptListByEndpointDeprecatedAsync($app_id, $msg_id, $endpoint_id, $limit = null, $iterator = null, $channel = null, $status = null, $before = null, $after = null, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByEndpointDeprecated'][0])
+ {
+ return $this->v1MessageAttemptListByEndpointDeprecatedAsyncWithHttpInfo($app_id, $msg_id, $endpoint_id, $limit, $iterator, $channel, $status, $before, $after, $event_types, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1MessageAttemptListByEndpointDeprecatedAsyncWithHttpInfo
+ *
+ * List Attempts For Endpoint
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByEndpointDeprecated'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ * @deprecated
+ */
+ public function v1MessageAttemptListByEndpointDeprecatedAsyncWithHttpInfo($app_id, $msg_id, $endpoint_id, $limit = null, $iterator = null, $channel = null, $status = null, $before = null, $after = null, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByEndpointDeprecated'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\ListResponseMessageAttemptEndpointOut';
+ $request = $this->v1MessageAttemptListByEndpointDeprecatedRequest($app_id, $msg_id, $endpoint_id, $limit, $iterator, $channel, $status, $before, $after, $event_types, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1MessageAttemptListByEndpointDeprecated'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByEndpointDeprecated'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ * @deprecated
+ */
+ public function v1MessageAttemptListByEndpointDeprecatedRequest($app_id, $msg_id, $endpoint_id, $limit = null, $iterator = null, $channel = null, $status = null, $before = null, $after = null, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByEndpointDeprecated'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1MessageAttemptListByEndpointDeprecated'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptListByEndpointDeprecated, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptListByEndpointDeprecated, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling MessageAttemptApi.v1MessageAttemptListByEndpointDeprecated, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'msg_id' is set
+ if ($msg_id === null || (is_array($msg_id) && count($msg_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $msg_id when calling v1MessageAttemptListByEndpointDeprecated'
+ );
+ }
+ if (strlen($msg_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageAttemptApi.v1MessageAttemptListByEndpointDeprecated, must be smaller than or equal to 256.');
+ }
+ if (strlen($msg_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageAttemptApi.v1MessageAttemptListByEndpointDeprecated, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $msg_id)) {
+ throw new \InvalidArgumentException("invalid value for \"msg_id\" when calling MessageAttemptApi.v1MessageAttemptListByEndpointDeprecated, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1MessageAttemptListByEndpointDeprecated'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling MessageAttemptApi.v1MessageAttemptListByEndpointDeprecated, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling MessageAttemptApi.v1MessageAttemptListByEndpointDeprecated, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling MessageAttemptApi.v1MessageAttemptListByEndpointDeprecated, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ if ($limit !== null && $limit > 250) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling MessageAttemptApi.v1MessageAttemptListByEndpointDeprecated, must be smaller than or equal to 250.');
+ }
+ if ($limit !== null && $limit < 1) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling MessageAttemptApi.v1MessageAttemptListByEndpointDeprecated, must be bigger than or equal to 1.');
+ }
+
+
+ if ($channel !== null && strlen($channel) > 128) {
+ throw new \InvalidArgumentException('invalid length for "$channel" when calling MessageAttemptApi.v1MessageAttemptListByEndpointDeprecated, must be smaller than or equal to 128.');
+ }
+ if ($channel !== null && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $channel)) {
+ throw new \InvalidArgumentException("invalid value for \"channel\" when calling MessageAttemptApi.v1MessageAttemptListByEndpointDeprecated, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/attempt/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $iterator,
+ 'iterator', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $channel,
+ 'channel', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $status,
+ 'status', // param base name
+ 'MessageStatus', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $before,
+ 'before', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $after,
+ 'after', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $event_types,
+ 'event_types', // param base name
+ 'array', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($msg_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'msg_id' . '}',
+ ObjectSerializer::toPathValue($msg_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1MessageAttemptListByMsg
+ *
+ * List Attempts By Msg
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param StatusCodeClass $status_code_class Filter response based on the HTTP status code (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param string $endpoint_id Filter the attempts based on the attempted endpoint (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` attempt content is included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByMsg'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\ListResponseMessageAttemptOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function v1MessageAttemptListByMsg($app_id, $msg_id, $limit = null, $iterator = null, $status = null, $status_code_class = null, $channel = null, $endpoint_id = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByMsg'][0])
+ {
+ list($response) = $this->v1MessageAttemptListByMsgWithHttpInfo($app_id, $msg_id, $limit, $iterator, $status, $status_code_class, $channel, $endpoint_id, $before, $after, $with_content, $event_types, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1MessageAttemptListByMsgWithHttpInfo
+ *
+ * List Attempts By Msg
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param StatusCodeClass $status_code_class Filter response based on the HTTP status code (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param string $endpoint_id Filter the attempts based on the attempted endpoint (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` attempt content is included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByMsg'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\ListResponseMessageAttemptOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1MessageAttemptListByMsgWithHttpInfo($app_id, $msg_id, $limit = null, $iterator = null, $status = null, $status_code_class = null, $channel = null, $endpoint_id = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByMsg'][0])
+ {
+ $request = $this->v1MessageAttemptListByMsgRequest($app_id, $msg_id, $limit, $iterator, $status, $status_code_class, $channel, $endpoint_id, $before, $after, $with_content, $event_types, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\ListResponseMessageAttemptOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ListResponseMessageAttemptOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ListResponseMessageAttemptOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\ListResponseMessageAttemptOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ListResponseMessageAttemptOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1MessageAttemptListByMsgAsync
+ *
+ * List Attempts By Msg
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param StatusCodeClass $status_code_class Filter response based on the HTTP status code (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param string $endpoint_id Filter the attempts based on the attempted endpoint (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` attempt content is included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByMsg'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageAttemptListByMsgAsync($app_id, $msg_id, $limit = null, $iterator = null, $status = null, $status_code_class = null, $channel = null, $endpoint_id = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByMsg'][0])
+ {
+ return $this->v1MessageAttemptListByMsgAsyncWithHttpInfo($app_id, $msg_id, $limit, $iterator, $status, $status_code_class, $channel, $endpoint_id, $before, $after, $with_content, $event_types, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1MessageAttemptListByMsgAsyncWithHttpInfo
+ *
+ * List Attempts By Msg
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param StatusCodeClass $status_code_class Filter response based on the HTTP status code (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param string $endpoint_id Filter the attempts based on the attempted endpoint (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` attempt content is included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByMsg'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageAttemptListByMsgAsyncWithHttpInfo($app_id, $msg_id, $limit = null, $iterator = null, $status = null, $status_code_class = null, $channel = null, $endpoint_id = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByMsg'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\ListResponseMessageAttemptOut';
+ $request = $this->v1MessageAttemptListByMsgRequest($app_id, $msg_id, $limit, $iterator, $status, $status_code_class, $channel, $endpoint_id, $before, $after, $with_content, $event_types, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1MessageAttemptListByMsg'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param StatusCodeClass $status_code_class Filter response based on the HTTP status code (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param string $endpoint_id Filter the attempts based on the attempted endpoint (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param bool $with_content When `true` attempt content is included in the response (optional, default to true)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByMsg'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1MessageAttemptListByMsgRequest($app_id, $msg_id, $limit = null, $iterator = null, $status = null, $status_code_class = null, $channel = null, $endpoint_id = null, $before = null, $after = null, $with_content = true, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByMsg'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1MessageAttemptListByMsg'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptListByMsg, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptListByMsg, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling MessageAttemptApi.v1MessageAttemptListByMsg, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'msg_id' is set
+ if ($msg_id === null || (is_array($msg_id) && count($msg_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $msg_id when calling v1MessageAttemptListByMsg'
+ );
+ }
+ if (strlen($msg_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageAttemptApi.v1MessageAttemptListByMsg, must be smaller than or equal to 256.');
+ }
+ if (strlen($msg_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageAttemptApi.v1MessageAttemptListByMsg, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $msg_id)) {
+ throw new \InvalidArgumentException("invalid value for \"msg_id\" when calling MessageAttemptApi.v1MessageAttemptListByMsg, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ if ($limit !== null && $limit > 250) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling MessageAttemptApi.v1MessageAttemptListByMsg, must be smaller than or equal to 250.');
+ }
+ if ($limit !== null && $limit < 1) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling MessageAttemptApi.v1MessageAttemptListByMsg, must be bigger than or equal to 1.');
+ }
+
+
+
+
+ if ($channel !== null && strlen($channel) > 128) {
+ throw new \InvalidArgumentException('invalid length for "$channel" when calling MessageAttemptApi.v1MessageAttemptListByMsg, must be smaller than or equal to 128.');
+ }
+ if ($channel !== null && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $channel)) {
+ throw new \InvalidArgumentException("invalid value for \"channel\" when calling MessageAttemptApi.v1MessageAttemptListByMsg, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ if ($endpoint_id !== null && strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling MessageAttemptApi.v1MessageAttemptListByMsg, must be smaller than or equal to 256.');
+ }
+ if ($endpoint_id !== null && strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling MessageAttemptApi.v1MessageAttemptListByMsg, must be bigger than or equal to 1.');
+ }
+ if ($endpoint_id !== null && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling MessageAttemptApi.v1MessageAttemptListByMsg, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/attempt/msg/{msg_id}/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $iterator,
+ 'iterator', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $status,
+ 'status', // param base name
+ 'MessageStatus', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $status_code_class,
+ 'status_code_class', // param base name
+ 'StatusCodeClass', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $channel,
+ 'channel', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endpoint_id,
+ 'endpoint_id', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $before,
+ 'before', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $after,
+ 'after', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $with_content,
+ 'with_content', // param base name
+ 'boolean', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $event_types,
+ 'event_types', // param base name
+ 'array', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($msg_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'msg_id' . '}',
+ ObjectSerializer::toPathValue($msg_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1MessageAttemptListByMsgDeprecated
+ *
+ * List Attempts
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $endpoint_id Filter the attempts based on the attempted endpoint (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param StatusCodeClass $status_code_class Filter response based on the HTTP status code (optional)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByMsgDeprecated'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\ListResponseMessageAttemptOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ * @deprecated
+ */
+ public function v1MessageAttemptListByMsgDeprecated($app_id, $msg_id, $limit = null, $iterator = null, $endpoint_id = null, $channel = null, $status = null, $before = null, $after = null, $status_code_class = null, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByMsgDeprecated'][0])
+ {
+ list($response) = $this->v1MessageAttemptListByMsgDeprecatedWithHttpInfo($app_id, $msg_id, $limit, $iterator, $endpoint_id, $channel, $status, $before, $after, $status_code_class, $event_types, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation v1MessageAttemptListByMsgDeprecatedWithHttpInfo
+ *
+ * List Attempts
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $endpoint_id Filter the attempts based on the attempted endpoint (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param StatusCodeClass $status_code_class Filter response based on the HTTP status code (optional)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByMsgDeprecated'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\ListResponseMessageAttemptOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ * @deprecated
+ */
+ public function v1MessageAttemptListByMsgDeprecatedWithHttpInfo($app_id, $msg_id, $limit = null, $iterator = null, $endpoint_id = null, $channel = null, $status = null, $before = null, $after = null, $status_code_class = null, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByMsgDeprecated'][0])
+ {
+ $request = $this->v1MessageAttemptListByMsgDeprecatedRequest($app_id, $msg_id, $limit, $iterator, $endpoint_id, $channel, $status, $before, $after, $status_code_class, $event_types, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\Svix\ApiClient\Model\ListResponseMessageAttemptOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\ListResponseMessageAttemptOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\ListResponseMessageAttemptOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\ListResponseMessageAttemptOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\ListResponseMessageAttemptOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1MessageAttemptListByMsgDeprecatedAsync
+ *
+ * List Attempts
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $endpoint_id Filter the attempts based on the attempted endpoint (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param StatusCodeClass $status_code_class Filter response based on the HTTP status code (optional)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByMsgDeprecated'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ * @deprecated
+ */
+ public function v1MessageAttemptListByMsgDeprecatedAsync($app_id, $msg_id, $limit = null, $iterator = null, $endpoint_id = null, $channel = null, $status = null, $before = null, $after = null, $status_code_class = null, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByMsgDeprecated'][0])
+ {
+ return $this->v1MessageAttemptListByMsgDeprecatedAsyncWithHttpInfo($app_id, $msg_id, $limit, $iterator, $endpoint_id, $channel, $status, $before, $after, $status_code_class, $event_types, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1MessageAttemptListByMsgDeprecatedAsyncWithHttpInfo
+ *
+ * List Attempts
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $endpoint_id Filter the attempts based on the attempted endpoint (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param StatusCodeClass $status_code_class Filter response based on the HTTP status code (optional)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByMsgDeprecated'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ * @deprecated
+ */
+ public function v1MessageAttemptListByMsgDeprecatedAsyncWithHttpInfo($app_id, $msg_id, $limit = null, $iterator = null, $endpoint_id = null, $channel = null, $status = null, $before = null, $after = null, $status_code_class = null, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByMsgDeprecated'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\ListResponseMessageAttemptOut';
+ $request = $this->v1MessageAttemptListByMsgDeprecatedRequest($app_id, $msg_id, $limit, $iterator, $endpoint_id, $channel, $status, $before, $after, $status_code_class, $event_types, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1MessageAttemptListByMsgDeprecated'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param int $limit Limit the number of returned items (optional)
+ * @param string $iterator The iterator returned from a prior invocation (optional)
+ * @param string $endpoint_id Filter the attempts based on the attempted endpoint (optional)
+ * @param string $channel Filter response based on the channel (optional)
+ * @param MessageStatus $status Filter response based on the delivery status (optional)
+ * @param \DateTime $before Only include items created before a certain date (optional)
+ * @param \DateTime $after Only include items created after a certain date (optional)
+ * @param StatusCodeClass $status_code_class Filter response based on the HTTP status code (optional)
+ * @param string[] $event_types Filter response based on the event type (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptListByMsgDeprecated'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ * @deprecated
+ */
+ public function v1MessageAttemptListByMsgDeprecatedRequest($app_id, $msg_id, $limit = null, $iterator = null, $endpoint_id = null, $channel = null, $status = null, $before = null, $after = null, $status_code_class = null, $event_types = null, string $contentType = self::contentTypes['v1MessageAttemptListByMsgDeprecated'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1MessageAttemptListByMsgDeprecated'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptListByMsgDeprecated, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptListByMsgDeprecated, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling MessageAttemptApi.v1MessageAttemptListByMsgDeprecated, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'msg_id' is set
+ if ($msg_id === null || (is_array($msg_id) && count($msg_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $msg_id when calling v1MessageAttemptListByMsgDeprecated'
+ );
+ }
+ if (strlen($msg_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageAttemptApi.v1MessageAttemptListByMsgDeprecated, must be smaller than or equal to 256.');
+ }
+ if (strlen($msg_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageAttemptApi.v1MessageAttemptListByMsgDeprecated, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $msg_id)) {
+ throw new \InvalidArgumentException("invalid value for \"msg_id\" when calling MessageAttemptApi.v1MessageAttemptListByMsgDeprecated, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ if ($limit !== null && $limit > 250) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling MessageAttemptApi.v1MessageAttemptListByMsgDeprecated, must be smaller than or equal to 250.');
+ }
+ if ($limit !== null && $limit < 1) {
+ throw new \InvalidArgumentException('invalid value for "$limit" when calling MessageAttemptApi.v1MessageAttemptListByMsgDeprecated, must be bigger than or equal to 1.');
+ }
+
+
+ if ($endpoint_id !== null && strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling MessageAttemptApi.v1MessageAttemptListByMsgDeprecated, must be smaller than or equal to 256.');
+ }
+ if ($endpoint_id !== null && strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling MessageAttemptApi.v1MessageAttemptListByMsgDeprecated, must be bigger than or equal to 1.');
+ }
+ if ($endpoint_id !== null && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling MessageAttemptApi.v1MessageAttemptListByMsgDeprecated, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ if ($channel !== null && strlen($channel) > 128) {
+ throw new \InvalidArgumentException('invalid length for "$channel" when calling MessageAttemptApi.v1MessageAttemptListByMsgDeprecated, must be smaller than or equal to 128.');
+ }
+ if ($channel !== null && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $channel)) {
+ throw new \InvalidArgumentException("invalid value for \"channel\" when calling MessageAttemptApi.v1MessageAttemptListByMsgDeprecated, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+
+
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/msg/{msg_id}/attempt/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $limit,
+ 'limit', // param base name
+ 'integer', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $iterator,
+ 'iterator', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $endpoint_id,
+ 'endpoint_id', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $channel,
+ 'channel', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $status,
+ 'status', // param base name
+ 'MessageStatus', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $before,
+ 'before', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $after,
+ 'after', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $status_code_class,
+ 'status_code_class', // param base name
+ 'StatusCodeClass', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $event_types,
+ 'event_types', // param base name
+ 'array', // openApiType
+ 'form', // style
+ true, // explode
+ false // required
+ ) ?? []);
+
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($msg_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'msg_id' . '}',
+ ObjectSerializer::toPathValue($msg_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'GET',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Operation v1MessageAttemptResend
+ *
+ * Resend Webhook
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptResend'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return void
+ */
+ public function v1MessageAttemptResend($app_id, $msg_id, $endpoint_id, $idempotency_key = null, string $contentType = self::contentTypes['v1MessageAttemptResend'][0])
+ {
+ $this->v1MessageAttemptResendWithHttpInfo($app_id, $msg_id, $endpoint_id, $idempotency_key, $contentType);
+ }
+
+ /**
+ * Operation v1MessageAttemptResendWithHttpInfo
+ *
+ * Resend Webhook
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptResend'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of null, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function v1MessageAttemptResendWithHttpInfo($app_id, $msg_id, $endpoint_id, $idempotency_key = null, string $contentType = self::contentTypes['v1MessageAttemptResend'][0])
+ {
+ $request = $this->v1MessageAttemptResendRequest($app_id, $msg_id, $endpoint_id, $idempotency_key, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ return [null, $statusCode, $response->getHeaders()];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation v1MessageAttemptResendAsync
+ *
+ * Resend Webhook
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptResend'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageAttemptResendAsync($app_id, $msg_id, $endpoint_id, $idempotency_key = null, string $contentType = self::contentTypes['v1MessageAttemptResend'][0])
+ {
+ return $this->v1MessageAttemptResendAsyncWithHttpInfo($app_id, $msg_id, $endpoint_id, $idempotency_key, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation v1MessageAttemptResendAsyncWithHttpInfo
+ *
+ * Resend Webhook
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptResend'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function v1MessageAttemptResendAsyncWithHttpInfo($app_id, $msg_id, $endpoint_id, $idempotency_key = null, string $contentType = self::contentTypes['v1MessageAttemptResend'][0])
+ {
+ $returnType = '';
+ $request = $this->v1MessageAttemptResendRequest($app_id, $msg_id, $endpoint_id, $idempotency_key, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ return [null, $response->getStatusCode(), $response->getHeaders()];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'v1MessageAttemptResend'
+ *
+ * @param string $app_id The app's ID or UID (required)
+ * @param string $msg_id The msg's ID or UID (required)
+ * @param string $endpoint_id The ep's ID or UID (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['v1MessageAttemptResend'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function v1MessageAttemptResendRequest($app_id, $msg_id, $endpoint_id, $idempotency_key = null, string $contentType = self::contentTypes['v1MessageAttemptResend'][0])
+ {
+
+ // verify the required parameter 'app_id' is set
+ if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_id when calling v1MessageAttemptResend'
+ );
+ }
+ if (strlen($app_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptResend, must be smaller than or equal to 256.');
+ }
+ if (strlen($app_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$app_id" when calling MessageAttemptApi.v1MessageAttemptResend, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $app_id)) {
+ throw new \InvalidArgumentException("invalid value for \"app_id\" when calling MessageAttemptApi.v1MessageAttemptResend, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'msg_id' is set
+ if ($msg_id === null || (is_array($msg_id) && count($msg_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $msg_id when calling v1MessageAttemptResend'
+ );
+ }
+ if (strlen($msg_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageAttemptApi.v1MessageAttemptResend, must be smaller than or equal to 256.');
+ }
+ if (strlen($msg_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$msg_id" when calling MessageAttemptApi.v1MessageAttemptResend, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $msg_id)) {
+ throw new \InvalidArgumentException("invalid value for \"msg_id\" when calling MessageAttemptApi.v1MessageAttemptResend, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ // verify the required parameter 'endpoint_id' is set
+ if ($endpoint_id === null || (is_array($endpoint_id) && count($endpoint_id) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $endpoint_id when calling v1MessageAttemptResend'
+ );
+ }
+ if (strlen($endpoint_id) > 256) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling MessageAttemptApi.v1MessageAttemptResend, must be smaller than or equal to 256.');
+ }
+ if (strlen($endpoint_id) < 1) {
+ throw new \InvalidArgumentException('invalid length for "$endpoint_id" when calling MessageAttemptApi.v1MessageAttemptResend, must be bigger than or equal to 1.');
+ }
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $endpoint_id)) {
+ throw new \InvalidArgumentException("invalid value for \"endpoint_id\" when calling MessageAttemptApi.v1MessageAttemptResend, must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+
+
+ $resourcePath = '/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+ // header params
+ if ($idempotency_key !== null) {
+ $headerParams['idempotency-key'] = ObjectSerializer::toHeaderValue($idempotency_key);
+ }
+
+ // path params
+ if ($app_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'app_id' . '}',
+ ObjectSerializer::toPathValue($app_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($msg_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'msg_id' . '}',
+ ObjectSerializer::toPathValue($msg_id),
+ $resourcePath
+ );
+ }
+ // path params
+ if ($endpoint_id !== null) {
+ $resourcePath = str_replace(
+ '{' . 'endpoint_id' . '}',
+ ObjectSerializer::toPathValue($endpoint_id),
+ $resourcePath
+ );
+ }
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Create http client option
+ *
+ * @throws \RuntimeException on file opening failure
+ * @return array of http client options
+ */
+ protected function createHttpClientOption()
+ {
+ $options = [];
+ if ($this->config->getDebug()) {
+ $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
+ if (!$options[RequestOptions::DEBUG]) {
+ throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
+ }
+ }
+
+ return $options;
+ }
+}
diff --git a/lib/Api/StatisticsApi.php b/lib/Api/StatisticsApi.php
new file mode 100644
index 0000000..1169fef
--- /dev/null
+++ b/lib/Api/StatisticsApi.php
@@ -0,0 +1,600 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Api;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Psr7\MultipartStream;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\RequestOptions;
+use Svix\ApiClient\ApiException;
+use Svix\ApiClient\Configuration;
+use Svix\ApiClient\HeaderSelector;
+use Svix\ApiClient\ObjectSerializer;
+
+/**
+ * StatisticsApi Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ */
+class StatisticsApi
+{
+ /**
+ * @var ClientInterface
+ */
+ protected $client;
+
+ /**
+ * @var Configuration
+ */
+ protected $config;
+
+ /**
+ * @var HeaderSelector
+ */
+ protected $headerSelector;
+
+ /**
+ * @var int Host index
+ */
+ protected $hostIndex;
+
+ /** @var string[] $contentTypes **/
+ public const contentTypes = [
+ 'calculateAggregateAppStats' => [
+ 'application/json',
+ ],
+ ];
+
+/**
+ * @param ClientInterface $client
+ * @param Configuration $config
+ * @param HeaderSelector $selector
+ * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
+ */
+ public function __construct(
+ ClientInterface $client = null,
+ Configuration $config = null,
+ HeaderSelector $selector = null,
+ $hostIndex = 0
+ ) {
+ $this->client = $client ?: new Client();
+ $this->config = $config ?: new Configuration();
+ $this->headerSelector = $selector ?: new HeaderSelector();
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Set the host index
+ *
+ * @param int $hostIndex Host index (required)
+ */
+ public function setHostIndex($hostIndex): void
+ {
+ $this->hostIndex = $hostIndex;
+ }
+
+ /**
+ * Get the host index
+ *
+ * @return int Host index
+ */
+ public function getHostIndex()
+ {
+ return $this->hostIndex;
+ }
+
+ /**
+ * @return Configuration
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ /**
+ * Operation calculateAggregateAppStats
+ *
+ * Calculate Aggregate App Stats
+ *
+ * @param \Svix\ApiClient\Model\AppUsageStatsIn $app_usage_stats_in app_usage_stats_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateAggregateAppStats'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \Svix\ApiClient\Model\AppUsageStatsOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut
+ */
+ public function calculateAggregateAppStats($app_usage_stats_in, $idempotency_key = null, string $contentType = self::contentTypes['calculateAggregateAppStats'][0])
+ {
+ list($response) = $this->calculateAggregateAppStatsWithHttpInfo($app_usage_stats_in, $idempotency_key, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation calculateAggregateAppStatsWithHttpInfo
+ *
+ * Calculate Aggregate App Stats
+ *
+ * @param \Svix\ApiClient\Model\AppUsageStatsIn $app_usage_stats_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateAggregateAppStats'] to see the possible values for this operation
+ *
+ * @throws \Svix\ApiClient\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \Svix\ApiClient\Model\AppUsageStatsOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HttpErrorOut|\Svix\ApiClient\Model\HTTPValidationError|\Svix\ApiClient\Model\HttpErrorOut, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function calculateAggregateAppStatsWithHttpInfo($app_usage_stats_in, $idempotency_key = null, string $contentType = self::contentTypes['calculateAggregateAppStats'][0])
+ {
+ $request = $this->calculateAggregateAppStatsRequest($app_usage_stats_in, $idempotency_key, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 202:
+ if ('\Svix\ApiClient\Model\AppUsageStatsOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\AppUsageStatsOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\AppUsageStatsOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 400:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 401:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 403:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 404:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 409:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 422:
+ if ('\Svix\ApiClient\Model\HTTPValidationError' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HTTPValidationError' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HTTPValidationError', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ case 429:
+ if ('\Svix\ApiClient\Model\HttpErrorOut' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\Svix\ApiClient\Model\HttpErrorOut' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\Svix\ApiClient\Model\HttpErrorOut', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\Svix\ApiClient\Model\AppUsageStatsOut';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 202:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\AppUsageStatsOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 400:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 401:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 403:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 404:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 409:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 422:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HTTPValidationError',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ case 429:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\Svix\ApiClient\Model\HttpErrorOut',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation calculateAggregateAppStatsAsync
+ *
+ * Calculate Aggregate App Stats
+ *
+ * @param \Svix\ApiClient\Model\AppUsageStatsIn $app_usage_stats_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateAggregateAppStats'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function calculateAggregateAppStatsAsync($app_usage_stats_in, $idempotency_key = null, string $contentType = self::contentTypes['calculateAggregateAppStats'][0])
+ {
+ return $this->calculateAggregateAppStatsAsyncWithHttpInfo($app_usage_stats_in, $idempotency_key, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation calculateAggregateAppStatsAsyncWithHttpInfo
+ *
+ * Calculate Aggregate App Stats
+ *
+ * @param \Svix\ApiClient\Model\AppUsageStatsIn $app_usage_stats_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateAggregateAppStats'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function calculateAggregateAppStatsAsyncWithHttpInfo($app_usage_stats_in, $idempotency_key = null, string $contentType = self::contentTypes['calculateAggregateAppStats'][0])
+ {
+ $returnType = '\Svix\ApiClient\Model\AppUsageStatsOut';
+ $request = $this->calculateAggregateAppStatsRequest($app_usage_stats_in, $idempotency_key, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'calculateAggregateAppStats'
+ *
+ * @param \Svix\ApiClient\Model\AppUsageStatsIn $app_usage_stats_in (required)
+ * @param string $idempotency_key The request's idempotency key (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['calculateAggregateAppStats'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function calculateAggregateAppStatsRequest($app_usage_stats_in, $idempotency_key = null, string $contentType = self::contentTypes['calculateAggregateAppStats'][0])
+ {
+
+ // verify the required parameter 'app_usage_stats_in' is set
+ if ($app_usage_stats_in === null || (is_array($app_usage_stats_in) && count($app_usage_stats_in) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $app_usage_stats_in when calling calculateAggregateAppStats'
+ );
+ }
+
+
+
+ $resourcePath = '/api/v1/stats/usage/app/';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+
+ // header params
+ if ($idempotency_key !== null) {
+ $headerParams['idempotency-key'] = ObjectSerializer::toHeaderValue($idempotency_key);
+ }
+
+
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['application/json', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ if (isset($app_usage_stats_in)) {
+ if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the body
+ $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($app_usage_stats_in));
+ } else {
+ $httpBody = $app_usage_stats_in;
+ }
+ } elseif (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+ // this endpoint requires Bearer authentication (access token)
+ if (!empty($this->config->getAccessToken())) {
+ $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+ }
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
+ /**
+ * Create http client option
+ *
+ * @throws \RuntimeException on file opening failure
+ * @return array of http client options
+ */
+ protected function createHttpClientOption()
+ {
+ $options = [];
+ if ($this->config->getDebug()) {
+ $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
+ if (!$options[RequestOptions::DEBUG]) {
+ throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
+ }
+ }
+
+ return $options;
+ }
+}
diff --git a/lib/ApiException.php b/lib/ApiException.php
new file mode 100644
index 0000000..dacfe93
--- /dev/null
+++ b/lib/ApiException.php
@@ -0,0 +1,119 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient;
+
+use \Exception;
+
+/**
+ * ApiException Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ */
+class ApiException extends Exception
+{
+ /**
+ * The HTTP body of the server response either as Json or string.
+ *
+ * @var \stdClass|string|null
+ */
+ protected $responseBody;
+
+ /**
+ * The HTTP header of the server response.
+ *
+ * @var string[]|null
+ */
+ protected $responseHeaders;
+
+ /**
+ * The deserialized response object
+ *
+ * @var \stdClass|string|null
+ */
+ protected $responseObject;
+
+ /**
+ * Constructor
+ *
+ * @param string $message Error message
+ * @param int $code HTTP status code
+ * @param string[]|null $responseHeaders HTTP response header
+ * @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string
+ */
+ public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null)
+ {
+ parent::__construct($message, $code);
+ $this->responseHeaders = $responseHeaders;
+ $this->responseBody = $responseBody;
+ }
+
+ /**
+ * Gets the HTTP response header
+ *
+ * @return string[]|null HTTP response header
+ */
+ public function getResponseHeaders()
+ {
+ return $this->responseHeaders;
+ }
+
+ /**
+ * Gets the HTTP body of the server response either as Json or string
+ *
+ * @return \stdClass|string|null HTTP body of the server response either as \stdClass or string
+ */
+ public function getResponseBody()
+ {
+ return $this->responseBody;
+ }
+
+ /**
+ * Sets the deserialized response object (during deserialization)
+ *
+ * @param mixed $obj Deserialized response object
+ *
+ * @return void
+ */
+ public function setResponseObject($obj)
+ {
+ $this->responseObject = $obj;
+ }
+
+ /**
+ * Gets the deserialized response object (during deserialization)
+ *
+ * @return mixed the deserialized response object
+ */
+ public function getResponseObject()
+ {
+ return $this->responseObject;
+ }
+}
diff --git a/lib/Configuration.php b/lib/Configuration.php
new file mode 100644
index 0000000..562a083
--- /dev/null
+++ b/lib/Configuration.php
@@ -0,0 +1,535 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient;
+
+/**
+ * Configuration Class Doc Comment
+ * PHP version 7.4
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ */
+class Configuration
+{
+ public const BOOLEAN_FORMAT_INT = 'int';
+ public const BOOLEAN_FORMAT_STRING = 'string';
+
+ /**
+ * @var Configuration
+ */
+ private static $defaultConfiguration;
+
+ /**
+ * Associate array to store API key(s)
+ *
+ * @var string[]
+ */
+ protected $apiKeys = [];
+
+ /**
+ * Associate array to store API prefix (e.g. Bearer)
+ *
+ * @var string[]
+ */
+ protected $apiKeyPrefixes = [];
+
+ /**
+ * Access token for OAuth/Bearer authentication
+ *
+ * @var string
+ */
+ protected $accessToken = '';
+
+ /**
+ * Boolean format for query string
+ *
+ * @var string
+ */
+ protected $booleanFormatForQueryString = self::BOOLEAN_FORMAT_INT;
+
+ /**
+ * Username for HTTP basic authentication
+ *
+ * @var string
+ */
+ protected $username = '';
+
+ /**
+ * Password for HTTP basic authentication
+ *
+ * @var string
+ */
+ protected $password = '';
+
+ /**
+ * The host
+ *
+ * @var string
+ */
+ protected $host = 'https://api.eu.svix.com';
+
+ /**
+ * User agent of the HTTP request, set to "OpenAPI-Generator/{version}/PHP" by default
+ *
+ * @var string
+ */
+ protected $userAgent = 'OpenAPI-Generator/1.0.0/PHP';
+
+ /**
+ * Debug switch (default set to false)
+ *
+ * @var bool
+ */
+ protected $debug = false;
+
+ /**
+ * Debug file location (log to STDOUT by default)
+ *
+ * @var string
+ */
+ protected $debugFile = 'php://output';
+
+ /**
+ * Debug file location (log to STDOUT by default)
+ *
+ * @var string
+ */
+ protected $tempFolderPath;
+
+ /**
+ * Constructor
+ */
+ public function __construct()
+ {
+ $this->tempFolderPath = sys_get_temp_dir();
+ }
+
+ /**
+ * Sets API key
+ *
+ * @param string $apiKeyIdentifier API key identifier (authentication scheme)
+ * @param string $key API key or token
+ *
+ * @return $this
+ */
+ public function setApiKey($apiKeyIdentifier, $key)
+ {
+ $this->apiKeys[$apiKeyIdentifier] = $key;
+ return $this;
+ }
+
+ /**
+ * Gets API key
+ *
+ * @param string $apiKeyIdentifier API key identifier (authentication scheme)
+ *
+ * @return null|string API key or token
+ */
+ public function getApiKey($apiKeyIdentifier)
+ {
+ return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null;
+ }
+
+ /**
+ * Sets the prefix for API key (e.g. Bearer)
+ *
+ * @param string $apiKeyIdentifier API key identifier (authentication scheme)
+ * @param string $prefix API key prefix, e.g. Bearer
+ *
+ * @return $this
+ */
+ public function setApiKeyPrefix($apiKeyIdentifier, $prefix)
+ {
+ $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix;
+ return $this;
+ }
+
+ /**
+ * Gets API key prefix
+ *
+ * @param string $apiKeyIdentifier API key identifier (authentication scheme)
+ *
+ * @return null|string
+ */
+ public function getApiKeyPrefix($apiKeyIdentifier)
+ {
+ return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null;
+ }
+
+ /**
+ * Sets the access token for OAuth
+ *
+ * @param string $accessToken Token for OAuth
+ *
+ * @return $this
+ */
+ public function setAccessToken($accessToken)
+ {
+ $this->accessToken = $accessToken;
+ return $this;
+ }
+
+ /**
+ * Gets the access token for OAuth
+ *
+ * @return string Access token for OAuth
+ */
+ public function getAccessToken()
+ {
+ return $this->accessToken;
+ }
+
+ /**
+ * Sets boolean format for query string.
+ *
+ * @param string $booleanFormatForQueryString Boolean format for query string
+ *
+ * @return $this
+ */
+ public function setBooleanFormatForQueryString(string $booleanFormat)
+ {
+ $this->booleanFormatForQueryString = $booleanFormat;
+
+ return $this;
+ }
+
+ /**
+ * Gets boolean format for query string.
+ *
+ * @return string Boolean format for query string
+ */
+ public function getBooleanFormatForQueryString(): string
+ {
+ return $this->booleanFormatForQueryString;
+ }
+
+ /**
+ * Sets the username for HTTP basic authentication
+ *
+ * @param string $username Username for HTTP basic authentication
+ *
+ * @return $this
+ */
+ public function setUsername($username)
+ {
+ $this->username = $username;
+ return $this;
+ }
+
+ /**
+ * Gets the username for HTTP basic authentication
+ *
+ * @return string Username for HTTP basic authentication
+ */
+ public function getUsername()
+ {
+ return $this->username;
+ }
+
+ /**
+ * Sets the password for HTTP basic authentication
+ *
+ * @param string $password Password for HTTP basic authentication
+ *
+ * @return $this
+ */
+ public function setPassword($password)
+ {
+ $this->password = $password;
+ return $this;
+ }
+
+ /**
+ * Gets the password for HTTP basic authentication
+ *
+ * @return string Password for HTTP basic authentication
+ */
+ public function getPassword()
+ {
+ return $this->password;
+ }
+
+ /**
+ * Sets the host
+ *
+ * @param string $host Host
+ *
+ * @return $this
+ */
+ public function setHost($host)
+ {
+ $this->host = $host;
+ return $this;
+ }
+
+ /**
+ * Gets the host
+ *
+ * @return string Host
+ */
+ public function getHost()
+ {
+ return $this->host;
+ }
+
+ /**
+ * Sets the user agent of the api client
+ *
+ * @param string $userAgent the user agent of the api client
+ *
+ * @throws \InvalidArgumentException
+ * @return $this
+ */
+ public function setUserAgent($userAgent)
+ {
+ if (!is_string($userAgent)) {
+ throw new \InvalidArgumentException('User-agent must be a string.');
+ }
+
+ $this->userAgent = $userAgent;
+ return $this;
+ }
+
+ /**
+ * Gets the user agent of the api client
+ *
+ * @return string user agent
+ */
+ public function getUserAgent()
+ {
+ return $this->userAgent;
+ }
+
+ /**
+ * Sets debug flag
+ *
+ * @param bool $debug Debug flag
+ *
+ * @return $this
+ */
+ public function setDebug($debug)
+ {
+ $this->debug = $debug;
+ return $this;
+ }
+
+ /**
+ * Gets the debug flag
+ *
+ * @return bool
+ */
+ public function getDebug()
+ {
+ return $this->debug;
+ }
+
+ /**
+ * Sets the debug file
+ *
+ * @param string $debugFile Debug file
+ *
+ * @return $this
+ */
+ public function setDebugFile($debugFile)
+ {
+ $this->debugFile = $debugFile;
+ return $this;
+ }
+
+ /**
+ * Gets the debug file
+ *
+ * @return string
+ */
+ public function getDebugFile()
+ {
+ return $this->debugFile;
+ }
+
+ /**
+ * Sets the temp folder path
+ *
+ * @param string $tempFolderPath Temp folder path
+ *
+ * @return $this
+ */
+ public function setTempFolderPath($tempFolderPath)
+ {
+ $this->tempFolderPath = $tempFolderPath;
+ return $this;
+ }
+
+ /**
+ * Gets the temp folder path
+ *
+ * @return string Temp folder path
+ */
+ public function getTempFolderPath()
+ {
+ return $this->tempFolderPath;
+ }
+
+ /**
+ * Gets the default configuration instance
+ *
+ * @return Configuration
+ */
+ public static function getDefaultConfiguration()
+ {
+ if (self::$defaultConfiguration === null) {
+ self::$defaultConfiguration = new Configuration();
+ }
+
+ return self::$defaultConfiguration;
+ }
+
+ /**
+ * Sets the default configuration instance
+ *
+ * @param Configuration $config An instance of the Configuration Object
+ *
+ * @return void
+ */
+ public static function setDefaultConfiguration(Configuration $config)
+ {
+ self::$defaultConfiguration = $config;
+ }
+
+ /**
+ * Gets the essential information for debugging
+ *
+ * @return string The report for debugging
+ */
+ public static function toDebugReport()
+ {
+ $report = 'PHP SDK (Svix\ApiClient) Debug Report:' . PHP_EOL;
+ $report .= ' OS: ' . php_uname() . PHP_EOL;
+ $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
+ $report .= ' The version of the OpenAPI document: 1.13.0' . PHP_EOL;
+ $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
+
+ return $report;
+ }
+
+ /**
+ * Get API key (with prefix if set)
+ *
+ * @param string $apiKeyIdentifier name of apikey
+ *
+ * @return null|string API key with the prefix
+ */
+ public function getApiKeyWithPrefix($apiKeyIdentifier)
+ {
+ $prefix = $this->getApiKeyPrefix($apiKeyIdentifier);
+ $apiKey = $this->getApiKey($apiKeyIdentifier);
+
+ if ($apiKey === null) {
+ return null;
+ }
+
+ if ($prefix === null) {
+ $keyWithPrefix = $apiKey;
+ } else {
+ $keyWithPrefix = $prefix . ' ' . $apiKey;
+ }
+
+ return $keyWithPrefix;
+ }
+
+ /**
+ * Returns an array of host settings
+ *
+ * @return array an array of host settings
+ */
+ public function getHostSettings()
+ {
+ return [
+ [
+ "url" => "https://api.eu.svix.com",
+ "description" => "The Svix EU region",
+ ],
+ [
+ "url" => "https://api.us.svix.com",
+ "description" => "The Svix US region",
+ ]
+ ];
+ }
+
+ /**
+ * Returns URL based on host settings, index and variables
+ *
+ * @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients
+ * @param int $hostIndex index of the host settings
+ * @param array|null $variables hash of variable and the corresponding value (optional)
+ * @return string URL based on host settings
+ */
+ public static function getHostString(array $hostsSettings, $hostIndex, array $variables = null)
+ {
+ if (null === $variables) {
+ $variables = [];
+ }
+
+ // check array index out of bound
+ if ($hostIndex < 0 || $hostIndex >= count($hostsSettings)) {
+ throw new \InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostsSettings));
+ }
+
+ $host = $hostsSettings[$hostIndex];
+ $url = $host["url"];
+
+ // go through variable and assign a value
+ foreach ($host["variables"] ?? [] as $name => $variable) {
+ if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user
+ if (!isset($variable['enum_values']) || in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum
+ $url = str_replace("{".$name."}", $variables[$name], $url);
+ } else {
+ throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"]).".");
+ }
+ } else {
+ // use default value
+ $url = str_replace("{".$name."}", $variable["default_value"], $url);
+ }
+ }
+
+ return $url;
+ }
+
+ /**
+ * Returns URL based on the index and variables
+ *
+ * @param int $index index of the host settings
+ * @param array|null $variables hash of variable and the corresponding value (optional)
+ * @return string URL based on host settings
+ */
+ public function getHostFromSettings($index, $variables = null)
+ {
+ return self::getHostString($this->getHostSettings(), $index, $variables);
+ }
+}
diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php
new file mode 100644
index 0000000..0d1a06c
--- /dev/null
+++ b/lib/HeaderSelector.php
@@ -0,0 +1,245 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient;
+
+/**
+ * HeaderSelector Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ */
+class HeaderSelector
+{
+ /**
+ * @param string[] $accept
+ * @param string $contentType
+ * @param bool $isMultipart
+ * @return string[]
+ */
+ public function selectHeaders(array $accept, string $contentType, bool $isMultipart): array
+ {
+ $headers = [];
+
+ $accept = $this->selectAcceptHeader($accept);
+ if ($accept !== null) {
+ $headers['Accept'] = $accept;
+ }
+
+ if (!$isMultipart) {
+ if($contentType === '') {
+ $contentType = 'application/json';
+ }
+
+ $headers['Content-Type'] = $contentType;
+ }
+
+ return $headers;
+ }
+
+ /**
+ * Return the header 'Accept' based on an array of Accept provided.
+ *
+ * @param string[] $accept Array of header
+ *
+ * @return null|string Accept (e.g. application/json)
+ */
+ private function selectAcceptHeader(array $accept): ?string
+ {
+ # filter out empty entries
+ $accept = array_filter($accept);
+
+ if (count($accept) === 0) {
+ return null;
+ }
+
+ # If there's only one Accept header, just use it
+ if (count($accept) === 1) {
+ return reset($accept);
+ }
+
+ # If none of the available Accept headers is of type "json", then just use all them
+ $headersWithJson = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept);
+ if (count($headersWithJson) === 0) {
+ return implode(',', $accept);
+ }
+
+ # If we got here, then we need add quality values (weight), as described in IETF RFC 9110, Items 12.4.2/12.5.1,
+ # to give the highest priority to json-like headers - recalculating the existing ones, if needed
+ return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson);
+ }
+
+ /**
+ * Create an Accept header string from the given "Accept" headers array, recalculating all weights
+ *
+ * @param string[] $accept Array of Accept Headers
+ * @param string[] $headersWithJson Array of Accept Headers of type "json"
+ *
+ * @return string "Accept" Header (e.g. "application/json, text/html; q=0.9")
+ */
+ private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headersWithJson): string
+ {
+ $processedHeaders = [
+ 'withApplicationJson' => [],
+ 'withJson' => [],
+ 'withoutJson' => [],
+ ];
+
+ foreach ($accept as $header) {
+
+ $headerData = $this->getHeaderAndWeight($header);
+
+ if (stripos($headerData['header'], 'application/json') === 0) {
+ $processedHeaders['withApplicationJson'][] = $headerData;
+ } elseif (in_array($header, $headersWithJson, true)) {
+ $processedHeaders['withJson'][] = $headerData;
+ } else {
+ $processedHeaders['withoutJson'][] = $headerData;
+ }
+ }
+
+ $acceptHeaders = [];
+ $currentWeight = 1000;
+
+ $hasMoreThan28Headers = count($accept) > 28;
+
+ foreach($processedHeaders as $headers) {
+ if (count($headers) > 0) {
+ $acceptHeaders[] = $this->adjustWeight($headers, $currentWeight, $hasMoreThan28Headers);
+ }
+ }
+
+ $acceptHeaders = array_merge(...$acceptHeaders);
+
+ return implode(',', $acceptHeaders);
+ }
+
+ /**
+ * Given an Accept header, returns an associative array splitting the header and its weight
+ *
+ * @param string $header "Accept" Header
+ *
+ * @return array with the header and its weight
+ */
+ private function getHeaderAndWeight(string $header): array
+ {
+ # matches headers with weight, splitting the header and the weight in $outputArray
+ if (preg_match('/(.*);\s*q=(1(?:\.0+)?|0\.\d+)$/', $header, $outputArray) === 1) {
+ $headerData = [
+ 'header' => $outputArray[1],
+ 'weight' => (int)($outputArray[2] * 1000),
+ ];
+ } else {
+ $headerData = [
+ 'header' => trim($header),
+ 'weight' => 1000,
+ ];
+ }
+
+ return $headerData;
+ }
+
+ /**
+ * @param array[] $headers
+ * @param float $currentWeight
+ * @param bool $hasMoreThan28Headers
+ * @return string[] array of adjusted "Accept" headers
+ */
+ private function adjustWeight(array $headers, float &$currentWeight, bool $hasMoreThan28Headers): array
+ {
+ usort($headers, function (array $a, array $b) {
+ return $b['weight'] - $a['weight'];
+ });
+
+ $acceptHeaders = [];
+ foreach ($headers as $index => $header) {
+ if($index > 0 && $headers[$index - 1]['weight'] > $header['weight'])
+ {
+ $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers);
+ }
+
+ $weight = $currentWeight;
+
+ $acceptHeaders[] = $this->buildAcceptHeader($header['header'], $weight);
+ }
+
+ $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers);
+
+ return $acceptHeaders;
+ }
+
+ /**
+ * @param string $header
+ * @param int $weight
+ * @return string
+ */
+ private function buildAcceptHeader(string $header, int $weight): string
+ {
+ if($weight === 1000) {
+ return $header;
+ }
+
+ return trim($header, '; ') . ';q=' . rtrim(sprintf('%0.3f', $weight / 1000), '0');
+ }
+
+ /**
+ * Calculate the next weight, based on the current one.
+ *
+ * If there are less than 28 "Accept" headers, the weights will be decreased by 1 on its highest significant digit, using the
+ * following formula:
+ *
+ * next weight = current weight - 10 ^ (floor(log(current weight - 1)))
+ *
+ * ( current weight minus ( 10 raised to the power of ( floor of (log to the base 10 of ( current weight minus 1 ) ) ) ) )
+ *
+ * Starting from 1000, this generates the following series:
+ *
+ * 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
+ *
+ * The resulting quality codes are closer to the average "normal" usage of them (like "q=0.9", "q=0.8" and so on), but it only works
+ * if there is a maximum of 28 "Accept" headers. If we have more than that (which is extremely unlikely), then we fall back to a 1-by-1
+ * decrement rule, which will result in quality codes like "q=0.999", "q=0.998" etc.
+ *
+ * @param int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value)
+ * @param bool $hasMoreThan28Headers
+ * @return int
+ */
+ public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int
+ {
+ if ($currentWeight <= 1) {
+ return 1;
+ }
+
+ if ($hasMoreThan28Headers) {
+ return $currentWeight - 1;
+ }
+
+ return $currentWeight - 10 ** floor( log10($currentWeight - 1) );
+ }
+}
diff --git a/lib/Model/AppPortalAccessIn.php b/lib/Model/AppPortalAccessIn.php
new file mode 100644
index 0000000..b413fdf
--- /dev/null
+++ b/lib/Model/AppPortalAccessIn.php
@@ -0,0 +1,409 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * AppPortalAccessIn Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class AppPortalAccessIn implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'AppPortalAccessIn';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'feature_flags' => 'string[]'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'feature_flags' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'feature_flags' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'feature_flags' => 'featureFlags'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'feature_flags' => 'setFeatureFlags'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'feature_flags' => 'getFeatureFlags'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('feature_flags', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets feature_flags
+ *
+ * @return string[]|null
+ */
+ public function getFeatureFlags()
+ {
+ return $this->container['feature_flags'];
+ }
+
+ /**
+ * Sets feature_flags
+ *
+ * @param string[]|null $feature_flags feature_flags
+ *
+ * @return self
+ */
+ public function setFeatureFlags($feature_flags)
+ {
+ if (is_null($feature_flags)) {
+ throw new \InvalidArgumentException('non-nullable feature_flags cannot be null');
+ }
+ $this->container['feature_flags'] = $feature_flags;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/AppPortalAccessOut.php b/lib/Model/AppPortalAccessOut.php
new file mode 100644
index 0000000..a9b06ef
--- /dev/null
+++ b/lib/Model/AppPortalAccessOut.php
@@ -0,0 +1,464 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * AppPortalAccessOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class AppPortalAccessOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'AppPortalAccessOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'url' => 'string',
+ 'token' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'url' => 'uri',
+ 'token' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'url' => false,
+ 'token' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'url' => 'url',
+ 'token' => 'token'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'url' => 'setUrl',
+ 'token' => 'setToken'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'url' => 'getUrl',
+ 'token' => 'getToken'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('url', $data ?? [], null);
+ $this->setIfExists('token', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['url'] === null) {
+ $invalidProperties[] = "'url' can't be null";
+ }
+ if ((mb_strlen($this->container['url']) > 65536)) {
+ $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 65536.";
+ }
+
+ if ((mb_strlen($this->container['url']) < 1)) {
+ $invalidProperties[] = "invalid value for 'url', the character length must be bigger than or equal to 1.";
+ }
+
+ if ($this->container['token'] === null) {
+ $invalidProperties[] = "'token' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets url
+ *
+ * @return string
+ */
+ public function getUrl()
+ {
+ return $this->container['url'];
+ }
+
+ /**
+ * Sets url
+ *
+ * @param string $url url
+ *
+ * @return self
+ */
+ public function setUrl($url)
+ {
+ if (is_null($url)) {
+ throw new \InvalidArgumentException('non-nullable url cannot be null');
+ }
+ if ((mb_strlen($url) > 65536)) {
+ throw new \InvalidArgumentException('invalid length for $url when calling AppPortalAccessOut., must be smaller than or equal to 65536.');
+ }
+ if ((mb_strlen($url) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $url when calling AppPortalAccessOut., must be bigger than or equal to 1.');
+ }
+
+ $this->container['url'] = $url;
+
+ return $this;
+ }
+
+ /**
+ * Gets token
+ *
+ * @return string
+ */
+ public function getToken()
+ {
+ return $this->container['token'];
+ }
+
+ /**
+ * Sets token
+ *
+ * @param string $token token
+ *
+ * @return self
+ */
+ public function setToken($token)
+ {
+ if (is_null($token)) {
+ throw new \InvalidArgumentException('non-nullable token cannot be null');
+ }
+ $this->container['token'] = $token;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/AppUsageStatsIn.php b/lib/Model/AppUsageStatsIn.php
new file mode 100644
index 0000000..d644a47
--- /dev/null
+++ b/lib/Model/AppUsageStatsIn.php
@@ -0,0 +1,483 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * AppUsageStatsIn Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class AppUsageStatsIn implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'AppUsageStatsIn';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'since' => '\DateTime',
+ 'until' => '\DateTime',
+ 'app_ids' => 'string[]'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'since' => 'date-time',
+ 'until' => 'date-time',
+ 'app_ids' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'since' => false,
+ 'until' => false,
+ 'app_ids' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'since' => 'since',
+ 'until' => 'until',
+ 'app_ids' => 'appIds'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'since' => 'setSince',
+ 'until' => 'setUntil',
+ 'app_ids' => 'setAppIds'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'since' => 'getSince',
+ 'until' => 'getUntil',
+ 'app_ids' => 'getAppIds'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('since', $data ?? [], null);
+ $this->setIfExists('until', $data ?? [], null);
+ $this->setIfExists('app_ids', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['since'] === null) {
+ $invalidProperties[] = "'since' can't be null";
+ }
+ if ($this->container['until'] === null) {
+ $invalidProperties[] = "'until' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets since
+ *
+ * @return \DateTime
+ */
+ public function getSince()
+ {
+ return $this->container['since'];
+ }
+
+ /**
+ * Sets since
+ *
+ * @param \DateTime $since since
+ *
+ * @return self
+ */
+ public function setSince($since)
+ {
+ if (is_null($since)) {
+ throw new \InvalidArgumentException('non-nullable since cannot be null');
+ }
+ $this->container['since'] = $since;
+
+ return $this;
+ }
+
+ /**
+ * Gets until
+ *
+ * @return \DateTime
+ */
+ public function getUntil()
+ {
+ return $this->container['until'];
+ }
+
+ /**
+ * Sets until
+ *
+ * @param \DateTime $until until
+ *
+ * @return self
+ */
+ public function setUntil($until)
+ {
+ if (is_null($until)) {
+ throw new \InvalidArgumentException('non-nullable until cannot be null');
+ }
+ $this->container['until'] = $until;
+
+ return $this;
+ }
+
+ /**
+ * Gets app_ids
+ *
+ * @return string[]|null
+ */
+ public function getAppIds()
+ {
+ return $this->container['app_ids'];
+ }
+
+ /**
+ * Sets app_ids
+ *
+ * @param string[]|null $app_ids app_ids
+ *
+ * @return self
+ */
+ public function setAppIds($app_ids)
+ {
+ if (is_null($app_ids)) {
+ throw new \InvalidArgumentException('non-nullable app_ids cannot be null');
+ }
+ $this->container['app_ids'] = $app_ids;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/AppUsageStatsOut.php b/lib/Model/AppUsageStatsOut.php
new file mode 100644
index 0000000..7cf41b8
--- /dev/null
+++ b/lib/Model/AppUsageStatsOut.php
@@ -0,0 +1,486 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * AppUsageStatsOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class AppUsageStatsOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'AppUsageStatsOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'id' => 'string',
+ 'status' => '\Svix\ApiClient\Model\BackgroundTaskStatus',
+ 'task' => '\Svix\ApiClient\Model\BackgroundTaskType'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'id' => null,
+ 'status' => null,
+ 'task' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'id' => false,
+ 'status' => false,
+ 'task' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'id' => 'id',
+ 'status' => 'status',
+ 'task' => 'task'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'id' => 'setId',
+ 'status' => 'setStatus',
+ 'task' => 'setTask'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'id' => 'getId',
+ 'status' => 'getStatus',
+ 'task' => 'getTask'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('id', $data ?? [], null);
+ $this->setIfExists('status', $data ?? [], null);
+ $this->setIfExists('task', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['id'] === null) {
+ $invalidProperties[] = "'id' can't be null";
+ }
+ if ($this->container['status'] === null) {
+ $invalidProperties[] = "'status' can't be null";
+ }
+ if ($this->container['task'] === null) {
+ $invalidProperties[] = "'task' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets id
+ *
+ * @return string
+ */
+ public function getId()
+ {
+ return $this->container['id'];
+ }
+
+ /**
+ * Sets id
+ *
+ * @param string $id id
+ *
+ * @return self
+ */
+ public function setId($id)
+ {
+ if (is_null($id)) {
+ throw new \InvalidArgumentException('non-nullable id cannot be null');
+ }
+ $this->container['id'] = $id;
+
+ return $this;
+ }
+
+ /**
+ * Gets status
+ *
+ * @return \Svix\ApiClient\Model\BackgroundTaskStatus
+ */
+ public function getStatus()
+ {
+ return $this->container['status'];
+ }
+
+ /**
+ * Sets status
+ *
+ * @param \Svix\ApiClient\Model\BackgroundTaskStatus $status status
+ *
+ * @return self
+ */
+ public function setStatus($status)
+ {
+ if (is_null($status)) {
+ throw new \InvalidArgumentException('non-nullable status cannot be null');
+ }
+ $this->container['status'] = $status;
+
+ return $this;
+ }
+
+ /**
+ * Gets task
+ *
+ * @return \Svix\ApiClient\Model\BackgroundTaskType
+ */
+ public function getTask()
+ {
+ return $this->container['task'];
+ }
+
+ /**
+ * Sets task
+ *
+ * @param \Svix\ApiClient\Model\BackgroundTaskType $task task
+ *
+ * @return self
+ */
+ public function setTask($task)
+ {
+ if (is_null($task)) {
+ throw new \InvalidArgumentException('non-nullable task cannot be null');
+ }
+ $this->container['task'] = $task;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ApplicationIn.php b/lib/Model/ApplicationIn.php
new file mode 100644
index 0000000..b56a451
--- /dev/null
+++ b/lib/Model/ApplicationIn.php
@@ -0,0 +1,561 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * ApplicationIn Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class ApplicationIn implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ApplicationIn';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'name' => 'string',
+ 'rate_limit' => 'int',
+ 'uid' => 'string',
+ 'metadata' => 'array'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'name' => null,
+ 'rate_limit' => 'uint16',
+ 'uid' => null,
+ 'metadata' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'name' => false,
+ 'rate_limit' => false,
+ 'uid' => false,
+ 'metadata' => true
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'name' => 'name',
+ 'rate_limit' => 'rateLimit',
+ 'uid' => 'uid',
+ 'metadata' => 'metadata'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'name' => 'setName',
+ 'rate_limit' => 'setRateLimit',
+ 'uid' => 'setUid',
+ 'metadata' => 'setMetadata'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'name' => 'getName',
+ 'rate_limit' => 'getRateLimit',
+ 'uid' => 'getUid',
+ 'metadata' => 'getMetadata'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('name', $data ?? [], null);
+ $this->setIfExists('rate_limit', $data ?? [], null);
+ $this->setIfExists('uid', $data ?? [], null);
+ $this->setIfExists('metadata', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['name'] === null) {
+ $invalidProperties[] = "'name' can't be null";
+ }
+ if ((mb_strlen($this->container['name']) < 1)) {
+ $invalidProperties[] = "invalid value for 'name', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['rate_limit']) && ($this->container['rate_limit'] < 1)) {
+ $invalidProperties[] = "invalid value for 'rate_limit', must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['uid']) && (mb_strlen($this->container['uid']) > 256)) {
+ $invalidProperties[] = "invalid value for 'uid', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['uid']) && (mb_strlen($this->container['uid']) < 1)) {
+ $invalidProperties[] = "invalid value for 'uid', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['uid']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['uid'])) {
+ $invalidProperties[] = "invalid value for 'uid', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets name
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->container['name'];
+ }
+
+ /**
+ * Sets name
+ *
+ * @param string $name name
+ *
+ * @return self
+ */
+ public function setName($name)
+ {
+ if (is_null($name)) {
+ throw new \InvalidArgumentException('non-nullable name cannot be null');
+ }
+
+ if ((mb_strlen($name) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $name when calling ApplicationIn., must be bigger than or equal to 1.');
+ }
+
+ $this->container['name'] = $name;
+
+ return $this;
+ }
+
+ /**
+ * Gets rate_limit
+ *
+ * @return int|null
+ */
+ public function getRateLimit()
+ {
+ return $this->container['rate_limit'];
+ }
+
+ /**
+ * Sets rate_limit
+ *
+ * @param int|null $rate_limit rate_limit
+ *
+ * @return self
+ */
+ public function setRateLimit($rate_limit)
+ {
+ if (is_null($rate_limit)) {
+ throw new \InvalidArgumentException('non-nullable rate_limit cannot be null');
+ }
+
+ if (($rate_limit < 1)) {
+ throw new \InvalidArgumentException('invalid value for $rate_limit when calling ApplicationIn., must be bigger than or equal to 1.');
+ }
+
+ $this->container['rate_limit'] = $rate_limit;
+
+ return $this;
+ }
+
+ /**
+ * Gets uid
+ *
+ * @return string|null
+ */
+ public function getUid()
+ {
+ return $this->container['uid'];
+ }
+
+ /**
+ * Sets uid
+ *
+ * @param string|null $uid Optional unique identifier for the application
+ *
+ * @return self
+ */
+ public function setUid($uid)
+ {
+ if (is_null($uid)) {
+ throw new \InvalidArgumentException('non-nullable uid cannot be null');
+ }
+ if ((mb_strlen($uid) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $uid when calling ApplicationIn., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($uid) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $uid when calling ApplicationIn., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($uid)))) {
+ throw new \InvalidArgumentException("invalid value for \$uid when calling ApplicationIn., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['uid'] = $uid;
+
+ return $this;
+ }
+
+ /**
+ * Gets metadata
+ *
+ * @return array|null
+ */
+ public function getMetadata()
+ {
+ return $this->container['metadata'];
+ }
+
+ /**
+ * Sets metadata
+ *
+ * @param array|null $metadata metadata
+ *
+ * @return self
+ */
+ public function setMetadata($metadata)
+ {
+ if (is_null($metadata)) {
+ array_push($this->openAPINullablesSetToNull, 'metadata');
+ } else {
+ $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+ $index = array_search('metadata', $nullablesSetToNull);
+ if ($index !== FALSE) {
+ unset($nullablesSetToNull[$index]);
+ $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+ }
+ }
+ $this->container['metadata'] = $metadata;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ApplicationOut.php b/lib/Model/ApplicationOut.php
new file mode 100644
index 0000000..37de09a
--- /dev/null
+++ b/lib/Model/ApplicationOut.php
@@ -0,0 +1,666 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * ApplicationOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class ApplicationOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ApplicationOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'uid' => 'string',
+ 'name' => 'string',
+ 'rate_limit' => 'int',
+ 'id' => 'string',
+ 'created_at' => '\DateTime',
+ 'updated_at' => '\DateTime',
+ 'metadata' => 'array'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'uid' => null,
+ 'name' => null,
+ 'rate_limit' => 'uint16',
+ 'id' => null,
+ 'created_at' => 'date-time',
+ 'updated_at' => 'date-time',
+ 'metadata' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'uid' => false,
+ 'name' => false,
+ 'rate_limit' => false,
+ 'id' => false,
+ 'created_at' => false,
+ 'updated_at' => false,
+ 'metadata' => true
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'uid' => 'uid',
+ 'name' => 'name',
+ 'rate_limit' => 'rateLimit',
+ 'id' => 'id',
+ 'created_at' => 'createdAt',
+ 'updated_at' => 'updatedAt',
+ 'metadata' => 'metadata'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'uid' => 'setUid',
+ 'name' => 'setName',
+ 'rate_limit' => 'setRateLimit',
+ 'id' => 'setId',
+ 'created_at' => 'setCreatedAt',
+ 'updated_at' => 'setUpdatedAt',
+ 'metadata' => 'setMetadata'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'uid' => 'getUid',
+ 'name' => 'getName',
+ 'rate_limit' => 'getRateLimit',
+ 'id' => 'getId',
+ 'created_at' => 'getCreatedAt',
+ 'updated_at' => 'getUpdatedAt',
+ 'metadata' => 'getMetadata'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('uid', $data ?? [], null);
+ $this->setIfExists('name', $data ?? [], null);
+ $this->setIfExists('rate_limit', $data ?? [], null);
+ $this->setIfExists('id', $data ?? [], null);
+ $this->setIfExists('created_at', $data ?? [], null);
+ $this->setIfExists('updated_at', $data ?? [], null);
+ $this->setIfExists('metadata', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if (!is_null($this->container['uid']) && (mb_strlen($this->container['uid']) > 256)) {
+ $invalidProperties[] = "invalid value for 'uid', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['uid']) && (mb_strlen($this->container['uid']) < 1)) {
+ $invalidProperties[] = "invalid value for 'uid', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['uid']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['uid'])) {
+ $invalidProperties[] = "invalid value for 'uid', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ if ($this->container['name'] === null) {
+ $invalidProperties[] = "'name' can't be null";
+ }
+ if (!is_null($this->container['rate_limit']) && ($this->container['rate_limit'] < 0)) {
+ $invalidProperties[] = "invalid value for 'rate_limit', must be bigger than or equal to 0.";
+ }
+
+ if ($this->container['id'] === null) {
+ $invalidProperties[] = "'id' can't be null";
+ }
+ if ($this->container['created_at'] === null) {
+ $invalidProperties[] = "'created_at' can't be null";
+ }
+ if ($this->container['updated_at'] === null) {
+ $invalidProperties[] = "'updated_at' can't be null";
+ }
+ if ($this->container['metadata'] === null) {
+ $invalidProperties[] = "'metadata' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets uid
+ *
+ * @return string|null
+ */
+ public function getUid()
+ {
+ return $this->container['uid'];
+ }
+
+ /**
+ * Sets uid
+ *
+ * @param string|null $uid The app's UID
+ *
+ * @return self
+ */
+ public function setUid($uid)
+ {
+ if (is_null($uid)) {
+ throw new \InvalidArgumentException('non-nullable uid cannot be null');
+ }
+ if ((mb_strlen($uid) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $uid when calling ApplicationOut., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($uid) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $uid when calling ApplicationOut., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($uid)))) {
+ throw new \InvalidArgumentException("invalid value for \$uid when calling ApplicationOut., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['uid'] = $uid;
+
+ return $this;
+ }
+
+ /**
+ * Gets name
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->container['name'];
+ }
+
+ /**
+ * Sets name
+ *
+ * @param string $name name
+ *
+ * @return self
+ */
+ public function setName($name)
+ {
+ if (is_null($name)) {
+ throw new \InvalidArgumentException('non-nullable name cannot be null');
+ }
+ $this->container['name'] = $name;
+
+ return $this;
+ }
+
+ /**
+ * Gets rate_limit
+ *
+ * @return int|null
+ */
+ public function getRateLimit()
+ {
+ return $this->container['rate_limit'];
+ }
+
+ /**
+ * Sets rate_limit
+ *
+ * @param int|null $rate_limit rate_limit
+ *
+ * @return self
+ */
+ public function setRateLimit($rate_limit)
+ {
+ if (is_null($rate_limit)) {
+ throw new \InvalidArgumentException('non-nullable rate_limit cannot be null');
+ }
+
+ if (($rate_limit < 0)) {
+ throw new \InvalidArgumentException('invalid value for $rate_limit when calling ApplicationOut., must be bigger than or equal to 0.');
+ }
+
+ $this->container['rate_limit'] = $rate_limit;
+
+ return $this;
+ }
+
+ /**
+ * Gets id
+ *
+ * @return string
+ */
+ public function getId()
+ {
+ return $this->container['id'];
+ }
+
+ /**
+ * Sets id
+ *
+ * @param string $id The app's ID
+ *
+ * @return self
+ */
+ public function setId($id)
+ {
+ if (is_null($id)) {
+ throw new \InvalidArgumentException('non-nullable id cannot be null');
+ }
+ $this->container['id'] = $id;
+
+ return $this;
+ }
+
+ /**
+ * Gets created_at
+ *
+ * @return \DateTime
+ */
+ public function getCreatedAt()
+ {
+ return $this->container['created_at'];
+ }
+
+ /**
+ * Sets created_at
+ *
+ * @param \DateTime $created_at created_at
+ *
+ * @return self
+ */
+ public function setCreatedAt($created_at)
+ {
+ if (is_null($created_at)) {
+ throw new \InvalidArgumentException('non-nullable created_at cannot be null');
+ }
+ $this->container['created_at'] = $created_at;
+
+ return $this;
+ }
+
+ /**
+ * Gets updated_at
+ *
+ * @return \DateTime
+ */
+ public function getUpdatedAt()
+ {
+ return $this->container['updated_at'];
+ }
+
+ /**
+ * Sets updated_at
+ *
+ * @param \DateTime $updated_at updated_at
+ *
+ * @return self
+ */
+ public function setUpdatedAt($updated_at)
+ {
+ if (is_null($updated_at)) {
+ throw new \InvalidArgumentException('non-nullable updated_at cannot be null');
+ }
+ $this->container['updated_at'] = $updated_at;
+
+ return $this;
+ }
+
+ /**
+ * Gets metadata
+ *
+ * @return array
+ */
+ public function getMetadata()
+ {
+ return $this->container['metadata'];
+ }
+
+ /**
+ * Sets metadata
+ *
+ * @param array $metadata metadata
+ *
+ * @return self
+ */
+ public function setMetadata($metadata)
+ {
+ if (is_null($metadata)) {
+ array_push($this->openAPINullablesSetToNull, 'metadata');
+ } else {
+ $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+ $index = array_search('metadata', $nullablesSetToNull);
+ if ($index !== FALSE) {
+ unset($nullablesSetToNull[$index]);
+ $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+ }
+ }
+ $this->container['metadata'] = $metadata;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ApplicationPatch.php b/lib/Model/ApplicationPatch.php
new file mode 100644
index 0000000..bec98a4
--- /dev/null
+++ b/lib/Model/ApplicationPatch.php
@@ -0,0 +1,549 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * ApplicationPatch Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class ApplicationPatch implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ApplicationPatch';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'name' => 'string',
+ 'rate_limit' => 'int',
+ 'uid' => 'string',
+ 'metadata' => 'array'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'name' => null,
+ 'rate_limit' => 'uint16',
+ 'uid' => null,
+ 'metadata' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'name' => false,
+ 'rate_limit' => false,
+ 'uid' => false,
+ 'metadata' => true
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'name' => 'name',
+ 'rate_limit' => 'rateLimit',
+ 'uid' => 'uid',
+ 'metadata' => 'metadata'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'name' => 'setName',
+ 'rate_limit' => 'setRateLimit',
+ 'uid' => 'setUid',
+ 'metadata' => 'setMetadata'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'name' => 'getName',
+ 'rate_limit' => 'getRateLimit',
+ 'uid' => 'getUid',
+ 'metadata' => 'getMetadata'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('name', $data ?? [], null);
+ $this->setIfExists('rate_limit', $data ?? [], null);
+ $this->setIfExists('uid', $data ?? [], null);
+ $this->setIfExists('metadata', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if (!is_null($this->container['rate_limit']) && ($this->container['rate_limit'] < 0)) {
+ $invalidProperties[] = "invalid value for 'rate_limit', must be bigger than or equal to 0.";
+ }
+
+ if (!is_null($this->container['uid']) && (mb_strlen($this->container['uid']) > 256)) {
+ $invalidProperties[] = "invalid value for 'uid', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['uid']) && (mb_strlen($this->container['uid']) < 1)) {
+ $invalidProperties[] = "invalid value for 'uid', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['uid']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['uid'])) {
+ $invalidProperties[] = "invalid value for 'uid', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets name
+ *
+ * @return string|null
+ */
+ public function getName()
+ {
+ return $this->container['name'];
+ }
+
+ /**
+ * Sets name
+ *
+ * @param string|null $name name
+ *
+ * @return self
+ */
+ public function setName($name)
+ {
+ if (is_null($name)) {
+ throw new \InvalidArgumentException('non-nullable name cannot be null');
+ }
+ $this->container['name'] = $name;
+
+ return $this;
+ }
+
+ /**
+ * Gets rate_limit
+ *
+ * @return int|null
+ */
+ public function getRateLimit()
+ {
+ return $this->container['rate_limit'];
+ }
+
+ /**
+ * Sets rate_limit
+ *
+ * @param int|null $rate_limit rate_limit
+ *
+ * @return self
+ */
+ public function setRateLimit($rate_limit)
+ {
+ if (is_null($rate_limit)) {
+ throw new \InvalidArgumentException('non-nullable rate_limit cannot be null');
+ }
+
+ if (($rate_limit < 0)) {
+ throw new \InvalidArgumentException('invalid value for $rate_limit when calling ApplicationPatch., must be bigger than or equal to 0.');
+ }
+
+ $this->container['rate_limit'] = $rate_limit;
+
+ return $this;
+ }
+
+ /**
+ * Gets uid
+ *
+ * @return string|null
+ */
+ public function getUid()
+ {
+ return $this->container['uid'];
+ }
+
+ /**
+ * Sets uid
+ *
+ * @param string|null $uid The app's UID
+ *
+ * @return self
+ */
+ public function setUid($uid)
+ {
+ if (is_null($uid)) {
+ throw new \InvalidArgumentException('non-nullable uid cannot be null');
+ }
+ if ((mb_strlen($uid) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $uid when calling ApplicationPatch., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($uid) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $uid when calling ApplicationPatch., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($uid)))) {
+ throw new \InvalidArgumentException("invalid value for \$uid when calling ApplicationPatch., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['uid'] = $uid;
+
+ return $this;
+ }
+
+ /**
+ * Gets metadata
+ *
+ * @return array|null
+ */
+ public function getMetadata()
+ {
+ return $this->container['metadata'];
+ }
+
+ /**
+ * Sets metadata
+ *
+ * @param array|null $metadata metadata
+ *
+ * @return self
+ */
+ public function setMetadata($metadata)
+ {
+ if (is_null($metadata)) {
+ array_push($this->openAPINullablesSetToNull, 'metadata');
+ } else {
+ $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+ $index = array_search('metadata', $nullablesSetToNull);
+ if ($index !== FALSE) {
+ unset($nullablesSetToNull[$index]);
+ $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+ }
+ }
+ $this->container['metadata'] = $metadata;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ApplicationTokenExpireIn.php b/lib/Model/ApplicationTokenExpireIn.php
new file mode 100644
index 0000000..81afe5f
--- /dev/null
+++ b/lib/Model/ApplicationTokenExpireIn.php
@@ -0,0 +1,425 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * ApplicationTokenExpireIn Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class ApplicationTokenExpireIn implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ApplicationTokenExpireIn';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'expiry' => 'int'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'expiry' => 'int64'
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'expiry' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'expiry' => 'expiry'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'expiry' => 'setExpiry'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'expiry' => 'getExpiry'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('expiry', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if (!is_null($this->container['expiry']) && ($this->container['expiry'] > 259200)) {
+ $invalidProperties[] = "invalid value for 'expiry', must be smaller than or equal to 259200.";
+ }
+
+ if (!is_null($this->container['expiry']) && ($this->container['expiry'] < 0)) {
+ $invalidProperties[] = "invalid value for 'expiry', must be bigger than or equal to 0.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets expiry
+ *
+ * @return int|null
+ */
+ public function getExpiry()
+ {
+ return $this->container['expiry'];
+ }
+
+ /**
+ * Sets expiry
+ *
+ * @param int|null $expiry How many seconds until the old key is expired.
+ *
+ * @return self
+ */
+ public function setExpiry($expiry)
+ {
+ if (is_null($expiry)) {
+ throw new \InvalidArgumentException('non-nullable expiry cannot be null');
+ }
+
+ if (($expiry > 259200)) {
+ throw new \InvalidArgumentException('invalid value for $expiry when calling ApplicationTokenExpireIn., must be smaller than or equal to 259200.');
+ }
+ if (($expiry < 0)) {
+ throw new \InvalidArgumentException('invalid value for $expiry when calling ApplicationTokenExpireIn., must be bigger than or equal to 0.');
+ }
+
+ $this->container['expiry'] = $expiry;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/BackgroundTaskOut.php b/lib/Model/BackgroundTaskOut.php
new file mode 100644
index 0000000..1cea681
--- /dev/null
+++ b/lib/Model/BackgroundTaskOut.php
@@ -0,0 +1,523 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * BackgroundTaskOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class BackgroundTaskOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'BackgroundTaskOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => 'object',
+ 'id' => 'string',
+ 'status' => '\Svix\ApiClient\Model\BackgroundTaskStatus',
+ 'task' => '\Svix\ApiClient\Model\BackgroundTaskType'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'id' => null,
+ 'status' => null,
+ 'task' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'id' => false,
+ 'status' => false,
+ 'task' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'id' => 'id',
+ 'status' => 'status',
+ 'task' => 'task'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'id' => 'setId',
+ 'status' => 'setStatus',
+ 'task' => 'setTask'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'id' => 'getId',
+ 'status' => 'getStatus',
+ 'task' => 'getTask'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('id', $data ?? [], null);
+ $this->setIfExists('status', $data ?? [], null);
+ $this->setIfExists('task', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['id'] === null) {
+ $invalidProperties[] = "'id' can't be null";
+ }
+ if ($this->container['status'] === null) {
+ $invalidProperties[] = "'status' can't be null";
+ }
+ if ($this->container['task'] === null) {
+ $invalidProperties[] = "'task' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return object
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param object $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets id
+ *
+ * @return string
+ */
+ public function getId()
+ {
+ return $this->container['id'];
+ }
+
+ /**
+ * Sets id
+ *
+ * @param string $id id
+ *
+ * @return self
+ */
+ public function setId($id)
+ {
+ if (is_null($id)) {
+ throw new \InvalidArgumentException('non-nullable id cannot be null');
+ }
+ $this->container['id'] = $id;
+
+ return $this;
+ }
+
+ /**
+ * Gets status
+ *
+ * @return \Svix\ApiClient\Model\BackgroundTaskStatus
+ */
+ public function getStatus()
+ {
+ return $this->container['status'];
+ }
+
+ /**
+ * Sets status
+ *
+ * @param \Svix\ApiClient\Model\BackgroundTaskStatus $status status
+ *
+ * @return self
+ */
+ public function setStatus($status)
+ {
+ if (is_null($status)) {
+ throw new \InvalidArgumentException('non-nullable status cannot be null');
+ }
+ $this->container['status'] = $status;
+
+ return $this;
+ }
+
+ /**
+ * Gets task
+ *
+ * @return \Svix\ApiClient\Model\BackgroundTaskType
+ */
+ public function getTask()
+ {
+ return $this->container['task'];
+ }
+
+ /**
+ * Sets task
+ *
+ * @param \Svix\ApiClient\Model\BackgroundTaskType $task task
+ *
+ * @return self
+ */
+ public function setTask($task)
+ {
+ if (is_null($task)) {
+ throw new \InvalidArgumentException('non-nullable task cannot be null');
+ }
+ $this->container['task'] = $task;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/BackgroundTaskStatus.php b/lib/Model/BackgroundTaskStatus.php
new file mode 100644
index 0000000..4f74321
--- /dev/null
+++ b/lib/Model/BackgroundTaskStatus.php
@@ -0,0 +1,65 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * BackgroundTaskStatus Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ */
+class BackgroundTaskStatus
+{
+ /**
+ * Possible values of this enum
+ */
+ public const RUNNING = 'running';
+
+ public const FINISHED = 'finished';
+
+ public const FAILED = 'failed';
+
+ /**
+ * Gets allowable values of the enum
+ * @return string[]
+ */
+ public static function getAllowableEnumValues()
+ {
+ return [
+ self::RUNNING,
+ self::FINISHED,
+ self::FAILED
+ ];
+ }
+}
+
+
diff --git a/lib/Model/BackgroundTaskType.php b/lib/Model/BackgroundTaskType.php
new file mode 100644
index 0000000..02fdd48
--- /dev/null
+++ b/lib/Model/BackgroundTaskType.php
@@ -0,0 +1,71 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * BackgroundTaskType Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ */
+class BackgroundTaskType
+{
+ /**
+ * Possible values of this enum
+ */
+ public const ENDPOINT_REPLAY = 'endpoint.replay';
+
+ public const ENDPOINT_RECOVER = 'endpoint.recover';
+
+ public const APPLICATION_STATS = 'application.stats';
+
+ public const MESSAGE_BROADCAST = 'message.broadcast';
+
+ public const SDK_GENERATE = 'sdk.generate';
+
+ /**
+ * Gets allowable values of the enum
+ * @return string[]
+ */
+ public static function getAllowableEnumValues()
+ {
+ return [
+ self::ENDPOINT_REPLAY,
+ self::ENDPOINT_RECOVER,
+ self::APPLICATION_STATS,
+ self::MESSAGE_BROADCAST,
+ self::SDK_GENERATE
+ ];
+ }
+}
+
+
diff --git a/lib/Model/DashboardAccessOut.php b/lib/Model/DashboardAccessOut.php
new file mode 100644
index 0000000..7635f80
--- /dev/null
+++ b/lib/Model/DashboardAccessOut.php
@@ -0,0 +1,464 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * DashboardAccessOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class DashboardAccessOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'DashboardAccessOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'url' => 'string',
+ 'token' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'url' => 'uri',
+ 'token' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'url' => false,
+ 'token' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'url' => 'url',
+ 'token' => 'token'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'url' => 'setUrl',
+ 'token' => 'setToken'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'url' => 'getUrl',
+ 'token' => 'getToken'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('url', $data ?? [], null);
+ $this->setIfExists('token', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['url'] === null) {
+ $invalidProperties[] = "'url' can't be null";
+ }
+ if ((mb_strlen($this->container['url']) > 65536)) {
+ $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 65536.";
+ }
+
+ if ((mb_strlen($this->container['url']) < 1)) {
+ $invalidProperties[] = "invalid value for 'url', the character length must be bigger than or equal to 1.";
+ }
+
+ if ($this->container['token'] === null) {
+ $invalidProperties[] = "'token' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets url
+ *
+ * @return string
+ */
+ public function getUrl()
+ {
+ return $this->container['url'];
+ }
+
+ /**
+ * Sets url
+ *
+ * @param string $url url
+ *
+ * @return self
+ */
+ public function setUrl($url)
+ {
+ if (is_null($url)) {
+ throw new \InvalidArgumentException('non-nullable url cannot be null');
+ }
+ if ((mb_strlen($url) > 65536)) {
+ throw new \InvalidArgumentException('invalid length for $url when calling DashboardAccessOut., must be smaller than or equal to 65536.');
+ }
+ if ((mb_strlen($url) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $url when calling DashboardAccessOut., must be bigger than or equal to 1.');
+ }
+
+ $this->container['url'] = $url;
+
+ return $this;
+ }
+
+ /**
+ * Gets token
+ *
+ * @return string
+ */
+ public function getToken()
+ {
+ return $this->container['token'];
+ }
+
+ /**
+ * Sets token
+ *
+ * @param string $token token
+ *
+ * @return self
+ */
+ public function setToken($token)
+ {
+ if (is_null($token)) {
+ throw new \InvalidArgumentException('non-nullable token cannot be null');
+ }
+ $this->container['token'] = $token;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointCreatedEvent.php b/lib/Model/EndpointCreatedEvent.php
new file mode 100644
index 0000000..ff65d67
--- /dev/null
+++ b/lib/Model/EndpointCreatedEvent.php
@@ -0,0 +1,482 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointCreatedEvent Class Doc Comment
+ *
+ * @category Class
+ * @description Sent when an endpoint is created.
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointCreatedEvent implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointCreatedEvent';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\EndpointCreatedEventData',
+ 'type' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'type' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'type' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'type' => 'type'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'type' => 'setType'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'type' => 'getType'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+ public const TYPE_ENDPOINT_CREATED = 'endpoint.created';
+
+ /**
+ * Gets allowable values of the enum
+ *
+ * @return string[]
+ */
+ public function getTypeAllowableValues()
+ {
+ return [
+ self::TYPE_ENDPOINT_CREATED,
+ ];
+ }
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('type', $data ?? [], 'endpoint.created');
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['type'] === null) {
+ $invalidProperties[] = "'type' can't be null";
+ }
+ $allowedValues = $this->getTypeAllowableValues();
+ if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
+ $invalidProperties[] = sprintf(
+ "invalid value '%s' for 'type', must be one of '%s'",
+ $this->container['type'],
+ implode("', '", $allowedValues)
+ );
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\EndpointCreatedEventData
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\EndpointCreatedEventData $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets type
+ *
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->container['type'];
+ }
+
+ /**
+ * Sets type
+ *
+ * @param string $type type
+ *
+ * @return self
+ */
+ public function setType($type)
+ {
+ if (is_null($type)) {
+ throw new \InvalidArgumentException('non-nullable type cannot be null');
+ }
+ $allowedValues = $this->getTypeAllowableValues();
+ if (!in_array($type, $allowedValues, true)) {
+ throw new \InvalidArgumentException(
+ sprintf(
+ "Invalid value '%s' for 'type', must be one of '%s'",
+ $type,
+ implode("', '", $allowedValues)
+ )
+ );
+ }
+ $this->container['type'] = $type;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointCreatedEventData.php b/lib/Model/EndpointCreatedEventData.php
new file mode 100644
index 0000000..287662b
--- /dev/null
+++ b/lib/Model/EndpointCreatedEventData.php
@@ -0,0 +1,561 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointCreatedEventData Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointCreatedEventData implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointCreatedEventData';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'app_id' => 'string',
+ 'app_uid' => 'string',
+ 'endpoint_id' => 'string',
+ 'endpoint_uid' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'app_id' => null,
+ 'app_uid' => null,
+ 'endpoint_id' => null,
+ 'endpoint_uid' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'app_id' => false,
+ 'app_uid' => false,
+ 'endpoint_id' => false,
+ 'endpoint_uid' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'app_id' => 'appId',
+ 'app_uid' => 'appUid',
+ 'endpoint_id' => 'endpointId',
+ 'endpoint_uid' => 'endpointUid'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'app_id' => 'setAppId',
+ 'app_uid' => 'setAppUid',
+ 'endpoint_id' => 'setEndpointId',
+ 'endpoint_uid' => 'setEndpointUid'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'app_id' => 'getAppId',
+ 'app_uid' => 'getAppUid',
+ 'endpoint_id' => 'getEndpointId',
+ 'endpoint_uid' => 'getEndpointUid'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('app_id', $data ?? [], null);
+ $this->setIfExists('app_uid', $data ?? [], null);
+ $this->setIfExists('endpoint_id', $data ?? [], null);
+ $this->setIfExists('endpoint_uid', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['app_id'] === null) {
+ $invalidProperties[] = "'app_id' can't be null";
+ }
+ if (!is_null($this->container['app_uid']) && (mb_strlen($this->container['app_uid']) > 256)) {
+ $invalidProperties[] = "invalid value for 'app_uid', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['app_uid']) && (mb_strlen($this->container['app_uid']) < 1)) {
+ $invalidProperties[] = "invalid value for 'app_uid', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['app_uid']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['app_uid'])) {
+ $invalidProperties[] = "invalid value for 'app_uid', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ if ($this->container['endpoint_id'] === null) {
+ $invalidProperties[] = "'endpoint_id' can't be null";
+ }
+ if (!is_null($this->container['endpoint_uid']) && (mb_strlen($this->container['endpoint_uid']) > 256)) {
+ $invalidProperties[] = "invalid value for 'endpoint_uid', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['endpoint_uid']) && (mb_strlen($this->container['endpoint_uid']) < 1)) {
+ $invalidProperties[] = "invalid value for 'endpoint_uid', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['endpoint_uid']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['endpoint_uid'])) {
+ $invalidProperties[] = "invalid value for 'endpoint_uid', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets app_id
+ *
+ * @return string
+ */
+ public function getAppId()
+ {
+ return $this->container['app_id'];
+ }
+
+ /**
+ * Sets app_id
+ *
+ * @param string $app_id The app's ID
+ *
+ * @return self
+ */
+ public function setAppId($app_id)
+ {
+ if (is_null($app_id)) {
+ throw new \InvalidArgumentException('non-nullable app_id cannot be null');
+ }
+ $this->container['app_id'] = $app_id;
+
+ return $this;
+ }
+
+ /**
+ * Gets app_uid
+ *
+ * @return string|null
+ */
+ public function getAppUid()
+ {
+ return $this->container['app_uid'];
+ }
+
+ /**
+ * Sets app_uid
+ *
+ * @param string|null $app_uid The app's UID
+ *
+ * @return self
+ */
+ public function setAppUid($app_uid)
+ {
+ if (is_null($app_uid)) {
+ throw new \InvalidArgumentException('non-nullable app_uid cannot be null');
+ }
+ if ((mb_strlen($app_uid) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $app_uid when calling EndpointCreatedEventData., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($app_uid) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $app_uid when calling EndpointCreatedEventData., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($app_uid)))) {
+ throw new \InvalidArgumentException("invalid value for \$app_uid when calling EndpointCreatedEventData., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['app_uid'] = $app_uid;
+
+ return $this;
+ }
+
+ /**
+ * Gets endpoint_id
+ *
+ * @return string
+ */
+ public function getEndpointId()
+ {
+ return $this->container['endpoint_id'];
+ }
+
+ /**
+ * Sets endpoint_id
+ *
+ * @param string $endpoint_id The ep's ID
+ *
+ * @return self
+ */
+ public function setEndpointId($endpoint_id)
+ {
+ if (is_null($endpoint_id)) {
+ throw new \InvalidArgumentException('non-nullable endpoint_id cannot be null');
+ }
+ $this->container['endpoint_id'] = $endpoint_id;
+
+ return $this;
+ }
+
+ /**
+ * Gets endpoint_uid
+ *
+ * @return string|null
+ */
+ public function getEndpointUid()
+ {
+ return $this->container['endpoint_uid'];
+ }
+
+ /**
+ * Sets endpoint_uid
+ *
+ * @param string|null $endpoint_uid The ep's UID
+ *
+ * @return self
+ */
+ public function setEndpointUid($endpoint_uid)
+ {
+ if (is_null($endpoint_uid)) {
+ throw new \InvalidArgumentException('non-nullable endpoint_uid cannot be null');
+ }
+ if ((mb_strlen($endpoint_uid) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $endpoint_uid when calling EndpointCreatedEventData., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($endpoint_uid) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $endpoint_uid when calling EndpointCreatedEventData., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($endpoint_uid)))) {
+ throw new \InvalidArgumentException("invalid value for \$endpoint_uid when calling EndpointCreatedEventData., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['endpoint_uid'] = $endpoint_uid;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointDeletedEvent.php b/lib/Model/EndpointDeletedEvent.php
new file mode 100644
index 0000000..850783b
--- /dev/null
+++ b/lib/Model/EndpointDeletedEvent.php
@@ -0,0 +1,482 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointDeletedEvent Class Doc Comment
+ *
+ * @category Class
+ * @description Sent when an endpoint is deleted.
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointDeletedEvent implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointDeletedEvent';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\EndpointDeletedEventData',
+ 'type' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'type' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'type' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'type' => 'type'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'type' => 'setType'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'type' => 'getType'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+ public const TYPE_ENDPOINT_DELETED = 'endpoint.deleted';
+
+ /**
+ * Gets allowable values of the enum
+ *
+ * @return string[]
+ */
+ public function getTypeAllowableValues()
+ {
+ return [
+ self::TYPE_ENDPOINT_DELETED,
+ ];
+ }
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('type', $data ?? [], 'endpoint.deleted');
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['type'] === null) {
+ $invalidProperties[] = "'type' can't be null";
+ }
+ $allowedValues = $this->getTypeAllowableValues();
+ if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
+ $invalidProperties[] = sprintf(
+ "invalid value '%s' for 'type', must be one of '%s'",
+ $this->container['type'],
+ implode("', '", $allowedValues)
+ );
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\EndpointDeletedEventData
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\EndpointDeletedEventData $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets type
+ *
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->container['type'];
+ }
+
+ /**
+ * Sets type
+ *
+ * @param string $type type
+ *
+ * @return self
+ */
+ public function setType($type)
+ {
+ if (is_null($type)) {
+ throw new \InvalidArgumentException('non-nullable type cannot be null');
+ }
+ $allowedValues = $this->getTypeAllowableValues();
+ if (!in_array($type, $allowedValues, true)) {
+ throw new \InvalidArgumentException(
+ sprintf(
+ "Invalid value '%s' for 'type', must be one of '%s'",
+ $type,
+ implode("', '", $allowedValues)
+ )
+ );
+ }
+ $this->container['type'] = $type;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointDeletedEventData.php b/lib/Model/EndpointDeletedEventData.php
new file mode 100644
index 0000000..a5ffa2c
--- /dev/null
+++ b/lib/Model/EndpointDeletedEventData.php
@@ -0,0 +1,561 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointDeletedEventData Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointDeletedEventData implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointDeletedEventData';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'app_id' => 'string',
+ 'app_uid' => 'string',
+ 'endpoint_id' => 'string',
+ 'endpoint_uid' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'app_id' => null,
+ 'app_uid' => null,
+ 'endpoint_id' => null,
+ 'endpoint_uid' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'app_id' => false,
+ 'app_uid' => false,
+ 'endpoint_id' => false,
+ 'endpoint_uid' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'app_id' => 'appId',
+ 'app_uid' => 'appUid',
+ 'endpoint_id' => 'endpointId',
+ 'endpoint_uid' => 'endpointUid'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'app_id' => 'setAppId',
+ 'app_uid' => 'setAppUid',
+ 'endpoint_id' => 'setEndpointId',
+ 'endpoint_uid' => 'setEndpointUid'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'app_id' => 'getAppId',
+ 'app_uid' => 'getAppUid',
+ 'endpoint_id' => 'getEndpointId',
+ 'endpoint_uid' => 'getEndpointUid'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('app_id', $data ?? [], null);
+ $this->setIfExists('app_uid', $data ?? [], null);
+ $this->setIfExists('endpoint_id', $data ?? [], null);
+ $this->setIfExists('endpoint_uid', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['app_id'] === null) {
+ $invalidProperties[] = "'app_id' can't be null";
+ }
+ if (!is_null($this->container['app_uid']) && (mb_strlen($this->container['app_uid']) > 256)) {
+ $invalidProperties[] = "invalid value for 'app_uid', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['app_uid']) && (mb_strlen($this->container['app_uid']) < 1)) {
+ $invalidProperties[] = "invalid value for 'app_uid', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['app_uid']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['app_uid'])) {
+ $invalidProperties[] = "invalid value for 'app_uid', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ if ($this->container['endpoint_id'] === null) {
+ $invalidProperties[] = "'endpoint_id' can't be null";
+ }
+ if (!is_null($this->container['endpoint_uid']) && (mb_strlen($this->container['endpoint_uid']) > 256)) {
+ $invalidProperties[] = "invalid value for 'endpoint_uid', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['endpoint_uid']) && (mb_strlen($this->container['endpoint_uid']) < 1)) {
+ $invalidProperties[] = "invalid value for 'endpoint_uid', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['endpoint_uid']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['endpoint_uid'])) {
+ $invalidProperties[] = "invalid value for 'endpoint_uid', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets app_id
+ *
+ * @return string
+ */
+ public function getAppId()
+ {
+ return $this->container['app_id'];
+ }
+
+ /**
+ * Sets app_id
+ *
+ * @param string $app_id The app's ID
+ *
+ * @return self
+ */
+ public function setAppId($app_id)
+ {
+ if (is_null($app_id)) {
+ throw new \InvalidArgumentException('non-nullable app_id cannot be null');
+ }
+ $this->container['app_id'] = $app_id;
+
+ return $this;
+ }
+
+ /**
+ * Gets app_uid
+ *
+ * @return string|null
+ */
+ public function getAppUid()
+ {
+ return $this->container['app_uid'];
+ }
+
+ /**
+ * Sets app_uid
+ *
+ * @param string|null $app_uid The app's UID
+ *
+ * @return self
+ */
+ public function setAppUid($app_uid)
+ {
+ if (is_null($app_uid)) {
+ throw new \InvalidArgumentException('non-nullable app_uid cannot be null');
+ }
+ if ((mb_strlen($app_uid) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $app_uid when calling EndpointDeletedEventData., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($app_uid) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $app_uid when calling EndpointDeletedEventData., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($app_uid)))) {
+ throw new \InvalidArgumentException("invalid value for \$app_uid when calling EndpointDeletedEventData., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['app_uid'] = $app_uid;
+
+ return $this;
+ }
+
+ /**
+ * Gets endpoint_id
+ *
+ * @return string
+ */
+ public function getEndpointId()
+ {
+ return $this->container['endpoint_id'];
+ }
+
+ /**
+ * Sets endpoint_id
+ *
+ * @param string $endpoint_id The ep's ID
+ *
+ * @return self
+ */
+ public function setEndpointId($endpoint_id)
+ {
+ if (is_null($endpoint_id)) {
+ throw new \InvalidArgumentException('non-nullable endpoint_id cannot be null');
+ }
+ $this->container['endpoint_id'] = $endpoint_id;
+
+ return $this;
+ }
+
+ /**
+ * Gets endpoint_uid
+ *
+ * @return string|null
+ */
+ public function getEndpointUid()
+ {
+ return $this->container['endpoint_uid'];
+ }
+
+ /**
+ * Sets endpoint_uid
+ *
+ * @param string|null $endpoint_uid The ep's UID
+ *
+ * @return self
+ */
+ public function setEndpointUid($endpoint_uid)
+ {
+ if (is_null($endpoint_uid)) {
+ throw new \InvalidArgumentException('non-nullable endpoint_uid cannot be null');
+ }
+ if ((mb_strlen($endpoint_uid) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $endpoint_uid when calling EndpointDeletedEventData., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($endpoint_uid) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $endpoint_uid when calling EndpointDeletedEventData., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($endpoint_uid)))) {
+ throw new \InvalidArgumentException("invalid value for \$endpoint_uid when calling EndpointDeletedEventData., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['endpoint_uid'] = $endpoint_uid;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointDisabledEvent.php b/lib/Model/EndpointDisabledEvent.php
new file mode 100644
index 0000000..94b6375
--- /dev/null
+++ b/lib/Model/EndpointDisabledEvent.php
@@ -0,0 +1,482 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointDisabledEvent Class Doc Comment
+ *
+ * @category Class
+ * @description Sent when an endpoint has been automatically disabled after continuous failures.
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointDisabledEvent implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointDisabledEvent';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\EndpointDisabledEventData',
+ 'type' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'type' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'type' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'type' => 'type'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'type' => 'setType'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'type' => 'getType'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+ public const TYPE_ENDPOINT_DISABLED = 'endpoint.disabled';
+
+ /**
+ * Gets allowable values of the enum
+ *
+ * @return string[]
+ */
+ public function getTypeAllowableValues()
+ {
+ return [
+ self::TYPE_ENDPOINT_DISABLED,
+ ];
+ }
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('type', $data ?? [], 'endpoint.disabled');
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['type'] === null) {
+ $invalidProperties[] = "'type' can't be null";
+ }
+ $allowedValues = $this->getTypeAllowableValues();
+ if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
+ $invalidProperties[] = sprintf(
+ "invalid value '%s' for 'type', must be one of '%s'",
+ $this->container['type'],
+ implode("', '", $allowedValues)
+ );
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\EndpointDisabledEventData
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\EndpointDisabledEventData $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets type
+ *
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->container['type'];
+ }
+
+ /**
+ * Sets type
+ *
+ * @param string $type type
+ *
+ * @return self
+ */
+ public function setType($type)
+ {
+ if (is_null($type)) {
+ throw new \InvalidArgumentException('non-nullable type cannot be null');
+ }
+ $allowedValues = $this->getTypeAllowableValues();
+ if (!in_array($type, $allowedValues, true)) {
+ throw new \InvalidArgumentException(
+ sprintf(
+ "Invalid value '%s' for 'type', must be one of '%s'",
+ $type,
+ implode("', '", $allowedValues)
+ )
+ );
+ }
+ $this->container['type'] = $type;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointDisabledEventData.php b/lib/Model/EndpointDisabledEventData.php
new file mode 100644
index 0000000..7dca80b
--- /dev/null
+++ b/lib/Model/EndpointDisabledEventData.php
@@ -0,0 +1,599 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointDisabledEventData Class Doc Comment
+ *
+ * @category Class
+ * @description Sent when an endpoint has been automatically disabled after continuous failures.
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointDisabledEventData implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointDisabledEventData';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'app_id' => 'string',
+ 'app_uid' => 'string',
+ 'endpoint_id' => 'string',
+ 'endpoint_uid' => 'string',
+ 'fail_since' => '\DateTime'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'app_id' => null,
+ 'app_uid' => null,
+ 'endpoint_id' => null,
+ 'endpoint_uid' => null,
+ 'fail_since' => 'date-time'
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'app_id' => false,
+ 'app_uid' => false,
+ 'endpoint_id' => false,
+ 'endpoint_uid' => false,
+ 'fail_since' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'app_id' => 'appId',
+ 'app_uid' => 'appUid',
+ 'endpoint_id' => 'endpointId',
+ 'endpoint_uid' => 'endpointUid',
+ 'fail_since' => 'failSince'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'app_id' => 'setAppId',
+ 'app_uid' => 'setAppUid',
+ 'endpoint_id' => 'setEndpointId',
+ 'endpoint_uid' => 'setEndpointUid',
+ 'fail_since' => 'setFailSince'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'app_id' => 'getAppId',
+ 'app_uid' => 'getAppUid',
+ 'endpoint_id' => 'getEndpointId',
+ 'endpoint_uid' => 'getEndpointUid',
+ 'fail_since' => 'getFailSince'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('app_id', $data ?? [], null);
+ $this->setIfExists('app_uid', $data ?? [], null);
+ $this->setIfExists('endpoint_id', $data ?? [], null);
+ $this->setIfExists('endpoint_uid', $data ?? [], null);
+ $this->setIfExists('fail_since', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['app_id'] === null) {
+ $invalidProperties[] = "'app_id' can't be null";
+ }
+ if (!is_null($this->container['app_uid']) && (mb_strlen($this->container['app_uid']) > 256)) {
+ $invalidProperties[] = "invalid value for 'app_uid', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['app_uid']) && (mb_strlen($this->container['app_uid']) < 1)) {
+ $invalidProperties[] = "invalid value for 'app_uid', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['app_uid']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['app_uid'])) {
+ $invalidProperties[] = "invalid value for 'app_uid', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ if ($this->container['endpoint_id'] === null) {
+ $invalidProperties[] = "'endpoint_id' can't be null";
+ }
+ if (!is_null($this->container['endpoint_uid']) && (mb_strlen($this->container['endpoint_uid']) > 256)) {
+ $invalidProperties[] = "invalid value for 'endpoint_uid', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['endpoint_uid']) && (mb_strlen($this->container['endpoint_uid']) < 1)) {
+ $invalidProperties[] = "invalid value for 'endpoint_uid', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['endpoint_uid']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['endpoint_uid'])) {
+ $invalidProperties[] = "invalid value for 'endpoint_uid', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ if ($this->container['fail_since'] === null) {
+ $invalidProperties[] = "'fail_since' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets app_id
+ *
+ * @return string
+ */
+ public function getAppId()
+ {
+ return $this->container['app_id'];
+ }
+
+ /**
+ * Sets app_id
+ *
+ * @param string $app_id The app's ID
+ *
+ * @return self
+ */
+ public function setAppId($app_id)
+ {
+ if (is_null($app_id)) {
+ throw new \InvalidArgumentException('non-nullable app_id cannot be null');
+ }
+ $this->container['app_id'] = $app_id;
+
+ return $this;
+ }
+
+ /**
+ * Gets app_uid
+ *
+ * @return string|null
+ */
+ public function getAppUid()
+ {
+ return $this->container['app_uid'];
+ }
+
+ /**
+ * Sets app_uid
+ *
+ * @param string|null $app_uid The app's UID
+ *
+ * @return self
+ */
+ public function setAppUid($app_uid)
+ {
+ if (is_null($app_uid)) {
+ throw new \InvalidArgumentException('non-nullable app_uid cannot be null');
+ }
+ if ((mb_strlen($app_uid) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $app_uid when calling EndpointDisabledEventData., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($app_uid) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $app_uid when calling EndpointDisabledEventData., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($app_uid)))) {
+ throw new \InvalidArgumentException("invalid value for \$app_uid when calling EndpointDisabledEventData., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['app_uid'] = $app_uid;
+
+ return $this;
+ }
+
+ /**
+ * Gets endpoint_id
+ *
+ * @return string
+ */
+ public function getEndpointId()
+ {
+ return $this->container['endpoint_id'];
+ }
+
+ /**
+ * Sets endpoint_id
+ *
+ * @param string $endpoint_id The ep's ID
+ *
+ * @return self
+ */
+ public function setEndpointId($endpoint_id)
+ {
+ if (is_null($endpoint_id)) {
+ throw new \InvalidArgumentException('non-nullable endpoint_id cannot be null');
+ }
+ $this->container['endpoint_id'] = $endpoint_id;
+
+ return $this;
+ }
+
+ /**
+ * Gets endpoint_uid
+ *
+ * @return string|null
+ */
+ public function getEndpointUid()
+ {
+ return $this->container['endpoint_uid'];
+ }
+
+ /**
+ * Sets endpoint_uid
+ *
+ * @param string|null $endpoint_uid The ep's UID
+ *
+ * @return self
+ */
+ public function setEndpointUid($endpoint_uid)
+ {
+ if (is_null($endpoint_uid)) {
+ throw new \InvalidArgumentException('non-nullable endpoint_uid cannot be null');
+ }
+ if ((mb_strlen($endpoint_uid) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $endpoint_uid when calling EndpointDisabledEventData., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($endpoint_uid) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $endpoint_uid when calling EndpointDisabledEventData., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($endpoint_uid)))) {
+ throw new \InvalidArgumentException("invalid value for \$endpoint_uid when calling EndpointDisabledEventData., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['endpoint_uid'] = $endpoint_uid;
+
+ return $this;
+ }
+
+ /**
+ * Gets fail_since
+ *
+ * @return \DateTime
+ */
+ public function getFailSince()
+ {
+ return $this->container['fail_since'];
+ }
+
+ /**
+ * Sets fail_since
+ *
+ * @param \DateTime $fail_since fail_since
+ *
+ * @return self
+ */
+ public function setFailSince($fail_since)
+ {
+ if (is_null($fail_since)) {
+ throw new \InvalidArgumentException('non-nullable fail_since cannot be null');
+ }
+ $this->container['fail_since'] = $fail_since;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointHeadersIn.php b/lib/Model/EndpointHeadersIn.php
new file mode 100644
index 0000000..2565440
--- /dev/null
+++ b/lib/Model/EndpointHeadersIn.php
@@ -0,0 +1,419 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointHeadersIn Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointHeadersIn implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointHeadersIn';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'headers' => 'array'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'headers' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'headers' => true
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'headers' => 'headers'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'headers' => 'setHeaders'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'headers' => 'getHeaders'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('headers', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['headers'] === null) {
+ $invalidProperties[] = "'headers' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets headers
+ *
+ * @return array
+ */
+ public function getHeaders()
+ {
+ return $this->container['headers'];
+ }
+
+ /**
+ * Sets headers
+ *
+ * @param array $headers headers
+ *
+ * @return self
+ */
+ public function setHeaders($headers)
+ {
+ if (is_null($headers)) {
+ array_push($this->openAPINullablesSetToNull, 'headers');
+ } else {
+ $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+ $index = array_search('headers', $nullablesSetToNull);
+ if ($index !== FALSE) {
+ unset($nullablesSetToNull[$index]);
+ $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+ }
+ }
+ $this->container['headers'] = $headers;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointHeadersOut.php b/lib/Model/EndpointHeadersOut.php
new file mode 100644
index 0000000..4f4b219
--- /dev/null
+++ b/lib/Model/EndpointHeadersOut.php
@@ -0,0 +1,457 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointHeadersOut Class Doc Comment
+ *
+ * @category Class
+ * @description The value of the headers is returned in the `headers` field. Sensitive headers that have been redacted are returned in the sensitive field.
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointHeadersOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointHeadersOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'headers' => 'array',
+ 'sensitive' => 'string[]'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'headers' => null,
+ 'sensitive' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'headers' => true,
+ 'sensitive' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'headers' => 'headers',
+ 'sensitive' => 'sensitive'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'headers' => 'setHeaders',
+ 'sensitive' => 'setSensitive'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'headers' => 'getHeaders',
+ 'sensitive' => 'getSensitive'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('headers', $data ?? [], null);
+ $this->setIfExists('sensitive', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['headers'] === null) {
+ $invalidProperties[] = "'headers' can't be null";
+ }
+ if ($this->container['sensitive'] === null) {
+ $invalidProperties[] = "'sensitive' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets headers
+ *
+ * @return array
+ */
+ public function getHeaders()
+ {
+ return $this->container['headers'];
+ }
+
+ /**
+ * Sets headers
+ *
+ * @param array $headers headers
+ *
+ * @return self
+ */
+ public function setHeaders($headers)
+ {
+ if (is_null($headers)) {
+ array_push($this->openAPINullablesSetToNull, 'headers');
+ } else {
+ $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+ $index = array_search('headers', $nullablesSetToNull);
+ if ($index !== FALSE) {
+ unset($nullablesSetToNull[$index]);
+ $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+ }
+ }
+ $this->container['headers'] = $headers;
+
+ return $this;
+ }
+
+ /**
+ * Gets sensitive
+ *
+ * @return string[]
+ */
+ public function getSensitive()
+ {
+ return $this->container['sensitive'];
+ }
+
+ /**
+ * Sets sensitive
+ *
+ * @param string[] $sensitive sensitive
+ *
+ * @return self
+ */
+ public function setSensitive($sensitive)
+ {
+ if (is_null($sensitive)) {
+ throw new \InvalidArgumentException('non-nullable sensitive cannot be null');
+ }
+ $this->container['sensitive'] = $sensitive;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointHeadersPatchIn.php b/lib/Model/EndpointHeadersPatchIn.php
new file mode 100644
index 0000000..d4221ad
--- /dev/null
+++ b/lib/Model/EndpointHeadersPatchIn.php
@@ -0,0 +1,419 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointHeadersPatchIn Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointHeadersPatchIn implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointHeadersPatchIn';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'headers' => 'array'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'headers' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'headers' => true
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'headers' => 'headers'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'headers' => 'setHeaders'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'headers' => 'getHeaders'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('headers', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['headers'] === null) {
+ $invalidProperties[] = "'headers' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets headers
+ *
+ * @return array
+ */
+ public function getHeaders()
+ {
+ return $this->container['headers'];
+ }
+
+ /**
+ * Sets headers
+ *
+ * @param array $headers headers
+ *
+ * @return self
+ */
+ public function setHeaders($headers)
+ {
+ if (is_null($headers)) {
+ array_push($this->openAPINullablesSetToNull, 'headers');
+ } else {
+ $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+ $index = array_search('headers', $nullablesSetToNull);
+ if ($index !== FALSE) {
+ unset($nullablesSetToNull[$index]);
+ $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+ }
+ }
+ $this->container['headers'] = $headers;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointIn.php b/lib/Model/EndpointIn.php
new file mode 100644
index 0000000..24e8c82
--- /dev/null
+++ b/lib/Model/EndpointIn.php
@@ -0,0 +1,791 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointIn Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointIn implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointIn';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'description' => 'string',
+ 'rate_limit' => 'int',
+ 'uid' => 'string',
+ 'url' => 'string',
+ 'version' => 'int',
+ 'disabled' => 'bool',
+ 'filter_types' => 'string[]',
+ 'channels' => 'string[]',
+ 'secret' => 'string',
+ 'metadata' => 'array'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'description' => null,
+ 'rate_limit' => 'uint16',
+ 'uid' => null,
+ 'url' => 'uri',
+ 'version' => 'uint16',
+ 'disabled' => null,
+ 'filter_types' => null,
+ 'channels' => null,
+ 'secret' => null,
+ 'metadata' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'description' => false,
+ 'rate_limit' => false,
+ 'uid' => false,
+ 'url' => false,
+ 'version' => false,
+ 'disabled' => false,
+ 'filter_types' => false,
+ 'channels' => false,
+ 'secret' => false,
+ 'metadata' => true
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'description' => 'description',
+ 'rate_limit' => 'rateLimit',
+ 'uid' => 'uid',
+ 'url' => 'url',
+ 'version' => 'version',
+ 'disabled' => 'disabled',
+ 'filter_types' => 'filterTypes',
+ 'channels' => 'channels',
+ 'secret' => 'secret',
+ 'metadata' => 'metadata'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'description' => 'setDescription',
+ 'rate_limit' => 'setRateLimit',
+ 'uid' => 'setUid',
+ 'url' => 'setUrl',
+ 'version' => 'setVersion',
+ 'disabled' => 'setDisabled',
+ 'filter_types' => 'setFilterTypes',
+ 'channels' => 'setChannels',
+ 'secret' => 'setSecret',
+ 'metadata' => 'setMetadata'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'description' => 'getDescription',
+ 'rate_limit' => 'getRateLimit',
+ 'uid' => 'getUid',
+ 'url' => 'getUrl',
+ 'version' => 'getVersion',
+ 'disabled' => 'getDisabled',
+ 'filter_types' => 'getFilterTypes',
+ 'channels' => 'getChannels',
+ 'secret' => 'getSecret',
+ 'metadata' => 'getMetadata'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('description', $data ?? [], '');
+ $this->setIfExists('rate_limit', $data ?? [], null);
+ $this->setIfExists('uid', $data ?? [], null);
+ $this->setIfExists('url', $data ?? [], null);
+ $this->setIfExists('version', $data ?? [], 1);
+ $this->setIfExists('disabled', $data ?? [], false);
+ $this->setIfExists('filter_types', $data ?? [], null);
+ $this->setIfExists('channels', $data ?? [], null);
+ $this->setIfExists('secret', $data ?? [], null);
+ $this->setIfExists('metadata', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if (!is_null($this->container['rate_limit']) && ($this->container['rate_limit'] < 1)) {
+ $invalidProperties[] = "invalid value for 'rate_limit', must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['uid']) && (mb_strlen($this->container['uid']) > 256)) {
+ $invalidProperties[] = "invalid value for 'uid', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['uid']) && (mb_strlen($this->container['uid']) < 1)) {
+ $invalidProperties[] = "invalid value for 'uid', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['uid']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['uid'])) {
+ $invalidProperties[] = "invalid value for 'uid', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ if ($this->container['url'] === null) {
+ $invalidProperties[] = "'url' can't be null";
+ }
+ if ((mb_strlen($this->container['url']) > 65536)) {
+ $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 65536.";
+ }
+
+ if ((mb_strlen($this->container['url']) < 1)) {
+ $invalidProperties[] = "invalid value for 'url', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['version']) && ($this->container['version'] < 1)) {
+ $invalidProperties[] = "invalid value for 'version', must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['secret']) && !preg_match("/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/", $this->container['secret'])) {
+ $invalidProperties[] = "invalid value for 'secret', must be conform to the pattern /^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets description
+ *
+ * @return string|null
+ */
+ public function getDescription()
+ {
+ return $this->container['description'];
+ }
+
+ /**
+ * Sets description
+ *
+ * @param string|null $description description
+ *
+ * @return self
+ */
+ public function setDescription($description)
+ {
+ if (is_null($description)) {
+ throw new \InvalidArgumentException('non-nullable description cannot be null');
+ }
+ $this->container['description'] = $description;
+
+ return $this;
+ }
+
+ /**
+ * Gets rate_limit
+ *
+ * @return int|null
+ */
+ public function getRateLimit()
+ {
+ return $this->container['rate_limit'];
+ }
+
+ /**
+ * Sets rate_limit
+ *
+ * @param int|null $rate_limit rate_limit
+ *
+ * @return self
+ */
+ public function setRateLimit($rate_limit)
+ {
+ if (is_null($rate_limit)) {
+ throw new \InvalidArgumentException('non-nullable rate_limit cannot be null');
+ }
+
+ if (($rate_limit < 1)) {
+ throw new \InvalidArgumentException('invalid value for $rate_limit when calling EndpointIn., must be bigger than or equal to 1.');
+ }
+
+ $this->container['rate_limit'] = $rate_limit;
+
+ return $this;
+ }
+
+ /**
+ * Gets uid
+ *
+ * @return string|null
+ */
+ public function getUid()
+ {
+ return $this->container['uid'];
+ }
+
+ /**
+ * Sets uid
+ *
+ * @param string|null $uid Optional unique identifier for the endpoint
+ *
+ * @return self
+ */
+ public function setUid($uid)
+ {
+ if (is_null($uid)) {
+ throw new \InvalidArgumentException('non-nullable uid cannot be null');
+ }
+ if ((mb_strlen($uid) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $uid when calling EndpointIn., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($uid) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $uid when calling EndpointIn., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($uid)))) {
+ throw new \InvalidArgumentException("invalid value for \$uid when calling EndpointIn., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['uid'] = $uid;
+
+ return $this;
+ }
+
+ /**
+ * Gets url
+ *
+ * @return string
+ */
+ public function getUrl()
+ {
+ return $this->container['url'];
+ }
+
+ /**
+ * Sets url
+ *
+ * @param string $url url
+ *
+ * @return self
+ */
+ public function setUrl($url)
+ {
+ if (is_null($url)) {
+ throw new \InvalidArgumentException('non-nullable url cannot be null');
+ }
+ if ((mb_strlen($url) > 65536)) {
+ throw new \InvalidArgumentException('invalid length for $url when calling EndpointIn., must be smaller than or equal to 65536.');
+ }
+ if ((mb_strlen($url) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $url when calling EndpointIn., must be bigger than or equal to 1.');
+ }
+
+ $this->container['url'] = $url;
+
+ return $this;
+ }
+
+ /**
+ * Gets version
+ *
+ * @return int|null
+ * @deprecated
+ */
+ public function getVersion()
+ {
+ return $this->container['version'];
+ }
+
+ /**
+ * Sets version
+ *
+ * @param int|null $version version
+ *
+ * @return self
+ * @deprecated
+ */
+ public function setVersion($version)
+ {
+ if (is_null($version)) {
+ throw new \InvalidArgumentException('non-nullable version cannot be null');
+ }
+
+ if (($version < 1)) {
+ throw new \InvalidArgumentException('invalid value for $version when calling EndpointIn., must be bigger than or equal to 1.');
+ }
+
+ $this->container['version'] = $version;
+
+ return $this;
+ }
+
+ /**
+ * Gets disabled
+ *
+ * @return bool|null
+ */
+ public function getDisabled()
+ {
+ return $this->container['disabled'];
+ }
+
+ /**
+ * Sets disabled
+ *
+ * @param bool|null $disabled disabled
+ *
+ * @return self
+ */
+ public function setDisabled($disabled)
+ {
+ if (is_null($disabled)) {
+ throw new \InvalidArgumentException('non-nullable disabled cannot be null');
+ }
+ $this->container['disabled'] = $disabled;
+
+ return $this;
+ }
+
+ /**
+ * Gets filter_types
+ *
+ * @return string[]|null
+ */
+ public function getFilterTypes()
+ {
+ return $this->container['filter_types'];
+ }
+
+ /**
+ * Sets filter_types
+ *
+ * @param string[]|null $filter_types filter_types
+ *
+ * @return self
+ */
+ public function setFilterTypes($filter_types)
+ {
+ if (is_null($filter_types)) {
+ throw new \InvalidArgumentException('non-nullable filter_types cannot be null');
+ }
+ $this->container['filter_types'] = $filter_types;
+
+ return $this;
+ }
+
+ /**
+ * Gets channels
+ *
+ * @return string[]|null
+ */
+ public function getChannels()
+ {
+ return $this->container['channels'];
+ }
+
+ /**
+ * Sets channels
+ *
+ * @param string[]|null $channels channels
+ *
+ * @return self
+ */
+ public function setChannels($channels)
+ {
+ if (is_null($channels)) {
+ throw new \InvalidArgumentException('non-nullable channels cannot be null');
+ }
+ $this->container['channels'] = $channels;
+
+ return $this;
+ }
+
+ /**
+ * Gets secret
+ *
+ * @return string|null
+ */
+ public function getSecret()
+ {
+ return $this->container['secret'];
+ }
+
+ /**
+ * Sets secret
+ *
+ * @param string|null $secret The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24.
+ *
+ * @return self
+ */
+ public function setSecret($secret)
+ {
+ if (is_null($secret)) {
+ throw new \InvalidArgumentException('non-nullable secret cannot be null');
+ }
+
+ if ((!preg_match("/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/", ObjectSerializer::toString($secret)))) {
+ throw new \InvalidArgumentException("invalid value for \$secret when calling EndpointIn., must conform to the pattern /^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/.");
+ }
+
+ $this->container['secret'] = $secret;
+
+ return $this;
+ }
+
+ /**
+ * Gets metadata
+ *
+ * @return array|null
+ */
+ public function getMetadata()
+ {
+ return $this->container['metadata'];
+ }
+
+ /**
+ * Sets metadata
+ *
+ * @param array|null $metadata metadata
+ *
+ * @return self
+ */
+ public function setMetadata($metadata)
+ {
+ if (is_null($metadata)) {
+ array_push($this->openAPINullablesSetToNull, 'metadata');
+ } else {
+ $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+ $index = array_search('metadata', $nullablesSetToNull);
+ if ($index !== FALSE) {
+ unset($nullablesSetToNull[$index]);
+ $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+ }
+ }
+ $this->container['metadata'] = $metadata;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointMessageOut.php b/lib/Model/EndpointMessageOut.php
new file mode 100644
index 0000000..81dfdfb
--- /dev/null
+++ b/lib/Model/EndpointMessageOut.php
@@ -0,0 +1,700 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointMessageOut Class Doc Comment
+ *
+ * @category Class
+ * @description A model containing information on a given message plus additional fields on the last attempt for that message.
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointMessageOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointMessageOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'status' => '\Svix\ApiClient\Model\MessageStatus',
+ 'next_attempt' => '\DateTime',
+ 'event_id' => 'string',
+ 'event_type' => 'string',
+ 'payload' => 'object',
+ 'channels' => 'string[]',
+ 'id' => 'string',
+ 'timestamp' => '\DateTime'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'status' => null,
+ 'next_attempt' => 'date-time',
+ 'event_id' => null,
+ 'event_type' => null,
+ 'payload' => null,
+ 'channels' => null,
+ 'id' => null,
+ 'timestamp' => 'date-time'
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'status' => false,
+ 'next_attempt' => false,
+ 'event_id' => false,
+ 'event_type' => false,
+ 'payload' => false,
+ 'channels' => false,
+ 'id' => false,
+ 'timestamp' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'status' => 'status',
+ 'next_attempt' => 'nextAttempt',
+ 'event_id' => 'eventId',
+ 'event_type' => 'eventType',
+ 'payload' => 'payload',
+ 'channels' => 'channels',
+ 'id' => 'id',
+ 'timestamp' => 'timestamp'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'status' => 'setStatus',
+ 'next_attempt' => 'setNextAttempt',
+ 'event_id' => 'setEventId',
+ 'event_type' => 'setEventType',
+ 'payload' => 'setPayload',
+ 'channels' => 'setChannels',
+ 'id' => 'setId',
+ 'timestamp' => 'setTimestamp'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'status' => 'getStatus',
+ 'next_attempt' => 'getNextAttempt',
+ 'event_id' => 'getEventId',
+ 'event_type' => 'getEventType',
+ 'payload' => 'getPayload',
+ 'channels' => 'getChannels',
+ 'id' => 'getId',
+ 'timestamp' => 'getTimestamp'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('status', $data ?? [], null);
+ $this->setIfExists('next_attempt', $data ?? [], null);
+ $this->setIfExists('event_id', $data ?? [], null);
+ $this->setIfExists('event_type', $data ?? [], null);
+ $this->setIfExists('payload', $data ?? [], null);
+ $this->setIfExists('channels', $data ?? [], null);
+ $this->setIfExists('id', $data ?? [], null);
+ $this->setIfExists('timestamp', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['status'] === null) {
+ $invalidProperties[] = "'status' can't be null";
+ }
+ if (!is_null($this->container['event_id']) && (mb_strlen($this->container['event_id']) > 256)) {
+ $invalidProperties[] = "invalid value for 'event_id', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['event_id']) && (mb_strlen($this->container['event_id']) < 1)) {
+ $invalidProperties[] = "invalid value for 'event_id', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['event_id']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['event_id'])) {
+ $invalidProperties[] = "invalid value for 'event_id', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ if ($this->container['event_type'] === null) {
+ $invalidProperties[] = "'event_type' can't be null";
+ }
+ if ((mb_strlen($this->container['event_type']) > 256)) {
+ $invalidProperties[] = "invalid value for 'event_type', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['event_type'])) {
+ $invalidProperties[] = "invalid value for 'event_type', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ if ($this->container['payload'] === null) {
+ $invalidProperties[] = "'payload' can't be null";
+ }
+ if ($this->container['id'] === null) {
+ $invalidProperties[] = "'id' can't be null";
+ }
+ if ($this->container['timestamp'] === null) {
+ $invalidProperties[] = "'timestamp' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets status
+ *
+ * @return \Svix\ApiClient\Model\MessageStatus
+ */
+ public function getStatus()
+ {
+ return $this->container['status'];
+ }
+
+ /**
+ * Sets status
+ *
+ * @param \Svix\ApiClient\Model\MessageStatus $status status
+ *
+ * @return self
+ */
+ public function setStatus($status)
+ {
+ if (is_null($status)) {
+ throw new \InvalidArgumentException('non-nullable status cannot be null');
+ }
+ $this->container['status'] = $status;
+
+ return $this;
+ }
+
+ /**
+ * Gets next_attempt
+ *
+ * @return \DateTime|null
+ */
+ public function getNextAttempt()
+ {
+ return $this->container['next_attempt'];
+ }
+
+ /**
+ * Sets next_attempt
+ *
+ * @param \DateTime|null $next_attempt next_attempt
+ *
+ * @return self
+ */
+ public function setNextAttempt($next_attempt)
+ {
+ if (is_null($next_attempt)) {
+ throw new \InvalidArgumentException('non-nullable next_attempt cannot be null');
+ }
+ $this->container['next_attempt'] = $next_attempt;
+
+ return $this;
+ }
+
+ /**
+ * Gets event_id
+ *
+ * @return string|null
+ */
+ public function getEventId()
+ {
+ return $this->container['event_id'];
+ }
+
+ /**
+ * Sets event_id
+ *
+ * @param string|null $event_id Optional unique identifier for the message
+ *
+ * @return self
+ */
+ public function setEventId($event_id)
+ {
+ if (is_null($event_id)) {
+ throw new \InvalidArgumentException('non-nullable event_id cannot be null');
+ }
+ if ((mb_strlen($event_id) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $event_id when calling EndpointMessageOut., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($event_id) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $event_id when calling EndpointMessageOut., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($event_id)))) {
+ throw new \InvalidArgumentException("invalid value for \$event_id when calling EndpointMessageOut., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['event_id'] = $event_id;
+
+ return $this;
+ }
+
+ /**
+ * Gets event_type
+ *
+ * @return string
+ */
+ public function getEventType()
+ {
+ return $this->container['event_type'];
+ }
+
+ /**
+ * Sets event_type
+ *
+ * @param string $event_type The event type's name
+ *
+ * @return self
+ */
+ public function setEventType($event_type)
+ {
+ if (is_null($event_type)) {
+ throw new \InvalidArgumentException('non-nullable event_type cannot be null');
+ }
+ if ((mb_strlen($event_type) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $event_type when calling EndpointMessageOut., must be smaller than or equal to 256.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($event_type)))) {
+ throw new \InvalidArgumentException("invalid value for \$event_type when calling EndpointMessageOut., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['event_type'] = $event_type;
+
+ return $this;
+ }
+
+ /**
+ * Gets payload
+ *
+ * @return object
+ */
+ public function getPayload()
+ {
+ return $this->container['payload'];
+ }
+
+ /**
+ * Sets payload
+ *
+ * @param object $payload payload
+ *
+ * @return self
+ */
+ public function setPayload($payload)
+ {
+ if (is_null($payload)) {
+ throw new \InvalidArgumentException('non-nullable payload cannot be null');
+ }
+ $this->container['payload'] = $payload;
+
+ return $this;
+ }
+
+ /**
+ * Gets channels
+ *
+ * @return string[]|null
+ */
+ public function getChannels()
+ {
+ return $this->container['channels'];
+ }
+
+ /**
+ * Sets channels
+ *
+ * @param string[]|null $channels channels
+ *
+ * @return self
+ */
+ public function setChannels($channels)
+ {
+ if (is_null($channels)) {
+ throw new \InvalidArgumentException('non-nullable channels cannot be null');
+ }
+ $this->container['channels'] = $channels;
+
+ return $this;
+ }
+
+ /**
+ * Gets id
+ *
+ * @return string
+ */
+ public function getId()
+ {
+ return $this->container['id'];
+ }
+
+ /**
+ * Sets id
+ *
+ * @param string $id The msg's ID
+ *
+ * @return self
+ */
+ public function setId($id)
+ {
+ if (is_null($id)) {
+ throw new \InvalidArgumentException('non-nullable id cannot be null');
+ }
+ $this->container['id'] = $id;
+
+ return $this;
+ }
+
+ /**
+ * Gets timestamp
+ *
+ * @return \DateTime
+ */
+ public function getTimestamp()
+ {
+ return $this->container['timestamp'];
+ }
+
+ /**
+ * Sets timestamp
+ *
+ * @param \DateTime $timestamp timestamp
+ *
+ * @return self
+ */
+ public function setTimestamp($timestamp)
+ {
+ if (is_null($timestamp)) {
+ throw new \InvalidArgumentException('non-nullable timestamp cannot be null');
+ }
+ $this->container['timestamp'] = $timestamp;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointOut.php b/lib/Model/EndpointOut.php
new file mode 100644
index 0000000..1197649
--- /dev/null
+++ b/lib/Model/EndpointOut.php
@@ -0,0 +1,868 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'id' => 'string',
+ 'metadata' => 'array',
+ 'description' => 'string',
+ 'rate_limit' => 'int',
+ 'uid' => 'string',
+ 'url' => 'string',
+ 'version' => 'int',
+ 'disabled' => 'bool',
+ 'filter_types' => 'string[]',
+ 'channels' => 'string[]',
+ 'created_at' => '\DateTime',
+ 'updated_at' => '\DateTime'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'id' => null,
+ 'metadata' => null,
+ 'description' => null,
+ 'rate_limit' => 'uint16',
+ 'uid' => null,
+ 'url' => 'uri',
+ 'version' => 'int32',
+ 'disabled' => null,
+ 'filter_types' => null,
+ 'channels' => null,
+ 'created_at' => 'date-time',
+ 'updated_at' => 'date-time'
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'id' => false,
+ 'metadata' => true,
+ 'description' => false,
+ 'rate_limit' => false,
+ 'uid' => false,
+ 'url' => false,
+ 'version' => false,
+ 'disabled' => false,
+ 'filter_types' => false,
+ 'channels' => false,
+ 'created_at' => false,
+ 'updated_at' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'id' => 'id',
+ 'metadata' => 'metadata',
+ 'description' => 'description',
+ 'rate_limit' => 'rateLimit',
+ 'uid' => 'uid',
+ 'url' => 'url',
+ 'version' => 'version',
+ 'disabled' => 'disabled',
+ 'filter_types' => 'filterTypes',
+ 'channels' => 'channels',
+ 'created_at' => 'createdAt',
+ 'updated_at' => 'updatedAt'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'id' => 'setId',
+ 'metadata' => 'setMetadata',
+ 'description' => 'setDescription',
+ 'rate_limit' => 'setRateLimit',
+ 'uid' => 'setUid',
+ 'url' => 'setUrl',
+ 'version' => 'setVersion',
+ 'disabled' => 'setDisabled',
+ 'filter_types' => 'setFilterTypes',
+ 'channels' => 'setChannels',
+ 'created_at' => 'setCreatedAt',
+ 'updated_at' => 'setUpdatedAt'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'id' => 'getId',
+ 'metadata' => 'getMetadata',
+ 'description' => 'getDescription',
+ 'rate_limit' => 'getRateLimit',
+ 'uid' => 'getUid',
+ 'url' => 'getUrl',
+ 'version' => 'getVersion',
+ 'disabled' => 'getDisabled',
+ 'filter_types' => 'getFilterTypes',
+ 'channels' => 'getChannels',
+ 'created_at' => 'getCreatedAt',
+ 'updated_at' => 'getUpdatedAt'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('id', $data ?? [], null);
+ $this->setIfExists('metadata', $data ?? [], null);
+ $this->setIfExists('description', $data ?? [], null);
+ $this->setIfExists('rate_limit', $data ?? [], null);
+ $this->setIfExists('uid', $data ?? [], null);
+ $this->setIfExists('url', $data ?? [], null);
+ $this->setIfExists('version', $data ?? [], null);
+ $this->setIfExists('disabled', $data ?? [], false);
+ $this->setIfExists('filter_types', $data ?? [], null);
+ $this->setIfExists('channels', $data ?? [], null);
+ $this->setIfExists('created_at', $data ?? [], null);
+ $this->setIfExists('updated_at', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['id'] === null) {
+ $invalidProperties[] = "'id' can't be null";
+ }
+ if ($this->container['metadata'] === null) {
+ $invalidProperties[] = "'metadata' can't be null";
+ }
+ if ($this->container['description'] === null) {
+ $invalidProperties[] = "'description' can't be null";
+ }
+ if (!is_null($this->container['rate_limit']) && ($this->container['rate_limit'] < 0)) {
+ $invalidProperties[] = "invalid value for 'rate_limit', must be bigger than or equal to 0.";
+ }
+
+ if (!is_null($this->container['uid']) && (mb_strlen($this->container['uid']) > 256)) {
+ $invalidProperties[] = "invalid value for 'uid', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['uid']) && (mb_strlen($this->container['uid']) < 1)) {
+ $invalidProperties[] = "invalid value for 'uid', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['uid']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['uid'])) {
+ $invalidProperties[] = "invalid value for 'uid', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ if ($this->container['url'] === null) {
+ $invalidProperties[] = "'url' can't be null";
+ }
+ if ((mb_strlen($this->container['url']) > 65536)) {
+ $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 65536.";
+ }
+
+ if ((mb_strlen($this->container['url']) < 1)) {
+ $invalidProperties[] = "invalid value for 'url', the character length must be bigger than or equal to 1.";
+ }
+
+ if ($this->container['version'] === null) {
+ $invalidProperties[] = "'version' can't be null";
+ }
+ if (($this->container['version'] < 1)) {
+ $invalidProperties[] = "invalid value for 'version', must be bigger than or equal to 1.";
+ }
+
+ if ($this->container['created_at'] === null) {
+ $invalidProperties[] = "'created_at' can't be null";
+ }
+ if ($this->container['updated_at'] === null) {
+ $invalidProperties[] = "'updated_at' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets id
+ *
+ * @return string
+ */
+ public function getId()
+ {
+ return $this->container['id'];
+ }
+
+ /**
+ * Sets id
+ *
+ * @param string $id The ep's ID
+ *
+ * @return self
+ */
+ public function setId($id)
+ {
+ if (is_null($id)) {
+ throw new \InvalidArgumentException('non-nullable id cannot be null');
+ }
+ $this->container['id'] = $id;
+
+ return $this;
+ }
+
+ /**
+ * Gets metadata
+ *
+ * @return array
+ */
+ public function getMetadata()
+ {
+ return $this->container['metadata'];
+ }
+
+ /**
+ * Sets metadata
+ *
+ * @param array $metadata metadata
+ *
+ * @return self
+ */
+ public function setMetadata($metadata)
+ {
+ if (is_null($metadata)) {
+ array_push($this->openAPINullablesSetToNull, 'metadata');
+ } else {
+ $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+ $index = array_search('metadata', $nullablesSetToNull);
+ if ($index !== FALSE) {
+ unset($nullablesSetToNull[$index]);
+ $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+ }
+ }
+ $this->container['metadata'] = $metadata;
+
+ return $this;
+ }
+
+ /**
+ * Gets description
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->container['description'];
+ }
+
+ /**
+ * Sets description
+ *
+ * @param string $description An example endpoint name
+ *
+ * @return self
+ */
+ public function setDescription($description)
+ {
+ if (is_null($description)) {
+ throw new \InvalidArgumentException('non-nullable description cannot be null');
+ }
+ $this->container['description'] = $description;
+
+ return $this;
+ }
+
+ /**
+ * Gets rate_limit
+ *
+ * @return int|null
+ */
+ public function getRateLimit()
+ {
+ return $this->container['rate_limit'];
+ }
+
+ /**
+ * Sets rate_limit
+ *
+ * @param int|null $rate_limit rate_limit
+ *
+ * @return self
+ */
+ public function setRateLimit($rate_limit)
+ {
+ if (is_null($rate_limit)) {
+ throw new \InvalidArgumentException('non-nullable rate_limit cannot be null');
+ }
+
+ if (($rate_limit < 0)) {
+ throw new \InvalidArgumentException('invalid value for $rate_limit when calling EndpointOut., must be bigger than or equal to 0.');
+ }
+
+ $this->container['rate_limit'] = $rate_limit;
+
+ return $this;
+ }
+
+ /**
+ * Gets uid
+ *
+ * @return string|null
+ */
+ public function getUid()
+ {
+ return $this->container['uid'];
+ }
+
+ /**
+ * Sets uid
+ *
+ * @param string|null $uid Optional unique identifier for the endpoint
+ *
+ * @return self
+ */
+ public function setUid($uid)
+ {
+ if (is_null($uid)) {
+ throw new \InvalidArgumentException('non-nullable uid cannot be null');
+ }
+ if ((mb_strlen($uid) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $uid when calling EndpointOut., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($uid) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $uid when calling EndpointOut., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($uid)))) {
+ throw new \InvalidArgumentException("invalid value for \$uid when calling EndpointOut., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['uid'] = $uid;
+
+ return $this;
+ }
+
+ /**
+ * Gets url
+ *
+ * @return string
+ */
+ public function getUrl()
+ {
+ return $this->container['url'];
+ }
+
+ /**
+ * Sets url
+ *
+ * @param string $url url
+ *
+ * @return self
+ */
+ public function setUrl($url)
+ {
+ if (is_null($url)) {
+ throw new \InvalidArgumentException('non-nullable url cannot be null');
+ }
+ if ((mb_strlen($url) > 65536)) {
+ throw new \InvalidArgumentException('invalid length for $url when calling EndpointOut., must be smaller than or equal to 65536.');
+ }
+ if ((mb_strlen($url) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $url when calling EndpointOut., must be bigger than or equal to 1.');
+ }
+
+ $this->container['url'] = $url;
+
+ return $this;
+ }
+
+ /**
+ * Gets version
+ *
+ * @return int
+ * @deprecated
+ */
+ public function getVersion()
+ {
+ return $this->container['version'];
+ }
+
+ /**
+ * Sets version
+ *
+ * @param int $version version
+ *
+ * @return self
+ * @deprecated
+ */
+ public function setVersion($version)
+ {
+ if (is_null($version)) {
+ throw new \InvalidArgumentException('non-nullable version cannot be null');
+ }
+
+ if (($version < 1)) {
+ throw new \InvalidArgumentException('invalid value for $version when calling EndpointOut., must be bigger than or equal to 1.');
+ }
+
+ $this->container['version'] = $version;
+
+ return $this;
+ }
+
+ /**
+ * Gets disabled
+ *
+ * @return bool|null
+ */
+ public function getDisabled()
+ {
+ return $this->container['disabled'];
+ }
+
+ /**
+ * Sets disabled
+ *
+ * @param bool|null $disabled disabled
+ *
+ * @return self
+ */
+ public function setDisabled($disabled)
+ {
+ if (is_null($disabled)) {
+ throw new \InvalidArgumentException('non-nullable disabled cannot be null');
+ }
+ $this->container['disabled'] = $disabled;
+
+ return $this;
+ }
+
+ /**
+ * Gets filter_types
+ *
+ * @return string[]|null
+ */
+ public function getFilterTypes()
+ {
+ return $this->container['filter_types'];
+ }
+
+ /**
+ * Sets filter_types
+ *
+ * @param string[]|null $filter_types filter_types
+ *
+ * @return self
+ */
+ public function setFilterTypes($filter_types)
+ {
+ if (is_null($filter_types)) {
+ throw new \InvalidArgumentException('non-nullable filter_types cannot be null');
+ }
+ $this->container['filter_types'] = $filter_types;
+
+ return $this;
+ }
+
+ /**
+ * Gets channels
+ *
+ * @return string[]|null
+ */
+ public function getChannels()
+ {
+ return $this->container['channels'];
+ }
+
+ /**
+ * Sets channels
+ *
+ * @param string[]|null $channels channels
+ *
+ * @return self
+ */
+ public function setChannels($channels)
+ {
+ if (is_null($channels)) {
+ throw new \InvalidArgumentException('non-nullable channels cannot be null');
+ }
+ $this->container['channels'] = $channels;
+
+ return $this;
+ }
+
+ /**
+ * Gets created_at
+ *
+ * @return \DateTime
+ */
+ public function getCreatedAt()
+ {
+ return $this->container['created_at'];
+ }
+
+ /**
+ * Sets created_at
+ *
+ * @param \DateTime $created_at created_at
+ *
+ * @return self
+ */
+ public function setCreatedAt($created_at)
+ {
+ if (is_null($created_at)) {
+ throw new \InvalidArgumentException('non-nullable created_at cannot be null');
+ }
+ $this->container['created_at'] = $created_at;
+
+ return $this;
+ }
+
+ /**
+ * Gets updated_at
+ *
+ * @return \DateTime
+ */
+ public function getUpdatedAt()
+ {
+ return $this->container['updated_at'];
+ }
+
+ /**
+ * Sets updated_at
+ *
+ * @param \DateTime $updated_at updated_at
+ *
+ * @return self
+ */
+ public function setUpdatedAt($updated_at)
+ {
+ if (is_null($updated_at)) {
+ throw new \InvalidArgumentException('non-nullable updated_at cannot be null');
+ }
+ $this->container['updated_at'] = $updated_at;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointPatch.php b/lib/Model/EndpointPatch.php
new file mode 100644
index 0000000..08c50fe
--- /dev/null
+++ b/lib/Model/EndpointPatch.php
@@ -0,0 +1,773 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointPatch Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointPatch implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointPatch';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'description' => 'string',
+ 'rate_limit' => 'int',
+ 'uid' => 'string',
+ 'url' => 'string',
+ 'version' => 'int',
+ 'disabled' => 'bool',
+ 'filter_types' => 'string[]',
+ 'channels' => 'string[]',
+ 'secret' => 'string',
+ 'metadata' => 'array'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'description' => null,
+ 'rate_limit' => 'uint16',
+ 'uid' => null,
+ 'url' => 'uri',
+ 'version' => 'uint16',
+ 'disabled' => null,
+ 'filter_types' => null,
+ 'channels' => null,
+ 'secret' => null,
+ 'metadata' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'description' => false,
+ 'rate_limit' => false,
+ 'uid' => false,
+ 'url' => false,
+ 'version' => false,
+ 'disabled' => false,
+ 'filter_types' => false,
+ 'channels' => false,
+ 'secret' => false,
+ 'metadata' => true
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'description' => 'description',
+ 'rate_limit' => 'rateLimit',
+ 'uid' => 'uid',
+ 'url' => 'url',
+ 'version' => 'version',
+ 'disabled' => 'disabled',
+ 'filter_types' => 'filterTypes',
+ 'channels' => 'channels',
+ 'secret' => 'secret',
+ 'metadata' => 'metadata'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'description' => 'setDescription',
+ 'rate_limit' => 'setRateLimit',
+ 'uid' => 'setUid',
+ 'url' => 'setUrl',
+ 'version' => 'setVersion',
+ 'disabled' => 'setDisabled',
+ 'filter_types' => 'setFilterTypes',
+ 'channels' => 'setChannels',
+ 'secret' => 'setSecret',
+ 'metadata' => 'setMetadata'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'description' => 'getDescription',
+ 'rate_limit' => 'getRateLimit',
+ 'uid' => 'getUid',
+ 'url' => 'getUrl',
+ 'version' => 'getVersion',
+ 'disabled' => 'getDisabled',
+ 'filter_types' => 'getFilterTypes',
+ 'channels' => 'getChannels',
+ 'secret' => 'getSecret',
+ 'metadata' => 'getMetadata'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('description', $data ?? [], null);
+ $this->setIfExists('rate_limit', $data ?? [], null);
+ $this->setIfExists('uid', $data ?? [], null);
+ $this->setIfExists('url', $data ?? [], null);
+ $this->setIfExists('version', $data ?? [], null);
+ $this->setIfExists('disabled', $data ?? [], null);
+ $this->setIfExists('filter_types', $data ?? [], null);
+ $this->setIfExists('channels', $data ?? [], null);
+ $this->setIfExists('secret', $data ?? [], null);
+ $this->setIfExists('metadata', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if (!is_null($this->container['rate_limit']) && ($this->container['rate_limit'] < 0)) {
+ $invalidProperties[] = "invalid value for 'rate_limit', must be bigger than or equal to 0.";
+ }
+
+ if (!is_null($this->container['uid']) && (mb_strlen($this->container['uid']) > 256)) {
+ $invalidProperties[] = "invalid value for 'uid', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['uid']) && (mb_strlen($this->container['uid']) < 1)) {
+ $invalidProperties[] = "invalid value for 'uid', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['uid']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['uid'])) {
+ $invalidProperties[] = "invalid value for 'uid', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ if (!is_null($this->container['version']) && ($this->container['version'] < 1)) {
+ $invalidProperties[] = "invalid value for 'version', must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['secret']) && !preg_match("/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/", $this->container['secret'])) {
+ $invalidProperties[] = "invalid value for 'secret', must be conform to the pattern /^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets description
+ *
+ * @return string|null
+ */
+ public function getDescription()
+ {
+ return $this->container['description'];
+ }
+
+ /**
+ * Sets description
+ *
+ * @param string|null $description description
+ *
+ * @return self
+ */
+ public function setDescription($description)
+ {
+ if (is_null($description)) {
+ throw new \InvalidArgumentException('non-nullable description cannot be null');
+ }
+ $this->container['description'] = $description;
+
+ return $this;
+ }
+
+ /**
+ * Gets rate_limit
+ *
+ * @return int|null
+ */
+ public function getRateLimit()
+ {
+ return $this->container['rate_limit'];
+ }
+
+ /**
+ * Sets rate_limit
+ *
+ * @param int|null $rate_limit rate_limit
+ *
+ * @return self
+ */
+ public function setRateLimit($rate_limit)
+ {
+ if (is_null($rate_limit)) {
+ throw new \InvalidArgumentException('non-nullable rate_limit cannot be null');
+ }
+
+ if (($rate_limit < 0)) {
+ throw new \InvalidArgumentException('invalid value for $rate_limit when calling EndpointPatch., must be bigger than or equal to 0.');
+ }
+
+ $this->container['rate_limit'] = $rate_limit;
+
+ return $this;
+ }
+
+ /**
+ * Gets uid
+ *
+ * @return string|null
+ */
+ public function getUid()
+ {
+ return $this->container['uid'];
+ }
+
+ /**
+ * Sets uid
+ *
+ * @param string|null $uid The ep's UID
+ *
+ * @return self
+ */
+ public function setUid($uid)
+ {
+ if (is_null($uid)) {
+ throw new \InvalidArgumentException('non-nullable uid cannot be null');
+ }
+ if ((mb_strlen($uid) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $uid when calling EndpointPatch., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($uid) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $uid when calling EndpointPatch., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($uid)))) {
+ throw new \InvalidArgumentException("invalid value for \$uid when calling EndpointPatch., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['uid'] = $uid;
+
+ return $this;
+ }
+
+ /**
+ * Gets url
+ *
+ * @return string|null
+ */
+ public function getUrl()
+ {
+ return $this->container['url'];
+ }
+
+ /**
+ * Sets url
+ *
+ * @param string|null $url url
+ *
+ * @return self
+ */
+ public function setUrl($url)
+ {
+ if (is_null($url)) {
+ throw new \InvalidArgumentException('non-nullable url cannot be null');
+ }
+ $this->container['url'] = $url;
+
+ return $this;
+ }
+
+ /**
+ * Gets version
+ *
+ * @return int|null
+ * @deprecated
+ */
+ public function getVersion()
+ {
+ return $this->container['version'];
+ }
+
+ /**
+ * Sets version
+ *
+ * @param int|null $version version
+ *
+ * @return self
+ * @deprecated
+ */
+ public function setVersion($version)
+ {
+ if (is_null($version)) {
+ throw new \InvalidArgumentException('non-nullable version cannot be null');
+ }
+
+ if (($version < 1)) {
+ throw new \InvalidArgumentException('invalid value for $version when calling EndpointPatch., must be bigger than or equal to 1.');
+ }
+
+ $this->container['version'] = $version;
+
+ return $this;
+ }
+
+ /**
+ * Gets disabled
+ *
+ * @return bool|null
+ */
+ public function getDisabled()
+ {
+ return $this->container['disabled'];
+ }
+
+ /**
+ * Sets disabled
+ *
+ * @param bool|null $disabled disabled
+ *
+ * @return self
+ */
+ public function setDisabled($disabled)
+ {
+ if (is_null($disabled)) {
+ throw new \InvalidArgumentException('non-nullable disabled cannot be null');
+ }
+ $this->container['disabled'] = $disabled;
+
+ return $this;
+ }
+
+ /**
+ * Gets filter_types
+ *
+ * @return string[]|null
+ */
+ public function getFilterTypes()
+ {
+ return $this->container['filter_types'];
+ }
+
+ /**
+ * Sets filter_types
+ *
+ * @param string[]|null $filter_types filter_types
+ *
+ * @return self
+ */
+ public function setFilterTypes($filter_types)
+ {
+ if (is_null($filter_types)) {
+ throw new \InvalidArgumentException('non-nullable filter_types cannot be null');
+ }
+ $this->container['filter_types'] = $filter_types;
+
+ return $this;
+ }
+
+ /**
+ * Gets channels
+ *
+ * @return string[]|null
+ */
+ public function getChannels()
+ {
+ return $this->container['channels'];
+ }
+
+ /**
+ * Sets channels
+ *
+ * @param string[]|null $channels channels
+ *
+ * @return self
+ */
+ public function setChannels($channels)
+ {
+ if (is_null($channels)) {
+ throw new \InvalidArgumentException('non-nullable channels cannot be null');
+ }
+ $this->container['channels'] = $channels;
+
+ return $this;
+ }
+
+ /**
+ * Gets secret
+ *
+ * @return string|null
+ */
+ public function getSecret()
+ {
+ return $this->container['secret'];
+ }
+
+ /**
+ * Sets secret
+ *
+ * @param string|null $secret The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24.
+ *
+ * @return self
+ */
+ public function setSecret($secret)
+ {
+ if (is_null($secret)) {
+ throw new \InvalidArgumentException('non-nullable secret cannot be null');
+ }
+
+ if ((!preg_match("/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/", ObjectSerializer::toString($secret)))) {
+ throw new \InvalidArgumentException("invalid value for \$secret when calling EndpointPatch., must conform to the pattern /^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/.");
+ }
+
+ $this->container['secret'] = $secret;
+
+ return $this;
+ }
+
+ /**
+ * Gets metadata
+ *
+ * @return array|null
+ */
+ public function getMetadata()
+ {
+ return $this->container['metadata'];
+ }
+
+ /**
+ * Sets metadata
+ *
+ * @param array|null $metadata metadata
+ *
+ * @return self
+ */
+ public function setMetadata($metadata)
+ {
+ if (is_null($metadata)) {
+ array_push($this->openAPINullablesSetToNull, 'metadata');
+ } else {
+ $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+ $index = array_search('metadata', $nullablesSetToNull);
+ if ($index !== FALSE) {
+ unset($nullablesSetToNull[$index]);
+ $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+ }
+ }
+ $this->container['metadata'] = $metadata;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointSecretOut.php b/lib/Model/EndpointSecretOut.php
new file mode 100644
index 0000000..25fd1af
--- /dev/null
+++ b/lib/Model/EndpointSecretOut.php
@@ -0,0 +1,421 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointSecretOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointSecretOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointSecretOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'key' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'key' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'key' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'key' => 'key'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'key' => 'setKey'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'key' => 'getKey'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('key', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['key'] === null) {
+ $invalidProperties[] = "'key' can't be null";
+ }
+ if (!preg_match("/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/", $this->container['key'])) {
+ $invalidProperties[] = "invalid value for 'key', must be conform to the pattern /^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets key
+ *
+ * @return string
+ */
+ public function getKey()
+ {
+ return $this->container['key'];
+ }
+
+ /**
+ * Sets key
+ *
+ * @param string $key The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24.
+ *
+ * @return self
+ */
+ public function setKey($key)
+ {
+ if (is_null($key)) {
+ throw new \InvalidArgumentException('non-nullable key cannot be null');
+ }
+
+ if ((!preg_match("/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/", ObjectSerializer::toString($key)))) {
+ throw new \InvalidArgumentException("invalid value for \$key when calling EndpointSecretOut., must conform to the pattern /^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/.");
+ }
+
+ $this->container['key'] = $key;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointSecretRotateIn.php b/lib/Model/EndpointSecretRotateIn.php
new file mode 100644
index 0000000..80f1c60
--- /dev/null
+++ b/lib/Model/EndpointSecretRotateIn.php
@@ -0,0 +1,418 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointSecretRotateIn Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointSecretRotateIn implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointSecretRotateIn';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'key' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'key' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'key' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'key' => 'key'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'key' => 'setKey'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'key' => 'getKey'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('key', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if (!is_null($this->container['key']) && !preg_match("/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/", $this->container['key'])) {
+ $invalidProperties[] = "invalid value for 'key', must be conform to the pattern /^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets key
+ *
+ * @return string|null
+ */
+ public function getKey()
+ {
+ return $this->container['key'];
+ }
+
+ /**
+ * Sets key
+ *
+ * @param string|null $key The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24.
+ *
+ * @return self
+ */
+ public function setKey($key)
+ {
+ if (is_null($key)) {
+ throw new \InvalidArgumentException('non-nullable key cannot be null');
+ }
+
+ if ((!preg_match("/^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/", ObjectSerializer::toString($key)))) {
+ throw new \InvalidArgumentException("invalid value for \$key when calling EndpointSecretRotateIn., must conform to the pattern /^(whsec_)?[a-zA-Z0-9+\/=]{32,100}$/.");
+ }
+
+ $this->container['key'] = $key;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointStats.php b/lib/Model/EndpointStats.php
new file mode 100644
index 0000000..a061ea4
--- /dev/null
+++ b/lib/Model/EndpointStats.php
@@ -0,0 +1,523 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointStats Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointStats implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointStats';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'success' => 'int',
+ 'pending' => 'int',
+ 'sending' => 'int',
+ 'fail' => 'int'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'success' => 'int64',
+ 'pending' => 'int64',
+ 'sending' => 'int64',
+ 'fail' => 'int64'
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'success' => false,
+ 'pending' => false,
+ 'sending' => false,
+ 'fail' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'success' => 'success',
+ 'pending' => 'pending',
+ 'sending' => 'sending',
+ 'fail' => 'fail'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'success' => 'setSuccess',
+ 'pending' => 'setPending',
+ 'sending' => 'setSending',
+ 'fail' => 'setFail'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'success' => 'getSuccess',
+ 'pending' => 'getPending',
+ 'sending' => 'getSending',
+ 'fail' => 'getFail'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('success', $data ?? [], null);
+ $this->setIfExists('pending', $data ?? [], null);
+ $this->setIfExists('sending', $data ?? [], null);
+ $this->setIfExists('fail', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['success'] === null) {
+ $invalidProperties[] = "'success' can't be null";
+ }
+ if ($this->container['pending'] === null) {
+ $invalidProperties[] = "'pending' can't be null";
+ }
+ if ($this->container['sending'] === null) {
+ $invalidProperties[] = "'sending' can't be null";
+ }
+ if ($this->container['fail'] === null) {
+ $invalidProperties[] = "'fail' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets success
+ *
+ * @return int
+ */
+ public function getSuccess()
+ {
+ return $this->container['success'];
+ }
+
+ /**
+ * Sets success
+ *
+ * @param int $success success
+ *
+ * @return self
+ */
+ public function setSuccess($success)
+ {
+ if (is_null($success)) {
+ throw new \InvalidArgumentException('non-nullable success cannot be null');
+ }
+ $this->container['success'] = $success;
+
+ return $this;
+ }
+
+ /**
+ * Gets pending
+ *
+ * @return int
+ */
+ public function getPending()
+ {
+ return $this->container['pending'];
+ }
+
+ /**
+ * Sets pending
+ *
+ * @param int $pending pending
+ *
+ * @return self
+ */
+ public function setPending($pending)
+ {
+ if (is_null($pending)) {
+ throw new \InvalidArgumentException('non-nullable pending cannot be null');
+ }
+ $this->container['pending'] = $pending;
+
+ return $this;
+ }
+
+ /**
+ * Gets sending
+ *
+ * @return int
+ */
+ public function getSending()
+ {
+ return $this->container['sending'];
+ }
+
+ /**
+ * Sets sending
+ *
+ * @param int $sending sending
+ *
+ * @return self
+ */
+ public function setSending($sending)
+ {
+ if (is_null($sending)) {
+ throw new \InvalidArgumentException('non-nullable sending cannot be null');
+ }
+ $this->container['sending'] = $sending;
+
+ return $this;
+ }
+
+ /**
+ * Gets fail
+ *
+ * @return int
+ */
+ public function getFail()
+ {
+ return $this->container['fail'];
+ }
+
+ /**
+ * Sets fail
+ *
+ * @param int $fail fail
+ *
+ * @return self
+ */
+ public function setFail($fail)
+ {
+ if (is_null($fail)) {
+ throw new \InvalidArgumentException('non-nullable fail cannot be null');
+ }
+ $this->container['fail'] = $fail;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointTransformationIn.php b/lib/Model/EndpointTransformationIn.php
new file mode 100644
index 0000000..55d1553
--- /dev/null
+++ b/lib/Model/EndpointTransformationIn.php
@@ -0,0 +1,458 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointTransformationIn Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointTransformationIn implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointTransformationIn';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'code' => 'string',
+ 'enabled' => 'bool'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'code' => null,
+ 'enabled' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'code' => false,
+ 'enabled' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'code' => 'code',
+ 'enabled' => 'enabled'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'code' => 'setCode',
+ 'enabled' => 'setEnabled'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'code' => 'getCode',
+ 'enabled' => 'getEnabled'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('code', $data ?? [], null);
+ $this->setIfExists('enabled', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if (!is_null($this->container['code']) && (mb_strlen($this->container['code']) > 51200)) {
+ $invalidProperties[] = "invalid value for 'code', the character length must be smaller than or equal to 51200.";
+ }
+
+ if (!is_null($this->container['code']) && (mb_strlen($this->container['code']) < 10)) {
+ $invalidProperties[] = "invalid value for 'code', the character length must be bigger than or equal to 10.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets code
+ *
+ * @return string|null
+ */
+ public function getCode()
+ {
+ return $this->container['code'];
+ }
+
+ /**
+ * Sets code
+ *
+ * @param string|null $code code
+ *
+ * @return self
+ */
+ public function setCode($code)
+ {
+ if (is_null($code)) {
+ throw new \InvalidArgumentException('non-nullable code cannot be null');
+ }
+ if ((mb_strlen($code) > 51200)) {
+ throw new \InvalidArgumentException('invalid length for $code when calling EndpointTransformationIn., must be smaller than or equal to 51200.');
+ }
+ if ((mb_strlen($code) < 10)) {
+ throw new \InvalidArgumentException('invalid length for $code when calling EndpointTransformationIn., must be bigger than or equal to 10.');
+ }
+
+ $this->container['code'] = $code;
+
+ return $this;
+ }
+
+ /**
+ * Gets enabled
+ *
+ * @return bool|null
+ */
+ public function getEnabled()
+ {
+ return $this->container['enabled'];
+ }
+
+ /**
+ * Sets enabled
+ *
+ * @param bool|null $enabled enabled
+ *
+ * @return self
+ */
+ public function setEnabled($enabled)
+ {
+ if (is_null($enabled)) {
+ throw new \InvalidArgumentException('non-nullable enabled cannot be null');
+ }
+ $this->container['enabled'] = $enabled;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointTransformationOut.php b/lib/Model/EndpointTransformationOut.php
new file mode 100644
index 0000000..b529d63
--- /dev/null
+++ b/lib/Model/EndpointTransformationOut.php
@@ -0,0 +1,458 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointTransformationOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointTransformationOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointTransformationOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'code' => 'string',
+ 'enabled' => 'bool'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'code' => null,
+ 'enabled' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'code' => false,
+ 'enabled' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'code' => 'code',
+ 'enabled' => 'enabled'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'code' => 'setCode',
+ 'enabled' => 'setEnabled'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'code' => 'getCode',
+ 'enabled' => 'getEnabled'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('code', $data ?? [], null);
+ $this->setIfExists('enabled', $data ?? [], false);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if (!is_null($this->container['code']) && (mb_strlen($this->container['code']) > 51200)) {
+ $invalidProperties[] = "invalid value for 'code', the character length must be smaller than or equal to 51200.";
+ }
+
+ if (!is_null($this->container['code']) && (mb_strlen($this->container['code']) < 10)) {
+ $invalidProperties[] = "invalid value for 'code', the character length must be bigger than or equal to 10.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets code
+ *
+ * @return string|null
+ */
+ public function getCode()
+ {
+ return $this->container['code'];
+ }
+
+ /**
+ * Sets code
+ *
+ * @param string|null $code code
+ *
+ * @return self
+ */
+ public function setCode($code)
+ {
+ if (is_null($code)) {
+ throw new \InvalidArgumentException('non-nullable code cannot be null');
+ }
+ if ((mb_strlen($code) > 51200)) {
+ throw new \InvalidArgumentException('invalid length for $code when calling EndpointTransformationOut., must be smaller than or equal to 51200.');
+ }
+ if ((mb_strlen($code) < 10)) {
+ throw new \InvalidArgumentException('invalid length for $code when calling EndpointTransformationOut., must be bigger than or equal to 10.');
+ }
+
+ $this->container['code'] = $code;
+
+ return $this;
+ }
+
+ /**
+ * Gets enabled
+ *
+ * @return bool|null
+ */
+ public function getEnabled()
+ {
+ return $this->container['enabled'];
+ }
+
+ /**
+ * Sets enabled
+ *
+ * @param bool|null $enabled enabled
+ *
+ * @return self
+ */
+ public function setEnabled($enabled)
+ {
+ if (is_null($enabled)) {
+ throw new \InvalidArgumentException('non-nullable enabled cannot be null');
+ }
+ $this->container['enabled'] = $enabled;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointTransformationSimulateIn.php b/lib/Model/EndpointTransformationSimulateIn.php
new file mode 100644
index 0000000..f57cabf
--- /dev/null
+++ b/lib/Model/EndpointTransformationSimulateIn.php
@@ -0,0 +1,550 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointTransformationSimulateIn Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointTransformationSimulateIn implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointTransformationSimulateIn';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'code' => 'string',
+ 'event_type' => 'string',
+ 'channels' => 'string[]',
+ 'payload' => 'object'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'code' => null,
+ 'event_type' => null,
+ 'channels' => null,
+ 'payload' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'code' => false,
+ 'event_type' => false,
+ 'channels' => false,
+ 'payload' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'code' => 'code',
+ 'event_type' => 'eventType',
+ 'channels' => 'channels',
+ 'payload' => 'payload'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'code' => 'setCode',
+ 'event_type' => 'setEventType',
+ 'channels' => 'setChannels',
+ 'payload' => 'setPayload'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'code' => 'getCode',
+ 'event_type' => 'getEventType',
+ 'channels' => 'getChannels',
+ 'payload' => 'getPayload'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('code', $data ?? [], null);
+ $this->setIfExists('event_type', $data ?? [], null);
+ $this->setIfExists('channels', $data ?? [], null);
+ $this->setIfExists('payload', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['code'] === null) {
+ $invalidProperties[] = "'code' can't be null";
+ }
+ if ((mb_strlen($this->container['code']) > 51200)) {
+ $invalidProperties[] = "invalid value for 'code', the character length must be smaller than or equal to 51200.";
+ }
+
+ if ((mb_strlen($this->container['code']) < 10)) {
+ $invalidProperties[] = "invalid value for 'code', the character length must be bigger than or equal to 10.";
+ }
+
+ if ($this->container['event_type'] === null) {
+ $invalidProperties[] = "'event_type' can't be null";
+ }
+ if ((mb_strlen($this->container['event_type']) > 256)) {
+ $invalidProperties[] = "invalid value for 'event_type', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['event_type'])) {
+ $invalidProperties[] = "invalid value for 'event_type', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ if ($this->container['payload'] === null) {
+ $invalidProperties[] = "'payload' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets code
+ *
+ * @return string
+ */
+ public function getCode()
+ {
+ return $this->container['code'];
+ }
+
+ /**
+ * Sets code
+ *
+ * @param string $code code
+ *
+ * @return self
+ */
+ public function setCode($code)
+ {
+ if (is_null($code)) {
+ throw new \InvalidArgumentException('non-nullable code cannot be null');
+ }
+ if ((mb_strlen($code) > 51200)) {
+ throw new \InvalidArgumentException('invalid length for $code when calling EndpointTransformationSimulateIn., must be smaller than or equal to 51200.');
+ }
+ if ((mb_strlen($code) < 10)) {
+ throw new \InvalidArgumentException('invalid length for $code when calling EndpointTransformationSimulateIn., must be bigger than or equal to 10.');
+ }
+
+ $this->container['code'] = $code;
+
+ return $this;
+ }
+
+ /**
+ * Gets event_type
+ *
+ * @return string
+ */
+ public function getEventType()
+ {
+ return $this->container['event_type'];
+ }
+
+ /**
+ * Sets event_type
+ *
+ * @param string $event_type The event type's name
+ *
+ * @return self
+ */
+ public function setEventType($event_type)
+ {
+ if (is_null($event_type)) {
+ throw new \InvalidArgumentException('non-nullable event_type cannot be null');
+ }
+ if ((mb_strlen($event_type) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $event_type when calling EndpointTransformationSimulateIn., must be smaller than or equal to 256.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($event_type)))) {
+ throw new \InvalidArgumentException("invalid value for \$event_type when calling EndpointTransformationSimulateIn., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['event_type'] = $event_type;
+
+ return $this;
+ }
+
+ /**
+ * Gets channels
+ *
+ * @return string[]|null
+ */
+ public function getChannels()
+ {
+ return $this->container['channels'];
+ }
+
+ /**
+ * Sets channels
+ *
+ * @param string[]|null $channels channels
+ *
+ * @return self
+ */
+ public function setChannels($channels)
+ {
+ if (is_null($channels)) {
+ throw new \InvalidArgumentException('non-nullable channels cannot be null');
+ }
+ $this->container['channels'] = $channels;
+
+ return $this;
+ }
+
+ /**
+ * Gets payload
+ *
+ * @return object
+ */
+ public function getPayload()
+ {
+ return $this->container['payload'];
+ }
+
+ /**
+ * Sets payload
+ *
+ * @param object $payload payload
+ *
+ * @return self
+ */
+ public function setPayload($payload)
+ {
+ if (is_null($payload)) {
+ throw new \InvalidArgumentException('non-nullable payload cannot be null');
+ }
+ $this->container['payload'] = $payload;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointTransformationSimulateOut.php b/lib/Model/EndpointTransformationSimulateOut.php
new file mode 100644
index 0000000..6baa6b4
--- /dev/null
+++ b/lib/Model/EndpointTransformationSimulateOut.php
@@ -0,0 +1,498 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointTransformationSimulateOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointTransformationSimulateOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointTransformationSimulateOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'url' => 'string',
+ 'payload' => 'string',
+ 'method' => '\Svix\ApiClient\Model\TransformationHttpMethod'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'url' => 'uri',
+ 'payload' => null,
+ 'method' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'url' => false,
+ 'payload' => false,
+ 'method' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'url' => 'url',
+ 'payload' => 'payload',
+ 'method' => 'method'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'url' => 'setUrl',
+ 'payload' => 'setPayload',
+ 'method' => 'setMethod'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'url' => 'getUrl',
+ 'payload' => 'getPayload',
+ 'method' => 'getMethod'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('url', $data ?? [], null);
+ $this->setIfExists('payload', $data ?? [], null);
+ $this->setIfExists('method', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['url'] === null) {
+ $invalidProperties[] = "'url' can't be null";
+ }
+ if ((mb_strlen($this->container['url']) > 65536)) {
+ $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 65536.";
+ }
+
+ if ((mb_strlen($this->container['url']) < 1)) {
+ $invalidProperties[] = "invalid value for 'url', the character length must be bigger than or equal to 1.";
+ }
+
+ if ($this->container['payload'] === null) {
+ $invalidProperties[] = "'payload' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets url
+ *
+ * @return string
+ */
+ public function getUrl()
+ {
+ return $this->container['url'];
+ }
+
+ /**
+ * Sets url
+ *
+ * @param string $url url
+ *
+ * @return self
+ */
+ public function setUrl($url)
+ {
+ if (is_null($url)) {
+ throw new \InvalidArgumentException('non-nullable url cannot be null');
+ }
+ if ((mb_strlen($url) > 65536)) {
+ throw new \InvalidArgumentException('invalid length for $url when calling EndpointTransformationSimulateOut., must be smaller than or equal to 65536.');
+ }
+ if ((mb_strlen($url) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $url when calling EndpointTransformationSimulateOut., must be bigger than or equal to 1.');
+ }
+
+ $this->container['url'] = $url;
+
+ return $this;
+ }
+
+ /**
+ * Gets payload
+ *
+ * @return string
+ */
+ public function getPayload()
+ {
+ return $this->container['payload'];
+ }
+
+ /**
+ * Sets payload
+ *
+ * @param string $payload payload
+ *
+ * @return self
+ */
+ public function setPayload($payload)
+ {
+ if (is_null($payload)) {
+ throw new \InvalidArgumentException('non-nullable payload cannot be null');
+ }
+ $this->container['payload'] = $payload;
+
+ return $this;
+ }
+
+ /**
+ * Gets method
+ *
+ * @return \Svix\ApiClient\Model\TransformationHttpMethod|null
+ */
+ public function getMethod()
+ {
+ return $this->container['method'];
+ }
+
+ /**
+ * Sets method
+ *
+ * @param \Svix\ApiClient\Model\TransformationHttpMethod|null $method method
+ *
+ * @return self
+ */
+ public function setMethod($method)
+ {
+ if (is_null($method)) {
+ throw new \InvalidArgumentException('non-nullable method cannot be null');
+ }
+ $this->container['method'] = $method;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointUpdate.php b/lib/Model/EndpointUpdate.php
new file mode 100644
index 0000000..828520b
--- /dev/null
+++ b/lib/Model/EndpointUpdate.php
@@ -0,0 +1,748 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointUpdate Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointUpdate implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointUpdate';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'description' => 'string',
+ 'rate_limit' => 'int',
+ 'uid' => 'string',
+ 'url' => 'string',
+ 'version' => 'int',
+ 'disabled' => 'bool',
+ 'filter_types' => 'string[]',
+ 'channels' => 'string[]',
+ 'metadata' => 'array'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'description' => null,
+ 'rate_limit' => 'uint16',
+ 'uid' => null,
+ 'url' => 'uri',
+ 'version' => 'uint16',
+ 'disabled' => null,
+ 'filter_types' => null,
+ 'channels' => null,
+ 'metadata' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'description' => false,
+ 'rate_limit' => false,
+ 'uid' => false,
+ 'url' => false,
+ 'version' => false,
+ 'disabled' => false,
+ 'filter_types' => false,
+ 'channels' => false,
+ 'metadata' => true
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'description' => 'description',
+ 'rate_limit' => 'rateLimit',
+ 'uid' => 'uid',
+ 'url' => 'url',
+ 'version' => 'version',
+ 'disabled' => 'disabled',
+ 'filter_types' => 'filterTypes',
+ 'channels' => 'channels',
+ 'metadata' => 'metadata'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'description' => 'setDescription',
+ 'rate_limit' => 'setRateLimit',
+ 'uid' => 'setUid',
+ 'url' => 'setUrl',
+ 'version' => 'setVersion',
+ 'disabled' => 'setDisabled',
+ 'filter_types' => 'setFilterTypes',
+ 'channels' => 'setChannels',
+ 'metadata' => 'setMetadata'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'description' => 'getDescription',
+ 'rate_limit' => 'getRateLimit',
+ 'uid' => 'getUid',
+ 'url' => 'getUrl',
+ 'version' => 'getVersion',
+ 'disabled' => 'getDisabled',
+ 'filter_types' => 'getFilterTypes',
+ 'channels' => 'getChannels',
+ 'metadata' => 'getMetadata'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('description', $data ?? [], '');
+ $this->setIfExists('rate_limit', $data ?? [], null);
+ $this->setIfExists('uid', $data ?? [], null);
+ $this->setIfExists('url', $data ?? [], null);
+ $this->setIfExists('version', $data ?? [], 1);
+ $this->setIfExists('disabled', $data ?? [], false);
+ $this->setIfExists('filter_types', $data ?? [], null);
+ $this->setIfExists('channels', $data ?? [], null);
+ $this->setIfExists('metadata', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if (!is_null($this->container['rate_limit']) && ($this->container['rate_limit'] < 1)) {
+ $invalidProperties[] = "invalid value for 'rate_limit', must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['uid']) && (mb_strlen($this->container['uid']) > 256)) {
+ $invalidProperties[] = "invalid value for 'uid', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['uid']) && (mb_strlen($this->container['uid']) < 1)) {
+ $invalidProperties[] = "invalid value for 'uid', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['uid']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['uid'])) {
+ $invalidProperties[] = "invalid value for 'uid', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ if ($this->container['url'] === null) {
+ $invalidProperties[] = "'url' can't be null";
+ }
+ if ((mb_strlen($this->container['url']) > 65536)) {
+ $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 65536.";
+ }
+
+ if ((mb_strlen($this->container['url']) < 1)) {
+ $invalidProperties[] = "invalid value for 'url', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['version']) && ($this->container['version'] < 1)) {
+ $invalidProperties[] = "invalid value for 'version', must be bigger than or equal to 1.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets description
+ *
+ * @return string|null
+ */
+ public function getDescription()
+ {
+ return $this->container['description'];
+ }
+
+ /**
+ * Sets description
+ *
+ * @param string|null $description description
+ *
+ * @return self
+ */
+ public function setDescription($description)
+ {
+ if (is_null($description)) {
+ throw new \InvalidArgumentException('non-nullable description cannot be null');
+ }
+ $this->container['description'] = $description;
+
+ return $this;
+ }
+
+ /**
+ * Gets rate_limit
+ *
+ * @return int|null
+ */
+ public function getRateLimit()
+ {
+ return $this->container['rate_limit'];
+ }
+
+ /**
+ * Sets rate_limit
+ *
+ * @param int|null $rate_limit rate_limit
+ *
+ * @return self
+ */
+ public function setRateLimit($rate_limit)
+ {
+ if (is_null($rate_limit)) {
+ throw new \InvalidArgumentException('non-nullable rate_limit cannot be null');
+ }
+
+ if (($rate_limit < 1)) {
+ throw new \InvalidArgumentException('invalid value for $rate_limit when calling EndpointUpdate., must be bigger than or equal to 1.');
+ }
+
+ $this->container['rate_limit'] = $rate_limit;
+
+ return $this;
+ }
+
+ /**
+ * Gets uid
+ *
+ * @return string|null
+ */
+ public function getUid()
+ {
+ return $this->container['uid'];
+ }
+
+ /**
+ * Sets uid
+ *
+ * @param string|null $uid Optional unique identifier for the endpoint
+ *
+ * @return self
+ */
+ public function setUid($uid)
+ {
+ if (is_null($uid)) {
+ throw new \InvalidArgumentException('non-nullable uid cannot be null');
+ }
+ if ((mb_strlen($uid) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $uid when calling EndpointUpdate., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($uid) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $uid when calling EndpointUpdate., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($uid)))) {
+ throw new \InvalidArgumentException("invalid value for \$uid when calling EndpointUpdate., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['uid'] = $uid;
+
+ return $this;
+ }
+
+ /**
+ * Gets url
+ *
+ * @return string
+ */
+ public function getUrl()
+ {
+ return $this->container['url'];
+ }
+
+ /**
+ * Sets url
+ *
+ * @param string $url url
+ *
+ * @return self
+ */
+ public function setUrl($url)
+ {
+ if (is_null($url)) {
+ throw new \InvalidArgumentException('non-nullable url cannot be null');
+ }
+ if ((mb_strlen($url) > 65536)) {
+ throw new \InvalidArgumentException('invalid length for $url when calling EndpointUpdate., must be smaller than or equal to 65536.');
+ }
+ if ((mb_strlen($url) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $url when calling EndpointUpdate., must be bigger than or equal to 1.');
+ }
+
+ $this->container['url'] = $url;
+
+ return $this;
+ }
+
+ /**
+ * Gets version
+ *
+ * @return int|null
+ * @deprecated
+ */
+ public function getVersion()
+ {
+ return $this->container['version'];
+ }
+
+ /**
+ * Sets version
+ *
+ * @param int|null $version version
+ *
+ * @return self
+ * @deprecated
+ */
+ public function setVersion($version)
+ {
+ if (is_null($version)) {
+ throw new \InvalidArgumentException('non-nullable version cannot be null');
+ }
+
+ if (($version < 1)) {
+ throw new \InvalidArgumentException('invalid value for $version when calling EndpointUpdate., must be bigger than or equal to 1.');
+ }
+
+ $this->container['version'] = $version;
+
+ return $this;
+ }
+
+ /**
+ * Gets disabled
+ *
+ * @return bool|null
+ */
+ public function getDisabled()
+ {
+ return $this->container['disabled'];
+ }
+
+ /**
+ * Sets disabled
+ *
+ * @param bool|null $disabled disabled
+ *
+ * @return self
+ */
+ public function setDisabled($disabled)
+ {
+ if (is_null($disabled)) {
+ throw new \InvalidArgumentException('non-nullable disabled cannot be null');
+ }
+ $this->container['disabled'] = $disabled;
+
+ return $this;
+ }
+
+ /**
+ * Gets filter_types
+ *
+ * @return string[]|null
+ */
+ public function getFilterTypes()
+ {
+ return $this->container['filter_types'];
+ }
+
+ /**
+ * Sets filter_types
+ *
+ * @param string[]|null $filter_types filter_types
+ *
+ * @return self
+ */
+ public function setFilterTypes($filter_types)
+ {
+ if (is_null($filter_types)) {
+ throw new \InvalidArgumentException('non-nullable filter_types cannot be null');
+ }
+ $this->container['filter_types'] = $filter_types;
+
+ return $this;
+ }
+
+ /**
+ * Gets channels
+ *
+ * @return string[]|null
+ */
+ public function getChannels()
+ {
+ return $this->container['channels'];
+ }
+
+ /**
+ * Sets channels
+ *
+ * @param string[]|null $channels channels
+ *
+ * @return self
+ */
+ public function setChannels($channels)
+ {
+ if (is_null($channels)) {
+ throw new \InvalidArgumentException('non-nullable channels cannot be null');
+ }
+ $this->container['channels'] = $channels;
+
+ return $this;
+ }
+
+ /**
+ * Gets metadata
+ *
+ * @return array|null
+ */
+ public function getMetadata()
+ {
+ return $this->container['metadata'];
+ }
+
+ /**
+ * Sets metadata
+ *
+ * @param array|null $metadata metadata
+ *
+ * @return self
+ */
+ public function setMetadata($metadata)
+ {
+ if (is_null($metadata)) {
+ array_push($this->openAPINullablesSetToNull, 'metadata');
+ } else {
+ $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+ $index = array_search('metadata', $nullablesSetToNull);
+ if ($index !== FALSE) {
+ unset($nullablesSetToNull[$index]);
+ $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+ }
+ }
+ $this->container['metadata'] = $metadata;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointUpdatedEvent.php b/lib/Model/EndpointUpdatedEvent.php
new file mode 100644
index 0000000..bd53bb8
--- /dev/null
+++ b/lib/Model/EndpointUpdatedEvent.php
@@ -0,0 +1,482 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointUpdatedEvent Class Doc Comment
+ *
+ * @category Class
+ * @description Sent when an endpoint is updated.
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointUpdatedEvent implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointUpdatedEvent';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\EndpointUpdatedEventData',
+ 'type' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'type' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'type' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'type' => 'type'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'type' => 'setType'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'type' => 'getType'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+ public const TYPE_ENDPOINT_UPDATED = 'endpoint.updated';
+
+ /**
+ * Gets allowable values of the enum
+ *
+ * @return string[]
+ */
+ public function getTypeAllowableValues()
+ {
+ return [
+ self::TYPE_ENDPOINT_UPDATED,
+ ];
+ }
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('type', $data ?? [], 'endpoint.updated');
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['type'] === null) {
+ $invalidProperties[] = "'type' can't be null";
+ }
+ $allowedValues = $this->getTypeAllowableValues();
+ if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
+ $invalidProperties[] = sprintf(
+ "invalid value '%s' for 'type', must be one of '%s'",
+ $this->container['type'],
+ implode("', '", $allowedValues)
+ );
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\EndpointUpdatedEventData
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\EndpointUpdatedEventData $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets type
+ *
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->container['type'];
+ }
+
+ /**
+ * Sets type
+ *
+ * @param string $type type
+ *
+ * @return self
+ */
+ public function setType($type)
+ {
+ if (is_null($type)) {
+ throw new \InvalidArgumentException('non-nullable type cannot be null');
+ }
+ $allowedValues = $this->getTypeAllowableValues();
+ if (!in_array($type, $allowedValues, true)) {
+ throw new \InvalidArgumentException(
+ sprintf(
+ "Invalid value '%s' for 'type', must be one of '%s'",
+ $type,
+ implode("', '", $allowedValues)
+ )
+ );
+ }
+ $this->container['type'] = $type;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EndpointUpdatedEventData.php b/lib/Model/EndpointUpdatedEventData.php
new file mode 100644
index 0000000..c6e2c68
--- /dev/null
+++ b/lib/Model/EndpointUpdatedEventData.php
@@ -0,0 +1,561 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EndpointUpdatedEventData Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EndpointUpdatedEventData implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EndpointUpdatedEventData';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'app_id' => 'string',
+ 'app_uid' => 'string',
+ 'endpoint_id' => 'string',
+ 'endpoint_uid' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'app_id' => null,
+ 'app_uid' => null,
+ 'endpoint_id' => null,
+ 'endpoint_uid' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'app_id' => false,
+ 'app_uid' => false,
+ 'endpoint_id' => false,
+ 'endpoint_uid' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'app_id' => 'appId',
+ 'app_uid' => 'appUid',
+ 'endpoint_id' => 'endpointId',
+ 'endpoint_uid' => 'endpointUid'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'app_id' => 'setAppId',
+ 'app_uid' => 'setAppUid',
+ 'endpoint_id' => 'setEndpointId',
+ 'endpoint_uid' => 'setEndpointUid'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'app_id' => 'getAppId',
+ 'app_uid' => 'getAppUid',
+ 'endpoint_id' => 'getEndpointId',
+ 'endpoint_uid' => 'getEndpointUid'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('app_id', $data ?? [], null);
+ $this->setIfExists('app_uid', $data ?? [], null);
+ $this->setIfExists('endpoint_id', $data ?? [], null);
+ $this->setIfExists('endpoint_uid', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['app_id'] === null) {
+ $invalidProperties[] = "'app_id' can't be null";
+ }
+ if (!is_null($this->container['app_uid']) && (mb_strlen($this->container['app_uid']) > 256)) {
+ $invalidProperties[] = "invalid value for 'app_uid', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['app_uid']) && (mb_strlen($this->container['app_uid']) < 1)) {
+ $invalidProperties[] = "invalid value for 'app_uid', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['app_uid']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['app_uid'])) {
+ $invalidProperties[] = "invalid value for 'app_uid', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ if ($this->container['endpoint_id'] === null) {
+ $invalidProperties[] = "'endpoint_id' can't be null";
+ }
+ if (!is_null($this->container['endpoint_uid']) && (mb_strlen($this->container['endpoint_uid']) > 256)) {
+ $invalidProperties[] = "invalid value for 'endpoint_uid', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['endpoint_uid']) && (mb_strlen($this->container['endpoint_uid']) < 1)) {
+ $invalidProperties[] = "invalid value for 'endpoint_uid', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['endpoint_uid']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['endpoint_uid'])) {
+ $invalidProperties[] = "invalid value for 'endpoint_uid', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets app_id
+ *
+ * @return string
+ */
+ public function getAppId()
+ {
+ return $this->container['app_id'];
+ }
+
+ /**
+ * Sets app_id
+ *
+ * @param string $app_id The app's ID
+ *
+ * @return self
+ */
+ public function setAppId($app_id)
+ {
+ if (is_null($app_id)) {
+ throw new \InvalidArgumentException('non-nullable app_id cannot be null');
+ }
+ $this->container['app_id'] = $app_id;
+
+ return $this;
+ }
+
+ /**
+ * Gets app_uid
+ *
+ * @return string|null
+ */
+ public function getAppUid()
+ {
+ return $this->container['app_uid'];
+ }
+
+ /**
+ * Sets app_uid
+ *
+ * @param string|null $app_uid The app's UID
+ *
+ * @return self
+ */
+ public function setAppUid($app_uid)
+ {
+ if (is_null($app_uid)) {
+ throw new \InvalidArgumentException('non-nullable app_uid cannot be null');
+ }
+ if ((mb_strlen($app_uid) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $app_uid when calling EndpointUpdatedEventData., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($app_uid) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $app_uid when calling EndpointUpdatedEventData., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($app_uid)))) {
+ throw new \InvalidArgumentException("invalid value for \$app_uid when calling EndpointUpdatedEventData., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['app_uid'] = $app_uid;
+
+ return $this;
+ }
+
+ /**
+ * Gets endpoint_id
+ *
+ * @return string
+ */
+ public function getEndpointId()
+ {
+ return $this->container['endpoint_id'];
+ }
+
+ /**
+ * Sets endpoint_id
+ *
+ * @param string $endpoint_id The ep's ID
+ *
+ * @return self
+ */
+ public function setEndpointId($endpoint_id)
+ {
+ if (is_null($endpoint_id)) {
+ throw new \InvalidArgumentException('non-nullable endpoint_id cannot be null');
+ }
+ $this->container['endpoint_id'] = $endpoint_id;
+
+ return $this;
+ }
+
+ /**
+ * Gets endpoint_uid
+ *
+ * @return string|null
+ */
+ public function getEndpointUid()
+ {
+ return $this->container['endpoint_uid'];
+ }
+
+ /**
+ * Sets endpoint_uid
+ *
+ * @param string|null $endpoint_uid The ep's UID
+ *
+ * @return self
+ */
+ public function setEndpointUid($endpoint_uid)
+ {
+ if (is_null($endpoint_uid)) {
+ throw new \InvalidArgumentException('non-nullable endpoint_uid cannot be null');
+ }
+ if ((mb_strlen($endpoint_uid) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $endpoint_uid when calling EndpointUpdatedEventData., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($endpoint_uid) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $endpoint_uid when calling EndpointUpdatedEventData., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($endpoint_uid)))) {
+ throw new \InvalidArgumentException("invalid value for \$endpoint_uid when calling EndpointUpdatedEventData., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['endpoint_uid'] = $endpoint_uid;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EventExampleIn.php b/lib/Model/EventExampleIn.php
new file mode 100644
index 0000000..9afe9fe
--- /dev/null
+++ b/lib/Model/EventExampleIn.php
@@ -0,0 +1,427 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EventExampleIn Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EventExampleIn implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EventExampleIn';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'event_type' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'event_type' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'event_type' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'event_type' => 'eventType'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'event_type' => 'setEventType'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'event_type' => 'getEventType'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('event_type', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['event_type'] === null) {
+ $invalidProperties[] = "'event_type' can't be null";
+ }
+ if ((mb_strlen($this->container['event_type']) > 256)) {
+ $invalidProperties[] = "invalid value for 'event_type', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['event_type'])) {
+ $invalidProperties[] = "invalid value for 'event_type', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets event_type
+ *
+ * @return string
+ */
+ public function getEventType()
+ {
+ return $this->container['event_type'];
+ }
+
+ /**
+ * Sets event_type
+ *
+ * @param string $event_type The event type's name
+ *
+ * @return self
+ */
+ public function setEventType($event_type)
+ {
+ if (is_null($event_type)) {
+ throw new \InvalidArgumentException('non-nullable event_type cannot be null');
+ }
+ if ((mb_strlen($event_type) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $event_type when calling EventExampleIn., must be smaller than or equal to 256.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($event_type)))) {
+ throw new \InvalidArgumentException("invalid value for \$event_type when calling EventExampleIn., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['event_type'] = $event_type;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EventTypeImportOpenApiIn.php b/lib/Model/EventTypeImportOpenApiIn.php
new file mode 100644
index 0000000..b14c714
--- /dev/null
+++ b/lib/Model/EventTypeImportOpenApiIn.php
@@ -0,0 +1,451 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EventTypeImportOpenApiIn Class Doc Comment
+ *
+ * @category Class
+ * @description Import a list of event types from webhooks defined in an OpenAPI spec. The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**.
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EventTypeImportOpenApiIn implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EventTypeImportOpenApiIn';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'spec' => 'array',
+ 'spec_raw' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'spec' => null,
+ 'spec_raw' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'spec' => true,
+ 'spec_raw' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'spec' => 'spec',
+ 'spec_raw' => 'specRaw'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'spec' => 'setSpec',
+ 'spec_raw' => 'setSpecRaw'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'spec' => 'getSpec',
+ 'spec_raw' => 'getSpecRaw'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('spec', $data ?? [], null);
+ $this->setIfExists('spec_raw', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets spec
+ *
+ * @return array|null
+ */
+ public function getSpec()
+ {
+ return $this->container['spec'];
+ }
+
+ /**
+ * Sets spec
+ *
+ * @param array|null $spec A pre-parsed JSON spec.
+ *
+ * @return self
+ */
+ public function setSpec($spec)
+ {
+ if (is_null($spec)) {
+ array_push($this->openAPINullablesSetToNull, 'spec');
+ } else {
+ $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+ $index = array_search('spec', $nullablesSetToNull);
+ if ($index !== FALSE) {
+ unset($nullablesSetToNull[$index]);
+ $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+ }
+ }
+ $this->container['spec'] = $spec;
+
+ return $this;
+ }
+
+ /**
+ * Gets spec_raw
+ *
+ * @return string|null
+ */
+ public function getSpecRaw()
+ {
+ return $this->container['spec_raw'];
+ }
+
+ /**
+ * Sets spec_raw
+ *
+ * @param string|null $spec_raw A string, parsed by the server as YAML or JSON.
+ *
+ * @return self
+ */
+ public function setSpecRaw($spec_raw)
+ {
+ if (is_null($spec_raw)) {
+ throw new \InvalidArgumentException('non-nullable spec_raw cannot be null');
+ }
+ $this->container['spec_raw'] = $spec_raw;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EventTypeImportOpenApiOut.php b/lib/Model/EventTypeImportOpenApiOut.php
new file mode 100644
index 0000000..1dbb4ec
--- /dev/null
+++ b/lib/Model/EventTypeImportOpenApiOut.php
@@ -0,0 +1,412 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EventTypeImportOpenApiOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EventTypeImportOpenApiOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EventTypeImportOpenApiOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\EventTypeImportOpenApiOutData'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\EventTypeImportOpenApiOutData
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\EventTypeImportOpenApiOutData $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EventTypeImportOpenApiOutData.php b/lib/Model/EventTypeImportOpenApiOutData.php
new file mode 100644
index 0000000..3f94909
--- /dev/null
+++ b/lib/Model/EventTypeImportOpenApiOutData.php
@@ -0,0 +1,412 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EventTypeImportOpenApiOutData Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EventTypeImportOpenApiOutData implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EventTypeImportOpenApiOutData';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'modified' => 'string[]'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'modified' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'modified' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'modified' => 'modified'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'modified' => 'setModified'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'modified' => 'getModified'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('modified', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['modified'] === null) {
+ $invalidProperties[] = "'modified' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets modified
+ *
+ * @return string[]
+ */
+ public function getModified()
+ {
+ return $this->container['modified'];
+ }
+
+ /**
+ * Sets modified
+ *
+ * @param string[] $modified modified
+ *
+ * @return self
+ */
+ public function setModified($modified)
+ {
+ if (is_null($modified)) {
+ throw new \InvalidArgumentException('non-nullable modified cannot be null');
+ }
+ $this->container['modified'] = $modified;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EventTypeIn.php b/lib/Model/EventTypeIn.php
new file mode 100644
index 0000000..a1bef30
--- /dev/null
+++ b/lib/Model/EventTypeIn.php
@@ -0,0 +1,588 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EventTypeIn Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EventTypeIn implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EventTypeIn';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'name' => 'string',
+ 'description' => 'string',
+ 'archived' => 'bool',
+ 'schemas' => 'array',
+ 'feature_flag' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'name' => null,
+ 'description' => null,
+ 'archived' => null,
+ 'schemas' => null,
+ 'feature_flag' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'name' => false,
+ 'description' => false,
+ 'archived' => false,
+ 'schemas' => true,
+ 'feature_flag' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'name' => 'name',
+ 'description' => 'description',
+ 'archived' => 'archived',
+ 'schemas' => 'schemas',
+ 'feature_flag' => 'featureFlag'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'name' => 'setName',
+ 'description' => 'setDescription',
+ 'archived' => 'setArchived',
+ 'schemas' => 'setSchemas',
+ 'feature_flag' => 'setFeatureFlag'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'name' => 'getName',
+ 'description' => 'getDescription',
+ 'archived' => 'getArchived',
+ 'schemas' => 'getSchemas',
+ 'feature_flag' => 'getFeatureFlag'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('name', $data ?? [], null);
+ $this->setIfExists('description', $data ?? [], null);
+ $this->setIfExists('archived', $data ?? [], false);
+ $this->setIfExists('schemas', $data ?? [], null);
+ $this->setIfExists('feature_flag', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['name'] === null) {
+ $invalidProperties[] = "'name' can't be null";
+ }
+ if ((mb_strlen($this->container['name']) > 256)) {
+ $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['name'])) {
+ $invalidProperties[] = "invalid value for 'name', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ if ($this->container['description'] === null) {
+ $invalidProperties[] = "'description' can't be null";
+ }
+ if (!is_null($this->container['feature_flag']) && (mb_strlen($this->container['feature_flag']) > 256)) {
+ $invalidProperties[] = "invalid value for 'feature_flag', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['feature_flag']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['feature_flag'])) {
+ $invalidProperties[] = "invalid value for 'feature_flag', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets name
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->container['name'];
+ }
+
+ /**
+ * Sets name
+ *
+ * @param string $name The event type's name
+ *
+ * @return self
+ */
+ public function setName($name)
+ {
+ if (is_null($name)) {
+ throw new \InvalidArgumentException('non-nullable name cannot be null');
+ }
+ if ((mb_strlen($name) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $name when calling EventTypeIn., must be smaller than or equal to 256.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($name)))) {
+ throw new \InvalidArgumentException("invalid value for \$name when calling EventTypeIn., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['name'] = $name;
+
+ return $this;
+ }
+
+ /**
+ * Gets description
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->container['description'];
+ }
+
+ /**
+ * Sets description
+ *
+ * @param string $description description
+ *
+ * @return self
+ */
+ public function setDescription($description)
+ {
+ if (is_null($description)) {
+ throw new \InvalidArgumentException('non-nullable description cannot be null');
+ }
+ $this->container['description'] = $description;
+
+ return $this;
+ }
+
+ /**
+ * Gets archived
+ *
+ * @return bool|null
+ */
+ public function getArchived()
+ {
+ return $this->container['archived'];
+ }
+
+ /**
+ * Sets archived
+ *
+ * @param bool|null $archived archived
+ *
+ * @return self
+ */
+ public function setArchived($archived)
+ {
+ if (is_null($archived)) {
+ throw new \InvalidArgumentException('non-nullable archived cannot be null');
+ }
+ $this->container['archived'] = $archived;
+
+ return $this;
+ }
+
+ /**
+ * Gets schemas
+ *
+ * @return array|null
+ */
+ public function getSchemas()
+ {
+ return $this->container['schemas'];
+ }
+
+ /**
+ * Sets schemas
+ *
+ * @param array|null $schemas The schema for the event type for a specific version as a JSON schema.
+ *
+ * @return self
+ */
+ public function setSchemas($schemas)
+ {
+ if (is_null($schemas)) {
+ array_push($this->openAPINullablesSetToNull, 'schemas');
+ } else {
+ $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+ $index = array_search('schemas', $nullablesSetToNull);
+ if ($index !== FALSE) {
+ unset($nullablesSetToNull[$index]);
+ $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+ }
+ }
+ $this->container['schemas'] = $schemas;
+
+ return $this;
+ }
+
+ /**
+ * Gets feature_flag
+ *
+ * @return string|null
+ */
+ public function getFeatureFlag()
+ {
+ return $this->container['feature_flag'];
+ }
+
+ /**
+ * Sets feature_flag
+ *
+ * @param string|null $feature_flag feature_flag
+ *
+ * @return self
+ */
+ public function setFeatureFlag($feature_flag)
+ {
+ if (is_null($feature_flag)) {
+ throw new \InvalidArgumentException('non-nullable feature_flag cannot be null');
+ }
+ if ((mb_strlen($feature_flag) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $feature_flag when calling EventTypeIn., must be smaller than or equal to 256.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($feature_flag)))) {
+ throw new \InvalidArgumentException("invalid value for \$feature_flag when calling EventTypeIn., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['feature_flag'] = $feature_flag;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EventTypeOut.php b/lib/Model/EventTypeOut.php
new file mode 100644
index 0000000..fdbcb4e
--- /dev/null
+++ b/lib/Model/EventTypeOut.php
@@ -0,0 +1,662 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EventTypeOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EventTypeOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EventTypeOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'name' => 'string',
+ 'description' => 'string',
+ 'archived' => 'bool',
+ 'schemas' => 'array',
+ 'created_at' => '\DateTime',
+ 'updated_at' => '\DateTime',
+ 'feature_flag' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'name' => null,
+ 'description' => null,
+ 'archived' => null,
+ 'schemas' => null,
+ 'created_at' => 'date-time',
+ 'updated_at' => 'date-time',
+ 'feature_flag' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'name' => false,
+ 'description' => false,
+ 'archived' => false,
+ 'schemas' => true,
+ 'created_at' => false,
+ 'updated_at' => false,
+ 'feature_flag' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'name' => 'name',
+ 'description' => 'description',
+ 'archived' => 'archived',
+ 'schemas' => 'schemas',
+ 'created_at' => 'createdAt',
+ 'updated_at' => 'updatedAt',
+ 'feature_flag' => 'featureFlag'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'name' => 'setName',
+ 'description' => 'setDescription',
+ 'archived' => 'setArchived',
+ 'schemas' => 'setSchemas',
+ 'created_at' => 'setCreatedAt',
+ 'updated_at' => 'setUpdatedAt',
+ 'feature_flag' => 'setFeatureFlag'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'name' => 'getName',
+ 'description' => 'getDescription',
+ 'archived' => 'getArchived',
+ 'schemas' => 'getSchemas',
+ 'created_at' => 'getCreatedAt',
+ 'updated_at' => 'getUpdatedAt',
+ 'feature_flag' => 'getFeatureFlag'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('name', $data ?? [], null);
+ $this->setIfExists('description', $data ?? [], null);
+ $this->setIfExists('archived', $data ?? [], false);
+ $this->setIfExists('schemas', $data ?? [], null);
+ $this->setIfExists('created_at', $data ?? [], null);
+ $this->setIfExists('updated_at', $data ?? [], null);
+ $this->setIfExists('feature_flag', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['name'] === null) {
+ $invalidProperties[] = "'name' can't be null";
+ }
+ if ((mb_strlen($this->container['name']) > 256)) {
+ $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['name'])) {
+ $invalidProperties[] = "invalid value for 'name', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ if ($this->container['description'] === null) {
+ $invalidProperties[] = "'description' can't be null";
+ }
+ if ($this->container['created_at'] === null) {
+ $invalidProperties[] = "'created_at' can't be null";
+ }
+ if ($this->container['updated_at'] === null) {
+ $invalidProperties[] = "'updated_at' can't be null";
+ }
+ if (!is_null($this->container['feature_flag']) && (mb_strlen($this->container['feature_flag']) > 256)) {
+ $invalidProperties[] = "invalid value for 'feature_flag', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['feature_flag']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['feature_flag'])) {
+ $invalidProperties[] = "invalid value for 'feature_flag', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets name
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->container['name'];
+ }
+
+ /**
+ * Sets name
+ *
+ * @param string $name The event type's name
+ *
+ * @return self
+ */
+ public function setName($name)
+ {
+ if (is_null($name)) {
+ throw new \InvalidArgumentException('non-nullable name cannot be null');
+ }
+ if ((mb_strlen($name) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $name when calling EventTypeOut., must be smaller than or equal to 256.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($name)))) {
+ throw new \InvalidArgumentException("invalid value for \$name when calling EventTypeOut., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['name'] = $name;
+
+ return $this;
+ }
+
+ /**
+ * Gets description
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->container['description'];
+ }
+
+ /**
+ * Sets description
+ *
+ * @param string $description description
+ *
+ * @return self
+ */
+ public function setDescription($description)
+ {
+ if (is_null($description)) {
+ throw new \InvalidArgumentException('non-nullable description cannot be null');
+ }
+ $this->container['description'] = $description;
+
+ return $this;
+ }
+
+ /**
+ * Gets archived
+ *
+ * @return bool|null
+ */
+ public function getArchived()
+ {
+ return $this->container['archived'];
+ }
+
+ /**
+ * Sets archived
+ *
+ * @param bool|null $archived archived
+ *
+ * @return self
+ */
+ public function setArchived($archived)
+ {
+ if (is_null($archived)) {
+ throw new \InvalidArgumentException('non-nullable archived cannot be null');
+ }
+ $this->container['archived'] = $archived;
+
+ return $this;
+ }
+
+ /**
+ * Gets schemas
+ *
+ * @return array|null
+ */
+ public function getSchemas()
+ {
+ return $this->container['schemas'];
+ }
+
+ /**
+ * Sets schemas
+ *
+ * @param array|null $schemas The schema for the event type for a specific version as a JSON schema.
+ *
+ * @return self
+ */
+ public function setSchemas($schemas)
+ {
+ if (is_null($schemas)) {
+ array_push($this->openAPINullablesSetToNull, 'schemas');
+ } else {
+ $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+ $index = array_search('schemas', $nullablesSetToNull);
+ if ($index !== FALSE) {
+ unset($nullablesSetToNull[$index]);
+ $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+ }
+ }
+ $this->container['schemas'] = $schemas;
+
+ return $this;
+ }
+
+ /**
+ * Gets created_at
+ *
+ * @return \DateTime
+ */
+ public function getCreatedAt()
+ {
+ return $this->container['created_at'];
+ }
+
+ /**
+ * Sets created_at
+ *
+ * @param \DateTime $created_at created_at
+ *
+ * @return self
+ */
+ public function setCreatedAt($created_at)
+ {
+ if (is_null($created_at)) {
+ throw new \InvalidArgumentException('non-nullable created_at cannot be null');
+ }
+ $this->container['created_at'] = $created_at;
+
+ return $this;
+ }
+
+ /**
+ * Gets updated_at
+ *
+ * @return \DateTime
+ */
+ public function getUpdatedAt()
+ {
+ return $this->container['updated_at'];
+ }
+
+ /**
+ * Sets updated_at
+ *
+ * @param \DateTime $updated_at updated_at
+ *
+ * @return self
+ */
+ public function setUpdatedAt($updated_at)
+ {
+ if (is_null($updated_at)) {
+ throw new \InvalidArgumentException('non-nullable updated_at cannot be null');
+ }
+ $this->container['updated_at'] = $updated_at;
+
+ return $this;
+ }
+
+ /**
+ * Gets feature_flag
+ *
+ * @return string|null
+ */
+ public function getFeatureFlag()
+ {
+ return $this->container['feature_flag'];
+ }
+
+ /**
+ * Sets feature_flag
+ *
+ * @param string|null $feature_flag feature_flag
+ *
+ * @return self
+ */
+ public function setFeatureFlag($feature_flag)
+ {
+ if (is_null($feature_flag)) {
+ throw new \InvalidArgumentException('non-nullable feature_flag cannot be null');
+ }
+ if ((mb_strlen($feature_flag) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $feature_flag when calling EventTypeOut., must be smaller than or equal to 256.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($feature_flag)))) {
+ throw new \InvalidArgumentException("invalid value for \$feature_flag when calling EventTypeOut., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['feature_flag'] = $feature_flag;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EventTypePatch.php b/lib/Model/EventTypePatch.php
new file mode 100644
index 0000000..a4e1580
--- /dev/null
+++ b/lib/Model/EventTypePatch.php
@@ -0,0 +1,533 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EventTypePatch Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EventTypePatch implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EventTypePatch';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'description' => 'string',
+ 'archived' => 'bool',
+ 'schemas' => 'array',
+ 'feature_flag' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'description' => null,
+ 'archived' => null,
+ 'schemas' => null,
+ 'feature_flag' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'description' => false,
+ 'archived' => false,
+ 'schemas' => true,
+ 'feature_flag' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'description' => 'description',
+ 'archived' => 'archived',
+ 'schemas' => 'schemas',
+ 'feature_flag' => 'featureFlag'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'description' => 'setDescription',
+ 'archived' => 'setArchived',
+ 'schemas' => 'setSchemas',
+ 'feature_flag' => 'setFeatureFlag'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'description' => 'getDescription',
+ 'archived' => 'getArchived',
+ 'schemas' => 'getSchemas',
+ 'feature_flag' => 'getFeatureFlag'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('description', $data ?? [], null);
+ $this->setIfExists('archived', $data ?? [], null);
+ $this->setIfExists('schemas', $data ?? [], null);
+ $this->setIfExists('feature_flag', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if (!is_null($this->container['feature_flag']) && (mb_strlen($this->container['feature_flag']) > 256)) {
+ $invalidProperties[] = "invalid value for 'feature_flag', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['feature_flag']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['feature_flag'])) {
+ $invalidProperties[] = "invalid value for 'feature_flag', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets description
+ *
+ * @return string|null
+ */
+ public function getDescription()
+ {
+ return $this->container['description'];
+ }
+
+ /**
+ * Sets description
+ *
+ * @param string|null $description description
+ *
+ * @return self
+ */
+ public function setDescription($description)
+ {
+ if (is_null($description)) {
+ throw new \InvalidArgumentException('non-nullable description cannot be null');
+ }
+ $this->container['description'] = $description;
+
+ return $this;
+ }
+
+ /**
+ * Gets archived
+ *
+ * @return bool|null
+ */
+ public function getArchived()
+ {
+ return $this->container['archived'];
+ }
+
+ /**
+ * Sets archived
+ *
+ * @param bool|null $archived archived
+ *
+ * @return self
+ */
+ public function setArchived($archived)
+ {
+ if (is_null($archived)) {
+ throw new \InvalidArgumentException('non-nullable archived cannot be null');
+ }
+ $this->container['archived'] = $archived;
+
+ return $this;
+ }
+
+ /**
+ * Gets schemas
+ *
+ * @return array|null
+ */
+ public function getSchemas()
+ {
+ return $this->container['schemas'];
+ }
+
+ /**
+ * Sets schemas
+ *
+ * @param array|null $schemas schemas
+ *
+ * @return self
+ */
+ public function setSchemas($schemas)
+ {
+ if (is_null($schemas)) {
+ array_push($this->openAPINullablesSetToNull, 'schemas');
+ } else {
+ $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+ $index = array_search('schemas', $nullablesSetToNull);
+ if ($index !== FALSE) {
+ unset($nullablesSetToNull[$index]);
+ $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+ }
+ }
+ $this->container['schemas'] = $schemas;
+
+ return $this;
+ }
+
+ /**
+ * Gets feature_flag
+ *
+ * @return string|null
+ */
+ public function getFeatureFlag()
+ {
+ return $this->container['feature_flag'];
+ }
+
+ /**
+ * Sets feature_flag
+ *
+ * @param string|null $feature_flag feature_flag
+ *
+ * @return self
+ */
+ public function setFeatureFlag($feature_flag)
+ {
+ if (is_null($feature_flag)) {
+ throw new \InvalidArgumentException('non-nullable feature_flag cannot be null');
+ }
+ if ((mb_strlen($feature_flag) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $feature_flag when calling EventTypePatch., must be smaller than or equal to 256.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($feature_flag)))) {
+ throw new \InvalidArgumentException("invalid value for \$feature_flag when calling EventTypePatch., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['feature_flag'] = $feature_flag;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/EventTypeUpdate.php b/lib/Model/EventTypeUpdate.php
new file mode 100644
index 0000000..94634dc
--- /dev/null
+++ b/lib/Model/EventTypeUpdate.php
@@ -0,0 +1,536 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * EventTypeUpdate Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class EventTypeUpdate implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'EventTypeUpdate';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'description' => 'string',
+ 'archived' => 'bool',
+ 'schemas' => 'array',
+ 'feature_flag' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'description' => null,
+ 'archived' => null,
+ 'schemas' => null,
+ 'feature_flag' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'description' => false,
+ 'archived' => false,
+ 'schemas' => true,
+ 'feature_flag' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'description' => 'description',
+ 'archived' => 'archived',
+ 'schemas' => 'schemas',
+ 'feature_flag' => 'featureFlag'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'description' => 'setDescription',
+ 'archived' => 'setArchived',
+ 'schemas' => 'setSchemas',
+ 'feature_flag' => 'setFeatureFlag'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'description' => 'getDescription',
+ 'archived' => 'getArchived',
+ 'schemas' => 'getSchemas',
+ 'feature_flag' => 'getFeatureFlag'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('description', $data ?? [], null);
+ $this->setIfExists('archived', $data ?? [], false);
+ $this->setIfExists('schemas', $data ?? [], null);
+ $this->setIfExists('feature_flag', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['description'] === null) {
+ $invalidProperties[] = "'description' can't be null";
+ }
+ if (!is_null($this->container['feature_flag']) && (mb_strlen($this->container['feature_flag']) > 256)) {
+ $invalidProperties[] = "invalid value for 'feature_flag', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['feature_flag']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['feature_flag'])) {
+ $invalidProperties[] = "invalid value for 'feature_flag', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets description
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->container['description'];
+ }
+
+ /**
+ * Sets description
+ *
+ * @param string $description description
+ *
+ * @return self
+ */
+ public function setDescription($description)
+ {
+ if (is_null($description)) {
+ throw new \InvalidArgumentException('non-nullable description cannot be null');
+ }
+ $this->container['description'] = $description;
+
+ return $this;
+ }
+
+ /**
+ * Gets archived
+ *
+ * @return bool|null
+ */
+ public function getArchived()
+ {
+ return $this->container['archived'];
+ }
+
+ /**
+ * Sets archived
+ *
+ * @param bool|null $archived archived
+ *
+ * @return self
+ */
+ public function setArchived($archived)
+ {
+ if (is_null($archived)) {
+ throw new \InvalidArgumentException('non-nullable archived cannot be null');
+ }
+ $this->container['archived'] = $archived;
+
+ return $this;
+ }
+
+ /**
+ * Gets schemas
+ *
+ * @return array|null
+ */
+ public function getSchemas()
+ {
+ return $this->container['schemas'];
+ }
+
+ /**
+ * Sets schemas
+ *
+ * @param array|null $schemas The schema for the event type for a specific version as a JSON schema.
+ *
+ * @return self
+ */
+ public function setSchemas($schemas)
+ {
+ if (is_null($schemas)) {
+ array_push($this->openAPINullablesSetToNull, 'schemas');
+ } else {
+ $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+ $index = array_search('schemas', $nullablesSetToNull);
+ if ($index !== FALSE) {
+ unset($nullablesSetToNull[$index]);
+ $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+ }
+ }
+ $this->container['schemas'] = $schemas;
+
+ return $this;
+ }
+
+ /**
+ * Gets feature_flag
+ *
+ * @return string|null
+ */
+ public function getFeatureFlag()
+ {
+ return $this->container['feature_flag'];
+ }
+
+ /**
+ * Sets feature_flag
+ *
+ * @param string|null $feature_flag feature_flag
+ *
+ * @return self
+ */
+ public function setFeatureFlag($feature_flag)
+ {
+ if (is_null($feature_flag)) {
+ throw new \InvalidArgumentException('non-nullable feature_flag cannot be null');
+ }
+ if ((mb_strlen($feature_flag) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $feature_flag when calling EventTypeUpdate., must be smaller than or equal to 256.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($feature_flag)))) {
+ throw new \InvalidArgumentException("invalid value for \$feature_flag when calling EventTypeUpdate., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['feature_flag'] = $feature_flag;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ExportEventTypeOut.php b/lib/Model/ExportEventTypeOut.php
new file mode 100644
index 0000000..14d3d42
--- /dev/null
+++ b/lib/Model/ExportEventTypeOut.php
@@ -0,0 +1,486 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * ExportEventTypeOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class ExportEventTypeOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ExportEventTypeOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'id' => 'string',
+ 'status' => '\Svix\ApiClient\Model\BackgroundTaskStatus',
+ 'task' => '\Svix\ApiClient\Model\BackgroundTaskType'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'id' => null,
+ 'status' => null,
+ 'task' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'id' => false,
+ 'status' => false,
+ 'task' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'id' => 'id',
+ 'status' => 'status',
+ 'task' => 'task'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'id' => 'setId',
+ 'status' => 'setStatus',
+ 'task' => 'setTask'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'id' => 'getId',
+ 'status' => 'getStatus',
+ 'task' => 'getTask'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('id', $data ?? [], null);
+ $this->setIfExists('status', $data ?? [], null);
+ $this->setIfExists('task', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['id'] === null) {
+ $invalidProperties[] = "'id' can't be null";
+ }
+ if ($this->container['status'] === null) {
+ $invalidProperties[] = "'status' can't be null";
+ }
+ if ($this->container['task'] === null) {
+ $invalidProperties[] = "'task' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets id
+ *
+ * @return string
+ */
+ public function getId()
+ {
+ return $this->container['id'];
+ }
+
+ /**
+ * Sets id
+ *
+ * @param string $id id
+ *
+ * @return self
+ */
+ public function setId($id)
+ {
+ if (is_null($id)) {
+ throw new \InvalidArgumentException('non-nullable id cannot be null');
+ }
+ $this->container['id'] = $id;
+
+ return $this;
+ }
+
+ /**
+ * Gets status
+ *
+ * @return \Svix\ApiClient\Model\BackgroundTaskStatus
+ */
+ public function getStatus()
+ {
+ return $this->container['status'];
+ }
+
+ /**
+ * Sets status
+ *
+ * @param \Svix\ApiClient\Model\BackgroundTaskStatus $status status
+ *
+ * @return self
+ */
+ public function setStatus($status)
+ {
+ if (is_null($status)) {
+ throw new \InvalidArgumentException('non-nullable status cannot be null');
+ }
+ $this->container['status'] = $status;
+
+ return $this;
+ }
+
+ /**
+ * Gets task
+ *
+ * @return \Svix\ApiClient\Model\BackgroundTaskType
+ */
+ public function getTask()
+ {
+ return $this->container['task'];
+ }
+
+ /**
+ * Sets task
+ *
+ * @param \Svix\ApiClient\Model\BackgroundTaskType $task task
+ *
+ * @return self
+ */
+ public function setTask($task)
+ {
+ if (is_null($task)) {
+ throw new \InvalidArgumentException('non-nullable task cannot be null');
+ }
+ $this->container['task'] = $task;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/HTTPValidationError.php b/lib/Model/HTTPValidationError.php
new file mode 100644
index 0000000..0582735
--- /dev/null
+++ b/lib/Model/HTTPValidationError.php
@@ -0,0 +1,412 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * HTTPValidationError Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class HTTPValidationError implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'HTTPValidationError';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'detail' => '\Svix\ApiClient\Model\ValidationError[]'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'detail' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'detail' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'detail' => 'detail'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'detail' => 'setDetail'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'detail' => 'getDetail'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('detail', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['detail'] === null) {
+ $invalidProperties[] = "'detail' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets detail
+ *
+ * @return \Svix\ApiClient\Model\ValidationError[]
+ */
+ public function getDetail()
+ {
+ return $this->container['detail'];
+ }
+
+ /**
+ * Sets detail
+ *
+ * @param \Svix\ApiClient\Model\ValidationError[] $detail detail
+ *
+ * @return self
+ */
+ public function setDetail($detail)
+ {
+ if (is_null($detail)) {
+ throw new \InvalidArgumentException('non-nullable detail cannot be null');
+ }
+ $this->container['detail'] = $detail;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/HttpErrorOut.php b/lib/Model/HttpErrorOut.php
new file mode 100644
index 0000000..7b61777
--- /dev/null
+++ b/lib/Model/HttpErrorOut.php
@@ -0,0 +1,449 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * HttpErrorOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class HttpErrorOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'HttpErrorOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'code' => 'string',
+ 'detail' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'code' => null,
+ 'detail' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'code' => false,
+ 'detail' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'code' => 'code',
+ 'detail' => 'detail'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'code' => 'setCode',
+ 'detail' => 'setDetail'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'code' => 'getCode',
+ 'detail' => 'getDetail'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('code', $data ?? [], null);
+ $this->setIfExists('detail', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['code'] === null) {
+ $invalidProperties[] = "'code' can't be null";
+ }
+ if ($this->container['detail'] === null) {
+ $invalidProperties[] = "'detail' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets code
+ *
+ * @return string
+ */
+ public function getCode()
+ {
+ return $this->container['code'];
+ }
+
+ /**
+ * Sets code
+ *
+ * @param string $code code
+ *
+ * @return self
+ */
+ public function setCode($code)
+ {
+ if (is_null($code)) {
+ throw new \InvalidArgumentException('non-nullable code cannot be null');
+ }
+ $this->container['code'] = $code;
+
+ return $this;
+ }
+
+ /**
+ * Gets detail
+ *
+ * @return string
+ */
+ public function getDetail()
+ {
+ return $this->container['detail'];
+ }
+
+ /**
+ * Sets detail
+ *
+ * @param string $detail detail
+ *
+ * @return self
+ */
+ public function setDetail($detail)
+ {
+ if (is_null($detail)) {
+ throw new \InvalidArgumentException('non-nullable detail cannot be null');
+ }
+ $this->container['detail'] = $detail;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/IntegrationIn.php b/lib/Model/IntegrationIn.php
new file mode 100644
index 0000000..7fd2d59
--- /dev/null
+++ b/lib/Model/IntegrationIn.php
@@ -0,0 +1,412 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * IntegrationIn Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class IntegrationIn implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'IntegrationIn';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'name' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'name' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'name' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'name' => 'name'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'name' => 'setName'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'name' => 'getName'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('name', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['name'] === null) {
+ $invalidProperties[] = "'name' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets name
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->container['name'];
+ }
+
+ /**
+ * Sets name
+ *
+ * @param string $name name
+ *
+ * @return self
+ */
+ public function setName($name)
+ {
+ if (is_null($name)) {
+ throw new \InvalidArgumentException('non-nullable name cannot be null');
+ }
+ $this->container['name'] = $name;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/IntegrationKeyOut.php b/lib/Model/IntegrationKeyOut.php
new file mode 100644
index 0000000..8357a22
--- /dev/null
+++ b/lib/Model/IntegrationKeyOut.php
@@ -0,0 +1,412 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * IntegrationKeyOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class IntegrationKeyOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'IntegrationKeyOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'key' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'key' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'key' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'key' => 'key'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'key' => 'setKey'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'key' => 'getKey'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('key', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['key'] === null) {
+ $invalidProperties[] = "'key' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets key
+ *
+ * @return string
+ */
+ public function getKey()
+ {
+ return $this->container['key'];
+ }
+
+ /**
+ * Sets key
+ *
+ * @param string $key key
+ *
+ * @return self
+ */
+ public function setKey($key)
+ {
+ if (is_null($key)) {
+ throw new \InvalidArgumentException('non-nullable key cannot be null');
+ }
+ $this->container['key'] = $key;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/IntegrationOut.php b/lib/Model/IntegrationOut.php
new file mode 100644
index 0000000..16d8f7e
--- /dev/null
+++ b/lib/Model/IntegrationOut.php
@@ -0,0 +1,523 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * IntegrationOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class IntegrationOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'IntegrationOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'name' => 'string',
+ 'id' => 'string',
+ 'created_at' => '\DateTime',
+ 'updated_at' => '\DateTime'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'name' => null,
+ 'id' => null,
+ 'created_at' => 'date-time',
+ 'updated_at' => 'date-time'
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'name' => false,
+ 'id' => false,
+ 'created_at' => false,
+ 'updated_at' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'name' => 'name',
+ 'id' => 'id',
+ 'created_at' => 'createdAt',
+ 'updated_at' => 'updatedAt'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'name' => 'setName',
+ 'id' => 'setId',
+ 'created_at' => 'setCreatedAt',
+ 'updated_at' => 'setUpdatedAt'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'name' => 'getName',
+ 'id' => 'getId',
+ 'created_at' => 'getCreatedAt',
+ 'updated_at' => 'getUpdatedAt'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('name', $data ?? [], null);
+ $this->setIfExists('id', $data ?? [], null);
+ $this->setIfExists('created_at', $data ?? [], null);
+ $this->setIfExists('updated_at', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['name'] === null) {
+ $invalidProperties[] = "'name' can't be null";
+ }
+ if ($this->container['id'] === null) {
+ $invalidProperties[] = "'id' can't be null";
+ }
+ if ($this->container['created_at'] === null) {
+ $invalidProperties[] = "'created_at' can't be null";
+ }
+ if ($this->container['updated_at'] === null) {
+ $invalidProperties[] = "'updated_at' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets name
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->container['name'];
+ }
+
+ /**
+ * Sets name
+ *
+ * @param string $name name
+ *
+ * @return self
+ */
+ public function setName($name)
+ {
+ if (is_null($name)) {
+ throw new \InvalidArgumentException('non-nullable name cannot be null');
+ }
+ $this->container['name'] = $name;
+
+ return $this;
+ }
+
+ /**
+ * Gets id
+ *
+ * @return string
+ */
+ public function getId()
+ {
+ return $this->container['id'];
+ }
+
+ /**
+ * Sets id
+ *
+ * @param string $id The integ's ID
+ *
+ * @return self
+ */
+ public function setId($id)
+ {
+ if (is_null($id)) {
+ throw new \InvalidArgumentException('non-nullable id cannot be null');
+ }
+ $this->container['id'] = $id;
+
+ return $this;
+ }
+
+ /**
+ * Gets created_at
+ *
+ * @return \DateTime
+ */
+ public function getCreatedAt()
+ {
+ return $this->container['created_at'];
+ }
+
+ /**
+ * Sets created_at
+ *
+ * @param \DateTime $created_at created_at
+ *
+ * @return self
+ */
+ public function setCreatedAt($created_at)
+ {
+ if (is_null($created_at)) {
+ throw new \InvalidArgumentException('non-nullable created_at cannot be null');
+ }
+ $this->container['created_at'] = $created_at;
+
+ return $this;
+ }
+
+ /**
+ * Gets updated_at
+ *
+ * @return \DateTime
+ */
+ public function getUpdatedAt()
+ {
+ return $this->container['updated_at'];
+ }
+
+ /**
+ * Sets updated_at
+ *
+ * @param \DateTime $updated_at updated_at
+ *
+ * @return self
+ */
+ public function setUpdatedAt($updated_at)
+ {
+ if (is_null($updated_at)) {
+ throw new \InvalidArgumentException('non-nullable updated_at cannot be null');
+ }
+ $this->container['updated_at'] = $updated_at;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/IntegrationUpdate.php b/lib/Model/IntegrationUpdate.php
new file mode 100644
index 0000000..8e8fe49
--- /dev/null
+++ b/lib/Model/IntegrationUpdate.php
@@ -0,0 +1,412 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * IntegrationUpdate Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class IntegrationUpdate implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'IntegrationUpdate';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'name' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'name' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'name' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'name' => 'name'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'name' => 'setName'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'name' => 'getName'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('name', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['name'] === null) {
+ $invalidProperties[] = "'name' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets name
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->container['name'];
+ }
+
+ /**
+ * Sets name
+ *
+ * @param string $name name
+ *
+ * @return self
+ */
+ public function setName($name)
+ {
+ if (is_null($name)) {
+ throw new \InvalidArgumentException('non-nullable name cannot be null');
+ }
+ $this->container['name'] = $name;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ListResponseApplicationOut.php b/lib/Model/ListResponseApplicationOut.php
new file mode 100644
index 0000000..b91f620
--- /dev/null
+++ b/lib/Model/ListResponseApplicationOut.php
@@ -0,0 +1,517 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * ListResponseApplicationOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class ListResponseApplicationOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ListResponse_ApplicationOut_';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\ApplicationOut[]',
+ 'iterator' => 'string',
+ 'prev_iterator' => 'string',
+ 'done' => 'bool'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'iterator' => null,
+ 'prev_iterator' => null,
+ 'done' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'iterator' => false,
+ 'prev_iterator' => false,
+ 'done' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'iterator' => 'iterator',
+ 'prev_iterator' => 'prevIterator',
+ 'done' => 'done'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'iterator' => 'setIterator',
+ 'prev_iterator' => 'setPrevIterator',
+ 'done' => 'setDone'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'iterator' => 'getIterator',
+ 'prev_iterator' => 'getPrevIterator',
+ 'done' => 'getDone'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('iterator', $data ?? [], null);
+ $this->setIfExists('prev_iterator', $data ?? [], null);
+ $this->setIfExists('done', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['done'] === null) {
+ $invalidProperties[] = "'done' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\ApplicationOut[]
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\ApplicationOut[] $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets iterator
+ *
+ * @return string|null
+ */
+ public function getIterator()
+ {
+ return $this->container['iterator'];
+ }
+
+ /**
+ * Sets iterator
+ *
+ * @param string|null $iterator iterator
+ *
+ * @return self
+ */
+ public function setIterator($iterator)
+ {
+ if (is_null($iterator)) {
+ throw new \InvalidArgumentException('non-nullable iterator cannot be null');
+ }
+ $this->container['iterator'] = $iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets prev_iterator
+ *
+ * @return string|null
+ */
+ public function getPrevIterator()
+ {
+ return $this->container['prev_iterator'];
+ }
+
+ /**
+ * Sets prev_iterator
+ *
+ * @param string|null $prev_iterator prev_iterator
+ *
+ * @return self
+ */
+ public function setPrevIterator($prev_iterator)
+ {
+ if (is_null($prev_iterator)) {
+ throw new \InvalidArgumentException('non-nullable prev_iterator cannot be null');
+ }
+ $this->container['prev_iterator'] = $prev_iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets done
+ *
+ * @return bool
+ */
+ public function getDone()
+ {
+ return $this->container['done'];
+ }
+
+ /**
+ * Sets done
+ *
+ * @param bool $done done
+ *
+ * @return self
+ */
+ public function setDone($done)
+ {
+ if (is_null($done)) {
+ throw new \InvalidArgumentException('non-nullable done cannot be null');
+ }
+ $this->container['done'] = $done;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ListResponseBackgroundTaskOut.php b/lib/Model/ListResponseBackgroundTaskOut.php
new file mode 100644
index 0000000..f7bbb50
--- /dev/null
+++ b/lib/Model/ListResponseBackgroundTaskOut.php
@@ -0,0 +1,517 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * ListResponseBackgroundTaskOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class ListResponseBackgroundTaskOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ListResponse_BackgroundTaskOut_';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\BackgroundTaskOut[]',
+ 'iterator' => 'string',
+ 'prev_iterator' => 'string',
+ 'done' => 'bool'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'iterator' => null,
+ 'prev_iterator' => null,
+ 'done' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'iterator' => false,
+ 'prev_iterator' => false,
+ 'done' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'iterator' => 'iterator',
+ 'prev_iterator' => 'prevIterator',
+ 'done' => 'done'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'iterator' => 'setIterator',
+ 'prev_iterator' => 'setPrevIterator',
+ 'done' => 'setDone'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'iterator' => 'getIterator',
+ 'prev_iterator' => 'getPrevIterator',
+ 'done' => 'getDone'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('iterator', $data ?? [], null);
+ $this->setIfExists('prev_iterator', $data ?? [], null);
+ $this->setIfExists('done', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['done'] === null) {
+ $invalidProperties[] = "'done' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\BackgroundTaskOut[]
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\BackgroundTaskOut[] $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets iterator
+ *
+ * @return string|null
+ */
+ public function getIterator()
+ {
+ return $this->container['iterator'];
+ }
+
+ /**
+ * Sets iterator
+ *
+ * @param string|null $iterator iterator
+ *
+ * @return self
+ */
+ public function setIterator($iterator)
+ {
+ if (is_null($iterator)) {
+ throw new \InvalidArgumentException('non-nullable iterator cannot be null');
+ }
+ $this->container['iterator'] = $iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets prev_iterator
+ *
+ * @return string|null
+ */
+ public function getPrevIterator()
+ {
+ return $this->container['prev_iterator'];
+ }
+
+ /**
+ * Sets prev_iterator
+ *
+ * @param string|null $prev_iterator prev_iterator
+ *
+ * @return self
+ */
+ public function setPrevIterator($prev_iterator)
+ {
+ if (is_null($prev_iterator)) {
+ throw new \InvalidArgumentException('non-nullable prev_iterator cannot be null');
+ }
+ $this->container['prev_iterator'] = $prev_iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets done
+ *
+ * @return bool
+ */
+ public function getDone()
+ {
+ return $this->container['done'];
+ }
+
+ /**
+ * Sets done
+ *
+ * @param bool $done done
+ *
+ * @return self
+ */
+ public function setDone($done)
+ {
+ if (is_null($done)) {
+ throw new \InvalidArgumentException('non-nullable done cannot be null');
+ }
+ $this->container['done'] = $done;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ListResponseEndpointMessageOut.php b/lib/Model/ListResponseEndpointMessageOut.php
new file mode 100644
index 0000000..f6228b6
--- /dev/null
+++ b/lib/Model/ListResponseEndpointMessageOut.php
@@ -0,0 +1,517 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * ListResponseEndpointMessageOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class ListResponseEndpointMessageOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ListResponse_EndpointMessageOut_';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\EndpointMessageOut[]',
+ 'iterator' => 'string',
+ 'prev_iterator' => 'string',
+ 'done' => 'bool'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'iterator' => null,
+ 'prev_iterator' => null,
+ 'done' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'iterator' => false,
+ 'prev_iterator' => false,
+ 'done' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'iterator' => 'iterator',
+ 'prev_iterator' => 'prevIterator',
+ 'done' => 'done'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'iterator' => 'setIterator',
+ 'prev_iterator' => 'setPrevIterator',
+ 'done' => 'setDone'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'iterator' => 'getIterator',
+ 'prev_iterator' => 'getPrevIterator',
+ 'done' => 'getDone'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('iterator', $data ?? [], null);
+ $this->setIfExists('prev_iterator', $data ?? [], null);
+ $this->setIfExists('done', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['done'] === null) {
+ $invalidProperties[] = "'done' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\EndpointMessageOut[]
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\EndpointMessageOut[] $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets iterator
+ *
+ * @return string|null
+ */
+ public function getIterator()
+ {
+ return $this->container['iterator'];
+ }
+
+ /**
+ * Sets iterator
+ *
+ * @param string|null $iterator iterator
+ *
+ * @return self
+ */
+ public function setIterator($iterator)
+ {
+ if (is_null($iterator)) {
+ throw new \InvalidArgumentException('non-nullable iterator cannot be null');
+ }
+ $this->container['iterator'] = $iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets prev_iterator
+ *
+ * @return string|null
+ */
+ public function getPrevIterator()
+ {
+ return $this->container['prev_iterator'];
+ }
+
+ /**
+ * Sets prev_iterator
+ *
+ * @param string|null $prev_iterator prev_iterator
+ *
+ * @return self
+ */
+ public function setPrevIterator($prev_iterator)
+ {
+ if (is_null($prev_iterator)) {
+ throw new \InvalidArgumentException('non-nullable prev_iterator cannot be null');
+ }
+ $this->container['prev_iterator'] = $prev_iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets done
+ *
+ * @return bool
+ */
+ public function getDone()
+ {
+ return $this->container['done'];
+ }
+
+ /**
+ * Sets done
+ *
+ * @param bool $done done
+ *
+ * @return self
+ */
+ public function setDone($done)
+ {
+ if (is_null($done)) {
+ throw new \InvalidArgumentException('non-nullable done cannot be null');
+ }
+ $this->container['done'] = $done;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ListResponseEndpointOut.php b/lib/Model/ListResponseEndpointOut.php
new file mode 100644
index 0000000..ca03270
--- /dev/null
+++ b/lib/Model/ListResponseEndpointOut.php
@@ -0,0 +1,517 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * ListResponseEndpointOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class ListResponseEndpointOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ListResponse_EndpointOut_';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\EndpointOut[]',
+ 'iterator' => 'string',
+ 'prev_iterator' => 'string',
+ 'done' => 'bool'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'iterator' => null,
+ 'prev_iterator' => null,
+ 'done' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'iterator' => false,
+ 'prev_iterator' => false,
+ 'done' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'iterator' => 'iterator',
+ 'prev_iterator' => 'prevIterator',
+ 'done' => 'done'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'iterator' => 'setIterator',
+ 'prev_iterator' => 'setPrevIterator',
+ 'done' => 'setDone'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'iterator' => 'getIterator',
+ 'prev_iterator' => 'getPrevIterator',
+ 'done' => 'getDone'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('iterator', $data ?? [], null);
+ $this->setIfExists('prev_iterator', $data ?? [], null);
+ $this->setIfExists('done', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['done'] === null) {
+ $invalidProperties[] = "'done' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\EndpointOut[]
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\EndpointOut[] $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets iterator
+ *
+ * @return string|null
+ */
+ public function getIterator()
+ {
+ return $this->container['iterator'];
+ }
+
+ /**
+ * Sets iterator
+ *
+ * @param string|null $iterator iterator
+ *
+ * @return self
+ */
+ public function setIterator($iterator)
+ {
+ if (is_null($iterator)) {
+ throw new \InvalidArgumentException('non-nullable iterator cannot be null');
+ }
+ $this->container['iterator'] = $iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets prev_iterator
+ *
+ * @return string|null
+ */
+ public function getPrevIterator()
+ {
+ return $this->container['prev_iterator'];
+ }
+
+ /**
+ * Sets prev_iterator
+ *
+ * @param string|null $prev_iterator prev_iterator
+ *
+ * @return self
+ */
+ public function setPrevIterator($prev_iterator)
+ {
+ if (is_null($prev_iterator)) {
+ throw new \InvalidArgumentException('non-nullable prev_iterator cannot be null');
+ }
+ $this->container['prev_iterator'] = $prev_iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets done
+ *
+ * @return bool
+ */
+ public function getDone()
+ {
+ return $this->container['done'];
+ }
+
+ /**
+ * Sets done
+ *
+ * @param bool $done done
+ *
+ * @return self
+ */
+ public function setDone($done)
+ {
+ if (is_null($done)) {
+ throw new \InvalidArgumentException('non-nullable done cannot be null');
+ }
+ $this->container['done'] = $done;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ListResponseEventTypeOut.php b/lib/Model/ListResponseEventTypeOut.php
new file mode 100644
index 0000000..a58a77d
--- /dev/null
+++ b/lib/Model/ListResponseEventTypeOut.php
@@ -0,0 +1,517 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * ListResponseEventTypeOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class ListResponseEventTypeOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ListResponse_EventTypeOut_';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\EventTypeOut[]',
+ 'iterator' => 'string',
+ 'prev_iterator' => 'string',
+ 'done' => 'bool'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'iterator' => null,
+ 'prev_iterator' => null,
+ 'done' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'iterator' => false,
+ 'prev_iterator' => false,
+ 'done' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'iterator' => 'iterator',
+ 'prev_iterator' => 'prevIterator',
+ 'done' => 'done'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'iterator' => 'setIterator',
+ 'prev_iterator' => 'setPrevIterator',
+ 'done' => 'setDone'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'iterator' => 'getIterator',
+ 'prev_iterator' => 'getPrevIterator',
+ 'done' => 'getDone'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('iterator', $data ?? [], null);
+ $this->setIfExists('prev_iterator', $data ?? [], null);
+ $this->setIfExists('done', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['done'] === null) {
+ $invalidProperties[] = "'done' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\EventTypeOut[]
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\EventTypeOut[] $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets iterator
+ *
+ * @return string|null
+ */
+ public function getIterator()
+ {
+ return $this->container['iterator'];
+ }
+
+ /**
+ * Sets iterator
+ *
+ * @param string|null $iterator iterator
+ *
+ * @return self
+ */
+ public function setIterator($iterator)
+ {
+ if (is_null($iterator)) {
+ throw new \InvalidArgumentException('non-nullable iterator cannot be null');
+ }
+ $this->container['iterator'] = $iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets prev_iterator
+ *
+ * @return string|null
+ */
+ public function getPrevIterator()
+ {
+ return $this->container['prev_iterator'];
+ }
+
+ /**
+ * Sets prev_iterator
+ *
+ * @param string|null $prev_iterator prev_iterator
+ *
+ * @return self
+ */
+ public function setPrevIterator($prev_iterator)
+ {
+ if (is_null($prev_iterator)) {
+ throw new \InvalidArgumentException('non-nullable prev_iterator cannot be null');
+ }
+ $this->container['prev_iterator'] = $prev_iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets done
+ *
+ * @return bool
+ */
+ public function getDone()
+ {
+ return $this->container['done'];
+ }
+
+ /**
+ * Sets done
+ *
+ * @param bool $done done
+ *
+ * @return self
+ */
+ public function setDone($done)
+ {
+ if (is_null($done)) {
+ throw new \InvalidArgumentException('non-nullable done cannot be null');
+ }
+ $this->container['done'] = $done;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ListResponseIntegrationOut.php b/lib/Model/ListResponseIntegrationOut.php
new file mode 100644
index 0000000..62ca04c
--- /dev/null
+++ b/lib/Model/ListResponseIntegrationOut.php
@@ -0,0 +1,517 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * ListResponseIntegrationOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class ListResponseIntegrationOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ListResponse_IntegrationOut_';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\IntegrationOut[]',
+ 'iterator' => 'string',
+ 'prev_iterator' => 'string',
+ 'done' => 'bool'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'iterator' => null,
+ 'prev_iterator' => null,
+ 'done' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'iterator' => false,
+ 'prev_iterator' => false,
+ 'done' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'iterator' => 'iterator',
+ 'prev_iterator' => 'prevIterator',
+ 'done' => 'done'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'iterator' => 'setIterator',
+ 'prev_iterator' => 'setPrevIterator',
+ 'done' => 'setDone'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'iterator' => 'getIterator',
+ 'prev_iterator' => 'getPrevIterator',
+ 'done' => 'getDone'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('iterator', $data ?? [], null);
+ $this->setIfExists('prev_iterator', $data ?? [], null);
+ $this->setIfExists('done', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['done'] === null) {
+ $invalidProperties[] = "'done' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\IntegrationOut[]
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\IntegrationOut[] $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets iterator
+ *
+ * @return string|null
+ */
+ public function getIterator()
+ {
+ return $this->container['iterator'];
+ }
+
+ /**
+ * Sets iterator
+ *
+ * @param string|null $iterator iterator
+ *
+ * @return self
+ */
+ public function setIterator($iterator)
+ {
+ if (is_null($iterator)) {
+ throw new \InvalidArgumentException('non-nullable iterator cannot be null');
+ }
+ $this->container['iterator'] = $iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets prev_iterator
+ *
+ * @return string|null
+ */
+ public function getPrevIterator()
+ {
+ return $this->container['prev_iterator'];
+ }
+
+ /**
+ * Sets prev_iterator
+ *
+ * @param string|null $prev_iterator prev_iterator
+ *
+ * @return self
+ */
+ public function setPrevIterator($prev_iterator)
+ {
+ if (is_null($prev_iterator)) {
+ throw new \InvalidArgumentException('non-nullable prev_iterator cannot be null');
+ }
+ $this->container['prev_iterator'] = $prev_iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets done
+ *
+ * @return bool
+ */
+ public function getDone()
+ {
+ return $this->container['done'];
+ }
+
+ /**
+ * Sets done
+ *
+ * @param bool $done done
+ *
+ * @return self
+ */
+ public function setDone($done)
+ {
+ if (is_null($done)) {
+ throw new \InvalidArgumentException('non-nullable done cannot be null');
+ }
+ $this->container['done'] = $done;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ListResponseMessageAttemptEndpointOut.php b/lib/Model/ListResponseMessageAttemptEndpointOut.php
new file mode 100644
index 0000000..07d41a4
--- /dev/null
+++ b/lib/Model/ListResponseMessageAttemptEndpointOut.php
@@ -0,0 +1,517 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * ListResponseMessageAttemptEndpointOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class ListResponseMessageAttemptEndpointOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ListResponse_MessageAttemptEndpointOut_';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\MessageAttemptEndpointOut[]',
+ 'iterator' => 'string',
+ 'prev_iterator' => 'string',
+ 'done' => 'bool'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'iterator' => null,
+ 'prev_iterator' => null,
+ 'done' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'iterator' => false,
+ 'prev_iterator' => false,
+ 'done' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'iterator' => 'iterator',
+ 'prev_iterator' => 'prevIterator',
+ 'done' => 'done'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'iterator' => 'setIterator',
+ 'prev_iterator' => 'setPrevIterator',
+ 'done' => 'setDone'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'iterator' => 'getIterator',
+ 'prev_iterator' => 'getPrevIterator',
+ 'done' => 'getDone'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('iterator', $data ?? [], null);
+ $this->setIfExists('prev_iterator', $data ?? [], null);
+ $this->setIfExists('done', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['done'] === null) {
+ $invalidProperties[] = "'done' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\MessageAttemptEndpointOut[]
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\MessageAttemptEndpointOut[] $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets iterator
+ *
+ * @return string|null
+ */
+ public function getIterator()
+ {
+ return $this->container['iterator'];
+ }
+
+ /**
+ * Sets iterator
+ *
+ * @param string|null $iterator iterator
+ *
+ * @return self
+ */
+ public function setIterator($iterator)
+ {
+ if (is_null($iterator)) {
+ throw new \InvalidArgumentException('non-nullable iterator cannot be null');
+ }
+ $this->container['iterator'] = $iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets prev_iterator
+ *
+ * @return string|null
+ */
+ public function getPrevIterator()
+ {
+ return $this->container['prev_iterator'];
+ }
+
+ /**
+ * Sets prev_iterator
+ *
+ * @param string|null $prev_iterator prev_iterator
+ *
+ * @return self
+ */
+ public function setPrevIterator($prev_iterator)
+ {
+ if (is_null($prev_iterator)) {
+ throw new \InvalidArgumentException('non-nullable prev_iterator cannot be null');
+ }
+ $this->container['prev_iterator'] = $prev_iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets done
+ *
+ * @return bool
+ */
+ public function getDone()
+ {
+ return $this->container['done'];
+ }
+
+ /**
+ * Sets done
+ *
+ * @param bool $done done
+ *
+ * @return self
+ */
+ public function setDone($done)
+ {
+ if (is_null($done)) {
+ throw new \InvalidArgumentException('non-nullable done cannot be null');
+ }
+ $this->container['done'] = $done;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ListResponseMessageAttemptOut.php b/lib/Model/ListResponseMessageAttemptOut.php
new file mode 100644
index 0000000..3f74069
--- /dev/null
+++ b/lib/Model/ListResponseMessageAttemptOut.php
@@ -0,0 +1,517 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * ListResponseMessageAttemptOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class ListResponseMessageAttemptOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ListResponse_MessageAttemptOut_';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\MessageAttemptOut[]',
+ 'iterator' => 'string',
+ 'prev_iterator' => 'string',
+ 'done' => 'bool'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'iterator' => null,
+ 'prev_iterator' => null,
+ 'done' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'iterator' => false,
+ 'prev_iterator' => false,
+ 'done' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'iterator' => 'iterator',
+ 'prev_iterator' => 'prevIterator',
+ 'done' => 'done'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'iterator' => 'setIterator',
+ 'prev_iterator' => 'setPrevIterator',
+ 'done' => 'setDone'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'iterator' => 'getIterator',
+ 'prev_iterator' => 'getPrevIterator',
+ 'done' => 'getDone'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('iterator', $data ?? [], null);
+ $this->setIfExists('prev_iterator', $data ?? [], null);
+ $this->setIfExists('done', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['done'] === null) {
+ $invalidProperties[] = "'done' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\MessageAttemptOut[]
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\MessageAttemptOut[] $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets iterator
+ *
+ * @return string|null
+ */
+ public function getIterator()
+ {
+ return $this->container['iterator'];
+ }
+
+ /**
+ * Sets iterator
+ *
+ * @param string|null $iterator iterator
+ *
+ * @return self
+ */
+ public function setIterator($iterator)
+ {
+ if (is_null($iterator)) {
+ throw new \InvalidArgumentException('non-nullable iterator cannot be null');
+ }
+ $this->container['iterator'] = $iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets prev_iterator
+ *
+ * @return string|null
+ */
+ public function getPrevIterator()
+ {
+ return $this->container['prev_iterator'];
+ }
+
+ /**
+ * Sets prev_iterator
+ *
+ * @param string|null $prev_iterator prev_iterator
+ *
+ * @return self
+ */
+ public function setPrevIterator($prev_iterator)
+ {
+ if (is_null($prev_iterator)) {
+ throw new \InvalidArgumentException('non-nullable prev_iterator cannot be null');
+ }
+ $this->container['prev_iterator'] = $prev_iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets done
+ *
+ * @return bool
+ */
+ public function getDone()
+ {
+ return $this->container['done'];
+ }
+
+ /**
+ * Sets done
+ *
+ * @param bool $done done
+ *
+ * @return self
+ */
+ public function setDone($done)
+ {
+ if (is_null($done)) {
+ throw new \InvalidArgumentException('non-nullable done cannot be null');
+ }
+ $this->container['done'] = $done;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ListResponseMessageEndpointOut.php b/lib/Model/ListResponseMessageEndpointOut.php
new file mode 100644
index 0000000..a45a460
--- /dev/null
+++ b/lib/Model/ListResponseMessageEndpointOut.php
@@ -0,0 +1,517 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * ListResponseMessageEndpointOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class ListResponseMessageEndpointOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ListResponse_MessageEndpointOut_';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\MessageEndpointOut[]',
+ 'iterator' => 'string',
+ 'prev_iterator' => 'string',
+ 'done' => 'bool'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'iterator' => null,
+ 'prev_iterator' => null,
+ 'done' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'iterator' => false,
+ 'prev_iterator' => false,
+ 'done' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'iterator' => 'iterator',
+ 'prev_iterator' => 'prevIterator',
+ 'done' => 'done'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'iterator' => 'setIterator',
+ 'prev_iterator' => 'setPrevIterator',
+ 'done' => 'setDone'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'iterator' => 'getIterator',
+ 'prev_iterator' => 'getPrevIterator',
+ 'done' => 'getDone'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('iterator', $data ?? [], null);
+ $this->setIfExists('prev_iterator', $data ?? [], null);
+ $this->setIfExists('done', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['done'] === null) {
+ $invalidProperties[] = "'done' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\MessageEndpointOut[]
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\MessageEndpointOut[] $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets iterator
+ *
+ * @return string|null
+ */
+ public function getIterator()
+ {
+ return $this->container['iterator'];
+ }
+
+ /**
+ * Sets iterator
+ *
+ * @param string|null $iterator iterator
+ *
+ * @return self
+ */
+ public function setIterator($iterator)
+ {
+ if (is_null($iterator)) {
+ throw new \InvalidArgumentException('non-nullable iterator cannot be null');
+ }
+ $this->container['iterator'] = $iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets prev_iterator
+ *
+ * @return string|null
+ */
+ public function getPrevIterator()
+ {
+ return $this->container['prev_iterator'];
+ }
+
+ /**
+ * Sets prev_iterator
+ *
+ * @param string|null $prev_iterator prev_iterator
+ *
+ * @return self
+ */
+ public function setPrevIterator($prev_iterator)
+ {
+ if (is_null($prev_iterator)) {
+ throw new \InvalidArgumentException('non-nullable prev_iterator cannot be null');
+ }
+ $this->container['prev_iterator'] = $prev_iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets done
+ *
+ * @return bool
+ */
+ public function getDone()
+ {
+ return $this->container['done'];
+ }
+
+ /**
+ * Sets done
+ *
+ * @param bool $done done
+ *
+ * @return self
+ */
+ public function setDone($done)
+ {
+ if (is_null($done)) {
+ throw new \InvalidArgumentException('non-nullable done cannot be null');
+ }
+ $this->container['done'] = $done;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ListResponseMessageOut.php b/lib/Model/ListResponseMessageOut.php
new file mode 100644
index 0000000..2fe7cf3
--- /dev/null
+++ b/lib/Model/ListResponseMessageOut.php
@@ -0,0 +1,517 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * ListResponseMessageOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class ListResponseMessageOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ListResponse_MessageOut_';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\MessageOut[]',
+ 'iterator' => 'string',
+ 'prev_iterator' => 'string',
+ 'done' => 'bool'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'iterator' => null,
+ 'prev_iterator' => null,
+ 'done' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'iterator' => false,
+ 'prev_iterator' => false,
+ 'done' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'iterator' => 'iterator',
+ 'prev_iterator' => 'prevIterator',
+ 'done' => 'done'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'iterator' => 'setIterator',
+ 'prev_iterator' => 'setPrevIterator',
+ 'done' => 'setDone'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'iterator' => 'getIterator',
+ 'prev_iterator' => 'getPrevIterator',
+ 'done' => 'getDone'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('iterator', $data ?? [], null);
+ $this->setIfExists('prev_iterator', $data ?? [], null);
+ $this->setIfExists('done', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['done'] === null) {
+ $invalidProperties[] = "'done' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\MessageOut[]
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\MessageOut[] $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets iterator
+ *
+ * @return string|null
+ */
+ public function getIterator()
+ {
+ return $this->container['iterator'];
+ }
+
+ /**
+ * Sets iterator
+ *
+ * @param string|null $iterator iterator
+ *
+ * @return self
+ */
+ public function setIterator($iterator)
+ {
+ if (is_null($iterator)) {
+ throw new \InvalidArgumentException('non-nullable iterator cannot be null');
+ }
+ $this->container['iterator'] = $iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets prev_iterator
+ *
+ * @return string|null
+ */
+ public function getPrevIterator()
+ {
+ return $this->container['prev_iterator'];
+ }
+
+ /**
+ * Sets prev_iterator
+ *
+ * @param string|null $prev_iterator prev_iterator
+ *
+ * @return self
+ */
+ public function setPrevIterator($prev_iterator)
+ {
+ if (is_null($prev_iterator)) {
+ throw new \InvalidArgumentException('non-nullable prev_iterator cannot be null');
+ }
+ $this->container['prev_iterator'] = $prev_iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets done
+ *
+ * @return bool
+ */
+ public function getDone()
+ {
+ return $this->container['done'];
+ }
+
+ /**
+ * Sets done
+ *
+ * @param bool $done done
+ *
+ * @return self
+ */
+ public function setDone($done)
+ {
+ if (is_null($done)) {
+ throw new \InvalidArgumentException('non-nullable done cannot be null');
+ }
+ $this->container['done'] = $done;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ListResponseTemplateOut.php b/lib/Model/ListResponseTemplateOut.php
new file mode 100644
index 0000000..d87658e
--- /dev/null
+++ b/lib/Model/ListResponseTemplateOut.php
@@ -0,0 +1,517 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * ListResponseTemplateOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class ListResponseTemplateOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ListResponse_TemplateOut_';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\TemplateOut[]',
+ 'iterator' => 'string',
+ 'prev_iterator' => 'string',
+ 'done' => 'bool'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'iterator' => null,
+ 'prev_iterator' => null,
+ 'done' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'iterator' => false,
+ 'prev_iterator' => false,
+ 'done' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'iterator' => 'iterator',
+ 'prev_iterator' => 'prevIterator',
+ 'done' => 'done'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'iterator' => 'setIterator',
+ 'prev_iterator' => 'setPrevIterator',
+ 'done' => 'setDone'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'iterator' => 'getIterator',
+ 'prev_iterator' => 'getPrevIterator',
+ 'done' => 'getDone'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('iterator', $data ?? [], null);
+ $this->setIfExists('prev_iterator', $data ?? [], null);
+ $this->setIfExists('done', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['done'] === null) {
+ $invalidProperties[] = "'done' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\TemplateOut[]
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\TemplateOut[] $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets iterator
+ *
+ * @return string|null
+ */
+ public function getIterator()
+ {
+ return $this->container['iterator'];
+ }
+
+ /**
+ * Sets iterator
+ *
+ * @param string|null $iterator iterator
+ *
+ * @return self
+ */
+ public function setIterator($iterator)
+ {
+ if (is_null($iterator)) {
+ throw new \InvalidArgumentException('non-nullable iterator cannot be null');
+ }
+ $this->container['iterator'] = $iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets prev_iterator
+ *
+ * @return string|null
+ */
+ public function getPrevIterator()
+ {
+ return $this->container['prev_iterator'];
+ }
+
+ /**
+ * Sets prev_iterator
+ *
+ * @param string|null $prev_iterator prev_iterator
+ *
+ * @return self
+ */
+ public function setPrevIterator($prev_iterator)
+ {
+ if (is_null($prev_iterator)) {
+ throw new \InvalidArgumentException('non-nullable prev_iterator cannot be null');
+ }
+ $this->container['prev_iterator'] = $prev_iterator;
+
+ return $this;
+ }
+
+ /**
+ * Gets done
+ *
+ * @return bool
+ */
+ public function getDone()
+ {
+ return $this->container['done'];
+ }
+
+ /**
+ * Sets done
+ *
+ * @param bool $done done
+ *
+ * @return self
+ */
+ public function setDone($done)
+ {
+ if (is_null($done)) {
+ throw new \InvalidArgumentException('non-nullable done cannot be null');
+ }
+ $this->container['done'] = $done;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/MessageAttemptEndpointOut.php b/lib/Model/MessageAttemptEndpointOut.php
new file mode 100644
index 0000000..ec0babd
--- /dev/null
+++ b/lib/Model/MessageAttemptEndpointOut.php
@@ -0,0 +1,723 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * MessageAttemptEndpointOut Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class MessageAttemptEndpointOut implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'MessageAttemptEndpointOut';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'url' => 'string',
+ 'response' => 'string',
+ 'response_status_code' => 'int',
+ 'status' => '\Svix\ApiClient\Model\MessageStatus',
+ 'trigger_type' => '\Svix\ApiClient\Model\MessageAttemptTriggerType',
+ 'msg_id' => 'string',
+ 'endpoint_id' => 'string',
+ 'id' => 'string',
+ 'timestamp' => '\DateTime'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'url' => 'uri',
+ 'response' => null,
+ 'response_status_code' => 'int16',
+ 'status' => null,
+ 'trigger_type' => null,
+ 'msg_id' => null,
+ 'endpoint_id' => null,
+ 'id' => null,
+ 'timestamp' => 'date-time'
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'url' => false,
+ 'response' => false,
+ 'response_status_code' => false,
+ 'status' => false,
+ 'trigger_type' => false,
+ 'msg_id' => false,
+ 'endpoint_id' => false,
+ 'id' => false,
+ 'timestamp' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'url' => 'url',
+ 'response' => 'response',
+ 'response_status_code' => 'responseStatusCode',
+ 'status' => 'status',
+ 'trigger_type' => 'triggerType',
+ 'msg_id' => 'msgId',
+ 'endpoint_id' => 'endpointId',
+ 'id' => 'id',
+ 'timestamp' => 'timestamp'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'url' => 'setUrl',
+ 'response' => 'setResponse',
+ 'response_status_code' => 'setResponseStatusCode',
+ 'status' => 'setStatus',
+ 'trigger_type' => 'setTriggerType',
+ 'msg_id' => 'setMsgId',
+ 'endpoint_id' => 'setEndpointId',
+ 'id' => 'setId',
+ 'timestamp' => 'setTimestamp'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'url' => 'getUrl',
+ 'response' => 'getResponse',
+ 'response_status_code' => 'getResponseStatusCode',
+ 'status' => 'getStatus',
+ 'trigger_type' => 'getTriggerType',
+ 'msg_id' => 'getMsgId',
+ 'endpoint_id' => 'getEndpointId',
+ 'id' => 'getId',
+ 'timestamp' => 'getTimestamp'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('url', $data ?? [], null);
+ $this->setIfExists('response', $data ?? [], null);
+ $this->setIfExists('response_status_code', $data ?? [], null);
+ $this->setIfExists('status', $data ?? [], null);
+ $this->setIfExists('trigger_type', $data ?? [], null);
+ $this->setIfExists('msg_id', $data ?? [], null);
+ $this->setIfExists('endpoint_id', $data ?? [], null);
+ $this->setIfExists('id', $data ?? [], null);
+ $this->setIfExists('timestamp', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['url'] === null) {
+ $invalidProperties[] = "'url' can't be null";
+ }
+ if ((mb_strlen($this->container['url']) > 65536)) {
+ $invalidProperties[] = "invalid value for 'url', the character length must be smaller than or equal to 65536.";
+ }
+
+ if ((mb_strlen($this->container['url']) < 1)) {
+ $invalidProperties[] = "invalid value for 'url', the character length must be bigger than or equal to 1.";
+ }
+
+ if ($this->container['response'] === null) {
+ $invalidProperties[] = "'response' can't be null";
+ }
+ if ($this->container['response_status_code'] === null) {
+ $invalidProperties[] = "'response_status_code' can't be null";
+ }
+ if ($this->container['status'] === null) {
+ $invalidProperties[] = "'status' can't be null";
+ }
+ if ($this->container['trigger_type'] === null) {
+ $invalidProperties[] = "'trigger_type' can't be null";
+ }
+ if ($this->container['msg_id'] === null) {
+ $invalidProperties[] = "'msg_id' can't be null";
+ }
+ if ($this->container['endpoint_id'] === null) {
+ $invalidProperties[] = "'endpoint_id' can't be null";
+ }
+ if ($this->container['id'] === null) {
+ $invalidProperties[] = "'id' can't be null";
+ }
+ if ($this->container['timestamp'] === null) {
+ $invalidProperties[] = "'timestamp' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets url
+ *
+ * @return string
+ */
+ public function getUrl()
+ {
+ return $this->container['url'];
+ }
+
+ /**
+ * Sets url
+ *
+ * @param string $url url
+ *
+ * @return self
+ */
+ public function setUrl($url)
+ {
+ if (is_null($url)) {
+ throw new \InvalidArgumentException('non-nullable url cannot be null');
+ }
+ if ((mb_strlen($url) > 65536)) {
+ throw new \InvalidArgumentException('invalid length for $url when calling MessageAttemptEndpointOut., must be smaller than or equal to 65536.');
+ }
+ if ((mb_strlen($url) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $url when calling MessageAttemptEndpointOut., must be bigger than or equal to 1.');
+ }
+
+ $this->container['url'] = $url;
+
+ return $this;
+ }
+
+ /**
+ * Gets response
+ *
+ * @return string
+ */
+ public function getResponse()
+ {
+ return $this->container['response'];
+ }
+
+ /**
+ * Sets response
+ *
+ * @param string $response response
+ *
+ * @return self
+ */
+ public function setResponse($response)
+ {
+ if (is_null($response)) {
+ throw new \InvalidArgumentException('non-nullable response cannot be null');
+ }
+ $this->container['response'] = $response;
+
+ return $this;
+ }
+
+ /**
+ * Gets response_status_code
+ *
+ * @return int
+ */
+ public function getResponseStatusCode()
+ {
+ return $this->container['response_status_code'];
+ }
+
+ /**
+ * Sets response_status_code
+ *
+ * @param int $response_status_code response_status_code
+ *
+ * @return self
+ */
+ public function setResponseStatusCode($response_status_code)
+ {
+ if (is_null($response_status_code)) {
+ throw new \InvalidArgumentException('non-nullable response_status_code cannot be null');
+ }
+ $this->container['response_status_code'] = $response_status_code;
+
+ return $this;
+ }
+
+ /**
+ * Gets status
+ *
+ * @return \Svix\ApiClient\Model\MessageStatus
+ */
+ public function getStatus()
+ {
+ return $this->container['status'];
+ }
+
+ /**
+ * Sets status
+ *
+ * @param \Svix\ApiClient\Model\MessageStatus $status status
+ *
+ * @return self
+ */
+ public function setStatus($status)
+ {
+ if (is_null($status)) {
+ throw new \InvalidArgumentException('non-nullable status cannot be null');
+ }
+ $this->container['status'] = $status;
+
+ return $this;
+ }
+
+ /**
+ * Gets trigger_type
+ *
+ * @return \Svix\ApiClient\Model\MessageAttemptTriggerType
+ */
+ public function getTriggerType()
+ {
+ return $this->container['trigger_type'];
+ }
+
+ /**
+ * Sets trigger_type
+ *
+ * @param \Svix\ApiClient\Model\MessageAttemptTriggerType $trigger_type trigger_type
+ *
+ * @return self
+ */
+ public function setTriggerType($trigger_type)
+ {
+ if (is_null($trigger_type)) {
+ throw new \InvalidArgumentException('non-nullable trigger_type cannot be null');
+ }
+ $this->container['trigger_type'] = $trigger_type;
+
+ return $this;
+ }
+
+ /**
+ * Gets msg_id
+ *
+ * @return string
+ */
+ public function getMsgId()
+ {
+ return $this->container['msg_id'];
+ }
+
+ /**
+ * Sets msg_id
+ *
+ * @param string $msg_id The msg's ID
+ *
+ * @return self
+ */
+ public function setMsgId($msg_id)
+ {
+ if (is_null($msg_id)) {
+ throw new \InvalidArgumentException('non-nullable msg_id cannot be null');
+ }
+ $this->container['msg_id'] = $msg_id;
+
+ return $this;
+ }
+
+ /**
+ * Gets endpoint_id
+ *
+ * @return string
+ */
+ public function getEndpointId()
+ {
+ return $this->container['endpoint_id'];
+ }
+
+ /**
+ * Sets endpoint_id
+ *
+ * @param string $endpoint_id The ep's ID
+ *
+ * @return self
+ */
+ public function setEndpointId($endpoint_id)
+ {
+ if (is_null($endpoint_id)) {
+ throw new \InvalidArgumentException('non-nullable endpoint_id cannot be null');
+ }
+ $this->container['endpoint_id'] = $endpoint_id;
+
+ return $this;
+ }
+
+ /**
+ * Gets id
+ *
+ * @return string
+ */
+ public function getId()
+ {
+ return $this->container['id'];
+ }
+
+ /**
+ * Sets id
+ *
+ * @param string $id The attempt's ID
+ *
+ * @return self
+ */
+ public function setId($id)
+ {
+ if (is_null($id)) {
+ throw new \InvalidArgumentException('non-nullable id cannot be null');
+ }
+ $this->container['id'] = $id;
+
+ return $this;
+ }
+
+ /**
+ * Gets timestamp
+ *
+ * @return \DateTime
+ */
+ public function getTimestamp()
+ {
+ return $this->container['timestamp'];
+ }
+
+ /**
+ * Sets timestamp
+ *
+ * @param \DateTime $timestamp timestamp
+ *
+ * @return self
+ */
+ public function setTimestamp($timestamp)
+ {
+ if (is_null($timestamp)) {
+ throw new \InvalidArgumentException('non-nullable timestamp cannot be null');
+ }
+ $this->container['timestamp'] = $timestamp;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/MessageAttemptExhaustedEvent.php b/lib/Model/MessageAttemptExhaustedEvent.php
new file mode 100644
index 0000000..ad3f38f
--- /dev/null
+++ b/lib/Model/MessageAttemptExhaustedEvent.php
@@ -0,0 +1,482 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * MessageAttemptExhaustedEvent Class Doc Comment
+ *
+ * @category Class
+ * @description Sent when a message delivery has failed (all of the retry attempts have been exhausted).
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class MessageAttemptExhaustedEvent implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'MessageAttemptExhaustedEvent';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\MessageAttemptExhaustedEventData',
+ 'type' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'type' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'type' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'type' => 'type'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'type' => 'setType'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'type' => 'getType'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+ public const TYPE_MESSAGE_ATTEMPT_EXHAUSTED = 'message.attempt.exhausted';
+
+ /**
+ * Gets allowable values of the enum
+ *
+ * @return string[]
+ */
+ public function getTypeAllowableValues()
+ {
+ return [
+ self::TYPE_MESSAGE_ATTEMPT_EXHAUSTED,
+ ];
+ }
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('type', $data ?? [], 'message.attempt.exhausted');
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['type'] === null) {
+ $invalidProperties[] = "'type' can't be null";
+ }
+ $allowedValues = $this->getTypeAllowableValues();
+ if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
+ $invalidProperties[] = sprintf(
+ "invalid value '%s' for 'type', must be one of '%s'",
+ $this->container['type'],
+ implode("', '", $allowedValues)
+ );
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\MessageAttemptExhaustedEventData
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\MessageAttemptExhaustedEventData $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets type
+ *
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->container['type'];
+ }
+
+ /**
+ * Sets type
+ *
+ * @param string $type type
+ *
+ * @return self
+ */
+ public function setType($type)
+ {
+ if (is_null($type)) {
+ throw new \InvalidArgumentException('non-nullable type cannot be null');
+ }
+ $allowedValues = $this->getTypeAllowableValues();
+ if (!in_array($type, $allowedValues, true)) {
+ throw new \InvalidArgumentException(
+ sprintf(
+ "Invalid value '%s' for 'type', must be one of '%s'",
+ $type,
+ implode("', '", $allowedValues)
+ )
+ );
+ }
+ $this->container['type'] = $type;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/MessageAttemptExhaustedEventData.php b/lib/Model/MessageAttemptExhaustedEventData.php
new file mode 100644
index 0000000..1cc64fd
--- /dev/null
+++ b/lib/Model/MessageAttemptExhaustedEventData.php
@@ -0,0 +1,636 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * MessageAttemptExhaustedEventData Class Doc Comment
+ *
+ * @category Class
+ * @description Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a \"message.attempt.exhausted\" type or after it's failed four times as a \"message.attempt.failing\" event.
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class MessageAttemptExhaustedEventData implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'MessageAttemptExhaustedEventData';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'app_id' => 'string',
+ 'app_uid' => 'string',
+ 'msg_id' => 'string',
+ 'msg_event_id' => 'string',
+ 'endpoint_id' => 'string',
+ 'last_attempt' => '\Svix\ApiClient\Model\MessageAttemptFailedData'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'app_id' => null,
+ 'app_uid' => null,
+ 'msg_id' => null,
+ 'msg_event_id' => null,
+ 'endpoint_id' => null,
+ 'last_attempt' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'app_id' => false,
+ 'app_uid' => false,
+ 'msg_id' => false,
+ 'msg_event_id' => false,
+ 'endpoint_id' => false,
+ 'last_attempt' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'app_id' => 'appId',
+ 'app_uid' => 'appUid',
+ 'msg_id' => 'msgId',
+ 'msg_event_id' => 'msgEventId',
+ 'endpoint_id' => 'endpointId',
+ 'last_attempt' => 'lastAttempt'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'app_id' => 'setAppId',
+ 'app_uid' => 'setAppUid',
+ 'msg_id' => 'setMsgId',
+ 'msg_event_id' => 'setMsgEventId',
+ 'endpoint_id' => 'setEndpointId',
+ 'last_attempt' => 'setLastAttempt'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'app_id' => 'getAppId',
+ 'app_uid' => 'getAppUid',
+ 'msg_id' => 'getMsgId',
+ 'msg_event_id' => 'getMsgEventId',
+ 'endpoint_id' => 'getEndpointId',
+ 'last_attempt' => 'getLastAttempt'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('app_id', $data ?? [], null);
+ $this->setIfExists('app_uid', $data ?? [], null);
+ $this->setIfExists('msg_id', $data ?? [], null);
+ $this->setIfExists('msg_event_id', $data ?? [], null);
+ $this->setIfExists('endpoint_id', $data ?? [], null);
+ $this->setIfExists('last_attempt', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['app_id'] === null) {
+ $invalidProperties[] = "'app_id' can't be null";
+ }
+ if (!is_null($this->container['app_uid']) && (mb_strlen($this->container['app_uid']) > 256)) {
+ $invalidProperties[] = "invalid value for 'app_uid', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['app_uid']) && (mb_strlen($this->container['app_uid']) < 1)) {
+ $invalidProperties[] = "invalid value for 'app_uid', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['app_uid']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['app_uid'])) {
+ $invalidProperties[] = "invalid value for 'app_uid', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ if ($this->container['msg_id'] === null) {
+ $invalidProperties[] = "'msg_id' can't be null";
+ }
+ if (!is_null($this->container['msg_event_id']) && (mb_strlen($this->container['msg_event_id']) > 256)) {
+ $invalidProperties[] = "invalid value for 'msg_event_id', the character length must be smaller than or equal to 256.";
+ }
+
+ if (!is_null($this->container['msg_event_id']) && (mb_strlen($this->container['msg_event_id']) < 1)) {
+ $invalidProperties[] = "invalid value for 'msg_event_id', the character length must be bigger than or equal to 1.";
+ }
+
+ if (!is_null($this->container['msg_event_id']) && !preg_match("/^[a-zA-Z0-9\\-_.]+$/", $this->container['msg_event_id'])) {
+ $invalidProperties[] = "invalid value for 'msg_event_id', must be conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.";
+ }
+
+ if ($this->container['endpoint_id'] === null) {
+ $invalidProperties[] = "'endpoint_id' can't be null";
+ }
+ if ($this->container['last_attempt'] === null) {
+ $invalidProperties[] = "'last_attempt' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets app_id
+ *
+ * @return string
+ */
+ public function getAppId()
+ {
+ return $this->container['app_id'];
+ }
+
+ /**
+ * Sets app_id
+ *
+ * @param string $app_id The app's ID
+ *
+ * @return self
+ */
+ public function setAppId($app_id)
+ {
+ if (is_null($app_id)) {
+ throw new \InvalidArgumentException('non-nullable app_id cannot be null');
+ }
+ $this->container['app_id'] = $app_id;
+
+ return $this;
+ }
+
+ /**
+ * Gets app_uid
+ *
+ * @return string|null
+ */
+ public function getAppUid()
+ {
+ return $this->container['app_uid'];
+ }
+
+ /**
+ * Sets app_uid
+ *
+ * @param string|null $app_uid The app's UID
+ *
+ * @return self
+ */
+ public function setAppUid($app_uid)
+ {
+ if (is_null($app_uid)) {
+ throw new \InvalidArgumentException('non-nullable app_uid cannot be null');
+ }
+ if ((mb_strlen($app_uid) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $app_uid when calling MessageAttemptExhaustedEventData., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($app_uid) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $app_uid when calling MessageAttemptExhaustedEventData., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($app_uid)))) {
+ throw new \InvalidArgumentException("invalid value for \$app_uid when calling MessageAttemptExhaustedEventData., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['app_uid'] = $app_uid;
+
+ return $this;
+ }
+
+ /**
+ * Gets msg_id
+ *
+ * @return string
+ */
+ public function getMsgId()
+ {
+ return $this->container['msg_id'];
+ }
+
+ /**
+ * Sets msg_id
+ *
+ * @param string $msg_id The msg's ID
+ *
+ * @return self
+ */
+ public function setMsgId($msg_id)
+ {
+ if (is_null($msg_id)) {
+ throw new \InvalidArgumentException('non-nullable msg_id cannot be null');
+ }
+ $this->container['msg_id'] = $msg_id;
+
+ return $this;
+ }
+
+ /**
+ * Gets msg_event_id
+ *
+ * @return string|null
+ */
+ public function getMsgEventId()
+ {
+ return $this->container['msg_event_id'];
+ }
+
+ /**
+ * Sets msg_event_id
+ *
+ * @param string|null $msg_event_id The msg's UID
+ *
+ * @return self
+ */
+ public function setMsgEventId($msg_event_id)
+ {
+ if (is_null($msg_event_id)) {
+ throw new \InvalidArgumentException('non-nullable msg_event_id cannot be null');
+ }
+ if ((mb_strlen($msg_event_id) > 256)) {
+ throw new \InvalidArgumentException('invalid length for $msg_event_id when calling MessageAttemptExhaustedEventData., must be smaller than or equal to 256.');
+ }
+ if ((mb_strlen($msg_event_id) < 1)) {
+ throw new \InvalidArgumentException('invalid length for $msg_event_id when calling MessageAttemptExhaustedEventData., must be bigger than or equal to 1.');
+ }
+ if ((!preg_match("/^[a-zA-Z0-9\\-_.]+$/", ObjectSerializer::toString($msg_event_id)))) {
+ throw new \InvalidArgumentException("invalid value for \$msg_event_id when calling MessageAttemptExhaustedEventData., must conform to the pattern /^[a-zA-Z0-9\\-_.]+$/.");
+ }
+
+ $this->container['msg_event_id'] = $msg_event_id;
+
+ return $this;
+ }
+
+ /**
+ * Gets endpoint_id
+ *
+ * @return string
+ */
+ public function getEndpointId()
+ {
+ return $this->container['endpoint_id'];
+ }
+
+ /**
+ * Sets endpoint_id
+ *
+ * @param string $endpoint_id The ep's ID
+ *
+ * @return self
+ */
+ public function setEndpointId($endpoint_id)
+ {
+ if (is_null($endpoint_id)) {
+ throw new \InvalidArgumentException('non-nullable endpoint_id cannot be null');
+ }
+ $this->container['endpoint_id'] = $endpoint_id;
+
+ return $this;
+ }
+
+ /**
+ * Gets last_attempt
+ *
+ * @return \Svix\ApiClient\Model\MessageAttemptFailedData
+ */
+ public function getLastAttempt()
+ {
+ return $this->container['last_attempt'];
+ }
+
+ /**
+ * Sets last_attempt
+ *
+ * @param \Svix\ApiClient\Model\MessageAttemptFailedData $last_attempt last_attempt
+ *
+ * @return self
+ */
+ public function setLastAttempt($last_attempt)
+ {
+ if (is_null($last_attempt)) {
+ throw new \InvalidArgumentException('non-nullable last_attempt cannot be null');
+ }
+ $this->container['last_attempt'] = $last_attempt;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/MessageAttemptFailedData.php b/lib/Model/MessageAttemptFailedData.php
new file mode 100644
index 0000000..94700d7
--- /dev/null
+++ b/lib/Model/MessageAttemptFailedData.php
@@ -0,0 +1,486 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * MessageAttemptFailedData Class Doc Comment
+ *
+ * @category Class
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class MessageAttemptFailedData implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'MessageAttemptFailedData';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'id' => 'string',
+ 'response_status_code' => 'int',
+ 'timestamp' => '\DateTime'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'id' => null,
+ 'response_status_code' => 'int16',
+ 'timestamp' => 'date-time'
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'id' => false,
+ 'response_status_code' => false,
+ 'timestamp' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'id' => 'id',
+ 'response_status_code' => 'responseStatusCode',
+ 'timestamp' => 'timestamp'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'id' => 'setId',
+ 'response_status_code' => 'setResponseStatusCode',
+ 'timestamp' => 'setTimestamp'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'id' => 'getId',
+ 'response_status_code' => 'getResponseStatusCode',
+ 'timestamp' => 'getTimestamp'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('id', $data ?? [], null);
+ $this->setIfExists('response_status_code', $data ?? [], null);
+ $this->setIfExists('timestamp', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['id'] === null) {
+ $invalidProperties[] = "'id' can't be null";
+ }
+ if ($this->container['response_status_code'] === null) {
+ $invalidProperties[] = "'response_status_code' can't be null";
+ }
+ if ($this->container['timestamp'] === null) {
+ $invalidProperties[] = "'timestamp' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets id
+ *
+ * @return string
+ */
+ public function getId()
+ {
+ return $this->container['id'];
+ }
+
+ /**
+ * Sets id
+ *
+ * @param string $id The attempt's ID
+ *
+ * @return self
+ */
+ public function setId($id)
+ {
+ if (is_null($id)) {
+ throw new \InvalidArgumentException('non-nullable id cannot be null');
+ }
+ $this->container['id'] = $id;
+
+ return $this;
+ }
+
+ /**
+ * Gets response_status_code
+ *
+ * @return int
+ */
+ public function getResponseStatusCode()
+ {
+ return $this->container['response_status_code'];
+ }
+
+ /**
+ * Sets response_status_code
+ *
+ * @param int $response_status_code response_status_code
+ *
+ * @return self
+ */
+ public function setResponseStatusCode($response_status_code)
+ {
+ if (is_null($response_status_code)) {
+ throw new \InvalidArgumentException('non-nullable response_status_code cannot be null');
+ }
+ $this->container['response_status_code'] = $response_status_code;
+
+ return $this;
+ }
+
+ /**
+ * Gets timestamp
+ *
+ * @return \DateTime
+ */
+ public function getTimestamp()
+ {
+ return $this->container['timestamp'];
+ }
+
+ /**
+ * Sets timestamp
+ *
+ * @param \DateTime $timestamp timestamp
+ *
+ * @return self
+ */
+ public function setTimestamp($timestamp)
+ {
+ if (is_null($timestamp)) {
+ throw new \InvalidArgumentException('non-nullable timestamp cannot be null');
+ }
+ $this->container['timestamp'] = $timestamp;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/MessageAttemptFailingEvent.php b/lib/Model/MessageAttemptFailingEvent.php
new file mode 100644
index 0000000..60d1493
--- /dev/null
+++ b/lib/Model/MessageAttemptFailingEvent.php
@@ -0,0 +1,482 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * MessageAttemptFailingEvent Class Doc Comment
+ *
+ * @category Class
+ * @description Sent after a message has been failing for a few times. It's sent on the fourth failure. It complements `message.attempt.exhausted` which is sent after the last failure.
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class MessageAttemptFailingEvent implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'MessageAttemptFailingEvent';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'data' => '\Svix\ApiClient\Model\MessageAttemptFailingEventData',
+ 'type' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'data' => null,
+ 'type' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'data' => false,
+ 'type' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'data' => 'data',
+ 'type' => 'type'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'data' => 'setData',
+ 'type' => 'setType'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'data' => 'getData',
+ 'type' => 'getType'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+ public const TYPE_MESSAGE_ATTEMPT_FAILING = 'message.attempt.failing';
+
+ /**
+ * Gets allowable values of the enum
+ *
+ * @return string[]
+ */
+ public function getTypeAllowableValues()
+ {
+ return [
+ self::TYPE_MESSAGE_ATTEMPT_FAILING,
+ ];
+ }
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('data', $data ?? [], null);
+ $this->setIfExists('type', $data ?? [], 'message.attempt.failing');
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['data'] === null) {
+ $invalidProperties[] = "'data' can't be null";
+ }
+ if ($this->container['type'] === null) {
+ $invalidProperties[] = "'type' can't be null";
+ }
+ $allowedValues = $this->getTypeAllowableValues();
+ if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {
+ $invalidProperties[] = sprintf(
+ "invalid value '%s' for 'type', must be one of '%s'",
+ $this->container['type'],
+ implode("', '", $allowedValues)
+ );
+ }
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets data
+ *
+ * @return \Svix\ApiClient\Model\MessageAttemptFailingEventData
+ */
+ public function getData()
+ {
+ return $this->container['data'];
+ }
+
+ /**
+ * Sets data
+ *
+ * @param \Svix\ApiClient\Model\MessageAttemptFailingEventData $data data
+ *
+ * @return self
+ */
+ public function setData($data)
+ {
+ if (is_null($data)) {
+ throw new \InvalidArgumentException('non-nullable data cannot be null');
+ }
+ $this->container['data'] = $data;
+
+ return $this;
+ }
+
+ /**
+ * Gets type
+ *
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->container['type'];
+ }
+
+ /**
+ * Sets type
+ *
+ * @param string $type type
+ *
+ * @return self
+ */
+ public function setType($type)
+ {
+ if (is_null($type)) {
+ throw new \InvalidArgumentException('non-nullable type cannot be null');
+ }
+ $allowedValues = $this->getTypeAllowableValues();
+ if (!in_array($type, $allowedValues, true)) {
+ throw new \InvalidArgumentException(
+ sprintf(
+ "Invalid value '%s' for 'type', must be one of '%s'",
+ $type,
+ implode("', '", $allowedValues)
+ )
+ );
+ }
+ $this->container['type'] = $type;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/MessageAttemptFailingEventData.php b/lib/Model/MessageAttemptFailingEventData.php
new file mode 100644
index 0000000..0d7e250
--- /dev/null
+++ b/lib/Model/MessageAttemptFailingEventData.php
@@ -0,0 +1,636 @@
+ ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
+ *
+ * The version of the OpenAPI document: 1.13.0
+ * Generated by: https://openapi-generator.tech
+ * OpenAPI Generator version: 7.1.0-SNAPSHOT
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace Svix\ApiClient\Model;
+
+use \ArrayAccess;
+use \Svix\ApiClient\ObjectSerializer;
+
+/**
+ * MessageAttemptFailingEventData Class Doc Comment
+ *
+ * @category Class
+ * @description Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a \"message.attempt.exhausted\" type or after it's failed four times as a \"message.attempt.failing\" event.
+ * @package Svix\ApiClient
+ * @author OpenAPI Generator team
+ * @link https://openapi-generator.tech
+ * @implements \ArrayAccess
+ */
+class MessageAttemptFailingEventData implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'MessageAttemptFailingEventData';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'app_id' => 'string',
+ 'app_uid' => 'string',
+ 'msg_id' => 'string',
+ 'msg_event_id' => 'string',
+ 'endpoint_id' => 'string',
+ 'last_attempt' => '\Svix\ApiClient\Model\MessageAttemptFailedData'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array