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 + */ + 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 MessageAttemptFailingEventData., must be smaller than or equal to 256.'); + } + if ((mb_strlen($app_uid) < 1)) { + throw new \InvalidArgumentException('invalid length for $app_uid when calling MessageAttemptFailingEventData., 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 MessageAttemptFailingEventData., 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 MessageAttemptFailingEventData., 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 MessageAttemptFailingEventData., 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 MessageAttemptFailingEventData., 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/MessageAttemptOut.php b/lib/Model/MessageAttemptOut.php new file mode 100644 index 0000000..e2f33c9 --- /dev/null +++ b/lib/Model/MessageAttemptOut.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; + +/** + * MessageAttemptOut Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class MessageAttemptOut implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MessageAttemptOut'; + + /** + * 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 MessageAttemptOut., must be smaller than or equal to 65536.'); + } + if ((mb_strlen($url) < 1)) { + throw new \InvalidArgumentException('invalid length for $url when calling MessageAttemptOut., 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/MessageAttemptRecoveredEvent.php b/lib/Model/MessageAttemptRecoveredEvent.php new file mode 100644 index 0000000..e4907cf --- /dev/null +++ b/lib/Model/MessageAttemptRecoveredEvent.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; + +/** + * MessageAttemptRecoveredEvent Class Doc Comment + * + * @category Class + * @description Sent on a successful dispatch after an earlier failure op webhook has already been sent. + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class MessageAttemptRecoveredEvent implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MessageAttemptRecoveredEvent'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Svix\ApiClient\Model\MessageAttemptRecoveredEventData', + '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_RECOVERED = 'message.attempt.recovered'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_MESSAGE_ATTEMPT_RECOVERED, + ]; + } + + /** + * 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.recovered'); + } + + /** + * 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\MessageAttemptRecoveredEventData + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Svix\ApiClient\Model\MessageAttemptRecoveredEventData $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/MessageAttemptRecoveredEventData.php b/lib/Model/MessageAttemptRecoveredEventData.php new file mode 100644 index 0000000..049c1c1 --- /dev/null +++ b/lib/Model/MessageAttemptRecoveredEventData.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; + +/** + * MessageAttemptRecoveredEventData 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 MessageAttemptRecoveredEventData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MessageAttemptRecoveredEventData'; + + /** + * 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 MessageAttemptRecoveredEventData., must be smaller than or equal to 256.'); + } + if ((mb_strlen($app_uid) < 1)) { + throw new \InvalidArgumentException('invalid length for $app_uid when calling MessageAttemptRecoveredEventData., 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 MessageAttemptRecoveredEventData., 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 MessageAttemptRecoveredEventData., 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 MessageAttemptRecoveredEventData., 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 MessageAttemptRecoveredEventData., 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/MessageAttemptTriggerType.php b/lib/Model/MessageAttemptTriggerType.php new file mode 100644 index 0000000..51b9830 --- /dev/null +++ b/lib/Model/MessageAttemptTriggerType.php @@ -0,0 +1,63 @@ + ## 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; + +/** + * MessageAttemptTriggerType Class Doc Comment + * + * @category Class + * @description The reason an attempt was made: - Scheduled = 0 - Manual = 1 + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class MessageAttemptTriggerType +{ + /** + * Possible values of this enum + */ + public const NUMBER_Scheduled = 0; + + public const NUMBER_Manual = 1; + + /** + * Gets allowable values of the enum + * @return string[] + */ + public static function getAllowableEnumValues() + { + return [ + self::NUMBER_Scheduled, + self::NUMBER_Manual + ]; + } +} + + diff --git a/lib/Model/MessageBroadcastIn.php b/lib/Model/MessageBroadcastIn.php new file mode 100644 index 0000000..7bfdc42 --- /dev/null +++ b/lib/Model/MessageBroadcastIn.php @@ -0,0 +1,604 @@ + ## 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; + +/** + * MessageBroadcastIn Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class MessageBroadcastIn implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MessageBroadcastIn'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'event_id' => 'string', + 'event_type' => 'string', + 'payload' => 'object', + 'channels' => 'string[]', + 'payload_retention_period' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'event_id' => null, + 'event_type' => null, + 'payload' => null, + 'channels' => null, + 'payload_retention_period' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'event_id' => false, + 'event_type' => false, + 'payload' => false, + 'channels' => false, + 'payload_retention_period' => 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_id' => 'eventId', + 'event_type' => 'eventType', + 'payload' => 'payload', + 'channels' => 'channels', + 'payload_retention_period' => 'payloadRetentionPeriod' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'event_id' => 'setEventId', + 'event_type' => 'setEventType', + 'payload' => 'setPayload', + 'channels' => 'setChannels', + 'payload_retention_period' => 'setPayloadRetentionPeriod' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'event_id' => 'getEventId', + 'event_type' => 'getEventType', + 'payload' => 'getPayload', + 'channels' => 'getChannels', + 'payload_retention_period' => 'getPayloadRetentionPeriod' + ]; + + /** + * 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_id', $data ?? [], null); + $this->setIfExists('event_type', $data ?? [], null); + $this->setIfExists('payload', $data ?? [], null); + $this->setIfExists('channels', $data ?? [], null); + $this->setIfExists('payload_retention_period', $data ?? [], 90); + } + + /** + * 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['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 (!is_null($this->container['payload_retention_period']) && ($this->container['payload_retention_period'] > 90)) { + $invalidProperties[] = "invalid value for 'payload_retention_period', must be smaller than or equal to 90."; + } + + if (!is_null($this->container['payload_retention_period']) && ($this->container['payload_retention_period'] < 5)) { + $invalidProperties[] = "invalid value for 'payload_retention_period', must be bigger than or equal to 5."; + } + + 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_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 MessageBroadcastIn., must be smaller than or equal to 256.'); + } + if ((mb_strlen($event_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $event_id when calling MessageBroadcastIn., 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 MessageBroadcastIn., 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 MessageBroadcastIn., 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 MessageBroadcastIn., 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 payload_retention_period + * + * @return int|null + */ + public function getPayloadRetentionPeriod() + { + return $this->container['payload_retention_period']; + } + + /** + * Sets payload_retention_period + * + * @param int|null $payload_retention_period payload_retention_period + * + * @return self + */ + public function setPayloadRetentionPeriod($payload_retention_period) + { + if (is_null($payload_retention_period)) { + throw new \InvalidArgumentException('non-nullable payload_retention_period cannot be null'); + } + + if (($payload_retention_period > 90)) { + throw new \InvalidArgumentException('invalid value for $payload_retention_period when calling MessageBroadcastIn., must be smaller than or equal to 90.'); + } + if (($payload_retention_period < 5)) { + throw new \InvalidArgumentException('invalid value for $payload_retention_period when calling MessageBroadcastIn., must be bigger than or equal to 5.'); + } + + $this->container['payload_retention_period'] = $payload_retention_period; + + 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/MessageBroadcastOut.php b/lib/Model/MessageBroadcastOut.php new file mode 100644 index 0000000..303119d --- /dev/null +++ b/lib/Model/MessageBroadcastOut.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; + +/** + * MessageBroadcastOut Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class MessageBroadcastOut implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MessageBroadcastOut'; + + /** + * 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/MessageEndpointOut.php b/lib/Model/MessageEndpointOut.php new file mode 100644 index 0000000..42ae1e4 --- /dev/null +++ b/lib/Model/MessageEndpointOut.php @@ -0,0 +1,895 @@ + ## 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; + +/** + * MessageEndpointOut Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class MessageEndpointOut implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MessageEndpointOut'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'status' => '\Svix\ApiClient\Model\MessageStatus', + 'next_attempt' => '\DateTime', + '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, + 'status' => null, + 'next_attempt' => 'date-time', + '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, + 'status' => false, + 'next_attempt' => false, + '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', + 'status' => 'status', + 'next_attempt' => 'nextAttempt', + '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', + 'status' => 'setStatus', + 'next_attempt' => 'setNextAttempt', + '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', + 'status' => 'getStatus', + 'next_attempt' => 'getNextAttempt', + '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('status', $data ?? [], null); + $this->setIfExists('next_attempt', $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['status'] === null) { + $invalidProperties[] = "'status' 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 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 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 MessageEndpointOut., 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 MessageEndpointOut., must be smaller than or equal to 256.'); + } + if ((mb_strlen($uid) < 1)) { + throw new \InvalidArgumentException('invalid length for $uid when calling MessageEndpointOut., 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 MessageEndpointOut., 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 MessageEndpointOut., must be smaller than or equal to 65536.'); + } + if ((mb_strlen($url) < 1)) { + throw new \InvalidArgumentException('invalid length for $url when calling MessageEndpointOut., 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 MessageEndpointOut., 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/MessageIn.php b/lib/Model/MessageIn.php new file mode 100644 index 0000000..7915fd3 --- /dev/null +++ b/lib/Model/MessageIn.php @@ -0,0 +1,638 @@ + ## 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; + +/** + * MessageIn Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class MessageIn implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MessageIn'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'event_id' => 'string', + 'event_type' => 'string', + 'payload' => 'object', + 'channels' => 'string[]', + 'payload_retention_period' => 'int', + 'application' => '\Svix\ApiClient\Model\ApplicationIn' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'event_id' => null, + 'event_type' => null, + 'payload' => null, + 'channels' => null, + 'payload_retention_period' => 'int64', + 'application' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'event_id' => false, + 'event_type' => false, + 'payload' => false, + 'channels' => false, + 'payload_retention_period' => false, + 'application' => 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_id' => 'eventId', + 'event_type' => 'eventType', + 'payload' => 'payload', + 'channels' => 'channels', + 'payload_retention_period' => 'payloadRetentionPeriod', + 'application' => 'application' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'event_id' => 'setEventId', + 'event_type' => 'setEventType', + 'payload' => 'setPayload', + 'channels' => 'setChannels', + 'payload_retention_period' => 'setPayloadRetentionPeriod', + 'application' => 'setApplication' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'event_id' => 'getEventId', + 'event_type' => 'getEventType', + 'payload' => 'getPayload', + 'channels' => 'getChannels', + 'payload_retention_period' => 'getPayloadRetentionPeriod', + 'application' => 'getApplication' + ]; + + /** + * 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_id', $data ?? [], null); + $this->setIfExists('event_type', $data ?? [], null); + $this->setIfExists('payload', $data ?? [], null); + $this->setIfExists('channels', $data ?? [], null); + $this->setIfExists('payload_retention_period', $data ?? [], 90); + $this->setIfExists('application', $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['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 (!is_null($this->container['payload_retention_period']) && ($this->container['payload_retention_period'] > 90)) { + $invalidProperties[] = "invalid value for 'payload_retention_period', must be smaller than or equal to 90."; + } + + if (!is_null($this->container['payload_retention_period']) && ($this->container['payload_retention_period'] < 5)) { + $invalidProperties[] = "invalid value for 'payload_retention_period', must be bigger than or equal to 5."; + } + + 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_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 MessageIn., must be smaller than or equal to 256.'); + } + if ((mb_strlen($event_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $event_id when calling MessageIn., 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 MessageIn., 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 MessageIn., 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 MessageIn., 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 payload_retention_period + * + * @return int|null + */ + public function getPayloadRetentionPeriod() + { + return $this->container['payload_retention_period']; + } + + /** + * Sets payload_retention_period + * + * @param int|null $payload_retention_period payload_retention_period + * + * @return self + */ + public function setPayloadRetentionPeriod($payload_retention_period) + { + if (is_null($payload_retention_period)) { + throw new \InvalidArgumentException('non-nullable payload_retention_period cannot be null'); + } + + if (($payload_retention_period > 90)) { + throw new \InvalidArgumentException('invalid value for $payload_retention_period when calling MessageIn., must be smaller than or equal to 90.'); + } + if (($payload_retention_period < 5)) { + throw new \InvalidArgumentException('invalid value for $payload_retention_period when calling MessageIn., must be bigger than or equal to 5.'); + } + + $this->container['payload_retention_period'] = $payload_retention_period; + + return $this; + } + + /** + * Gets application + * + * @return \Svix\ApiClient\Model\ApplicationIn|null + */ + public function getApplication() + { + return $this->container['application']; + } + + /** + * Sets application + * + * @param \Svix\ApiClient\Model\ApplicationIn|null $application application + * + * @return self + */ + public function setApplication($application) + { + if (is_null($application)) { + throw new \InvalidArgumentException('non-nullable application cannot be null'); + } + $this->container['application'] = $application; + + 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/MessageOut.php b/lib/Model/MessageOut.php new file mode 100644 index 0000000..d8b13a3 --- /dev/null +++ b/lib/Model/MessageOut.php @@ -0,0 +1,628 @@ + ## 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; + +/** + * MessageOut Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class MessageOut implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MessageOut'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + '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 = [ + '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 = [ + '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 = [ + '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 = [ + '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 = [ + '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('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 (!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 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 MessageOut., must be smaller than or equal to 256.'); + } + if ((mb_strlen($event_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $event_id when calling MessageOut., 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 MessageOut., 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 MessageOut., 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 MessageOut., 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/MessageRawPayloadOut.php b/lib/Model/MessageRawPayloadOut.php new file mode 100644 index 0000000..30b4547 --- /dev/null +++ b/lib/Model/MessageRawPayloadOut.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; + +/** + * MessageRawPayloadOut Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class MessageRawPayloadOut implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MessageRawPayloadOut'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payload' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payload' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + '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 = [ + 'payload' => 'payload' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payload' => 'setPayload' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '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('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['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 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; + } + /** + * 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/MessageStatus.php b/lib/Model/MessageStatus.php new file mode 100644 index 0000000..852863b --- /dev/null +++ b/lib/Model/MessageStatus.php @@ -0,0 +1,69 @@ + ## 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; + +/** + * MessageStatus Class Doc Comment + * + * @category Class + * @description The sending status of the message: - Success = 0 - Pending = 1 - Fail = 2 - Sending = 3 + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class MessageStatus +{ + /** + * Possible values of this enum + */ + public const NUMBER_Success = 0; + + public const NUMBER_Pending = 1; + + public const NUMBER_Fail = 2; + + public const NUMBER_Sending = 3; + + /** + * Gets allowable values of the enum + * @return string[] + */ + public static function getAllowableEnumValues() + { + return [ + self::NUMBER_Success, + self::NUMBER_Pending, + self::NUMBER_Fail, + self::NUMBER_Sending + ]; + } +} + + diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php new file mode 100644 index 0000000..6efafce --- /dev/null +++ b/lib/Model/ModelInterface.php @@ -0,0 +1,111 @@ + ## 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; + +/** + * Interface abstracting model access. + * + * @package Svix\ApiClient\Model + * @author OpenAPI Generator team + */ +interface ModelInterface +{ + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(); + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(); + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(); + + /** + * Array of attributes where the key is the local name, and the value is the original name + * + * @return array + */ + public static function attributeMap(); + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(); + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(); + + /** + * Show all the invalid properties with reasons. + * + * @return array + */ + public function listInvalidProperties(); + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool + */ + public function valid(); + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool; + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool; +} diff --git a/lib/Model/OauthPayloadIn.php b/lib/Model/OauthPayloadIn.php new file mode 100644 index 0000000..3d4b29f --- /dev/null +++ b/lib/Model/OauthPayloadIn.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; + +/** + * OauthPayloadIn Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class OauthPayloadIn implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OauthPayloadIn'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'code' => 'string', + 'redirect_uri' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'code' => null, + 'redirect_uri' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'code' => false, + 'redirect_uri' => 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', + 'redirect_uri' => 'redirectUri' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'redirect_uri' => 'setRedirectUri' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'redirect_uri' => 'getRedirectUri' + ]; + + /** + * 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('redirect_uri', $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['redirect_uri'] === null) { + $invalidProperties[] = "'redirect_uri' 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 redirect_uri + * + * @return string + */ + public function getRedirectUri() + { + return $this->container['redirect_uri']; + } + + /** + * Sets redirect_uri + * + * @param string $redirect_uri redirect_uri + * + * @return self + */ + public function setRedirectUri($redirect_uri) + { + if (is_null($redirect_uri)) { + throw new \InvalidArgumentException('non-nullable redirect_uri cannot be null'); + } + $this->container['redirect_uri'] = $redirect_uri; + + 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/OauthPayloadOut.php b/lib/Model/OauthPayloadOut.php new file mode 100644 index 0000000..984e5d7 --- /dev/null +++ b/lib/Model/OauthPayloadOut.php @@ -0,0 +1,477 @@ + ## 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; + +/** + * OauthPayloadOut Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class OauthPayloadOut implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OauthPayloadOut'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'error' => 'string', + 'incoming_webhook_url' => 'string', + 'channel' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'error' => null, + 'incoming_webhook_url' => 'uri', + 'channel' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'error' => false, + 'incoming_webhook_url' => false, + 'channel' => 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 = [ + 'error' => 'error', + 'incoming_webhook_url' => 'incomingWebhookUrl', + 'channel' => 'channel' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'error' => 'setError', + 'incoming_webhook_url' => 'setIncomingWebhookUrl', + 'channel' => 'setChannel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'error' => 'getError', + 'incoming_webhook_url' => 'getIncomingWebhookUrl', + 'channel' => 'getChannel' + ]; + + /** + * 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('error', $data ?? [], null); + $this->setIfExists('incoming_webhook_url', $data ?? [], null); + $this->setIfExists('channel', $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 error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error error + * + * @return self + */ + public function setError($error) + { + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets incoming_webhook_url + * + * @return string|null + */ + public function getIncomingWebhookUrl() + { + return $this->container['incoming_webhook_url']; + } + + /** + * Sets incoming_webhook_url + * + * @param string|null $incoming_webhook_url incoming_webhook_url + * + * @return self + */ + public function setIncomingWebhookUrl($incoming_webhook_url) + { + if (is_null($incoming_webhook_url)) { + throw new \InvalidArgumentException('non-nullable incoming_webhook_url cannot be null'); + } + $this->container['incoming_webhook_url'] = $incoming_webhook_url; + + return $this; + } + + /** + * Gets channel + * + * @return string|null + */ + public function getChannel() + { + return $this->container['channel']; + } + + /** + * Sets channel + * + * @param string|null $channel channel + * + * @return self + */ + public function setChannel($channel) + { + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; + + 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/OneTimeTokenIn.php b/lib/Model/OneTimeTokenIn.php new file mode 100644 index 0000000..f2ebe26 --- /dev/null +++ b/lib/Model/OneTimeTokenIn.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; + +/** + * OneTimeTokenIn Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class OneTimeTokenIn implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OneTimeTokenIn'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'one_time_token' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'one_time_token' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'one_time_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 = [ + 'one_time_token' => 'oneTimeToken' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'one_time_token' => 'setOneTimeToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'one_time_token' => 'getOneTimeToken' + ]; + + /** + * 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('one_time_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['one_time_token'] === null) { + $invalidProperties[] = "'one_time_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 one_time_token + * + * @return string + */ + public function getOneTimeToken() + { + return $this->container['one_time_token']; + } + + /** + * Sets one_time_token + * + * @param string $one_time_token one_time_token + * + * @return self + */ + public function setOneTimeToken($one_time_token) + { + if (is_null($one_time_token)) { + throw new \InvalidArgumentException('non-nullable one_time_token cannot be null'); + } + $this->container['one_time_token'] = $one_time_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/OneTimeTokenOut.php b/lib/Model/OneTimeTokenOut.php new file mode 100644 index 0000000..605da9f --- /dev/null +++ b/lib/Model/OneTimeTokenOut.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; + +/** + * OneTimeTokenOut Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class OneTimeTokenOut implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OneTimeTokenOut'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'token' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'token' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + '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 = [ + 'token' => 'token' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'token' => 'setToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '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('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['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 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/Ordering.php b/lib/Model/Ordering.php new file mode 100644 index 0000000..5a1be4b --- /dev/null +++ b/lib/Model/Ordering.php @@ -0,0 +1,63 @@ + ## 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; + +/** + * Ordering Class Doc Comment + * + * @category Class + * @description Defines the ordering in a listing of results. + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class Ordering +{ + /** + * Possible values of this enum + */ + public const ASCENDING = 'ascending'; + + public const DESCENDING = 'descending'; + + /** + * Gets allowable values of the enum + * @return string[] + */ + public static function getAllowableEnumValues() + { + return [ + self::ASCENDING, + self::DESCENDING + ]; + } +} + + diff --git a/lib/Model/RecoverIn.php b/lib/Model/RecoverIn.php new file mode 100644 index 0000000..aa24cf6 --- /dev/null +++ b/lib/Model/RecoverIn.php @@ -0,0 +1,446 @@ + ## 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; + +/** + * RecoverIn Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class RecoverIn implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RecoverIn'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'since' => '\DateTime', + 'until' => '\DateTime' + ]; + + /** + * 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' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'since' => false, + 'until' => 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' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'since' => 'setSince', + 'until' => 'setUntil' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'since' => 'getSince', + 'until' => 'getUntil' + ]; + + /** + * 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); + } + + /** + * 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"; + } + 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|null + */ + public function getUntil() + { + return $this->container['until']; + } + + /** + * Sets until + * + * @param \DateTime|null $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; + } + /** + * 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/RecoverOut.php b/lib/Model/RecoverOut.php new file mode 100644 index 0000000..14b5f39 --- /dev/null +++ b/lib/Model/RecoverOut.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; + +/** + * RecoverOut Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class RecoverOut implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RecoverOut'; + + /** + * 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/ReplayIn.php b/lib/Model/ReplayIn.php new file mode 100644 index 0000000..02e4879 --- /dev/null +++ b/lib/Model/ReplayIn.php @@ -0,0 +1,446 @@ + ## 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; + +/** + * ReplayIn Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ReplayIn implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ReplayIn'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'since' => '\DateTime', + 'until' => '\DateTime' + ]; + + /** + * 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' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'since' => false, + 'until' => 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' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'since' => 'setSince', + 'until' => 'setUntil' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'since' => 'getSince', + 'until' => 'getUntil' + ]; + + /** + * 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); + } + + /** + * 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"; + } + 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|null + */ + public function getUntil() + { + return $this->container['until']; + } + + /** + * Sets until + * + * @param \DateTime|null $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; + } + /** + * 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/ReplayOut.php b/lib/Model/ReplayOut.php new file mode 100644 index 0000000..12e42f4 --- /dev/null +++ b/lib/Model/ReplayOut.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; + +/** + * ReplayOut Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ReplayOut implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ReplayOut'; + + /** + * 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/StatusCodeClass.php b/lib/Model/StatusCodeClass.php new file mode 100644 index 0000000..9dac6fa --- /dev/null +++ b/lib/Model/StatusCodeClass.php @@ -0,0 +1,75 @@ + ## 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; + +/** + * StatusCodeClass Class Doc Comment + * + * @category Class + * @description The different classes of HTTP status codes: - CodeNone = 0 - Code1xx = 100 - Code2xx = 200 - Code3xx = 300 - Code4xx = 400 - Code5xx = 500 + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class StatusCodeClass +{ + /** + * Possible values of this enum + */ + public const NUMBER_CodeNone = 0; + + public const NUMBER_Code1xx = 100; + + public const NUMBER_Code2xx = 200; + + public const NUMBER_Code3xx = 300; + + public const NUMBER_Code4xx = 400; + + public const NUMBER_Code5xx = 500; + + /** + * Gets allowable values of the enum + * @return string[] + */ + public static function getAllowableEnumValues() + { + return [ + self::NUMBER_CodeNone, + self::NUMBER_Code1xx, + self::NUMBER_Code2xx, + self::NUMBER_Code3xx, + self::NUMBER_Code4xx, + self::NUMBER_Code5xx + ]; + } +} + + diff --git a/lib/Model/TemplateIn.php b/lib/Model/TemplateIn.php new file mode 100644 index 0000000..d644c4b --- /dev/null +++ b/lib/Model/TemplateIn.php @@ -0,0 +1,720 @@ + ## 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; + +/** + * TemplateIn Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class TemplateIn implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TemplateIn'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'logo' => 'string', + 'description' => 'string', + 'kind' => '\Svix\ApiClient\Model\TransformationTemplateKind', + 'instructions' => 'string', + 'instructions_link' => 'string', + 'filter_types' => 'string[]', + 'transformation' => 'string', + '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, + 'logo' => 'uri', + 'description' => null, + 'kind' => null, + 'instructions' => null, + 'instructions_link' => 'uri', + 'filter_types' => null, + 'transformation' => null, + 'feature_flag' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'logo' => false, + 'description' => false, + 'kind' => false, + 'instructions' => false, + 'instructions_link' => false, + 'filter_types' => false, + 'transformation' => 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', + 'logo' => 'logo', + 'description' => 'description', + 'kind' => 'kind', + 'instructions' => 'instructions', + 'instructions_link' => 'instructionsLink', + 'filter_types' => 'filterTypes', + 'transformation' => 'transformation', + 'feature_flag' => 'featureFlag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'logo' => 'setLogo', + 'description' => 'setDescription', + 'kind' => 'setKind', + 'instructions' => 'setInstructions', + 'instructions_link' => 'setInstructionsLink', + 'filter_types' => 'setFilterTypes', + 'transformation' => 'setTransformation', + 'feature_flag' => 'setFeatureFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'logo' => 'getLogo', + 'description' => 'getDescription', + 'kind' => 'getKind', + 'instructions' => 'getInstructions', + 'instructions_link' => 'getInstructionsLink', + 'filter_types' => 'getFilterTypes', + 'transformation' => 'getTransformation', + '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('logo', $data ?? [], null); + $this->setIfExists('description', $data ?? [], ''); + $this->setIfExists('kind', $data ?? [], null); + $this->setIfExists('instructions', $data ?? [], ''); + $this->setIfExists('instructions_link', $data ?? [], 'null'); + $this->setIfExists('filter_types', $data ?? [], null); + $this->setIfExists('transformation', $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 ($this->container['logo'] === null) { + $invalidProperties[] = "'logo' can't be null"; + } + if ($this->container['transformation'] === null) { + $invalidProperties[] = "'transformation' can't be null"; + } + if ((mb_strlen($this->container['transformation']) > 51200)) { + $invalidProperties[] = "invalid value for 'transformation', the character length must be smaller than or equal to 51200."; + } + + if ((mb_strlen($this->container['transformation']) < 10)) { + $invalidProperties[] = "invalid value for 'transformation', the character length must be bigger than or equal to 10."; + } + + 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 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 logo + * + * @return string + */ + public function getLogo() + { + return $this->container['logo']; + } + + /** + * Sets logo + * + * @param string $logo logo + * + * @return self + */ + public function setLogo($logo) + { + if (is_null($logo)) { + throw new \InvalidArgumentException('non-nullable logo cannot be null'); + } + $this->container['logo'] = $logo; + + return $this; + } + + /** + * 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 kind + * + * @return \Svix\ApiClient\Model\TransformationTemplateKind|null + */ + public function getKind() + { + return $this->container['kind']; + } + + /** + * Sets kind + * + * @param \Svix\ApiClient\Model\TransformationTemplateKind|null $kind kind + * + * @return self + */ + public function setKind($kind) + { + if (is_null($kind)) { + throw new \InvalidArgumentException('non-nullable kind cannot be null'); + } + $this->container['kind'] = $kind; + + return $this; + } + + /** + * Gets instructions + * + * @return string|null + */ + public function getInstructions() + { + return $this->container['instructions']; + } + + /** + * Sets instructions + * + * @param string|null $instructions instructions + * + * @return self + */ + public function setInstructions($instructions) + { + if (is_null($instructions)) { + throw new \InvalidArgumentException('non-nullable instructions cannot be null'); + } + $this->container['instructions'] = $instructions; + + return $this; + } + + /** + * Gets instructions_link + * + * @return string|null + */ + public function getInstructionsLink() + { + return $this->container['instructions_link']; + } + + /** + * Sets instructions_link + * + * @param string|null $instructions_link instructions_link + * + * @return self + */ + public function setInstructionsLink($instructions_link) + { + if (is_null($instructions_link)) { + throw new \InvalidArgumentException('non-nullable instructions_link cannot be null'); + } + $this->container['instructions_link'] = $instructions_link; + + 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 transformation + * + * @return string + */ + public function getTransformation() + { + return $this->container['transformation']; + } + + /** + * Sets transformation + * + * @param string $transformation transformation + * + * @return self + */ + public function setTransformation($transformation) + { + if (is_null($transformation)) { + throw new \InvalidArgumentException('non-nullable transformation cannot be null'); + } + if ((mb_strlen($transformation) > 51200)) { + throw new \InvalidArgumentException('invalid length for $transformation when calling TemplateIn., must be smaller than or equal to 51200.'); + } + if ((mb_strlen($transformation) < 10)) { + throw new \InvalidArgumentException('invalid length for $transformation when calling TemplateIn., must be bigger than or equal to 10.'); + } + + $this->container['transformation'] = $transformation; + + 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 TemplateIn., 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 TemplateIn., 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/TemplateOut.php b/lib/Model/TemplateOut.php new file mode 100644 index 0000000..dbaa0c5 --- /dev/null +++ b/lib/Model/TemplateOut.php @@ -0,0 +1,862 @@ + ## 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; + +/** + * TemplateOut Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class TemplateOut implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TemplateOut'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'org_id' => 'string', + 'kind' => '\Svix\ApiClient\Model\TransformationTemplateKind', + 'name' => 'string', + 'logo' => 'string', + 'description' => 'string', + 'instructions' => 'string', + 'instructions_link' => 'string', + 'filter_types' => 'string[]', + 'transformation' => 'string', + '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 = [ + 'id' => null, + 'org_id' => null, + 'kind' => null, + 'name' => null, + 'logo' => 'uri', + 'description' => null, + 'instructions' => null, + 'instructions_link' => 'uri', + 'filter_types' => null, + 'transformation' => 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 = [ + 'id' => false, + 'org_id' => false, + 'kind' => false, + 'name' => false, + 'logo' => false, + 'description' => false, + 'instructions' => false, + 'instructions_link' => false, + 'filter_types' => false, + 'transformation' => false, + '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 = [ + 'id' => 'id', + 'org_id' => 'orgId', + 'kind' => 'kind', + 'name' => 'name', + 'logo' => 'logo', + 'description' => 'description', + 'instructions' => 'instructions', + 'instructions_link' => 'instructionsLink', + 'filter_types' => 'filterTypes', + 'transformation' => 'transformation', + 'created_at' => 'createdAt', + 'updated_at' => 'updatedAt', + 'feature_flag' => 'featureFlag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'org_id' => 'setOrgId', + 'kind' => 'setKind', + 'name' => 'setName', + 'logo' => 'setLogo', + 'description' => 'setDescription', + 'instructions' => 'setInstructions', + 'instructions_link' => 'setInstructionsLink', + 'filter_types' => 'setFilterTypes', + 'transformation' => 'setTransformation', + 'created_at' => 'setCreatedAt', + 'updated_at' => 'setUpdatedAt', + 'feature_flag' => 'setFeatureFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'org_id' => 'getOrgId', + 'kind' => 'getKind', + 'name' => 'getName', + 'logo' => 'getLogo', + 'description' => 'getDescription', + 'instructions' => 'getInstructions', + 'instructions_link' => 'getInstructionsLink', + 'filter_types' => 'getFilterTypes', + 'transformation' => 'getTransformation', + '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('id', $data ?? [], null); + $this->setIfExists('org_id', $data ?? [], null); + $this->setIfExists('kind', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('logo', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('instructions', $data ?? [], null); + $this->setIfExists('instructions_link', $data ?? [], null); + $this->setIfExists('filter_types', $data ?? [], null); + $this->setIfExists('transformation', $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['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['org_id'] === null) { + $invalidProperties[] = "'org_id' can't be null"; + } + if ($this->container['kind'] === null) { + $invalidProperties[] = "'kind' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['logo'] === null) { + $invalidProperties[] = "'logo' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['instructions'] === null) { + $invalidProperties[] = "'instructions' can't be null"; + } + if ($this->container['transformation'] === null) { + $invalidProperties[] = "'transformation' 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 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 org_id + * + * @return string + */ + public function getOrgId() + { + return $this->container['org_id']; + } + + /** + * Sets org_id + * + * @param string $org_id org_id + * + * @return self + */ + public function setOrgId($org_id) + { + if (is_null($org_id)) { + throw new \InvalidArgumentException('non-nullable org_id cannot be null'); + } + $this->container['org_id'] = $org_id; + + return $this; + } + + /** + * Gets kind + * + * @return \Svix\ApiClient\Model\TransformationTemplateKind + */ + public function getKind() + { + return $this->container['kind']; + } + + /** + * Sets kind + * + * @param \Svix\ApiClient\Model\TransformationTemplateKind $kind kind + * + * @return self + */ + public function setKind($kind) + { + if (is_null($kind)) { + throw new \InvalidArgumentException('non-nullable kind cannot be null'); + } + $this->container['kind'] = $kind; + + 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 logo + * + * @return string + */ + public function getLogo() + { + return $this->container['logo']; + } + + /** + * Sets logo + * + * @param string $logo logo + * + * @return self + */ + public function setLogo($logo) + { + if (is_null($logo)) { + throw new \InvalidArgumentException('non-nullable logo cannot be null'); + } + $this->container['logo'] = $logo; + + 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 instructions + * + * @return string + */ + public function getInstructions() + { + return $this->container['instructions']; + } + + /** + * Sets instructions + * + * @param string $instructions instructions + * + * @return self + */ + public function setInstructions($instructions) + { + if (is_null($instructions)) { + throw new \InvalidArgumentException('non-nullable instructions cannot be null'); + } + $this->container['instructions'] = $instructions; + + return $this; + } + + /** + * Gets instructions_link + * + * @return string|null + */ + public function getInstructionsLink() + { + return $this->container['instructions_link']; + } + + /** + * Sets instructions_link + * + * @param string|null $instructions_link instructions_link + * + * @return self + */ + public function setInstructionsLink($instructions_link) + { + if (is_null($instructions_link)) { + throw new \InvalidArgumentException('non-nullable instructions_link cannot be null'); + } + $this->container['instructions_link'] = $instructions_link; + + 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 transformation + * + * @return string + */ + public function getTransformation() + { + return $this->container['transformation']; + } + + /** + * Sets transformation + * + * @param string $transformation transformation + * + * @return self + */ + public function setTransformation($transformation) + { + if (is_null($transformation)) { + throw new \InvalidArgumentException('non-nullable transformation cannot be null'); + } + $this->container['transformation'] = $transformation; + + 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 TemplateOut., 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 TemplateOut., 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/TemplatePatch.php b/lib/Model/TemplatePatch.php new file mode 100644 index 0000000..82c192c --- /dev/null +++ b/lib/Model/TemplatePatch.php @@ -0,0 +1,711 @@ + ## 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; + +/** + * TemplatePatch Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class TemplatePatch implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TemplatePatch'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'logo' => 'string', + 'description' => 'string', + 'kind' => '\Svix\ApiClient\Model\TransformationTemplateKind', + 'instructions' => 'string', + 'instructions_link' => 'string', + 'filter_types' => 'string[]', + 'transformation' => 'string', + '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, + 'logo' => 'uri', + 'description' => null, + 'kind' => null, + 'instructions' => null, + 'instructions_link' => 'uri', + 'filter_types' => null, + 'transformation' => null, + 'feature_flag' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'logo' => false, + 'description' => false, + 'kind' => false, + 'instructions' => false, + 'instructions_link' => false, + 'filter_types' => false, + 'transformation' => 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', + 'logo' => 'logo', + 'description' => 'description', + 'kind' => 'kind', + 'instructions' => 'instructions', + 'instructions_link' => 'instructionsLink', + 'filter_types' => 'filterTypes', + 'transformation' => 'transformation', + 'feature_flag' => 'featureFlag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'logo' => 'setLogo', + 'description' => 'setDescription', + 'kind' => 'setKind', + 'instructions' => 'setInstructions', + 'instructions_link' => 'setInstructionsLink', + 'filter_types' => 'setFilterTypes', + 'transformation' => 'setTransformation', + 'feature_flag' => 'setFeatureFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'logo' => 'getLogo', + 'description' => 'getDescription', + 'kind' => 'getKind', + 'instructions' => 'getInstructions', + 'instructions_link' => 'getInstructionsLink', + 'filter_types' => 'getFilterTypes', + 'transformation' => 'getTransformation', + '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('logo', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('kind', $data ?? [], null); + $this->setIfExists('instructions', $data ?? [], null); + $this->setIfExists('instructions_link', $data ?? [], null); + $this->setIfExists('filter_types', $data ?? [], null); + $this->setIfExists('transformation', $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['transformation']) && (mb_strlen($this->container['transformation']) > 51200)) { + $invalidProperties[] = "invalid value for 'transformation', the character length must be smaller than or equal to 51200."; + } + + if (!is_null($this->container['transformation']) && (mb_strlen($this->container['transformation']) < 10)) { + $invalidProperties[] = "invalid value for 'transformation', the character length must be bigger than or equal to 10."; + } + + 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|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 logo + * + * @return string|null + */ + public function getLogo() + { + return $this->container['logo']; + } + + /** + * Sets logo + * + * @param string|null $logo logo + * + * @return self + */ + public function setLogo($logo) + { + if (is_null($logo)) { + throw new \InvalidArgumentException('non-nullable logo cannot be null'); + } + $this->container['logo'] = $logo; + + return $this; + } + + /** + * 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 kind + * + * @return \Svix\ApiClient\Model\TransformationTemplateKind|null + */ + public function getKind() + { + return $this->container['kind']; + } + + /** + * Sets kind + * + * @param \Svix\ApiClient\Model\TransformationTemplateKind|null $kind kind + * + * @return self + */ + public function setKind($kind) + { + if (is_null($kind)) { + throw new \InvalidArgumentException('non-nullable kind cannot be null'); + } + $this->container['kind'] = $kind; + + return $this; + } + + /** + * Gets instructions + * + * @return string|null + */ + public function getInstructions() + { + return $this->container['instructions']; + } + + /** + * Sets instructions + * + * @param string|null $instructions instructions + * + * @return self + */ + public function setInstructions($instructions) + { + if (is_null($instructions)) { + throw new \InvalidArgumentException('non-nullable instructions cannot be null'); + } + $this->container['instructions'] = $instructions; + + return $this; + } + + /** + * Gets instructions_link + * + * @return string|null + */ + public function getInstructionsLink() + { + return $this->container['instructions_link']; + } + + /** + * Sets instructions_link + * + * @param string|null $instructions_link instructions_link + * + * @return self + */ + public function setInstructionsLink($instructions_link) + { + if (is_null($instructions_link)) { + throw new \InvalidArgumentException('non-nullable instructions_link cannot be null'); + } + $this->container['instructions_link'] = $instructions_link; + + 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 transformation + * + * @return string|null + */ + public function getTransformation() + { + return $this->container['transformation']; + } + + /** + * Sets transformation + * + * @param string|null $transformation transformation + * + * @return self + */ + public function setTransformation($transformation) + { + if (is_null($transformation)) { + throw new \InvalidArgumentException('non-nullable transformation cannot be null'); + } + if ((mb_strlen($transformation) > 51200)) { + throw new \InvalidArgumentException('invalid length for $transformation when calling TemplatePatch., must be smaller than or equal to 51200.'); + } + if ((mb_strlen($transformation) < 10)) { + throw new \InvalidArgumentException('invalid length for $transformation when calling TemplatePatch., must be bigger than or equal to 10.'); + } + + $this->container['transformation'] = $transformation; + + 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 TemplatePatch., 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 TemplatePatch., 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/TemplateUpdate.php b/lib/Model/TemplateUpdate.php new file mode 100644 index 0000000..9a0e970 --- /dev/null +++ b/lib/Model/TemplateUpdate.php @@ -0,0 +1,717 @@ + ## 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; + +/** + * TemplateUpdate Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class TemplateUpdate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TemplateUpdate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'logo' => 'string', + 'description' => 'string', + 'kind' => '\Svix\ApiClient\Model\TransformationTemplateKind', + 'instructions' => 'string', + 'instructions_link' => 'string', + 'filter_types' => 'string[]', + 'transformation' => 'string', + '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, + 'logo' => 'uri', + 'description' => null, + 'kind' => null, + 'instructions' => null, + 'instructions_link' => 'uri', + 'filter_types' => null, + 'transformation' => null, + 'feature_flag' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'logo' => false, + 'description' => false, + 'kind' => false, + 'instructions' => false, + 'instructions_link' => false, + 'filter_types' => false, + 'transformation' => 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', + 'logo' => 'logo', + 'description' => 'description', + 'kind' => 'kind', + 'instructions' => 'instructions', + 'instructions_link' => 'instructionsLink', + 'filter_types' => 'filterTypes', + 'transformation' => 'transformation', + 'feature_flag' => 'featureFlag' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'logo' => 'setLogo', + 'description' => 'setDescription', + 'kind' => 'setKind', + 'instructions' => 'setInstructions', + 'instructions_link' => 'setInstructionsLink', + 'filter_types' => 'setFilterTypes', + 'transformation' => 'setTransformation', + 'feature_flag' => 'setFeatureFlag' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'logo' => 'getLogo', + 'description' => 'getDescription', + 'kind' => 'getKind', + 'instructions' => 'getInstructions', + 'instructions_link' => 'getInstructionsLink', + 'filter_types' => 'getFilterTypes', + 'transformation' => 'getTransformation', + '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 ?? [], ''); + $this->setIfExists('logo', $data ?? [], null); + $this->setIfExists('description', $data ?? [], ''); + $this->setIfExists('kind', $data ?? [], null); + $this->setIfExists('instructions', $data ?? [], ''); + $this->setIfExists('instructions_link', $data ?? [], null); + $this->setIfExists('filter_types', $data ?? [], null); + $this->setIfExists('transformation', $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['logo'] === null) { + $invalidProperties[] = "'logo' can't be null"; + } + if ($this->container['transformation'] === null) { + $invalidProperties[] = "'transformation' can't be null"; + } + if ((mb_strlen($this->container['transformation']) > 51200)) { + $invalidProperties[] = "invalid value for 'transformation', the character length must be smaller than or equal to 51200."; + } + + if ((mb_strlen($this->container['transformation']) < 10)) { + $invalidProperties[] = "invalid value for 'transformation', the character length must be bigger than or equal to 10."; + } + + 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|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 logo + * + * @return string + */ + public function getLogo() + { + return $this->container['logo']; + } + + /** + * Sets logo + * + * @param string $logo logo + * + * @return self + */ + public function setLogo($logo) + { + if (is_null($logo)) { + throw new \InvalidArgumentException('non-nullable logo cannot be null'); + } + $this->container['logo'] = $logo; + + return $this; + } + + /** + * 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 kind + * + * @return \Svix\ApiClient\Model\TransformationTemplateKind|null + */ + public function getKind() + { + return $this->container['kind']; + } + + /** + * Sets kind + * + * @param \Svix\ApiClient\Model\TransformationTemplateKind|null $kind kind + * + * @return self + */ + public function setKind($kind) + { + if (is_null($kind)) { + throw new \InvalidArgumentException('non-nullable kind cannot be null'); + } + $this->container['kind'] = $kind; + + return $this; + } + + /** + * Gets instructions + * + * @return string|null + */ + public function getInstructions() + { + return $this->container['instructions']; + } + + /** + * Sets instructions + * + * @param string|null $instructions instructions + * + * @return self + */ + public function setInstructions($instructions) + { + if (is_null($instructions)) { + throw new \InvalidArgumentException('non-nullable instructions cannot be null'); + } + $this->container['instructions'] = $instructions; + + return $this; + } + + /** + * Gets instructions_link + * + * @return string|null + */ + public function getInstructionsLink() + { + return $this->container['instructions_link']; + } + + /** + * Sets instructions_link + * + * @param string|null $instructions_link instructions_link + * + * @return self + */ + public function setInstructionsLink($instructions_link) + { + if (is_null($instructions_link)) { + throw new \InvalidArgumentException('non-nullable instructions_link cannot be null'); + } + $this->container['instructions_link'] = $instructions_link; + + 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 transformation + * + * @return string + */ + public function getTransformation() + { + return $this->container['transformation']; + } + + /** + * Sets transformation + * + * @param string $transformation transformation + * + * @return self + */ + public function setTransformation($transformation) + { + if (is_null($transformation)) { + throw new \InvalidArgumentException('non-nullable transformation cannot be null'); + } + if ((mb_strlen($transformation) > 51200)) { + throw new \InvalidArgumentException('invalid length for $transformation when calling TemplateUpdate., must be smaller than or equal to 51200.'); + } + if ((mb_strlen($transformation) < 10)) { + throw new \InvalidArgumentException('invalid length for $transformation when calling TemplateUpdate., must be bigger than or equal to 10.'); + } + + $this->container['transformation'] = $transformation; + + 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 TemplateUpdate., 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 TemplateUpdate., 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/TransformationHttpMethod.php b/lib/Model/TransformationHttpMethod.php new file mode 100644 index 0000000..e8938ee --- /dev/null +++ b/lib/Model/TransformationHttpMethod.php @@ -0,0 +1,62 @@ + ## 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; + +/** + * TransformationHttpMethod Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class TransformationHttpMethod +{ + /** + * Possible values of this enum + */ + public const POST = 'POST'; + + public const PUT = 'PUT'; + + /** + * Gets allowable values of the enum + * @return string[] + */ + public static function getAllowableEnumValues() + { + return [ + self::POST, + self::PUT + ]; + } +} + + diff --git a/lib/Model/TransformationSimulateIn.php b/lib/Model/TransformationSimulateIn.php new file mode 100644 index 0000000..59ed741 --- /dev/null +++ b/lib/Model/TransformationSimulateIn.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; + +/** + * TransformationSimulateIn Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class TransformationSimulateIn implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransformationSimulateIn'; + + /** + * 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 TransformationSimulateIn., must be smaller than or equal to 51200.'); + } + if ((mb_strlen($code) < 10)) { + throw new \InvalidArgumentException('invalid length for $code when calling TransformationSimulateIn., 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 TransformationSimulateIn., 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 TransformationSimulateIn., 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/TransformationSimulateOut.php b/lib/Model/TransformationSimulateOut.php new file mode 100644 index 0000000..fa51a3e --- /dev/null +++ b/lib/Model/TransformationSimulateOut.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; + +/** + * TransformationSimulateOut Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class TransformationSimulateOut implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransformationSimulateOut'; + + /** + * 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 TransformationSimulateOut., must be smaller than or equal to 65536.'); + } + if ((mb_strlen($url) < 1)) { + throw new \InvalidArgumentException('invalid length for $url when calling TransformationSimulateOut., 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/TransformationTemplateKind.php b/lib/Model/TransformationTemplateKind.php new file mode 100644 index 0000000..b3c4415 --- /dev/null +++ b/lib/Model/TransformationTemplateKind.php @@ -0,0 +1,74 @@ + ## 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; + +/** + * TransformationTemplateKind Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class TransformationTemplateKind +{ + /** + * Possible values of this enum + */ + public const CUSTOM = 'Custom'; + + public const SLACK = 'Slack'; + + public const DISCORD = 'Discord'; + + public const TEAMS = 'Teams'; + + public const INNGEST = 'Inngest'; + + public const SEGMENT = 'Segment'; + + /** + * Gets allowable values of the enum + * @return string[] + */ + public static function getAllowableEnumValues() + { + return [ + self::CUSTOM, + self::SLACK, + self::DISCORD, + self::TEAMS, + self::INNGEST, + self::SEGMENT + ]; + } +} + + diff --git a/lib/Model/ValidationError.php b/lib/Model/ValidationError.php new file mode 100644 index 0000000..5b944bc --- /dev/null +++ b/lib/Model/ValidationError.php @@ -0,0 +1,487 @@ + ## 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; + +/** + * ValidationError Class Doc Comment + * + * @category Class + * @description Validation errors have their own schema to provide context for invalid requests eg. mismatched types and out of bounds values. There may be any number of these per 422 UNPROCESSABLE ENTITY error. + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + */ +class ValidationError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ValidationError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'loc' => 'string[]', + 'msg' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'loc' => null, + 'msg' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'loc' => false, + 'msg' => 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 = [ + 'loc' => 'loc', + 'msg' => 'msg', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'loc' => 'setLoc', + 'msg' => 'setMsg', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'loc' => 'getLoc', + 'msg' => 'getMsg', + '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; + } + + + /** + * 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('loc', $data ?? [], null); + $this->setIfExists('msg', $data ?? [], null); + $this->setIfExists('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['loc'] === null) { + $invalidProperties[] = "'loc' can't be null"; + } + if ($this->container['msg'] === null) { + $invalidProperties[] = "'msg' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' 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 loc + * + * @return string[] + */ + public function getLoc() + { + return $this->container['loc']; + } + + /** + * Sets loc + * + * @param string[] $loc loc + * + * @return self + */ + public function setLoc($loc) + { + if (is_null($loc)) { + throw new \InvalidArgumentException('non-nullable loc cannot be null'); + } + $this->container['loc'] = $loc; + + return $this; + } + + /** + * Gets msg + * + * @return string + */ + public function getMsg() + { + return $this->container['msg']; + } + + /** + * Sets msg + * + * @param string $msg The message accompanying the validation error item. + * + * @return self + */ + public function setMsg($msg) + { + if (is_null($msg)) { + throw new \InvalidArgumentException('non-nullable msg cannot be null'); + } + $this->container['msg'] = $msg; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of error, often \"type_error\" or \"value_error\", but sometimes with more context like as \"value_error.number.not_ge\" + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $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/ObjectSerializer.php b/lib/ObjectSerializer.php new file mode 100644 index 0000000..5c56e06 --- /dev/null +++ b/lib/ObjectSerializer.php @@ -0,0 +1,567 @@ + ## 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 GuzzleHttp\Psr7\Utils; +use Svix\ApiClient\Model\ModelInterface; + +/** + * ObjectSerializer Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ObjectSerializer +{ + /** @var string */ + private static $dateTimeFormat = \DateTime::ATOM; + + /** + * Change the date format + * + * @param string $format the new date format to use + */ + public static function setDateTimeFormat($format) + { + self::$dateTimeFormat = $format; + } + + /** + * Serialize data + * + * @param mixed $data the data to serialize + * @param string $type the OpenAPIToolsType of the data + * @param string $format the format of the OpenAPITools type of the data + * + * @return scalar|object|array|null serialized form of $data + */ + public static function sanitizeForSerialization($data, $type = null, $format = null) + { + if (is_scalar($data) || null === $data) { + return $data; + } + + if ($data instanceof \DateTime) { + return ($format === 'date') ? $data->format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) return $timestamp; + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the path, by url-encoding. + * + * @param string $value a string which will be part of the path + * + * @return string the serialized object + */ + public static function toPathValue($value) + { + return rawurlencode(self::toString($value)); + } + + /** + * Checks if a value is empty, based on its OpenAPI type. + * + * @param mixed $value + * @param string $openApiType + * + * @return bool true if $value is empty + */ + private static function isEmptyValue($value, string $openApiType): bool + { + # If empty() returns false, it is not empty regardless of its type. + if (!empty($value)) { + return false; + } + + # Null is always empty, as we cannot send a real "null" value in a query parameter. + if ($value === null) { + return true; + } + + switch ($openApiType) { + # For numeric values, false and '' are considered empty. + # This comparison is safe for floating point values, since the previous call to empty() will + # filter out values that don't match 0. + case 'int': + case 'integer': + return $value !== 0; + + case 'number': + case 'float': + return $value !== 0 && $value !== 0.0; + + # For boolean values, '' is considered empty + case 'bool': + case 'boolean': + return !in_array($value, [false, 0], true); + + # For all the other types, any value at this point can be considered empty. + default: + return true; + } + } + + /** + * Take query parameter properties and turn it into an array suitable for + * native http_build_query or GuzzleHttp\Psr7\Query::build. + * + * @param mixed $value Parameter value + * @param string $paramName Parameter name + * @param string $openApiType OpenAPIType eg. array or object + * @param string $style Parameter serialization style + * @param bool $explode Parameter explode option + * @param bool $required Whether query param is required or not + * + * @return array + */ + public static function toQueryValue( + $value, + string $paramName, + string $openApiType = 'string', + string $style = 'form', + bool $explode = true, + bool $required = true + ): array { + + # Check if we should omit this parameter from the query. This should only happen when: + # - Parameter is NOT required; AND + # - its value is set to a value that is equivalent to "empty", depending on its OpenAPI type. For + # example, 0 as "int" or "boolean" is NOT an empty value. + if (self::isEmptyValue($value, $openApiType)) { + if ($required) { + return ["{$paramName}" => '']; + } else { + return []; + } + } + + # Handle DateTime objects in query + if($openApiType === "\\DateTime" && $value instanceof \DateTime) { + return ["{$paramName}" => $value->format(self::$dateTimeFormat)]; + } + + $query = []; + $value = (in_array($openApiType, ['object', 'array'], true)) ? (array)$value : $value; + + // since \GuzzleHttp\Psr7\Query::build fails with nested arrays + // need to flatten array first + $flattenArray = function ($arr, $name, &$result = []) use (&$flattenArray, $style, $explode) { + if (!is_array($arr)) return $arr; + + foreach ($arr as $k => $v) { + $prop = ($style === 'deepObject') ? $prop = "{$name}[{$k}]" : $k; + + if (is_array($v)) { + $flattenArray($v, $prop, $result); + } else { + if ($style !== 'deepObject' && !$explode) { + // push key itself + $result[] = $prop; + } + $result[$prop] = $v; + } + } + return $result; + }; + + $value = $flattenArray($value, $paramName); + + if ($openApiType === 'object' && ($style === 'deepObject' || $explode)) { + return $value; + } + + if ('boolean' === $openApiType && is_bool($value)) { + $value = self::convertBoolToQueryStringFormat($value); + } + + // handle style in serializeCollection + $query[$paramName] = ($explode) ? $value : self::serializeCollection((array)$value, $style); + + return $query; + } + + /** + * Convert boolean value to format for query string. + * + * @param bool $value Boolean value + * + * @return int|string Boolean value in format + */ + public static function convertBoolToQueryStringFormat(bool $value) + { + if (Configuration::BOOLEAN_FORMAT_STRING == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) { + return $value ? 'true' : 'false'; + } + + return (int) $value; + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the header. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string $value a string which will be part of the header + * + * @return string the header string + */ + public static function toHeaderValue($value) + { + $callable = [$value, 'toHeaderValue']; + if (is_callable($callable)) { + return $callable(); + } + + return self::toString($value); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the http body (form parameter). If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\SplFileObject $value the value of the form parameter + * + * @return string the form string + */ + public static function toFormValue($value) + { + if ($value instanceof \SplFileObject) { + return $value->getRealPath(); + } else { + return self::toString($value); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the parameter. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * If it's a boolean, convert it to "true" or "false". + * + * @param string|bool|\DateTime $value the value of the parameter + * + * @return string the header string + */ + public static function toString($value) + { + if ($value instanceof \DateTime) { // datetime in ISO8601 format + return $value->format(self::$dateTimeFormat); + } elseif (is_bool($value)) { + return $value ? 'true' : 'false'; + } else { + return (string) $value; + } + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if ( + is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Svix\ApiClient\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } + + /** + * Native `http_build_query` wrapper. + * @see https://www.php.net/manual/en/function.http-build-query + * + * @param array|object $data May be an array or object containing properties. + * @param string $numeric_prefix If numeric indices are used in the base array and this parameter is provided, it will be prepended to the numeric index for elements in the base array only. + * @param string|null $arg_separator arg_separator.output is used to separate arguments but may be overridden by specifying this parameter. + * @param int $encoding_type Encoding type. By default, PHP_QUERY_RFC1738. + * + * @return string + */ + public static function buildQuery( + $data, + string $numeric_prefix = '', + ?string $arg_separator = null, + int $encoding_type = \PHP_QUERY_RFC3986 + ): string { + return \GuzzleHttp\Psr7\Query::build($data, $encoding_type); + } +} diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..485899a --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,18 @@ + + + + + ./lib/Api + ./lib/Model + + + + + ./test/Api + ./test/Model + + + + + + diff --git a/spec/config.yaml b/spec/config.yaml new file mode 100644 index 0000000..b436d95 --- /dev/null +++ b/spec/config.yaml @@ -0,0 +1,4 @@ +skipValidateSpec: true +composerPackageName: paypaplane/svix-client +additionalProperties: + invokerPackage: Svix\ApiClient diff --git a/spec/svix.json b/spec/svix.json new file mode 100644 index 0000000..1465e6d --- /dev/null +++ b/spec/svix.json @@ -0,0 +1,15102 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Svix API", + "description": "Welcome to the Svix API documentation!\n\nUseful 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/)\n\n# Introduction\n\nThis 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).\n\n## Main concepts\n\nIn Svix you have four important entities you will be interacting with:\n\n- `messages`: these are the webhooks being sent. They can have contents and a few other properties.\n- `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform.\n- `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).\n- `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.\n\n\n## Authentication\n\nGet 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).\n\n\n\n\n## Code samples\n\nThe 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/).\n\n\n## Idempotency\n\nSvix 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.\n\nTo 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.\n\nSvix'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.\n\nPlease note that idempotency is only supported for `POST` requests.\n\n\n## Cross-Origin Resource Sharing\n\nThis 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.\n", + "version": "1.13.0", + "x-logo": { + "altText": "Svix Logo", + "url": "https://www.svix.com/static/img/brand-padded.svg" + } + }, + "servers": [ + { + "url": "https://api.eu.svix.com/", + "description": "The Svix EU region" + }, + { + "url": "https://api.us.svix.com/", + "description": "The Svix US region" + } + ], + "paths": { + "/api/v1/auth/app-portal-access/{app_id}/": { + "post": { + "tags": [ + "Authentication" + ], + "summary": "Get Consumer App Portal Access", + "description": "Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.", + "operationId": "v1.authentication.app-portal-access", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "header", + "name": "idempotency-key", + "description": "The request's idempotency key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AppPortalAccessIn" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AppPortalAccessOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const appPortalAccessOut = await svix.authentication.appPortalAccess(\"app_id\", {\n featureFlags: []\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const appPortalAccessOut = await svix.authentication.appPortalAccess(\"app_id\", {\n featureFlags: []\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "app_portal_access_out = svix.authentication.app_portal_access(\"app_id\", AppPortalAccessIn(\n feature_flags=[]\n), None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "app_portal_access_out = await svix.authentication.app_portal_access(\"app_id\", AppPortalAccessIn(\n feature_flags=[]\n), None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "appPortalAccessOut, err := svixClient.Authentication.AppPortalAccess(ctx, \"app_id\", &AppPortalAccessIn{\n FeatureFlags: []interface{}{},\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val appPortalAccessOut = svix.authentication.appPortalAccess(\"app_id\", AppPortalAccessIn()\n .featureFlags(arrayOf())\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "AppPortalAccessOut appPortalAccessOut = svix.getAuthentication().appPortalAccess(\"app_id\", new AppPortalAccessIn()\n .featureFlags(new Object[]{})\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "app_portal_access_out = svix.authentication.app_portal_access(\"app_id\", Svix::AppPortalAccessIn.new({\n \"feature_flags\": []\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let app_portal_access_out = svix.authentication().app_portal_access(\"app_id\", AppPortalAccessIn {\n feature_flags: Some(vec![]),\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var appPortalAccessOut = await svix.Authentication.AppPortalAccessAsync(\"app_id\", new AppPortalAccessIn{\n featureFlags: new Object[] {}\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix authentication app-portal-access \"app_id\" '{\n \"featureFlags\": []\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/app-portal-access/{app_id}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"featureFlags\": []\n }'" + } + ] + } + }, + "/api/v1/auth/dashboard-access/{app_id}/": { + "post": { + "tags": [ + "Authentication" + ], + "summary": "Dashboard Access", + "description": "DEPRECATED: Please use `app-portal-access` instead.\n\nUse this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal.", + "operationId": "v1.authentication.dashboard-access", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "header", + "name": "idempotency-key", + "description": "The request's idempotency key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DashboardAccessOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "deprecated": true, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const dashboardAccessOut = await svix.authentication.dashboardAccess(\"app_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const dashboardAccessOut = await svix.authentication.dashboardAccess(\"app_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "dashboard_access_out = svix.authentication.dashboard_access(\"app_id\", None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "dashboard_access_out = await svix.authentication.dashboard_access(\"app_id\", None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "dashboardAccessOut, err := svixClient.Authentication.DashboardAccess(ctx, \"app_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val dashboardAccessOut = svix.authentication.dashboardAccess(\"app_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "DashboardAccessOut dashboardAccessOut = svix.getAuthentication().dashboardAccess(\"app_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "dashboard_access_out = svix.authentication.dashboard_access(\"app_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let dashboard_access_out = svix.authentication().dashboard_access(\"app_id\", None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var dashboardAccessOut = await svix.Authentication.DashboardAccessAsync(\"app_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix authentication dashboard-access \"app_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/dashboard-access/{app_id}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/auth/logout/": { + "post": { + "tags": [ + "Authentication" + ], + "summary": "Logout", + "description": "Logout an app token.\n\nTrying to log out other tokens will fail.", + "operationId": "v1.authentication.logout", + "parameters": [ + { + "in": "header", + "name": "idempotency-key", + "description": "The request's idempotency key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "204": { + "description": "no content" + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.authentication.logout();" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.authentication.logout();" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.authentication.logout(None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.authentication.logout(None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.Authentication.Logout(ctx)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.authentication.logout()" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getAuthentication().logout()" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.authentication.logout()" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.authentication().logout(None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.Authentication.LogoutAsync()" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix authentication logout " + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/logout/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/auth/app/{app_id}/expire-all/": { + "post": { + "tags": [ + "Authentication" + ], + "summary": "Expire All", + "description": "Expire all of the tokens associated with a specific Application", + "operationId": "v1.authentication.expire-all", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "header", + "name": "idempotency-key", + "description": "The request's idempotency key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationTokenExpireIn" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "no content" + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.authentication.expireAll(\"app_id\", {\n expiry: 60\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.authentication.expireAll(\"app_id\", {\n expiry: 60\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.authentication.expire_all(\"app_id\", ApplicationTokenExpireIn(\n expiry=60\n), None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.authentication.expire_all(\"app_id\", ApplicationTokenExpireIn(\n expiry=60\n), None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.Authentication.ExpireAll(ctx, \"app_id\", &ApplicationTokenExpireIn{\n Expiry: 60,\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.authentication.expireAll(\"app_id\", ApplicationTokenExpireIn()\n .expiry(60)\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getAuthentication().expireAll(\"app_id\", new ApplicationTokenExpireIn()\n .expiry(60)\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.authentication.expire_all(\"app_id\", Svix::ApplicationTokenExpireIn.new({\n \"expiry\": 60\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.authentication().expire_all(\"app_id\", ApplicationTokenExpireIn {\n expiry: Some(60),\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.Authentication.ExpireAllAsync(\"app_id\", new ApplicationTokenExpireIn{\n expiry: 60\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix authentication expire-all \"app_id\" '{\n \"expiry\": 60\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/app/{app_id}/expire-all/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"expiry\": 60\n }'" + } + ] + } + }, + "/api/v1/app/": { + "get": { + "tags": [ + "Application" + ], + "summary": "List Applications", + "description": "List of all the organization's applications.", + "operationId": "v1.application.list", + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "Limit the number of returned items", + "schema": { + "description": "Limit the number of returned items", + "type": "integer", + "format": "uint64", + "maximum": 250.0, + "minimum": 1.0 + }, + "style": "form" + }, + { + "in": "query", + "name": "iterator", + "description": "The iterator returned from a prior invocation", + "schema": { + "description": "The iterator returned from a prior invocation", + "type": "string", + "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "order", + "description": "The sorting order of the returned items", + "schema": { + "description": "The sorting order of the returned items", + "$ref": "#/components/schemas/Ordering", + "nullable": true + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_ApplicationOut_" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const listResponseApplicationOut = await svix.application.list();" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const listResponseApplicationOut = await svix.application.list();" + }, + { + "label": "Python", + "lang": "Python", + "source": "list_response_application_out = svix.application.list(None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "list_response_application_out = await svix.application.list(None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "listResponseApplicationOut, err := svixClient.Application.List(ctx, nil)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val listResponseApplicationOut = svix.application.list()" + }, + { + "label": "Java", + "lang": "Java", + "source": "ListResponseApplicationOut listResponseApplicationOut = svix.getApplication().list()" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "list_response_application_out = svix.application.list()" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let list_response_application_out = svix.application().list(None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var listResponseApplicationOut = await svix.Application.ListAsync()" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix application list " + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "post": { + "tags": [ + "Application" + ], + "summary": "Create Application", + "description": "Create a new application.", + "operationId": "v1.application.create", + "parameters": [ + { + "in": "query", + "name": "get_if_exists", + "description": "Get an existing application, or create a new one if doesn't exist. It's two separate functions in the libs.", + "schema": { + "description": "Get an existing application, or create a new one if doesn't exist. It's two separate functions in the libs.", + "default": false, + "type": "boolean" + }, + "style": "form" + }, + { + "in": "header", + "name": "idempotency-key", + "description": "The request's idempotency key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationIn" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationOut" + } + } + } + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const applicationOut = await svix.application.create({\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const applicationOut = await svix.application.create({\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "application_out = svix.application.create(ApplicationIn(\n name=\"My first application\",\n rate_limit=None,\n uid=\"unique-app-identifier\"\n), None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "application_out = await svix.application.create(ApplicationIn(\n name=\"My first application\",\n rate_limit=None,\n uid=\"unique-app-identifier\"\n), None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "applicationOut, err := svixClient.Application.Create(ctx, &ApplicationIn{\n Name: \"My first application\",\n RateLimit: nil,\n Uid: \"unique-app-identifier\",\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val applicationOut = svix.application.create(ApplicationIn()\n .name(\"My first application\")\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "ApplicationOut applicationOut = svix.getApplication().create(new ApplicationIn()\n .name(\"My first application\")\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "application_out = svix.application.create(Svix::ApplicationIn.new({\n \"name\": \"My first application\",\n \"rate_limit\": nil,\n \"uid\": \"unique-app-identifier\"\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let application_out = svix.application().create(ApplicationIn {\n name: \"My first application\".to_string(),\n rate_limit: None,\n uid: Some(\"unique-app-identifier\".to_string()),\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var applicationOut = await svix.Application.CreateAsync(new ApplicationIn{\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix application create '{\n \"name\": \"My first application\",\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"My first application\",\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n }'" + } + ] + } + }, + "/api/v1/app/{app_id}/": { + "get": { + "tags": [ + "Application" + ], + "summary": "Get Application", + "description": "Get an application.", + "operationId": "v1.application.get", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const applicationOut = await svix.application.get(\"app_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const applicationOut = await svix.application.get(\"app_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "application_out = svix.application.get(\"app_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "application_out = await svix.application.get(\"app_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "applicationOut, err := svixClient.Application.Get(ctx, \"app_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val applicationOut = svix.application.get(\"app_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "ApplicationOut applicationOut = svix.getApplication().get(\"app_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "application_out = svix.application.get(\"app_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let application_out = svix.application().get(\"app_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var applicationOut = await svix.Application.GetAsync(\"app_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix application get \"app_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "put": { + "tags": [ + "Application" + ], + "summary": "Update Application", + "description": "Update an application.", + "operationId": "v1.application.update", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationIn" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationOut" + } + } + } + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const applicationOut = await svix.application.update(\"app_id\", {\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const applicationOut = await svix.application.update(\"app_id\", {\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "application_out = svix.application.update(\"app_id\", ApplicationIn(\n name=\"My first application\",\n rate_limit=None,\n uid=\"unique-app-identifier\"\n))" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "application_out = await svix.application.update(\"app_id\", ApplicationIn(\n name=\"My first application\",\n rate_limit=None,\n uid=\"unique-app-identifier\"\n))" + }, + { + "label": "Go", + "lang": "Go", + "source": "applicationOut, err := svixClient.Application.Update(ctx, \"app_id\", &ApplicationIn{\n Name: \"My first application\",\n RateLimit: nil,\n Uid: \"unique-app-identifier\",\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val applicationOut = svix.application.update(\"app_id\", ApplicationIn()\n .name(\"My first application\")\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "ApplicationOut applicationOut = svix.getApplication().update(\"app_id\", new ApplicationIn()\n .name(\"My first application\")\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "application_out = svix.application.update(\"app_id\", Svix::ApplicationIn.new({\n \"name\": \"My first application\",\n \"rate_limit\": nil,\n \"uid\": \"unique-app-identifier\"\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let application_out = svix.application().update(\"app_id\", ApplicationIn {\n name: \"My first application\".to_string(),\n rate_limit: None,\n uid: Some(\"unique-app-identifier\".to_string()),\n}).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var applicationOut = await svix.Application.UpdateAsync(\"app_id\", new ApplicationIn{\n name: \"My first application\",\n rateLimit: null,\n uid: \"unique-app-identifier\"\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix application update \"app_id\" '{\n \"name\": \"My first application\",\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"My first application\",\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n }'" + } + ] + }, + "delete": { + "tags": [ + "Application" + ], + "summary": "Delete Application", + "description": "Delete an application.", + "operationId": "v1.application.delete", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + } + ], + "responses": { + "204": { + "description": "no content" + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.application.delete(\"app_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.application.delete(\"app_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.application.delete(\"app_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.application.delete(\"app_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.Application.Delete(ctx, \"app_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.application.delete(\"app_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getApplication().delete(\"app_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.application.delete(\"app_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.application().delete(\"app_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.Application.DeleteAsync(\"app_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix application delete \"app_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "patch": { + "tags": [ + "Application" + ], + "summary": "Patch Application", + "description": "Partially update an application.", + "operationId": "v1.application.patch", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationPatch" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplicationOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const applicationOut = await svix.application.patch(\"app_id\", {\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const applicationOut = await svix.application.patch(\"app_id\", {\n rateLimit: null,\n uid: \"unique-app-identifier\"\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "application_out = svix.application.patch(\"app_id\", ApplicationPatch(\n rate_limit=None,\n uid=\"unique-app-identifier\"\n))" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "application_out = await svix.application.patch(\"app_id\", ApplicationPatch(\n rate_limit=None,\n uid=\"unique-app-identifier\"\n))" + }, + { + "label": "Go", + "lang": "Go", + "source": "applicationOut, err := svixClient.Application.Patch(ctx, \"app_id\", &ApplicationPatch{\n RateLimit: nil,\n Uid: \"unique-app-identifier\",\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val applicationOut = svix.application.patch(\"app_id\", ApplicationPatch()\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "ApplicationOut applicationOut = svix.getApplication().patch(\"app_id\", new ApplicationPatch()\n .rateLimit(null)\n .uid(\"unique-app-identifier\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "application_out = svix.application.patch(\"app_id\", Svix::ApplicationPatch.new({\n \"rate_limit\": nil,\n \"uid\": \"unique-app-identifier\"\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let application_out = svix.application().patch(\"app_id\", ApplicationPatch {\n rate_limit: None,\n uid: Some(\"unique-app-identifier\".to_string()),\n}).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var applicationOut = await svix.Application.PatchAsync(\"app_id\", new ApplicationPatch{\n rateLimit: null,\n uid: \"unique-app-identifier\"\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix application patch \"app_id\" '{\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"rateLimit\": null,\n \"uid\": \"unique-app-identifier\"\n }'" + } + ] + } + }, + "/api/v1/app/{app_id}/endpoint/": { + "get": { + "tags": [ + "Endpoint" + ], + "summary": "List Endpoints", + "description": "List the application's endpoints.", + "operationId": "v1.endpoint.list", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of returned items", + "schema": { + "description": "Limit the number of returned items", + "type": "integer", + "format": "uint64", + "maximum": 250.0, + "minimum": 1.0 + }, + "style": "form" + }, + { + "in": "query", + "name": "iterator", + "description": "The iterator returned from a prior invocation", + "schema": { + "description": "The iterator returned from a prior invocation", + "type": "string", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "order", + "description": "The sorting order of the returned items", + "schema": { + "description": "The sorting order of the returned items", + "$ref": "#/components/schemas/Ordering", + "nullable": true + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_EndpointOut_" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const listResponseEndpointOut = await svix.endpoint.list(\"app_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const listResponseEndpointOut = await svix.endpoint.list(\"app_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "list_response_endpoint_out = svix.endpoint.list(\"app_id\", None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "list_response_endpoint_out = await svix.endpoint.list(\"app_id\", None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "listResponseEndpointOut, err := svixClient.Endpoint.List(ctx, \"app_id\", nil)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val listResponseEndpointOut = svix.endpoint.list(\"app_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "ListResponseEndpointOut listResponseEndpointOut = svix.getEndpoint().list(\"app_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "list_response_endpoint_out = svix.endpoint.list(\"app_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let list_response_endpoint_out = svix.endpoint().list(\"app_id\", None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var listResponseEndpointOut = await svix.Endpoint.ListAsync(\"app_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint list \"app_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "post": { + "tags": [ + "Endpoint" + ], + "summary": "Create Endpoint", + "description": "Create a new endpoint for the application.\n\nWhen `secret` is `null` the secret is automatically generated (recommended)", + "operationId": "v1.endpoint.create", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "header", + "name": "idempotency-key", + "description": "The request's idempotency key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointIn" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const endpointOut = await svix.endpoint.create(\"app_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: [\"user.signup\", \"user.deleted\"],\n channels: [\"project_123\", \"group_2\"],\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const endpointOut = await svix.endpoint.create(\"app_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: [\"user.signup\", \"user.deleted\"],\n channels: [\"project_123\", \"group_2\"],\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "endpoint_out = svix.endpoint.create(\"app_id\", EndpointIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n url=\"https://example.com/webhook/\",\n version=1,\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"],\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "endpoint_out = await svix.endpoint.create(\"app_id\", EndpointIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n url=\"https://example.com/webhook/\",\n version=1,\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"],\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "endpointOut, err := svixClient.Endpoint.Create(ctx, \"app_id\", &EndpointIn{\n Description: \"An example endpoint name\",\n RateLimit: nil,\n Uid: \"unique-ep-identifier\",\n Url: \"https://example.com/webhook/\",\n Version: 1,\n Disabled: false,\n FilterTypes: []string{\"user.signup\", \"user.deleted\"},\n Channels: []string{\"project_123\", \"group_2\"},\n Secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val endpointOut = svix.endpoint.create(\"app_id\", EndpointIn()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .url(\"https://example.com/webhook/\")\n .version(1)\n .disabled(false)\n .filterTypes(arrayOf(\"user.signup\", \"user.deleted\"))\n .channels(arrayOf(\"project_123\", \"group_2\"))\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "EndpointOut endpointOut = svix.getEndpoint().create(\"app_id\", new EndpointIn()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .url(\"https://example.com/webhook/\")\n .version(1)\n .disabled(false)\n .filterTypes(new String[]{\"user.signup\", \"user.deleted\"})\n .channels(new String[]{\"project_123\", \"group_2\"})\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "endpoint_out = svix.endpoint.create(\"app_id\", Svix::EndpointIn.new({\n \"description\": \"An example endpoint name\",\n \"rate_limit\": nil,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filter_types\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"],\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let endpoint_out = svix.endpoint().create(\"app_id\", EndpointIn {\n description: Some(\"An example endpoint name\".to_string()),\n rate_limit: None,\n uid: Some(\"unique-ep-identifier\".to_string()),\n url: \"https://example.com/webhook/\".to_string(),\n version: Some(1),\n disabled: Some(false),\n filter_types: Some(vec![\"user.signup\".to_string(), \"user.deleted\".to_string()]),\n channels: Some(vec![\"project_123\".to_string(), \"group_2\".to_string()]),\n secret: Some(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\".to_string()),\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var endpointOut = await svix.Endpoint.CreateAsync(\"app_id\", new EndpointIn{\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: new string[] {\"user.signup\", \"user.deleted\"},\n channels: new string[] {\"project_123\", \"group_2\"},\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint create \"app_id\" '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"],\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"],\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n }'" + } + ] + } + }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/": { + "get": { + "tags": [ + "Endpoint" + ], + "summary": "Get Endpoint", + "description": "Get an endpoint.", + "operationId": "v1.endpoint.get", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const endpointOut = await svix.endpoint.get(\"app_id\", \"endpoint_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const endpointOut = await svix.endpoint.get(\"app_id\", \"endpoint_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "endpoint_out = svix.endpoint.get(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "endpoint_out = await svix.endpoint.get(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "endpointOut, err := svixClient.Endpoint.Get(ctx, \"app_id\", \"endpoint_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val endpointOut = svix.endpoint.get(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "EndpointOut endpointOut = svix.getEndpoint().get(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "endpoint_out = svix.endpoint.get(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let endpoint_out = svix.endpoint().get(\"app_id\", \"endpoint_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var endpointOut = await svix.Endpoint.GetAsync(\"app_id\", \"endpoint_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint get \"app_id\" \"endpoint_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "put": { + "tags": [ + "Endpoint" + ], + "summary": "Update Endpoint", + "description": "Update an endpoint.", + "operationId": "v1.endpoint.update", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointUpdate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointOut" + } + } + } + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const endpointOut = await svix.endpoint.update(\"app_id\", \"endpoint_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: [\"user.signup\", \"user.deleted\"],\n channels: [\"project_123\", \"group_2\"]\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const endpointOut = await svix.endpoint.update(\"app_id\", \"endpoint_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: [\"user.signup\", \"user.deleted\"],\n channels: [\"project_123\", \"group_2\"]\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "endpoint_out = svix.endpoint.update(\"app_id\", \"endpoint_id\", EndpointUpdate(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n url=\"https://example.com/webhook/\",\n version=1,\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"]\n))" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "endpoint_out = await svix.endpoint.update(\"app_id\", \"endpoint_id\", EndpointUpdate(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n url=\"https://example.com/webhook/\",\n version=1,\n disabled=False,\n filter_types=[\"user.signup\", \"user.deleted\"],\n channels=[\"project_123\", \"group_2\"]\n))" + }, + { + "label": "Go", + "lang": "Go", + "source": "endpointOut, err := svixClient.Endpoint.Update(ctx, \"app_id\", \"endpoint_id\", &EndpointUpdate{\n Description: \"An example endpoint name\",\n RateLimit: nil,\n Uid: \"unique-ep-identifier\",\n Url: \"https://example.com/webhook/\",\n Version: 1,\n Disabled: false,\n FilterTypes: []string{\"user.signup\", \"user.deleted\"},\n Channels: []string{\"project_123\", \"group_2\"},\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val endpointOut = svix.endpoint.update(\"app_id\", \"endpoint_id\", EndpointUpdate()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .url(\"https://example.com/webhook/\")\n .version(1)\n .disabled(false)\n .filterTypes(arrayOf(\"user.signup\", \"user.deleted\"))\n .channels(arrayOf(\"project_123\", \"group_2\"))\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "EndpointOut endpointOut = svix.getEndpoint().update(\"app_id\", \"endpoint_id\", new EndpointUpdate()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .url(\"https://example.com/webhook/\")\n .version(1)\n .disabled(false)\n .filterTypes(new String[]{\"user.signup\", \"user.deleted\"})\n .channels(new String[]{\"project_123\", \"group_2\"})\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "endpoint_out = svix.endpoint.update(\"app_id\", \"endpoint_id\", Svix::EndpointUpdate.new({\n \"description\": \"An example endpoint name\",\n \"rate_limit\": nil,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filter_types\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"]\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let endpoint_out = svix.endpoint().update(\"app_id\", \"endpoint_id\", EndpointUpdate {\n description: Some(\"An example endpoint name\".to_string()),\n rate_limit: None,\n uid: Some(\"unique-ep-identifier\".to_string()),\n url: \"https://example.com/webhook/\".to_string(),\n version: Some(1),\n disabled: Some(false),\n filter_types: Some(vec![\"user.signup\".to_string(), \"user.deleted\".to_string()]),\n channels: Some(vec![\"project_123\".to_string(), \"group_2\".to_string()]),\n}).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var endpointOut = await svix.Endpoint.UpdateAsync(\"app_id\", \"endpoint_id\", new EndpointUpdate{\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n url: \"https://example.com/webhook/\",\n version: 1,\n disabled: false,\n filterTypes: new string[] {\"user.signup\", \"user.deleted\"},\n channels: new string[] {\"project_123\", \"group_2\"}\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint update \"app_id\" \"endpoint_id\" '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"]\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"version\": 1,\n \"disabled\": false,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"channels\": [\"project_123\", \"group_2\"]\n }'" + } + ] + }, + "delete": { + "tags": [ + "Endpoint" + ], + "summary": "Delete Endpoint", + "description": "Delete an endpoint.", + "operationId": "v1.endpoint.delete", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + } + ], + "responses": { + "204": { + "description": "no content" + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.endpoint.delete(\"app_id\", \"endpoint_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.endpoint.delete(\"app_id\", \"endpoint_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.endpoint.delete(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.endpoint.delete(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.Endpoint.Delete(ctx, \"app_id\", \"endpoint_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.endpoint.delete(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getEndpoint().delete(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.endpoint.delete(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.endpoint().delete(\"app_id\", \"endpoint_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.Endpoint.DeleteAsync(\"app_id\", \"endpoint_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint delete \"app_id\" \"endpoint_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "patch": { + "tags": [ + "Endpoint" + ], + "summary": "Patch Endpoint", + "description": "Partially update an endpoint.", + "operationId": "v1.endpoint.patch", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointPatch" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const endpointOut = await svix.endpoint.patch(\"app_id\", \"endpoint_id\", {\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n version: 1,\n filterTypes: null,\n channels: null,\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const endpointOut = await svix.endpoint.patch(\"app_id\", \"endpoint_id\", {\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n version: 1,\n filterTypes: null,\n channels: null,\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "endpoint_out = svix.endpoint.patch(\"app_id\", \"endpoint_id\", EndpointPatch(\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n version=1,\n filter_types=None,\n channels=None,\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n))" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "endpoint_out = await svix.endpoint.patch(\"app_id\", \"endpoint_id\", EndpointPatch(\n rate_limit=None,\n uid=\"unique-ep-identifier\",\n version=1,\n filter_types=None,\n channels=None,\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n))" + }, + { + "label": "Go", + "lang": "Go", + "source": "endpointOut, err := svixClient.Endpoint.Patch(ctx, \"app_id\", \"endpoint_id\", &EndpointPatch{\n RateLimit: nil,\n Uid: \"unique-ep-identifier\",\n Version: 1,\n FilterTypes: nil,\n Channels: nil,\n Secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val endpointOut = svix.endpoint.patch(\"app_id\", \"endpoint_id\", EndpointPatch()\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .version(1)\n .filterTypes(null)\n .channels(null)\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "EndpointOut endpointOut = svix.getEndpoint().patch(\"app_id\", \"endpoint_id\", new EndpointPatch()\n .rateLimit(null)\n .uid(\"unique-ep-identifier\")\n .version(1)\n .filterTypes(null)\n .channels(null)\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "endpoint_out = svix.endpoint.patch(\"app_id\", \"endpoint_id\", Svix::EndpointPatch.new({\n \"rate_limit\": nil,\n \"uid\": \"unique-ep-identifier\",\n \"version\": 1,\n \"filter_types\": nil,\n \"channels\": nil,\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let endpoint_out = svix.endpoint().patch(\"app_id\", \"endpoint_id\", EndpointPatch {\n rate_limit: None,\n uid: Some(\"unique-ep-identifier\".to_string()),\n version: Some(1),\n filter_types: None,\n channels: None,\n secret: Some(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\".to_string()),\n}).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var endpointOut = await svix.Endpoint.PatchAsync(\"app_id\", \"endpoint_id\", new EndpointPatch{\n rateLimit: null,\n uid: \"unique-ep-identifier\",\n version: 1,\n filterTypes: null,\n channels: null,\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint patch \"app_id\" \"endpoint_id\" '{\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"version\": 1,\n \"filterTypes\": null,\n \"channels\": null,\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"rateLimit\": null,\n \"uid\": \"unique-ep-identifier\",\n \"version\": 1,\n \"filterTypes\": null,\n \"channels\": null,\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n }'" + } + ] + } + }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/": { + "get": { + "tags": [ + "Endpoint" + ], + "summary": "Get Endpoint Secret", + "description": "Get the endpoint's signing secret.\n\nThis is used to verify the authenticity of the webhook.\nFor more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).", + "operationId": "v1.endpoint.get-secret", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointSecretOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const endpointSecretOut = await svix.endpoint.getSecret(\"app_id\", \"endpoint_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const endpointSecretOut = await svix.endpoint.getSecret(\"app_id\", \"endpoint_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "endpoint_secret_out = svix.endpoint.get_secret(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "endpoint_secret_out = await svix.endpoint.get_secret(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "endpointSecretOut, err := svixClient.Endpoint.GetSecret(ctx, \"app_id\", \"endpoint_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val endpointSecretOut = svix.endpoint.getSecret(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "EndpointSecretOut endpointSecretOut = svix.getEndpoint().getSecret(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "endpoint_secret_out = svix.endpoint.get_secret(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let endpoint_secret_out = svix.endpoint().get_secret(\"app_id\", \"endpoint_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var endpointSecretOut = await svix.Endpoint.GetSecretAsync(\"app_id\", \"endpoint_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint get-secret \"app_id\" \"endpoint_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate/": { + "post": { + "tags": [ + "Endpoint" + ], + "summary": "Rotate Endpoint Secret", + "description": "Rotates the endpoint's signing secret. The previous secret will be valid for the next 24 hours.", + "operationId": "v1.endpoint.rotate-secret", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + }, + { + "in": "header", + "name": "idempotency-key", + "description": "The request's idempotency key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointSecretRotateIn" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "no content" + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.endpoint.rotateSecret(\"app_id\", \"endpoint_id\", {\n key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.endpoint.rotateSecret(\"app_id\", \"endpoint_id\", {\n key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.endpoint.rotate_secret(\"app_id\", \"endpoint_id\", EndpointSecretRotateIn(\n key=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.endpoint.rotate_secret(\"app_id\", \"endpoint_id\", EndpointSecretRotateIn(\n key=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.Endpoint.RotateSecret(ctx, \"app_id\", \"endpoint_id\", &EndpointSecretRotateIn{\n Key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.endpoint.rotateSecret(\"app_id\", \"endpoint_id\", EndpointSecretRotateIn()\n .key(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getEndpoint().rotateSecret(\"app_id\", \"endpoint_id\", new EndpointSecretRotateIn()\n .key(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.endpoint.rotate_secret(\"app_id\", \"endpoint_id\", Svix::EndpointSecretRotateIn.new({\n \"key\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.endpoint().rotate_secret(\"app_id\", \"endpoint_id\", EndpointSecretRotateIn {\n key: Some(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\".to_string()),\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.Endpoint.RotateSecretAsync(\"app_id\", \"endpoint_id\", new EndpointSecretRotateIn{\n key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint rotate-secret \"app_id\" \"endpoint_id\" '{\n \"key\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"key\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n }'" + } + ] + } + }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats/": { + "get": { + "tags": [ + "Endpoint" + ], + "summary": "Endpoint Stats", + "description": "Get basic statistics for the endpoint.", + "operationId": "v1.endpoint.get-stats", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + }, + { + "in": "query", + "name": "since", + "description": "Filter the range to data starting from this date", + "schema": { + "description": "Filter the range to data starting from this date", + "type": "string", + "format": "date-time", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "until", + "description": "Filter the range to data ending by this date", + "schema": { + "description": "Filter the range to data ending by this date", + "type": "string", + "format": "date-time", + "nullable": true + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointStats" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const endpointStats = await svix.endpoint.getStats(\"app_id\", \"endpoint_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const endpointStats = await svix.endpoint.getStats(\"app_id\", \"endpoint_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "endpoint_stats = svix.endpoint.get_stats(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "endpoint_stats = await svix.endpoint.get_stats(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "endpointStats, err := svixClient.Endpoint.GetStats(ctx, \"app_id\", \"endpoint_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val endpointStats = svix.endpoint.getStats(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "EndpointStats endpointStats = svix.getEndpoint().getStats(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "endpoint_stats = svix.endpoint.get_stats(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let endpoint_stats = svix.endpoint().get_stats(\"app_id\", \"endpoint_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var endpointStats = await svix.Endpoint.GetStatsAsync(\"app_id\", \"endpoint_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint get-stats \"app_id\" \"endpoint_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover/": { + "post": { + "tags": [ + "Endpoint" + ], + "summary": "Recover Failed Webhooks", + "description": "Resend all failed messages since a given time.", + "operationId": "v1.endpoint.recover", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + }, + { + "in": "header", + "name": "idempotency-key", + "description": "The request's idempotency key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RecoverIn" + } + } + }, + "required": true + }, + "responses": { + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RecoverOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const recoverOut = await svix.endpoint.recover(\"app_id\", \"endpoint_id\", {\n until: null\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const recoverOut = await svix.endpoint.recover(\"app_id\", \"endpoint_id\", {\n until: null\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "recover_out = svix.endpoint.recover(\"app_id\", \"endpoint_id\", RecoverIn(\n until=None\n), None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "recover_out = await svix.endpoint.recover(\"app_id\", \"endpoint_id\", RecoverIn(\n until=None\n), None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "recoverOut, err := svixClient.Endpoint.Recover(ctx, \"app_id\", \"endpoint_id\", &RecoverIn{\n Until: nil,\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val recoverOut = svix.endpoint.recover(\"app_id\", \"endpoint_id\", RecoverIn()\n .until(null)\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "RecoverOut recoverOut = svix.getEndpoint().recover(\"app_id\", \"endpoint_id\", new RecoverIn()\n .until(null)\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "recover_out = svix.endpoint.recover(\"app_id\", \"endpoint_id\", Svix::RecoverIn.new({\n \"until\": nil\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let recover_out = svix.endpoint().recover(\"app_id\", \"endpoint_id\", RecoverIn {\n until: None,\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var recoverOut = await svix.Endpoint.RecoverAsync(\"app_id\", \"endpoint_id\", new RecoverIn{\n until: null\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint recover \"app_id\" \"endpoint_id\" '{\n \"until\": null\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"until\": null\n }'" + } + ] + } + }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing/": { + "post": { + "tags": [ + "Endpoint" + ], + "summary": "Replay Missing Webhooks", + "description": "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.", + "operationId": "v1.endpoint.replay", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + }, + { + "in": "header", + "name": "idempotency-key", + "description": "The request's idempotency key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReplayIn" + } + } + }, + "required": true + }, + "responses": { + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReplayOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const replayOut = await svix.endpoint.replay(\"app_id\", \"endpoint_id\", {\n until: null\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const replayOut = await svix.endpoint.replay(\"app_id\", \"endpoint_id\", {\n until: null\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "replay_out = svix.endpoint.replay(\"app_id\", \"endpoint_id\", ReplayIn(\n until=None\n), None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "replay_out = await svix.endpoint.replay(\"app_id\", \"endpoint_id\", ReplayIn(\n until=None\n), None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "replayOut, err := svixClient.Endpoint.Replay(ctx, \"app_id\", \"endpoint_id\", &ReplayIn{\n Until: nil,\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val replayOut = svix.endpoint.replay(\"app_id\", \"endpoint_id\", ReplayIn()\n .until(null)\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "ReplayOut replayOut = svix.getEndpoint().replay(\"app_id\", \"endpoint_id\", new ReplayIn()\n .until(null)\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "replay_out = svix.endpoint.replay(\"app_id\", \"endpoint_id\", Svix::ReplayIn.new({\n \"until\": nil\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let replay_out = svix.endpoint().replay(\"app_id\", \"endpoint_id\", ReplayIn {\n until: None,\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var replayOut = await svix.Endpoint.ReplayAsync(\"app_id\", \"endpoint_id\", new ReplayIn{\n until: null\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint replay \"app_id\" \"endpoint_id\" '{\n \"until\": null\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"until\": null\n }'" + } + ] + } + }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/": { + "get": { + "tags": [ + "Endpoint" + ], + "summary": "Get Endpoint Headers", + "description": "Get the additional headers to be sent with the webhook", + "operationId": "v1.endpoint.get-headers", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointHeadersOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const endpointHeadersOut = await svix.endpoint.getHeaders(\"app_id\", \"endpoint_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const endpointHeadersOut = await svix.endpoint.getHeaders(\"app_id\", \"endpoint_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "endpoint_headers_out = svix.endpoint.get_headers(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "endpoint_headers_out = await svix.endpoint.get_headers(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "endpointHeadersOut, err := svixClient.Endpoint.GetHeaders(ctx, \"app_id\", \"endpoint_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val endpointHeadersOut = svix.endpoint.getHeaders(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "EndpointHeadersOut endpointHeadersOut = svix.getEndpoint().getHeaders(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "endpoint_headers_out = svix.endpoint.get_headers(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let endpoint_headers_out = svix.endpoint().get_headers(\"app_id\", \"endpoint_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var endpointHeadersOut = await svix.Endpoint.GetHeadersAsync(\"app_id\", \"endpoint_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint get-headers \"app_id\" \"endpoint_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "put": { + "tags": [ + "Endpoint" + ], + "summary": "Update Endpoint Headers", + "description": "Set the additional headers to be sent with the webhook", + "operationId": "v1.endpoint.update-headers", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointHeadersIn" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "no content" + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.endpoint.updateHeaders(\"app_id\", \"endpoint_id\", {\n headers: {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.endpoint.updateHeaders(\"app_id\", \"endpoint_id\", {\n headers: {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.endpoint.update_headers(\"app_id\", \"endpoint_id\", EndpointHeadersIn(\n headers={\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"}\n))" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.endpoint.update_headers(\"app_id\", \"endpoint_id\", EndpointHeadersIn(\n headers={\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"}\n))" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.Endpoint.UpdateHeaders(ctx, \"app_id\", \"endpoint_id\", &EndpointHeadersIn{\n Headers: map[string]interface{}{\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"},\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.endpoint.updateHeaders(\"app_id\", \"endpoint_id\", EndpointHeadersIn()\n .headers(\"\"\"{\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\"\"\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getEndpoint().updateHeaders(\"app_id\", \"endpoint_id\", new EndpointHeadersIn()\n .headers(\"{\\\"X-Example\\\":\\\"123\\\",\\\"X-Foobar\\\":\\\"Bar\\\"}\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.endpoint.update_headers(\"app_id\", \"endpoint_id\", Svix::EndpointHeadersIn.new({\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.endpoint().update_headers(\"app_id\", \"endpoint_id\", EndpointHeadersIn {\n headers: json!({\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}),\n}).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.Endpoint.UpdateHeadersAsync(\"app_id\", \"endpoint_id\", new EndpointHeadersIn{\n headers: new {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint update-headers \"app_id\" \"endpoint_id\" '{\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n }'" + } + ] + }, + "patch": { + "tags": [ + "Endpoint" + ], + "summary": "Patch Endpoint Headers", + "description": "Partially set the additional headers to be sent with the webhook", + "operationId": "v1.endpoint.patch-headers", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointHeadersPatchIn" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "no content" + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.endpoint.patchHeaders(\"app_id\", \"endpoint_id\", {\n headers: {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.endpoint.patchHeaders(\"app_id\", \"endpoint_id\", {\n headers: {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.endpoint.patch_headers(\"app_id\", \"endpoint_id\", EndpointHeadersPatchIn(\n headers={\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"}\n))" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.endpoint.patch_headers(\"app_id\", \"endpoint_id\", EndpointHeadersPatchIn(\n headers={\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"}\n))" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.Endpoint.PatchHeaders(ctx, \"app_id\", \"endpoint_id\", &EndpointHeadersPatchIn{\n Headers: map[string]interface{}{\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"},\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.endpoint.patchHeaders(\"app_id\", \"endpoint_id\", EndpointHeadersPatchIn()\n .headers(\"\"\"{\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\"\"\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getEndpoint().patchHeaders(\"app_id\", \"endpoint_id\", new EndpointHeadersPatchIn()\n .headers(\"{\\\"X-Example\\\":\\\"123\\\",\\\"X-Foobar\\\":\\\"Bar\\\"}\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.endpoint.patch_headers(\"app_id\", \"endpoint_id\", Svix::EndpointHeadersPatchIn.new({\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.endpoint().patch_headers(\"app_id\", \"endpoint_id\", EndpointHeadersPatchIn {\n headers: json!({\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}),\n}).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.Endpoint.PatchHeadersAsync(\"app_id\", \"endpoint_id\", new EndpointHeadersPatchIn{\n headers: new {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint patch-headers \"app_id\" \"endpoint_id\" '{\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n }'" + } + ] + } + }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/": { + "get": { + "tags": [ + "Endpoint" + ], + "summary": "Get Endpoint Transformation", + "description": "Get the transformation code associated with this endpoint", + "operationId": "v1.endpoint.transformation-get", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointTransformationOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const endpointTransformationOut = await svix.endpoint.transformationGet(\"app_id\", \"endpoint_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const endpointTransformationOut = await svix.endpoint.transformationGet(\"app_id\", \"endpoint_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "endpoint_transformation_out = svix.endpoint.transformation_get(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "endpoint_transformation_out = await svix.endpoint.transformation_get(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "endpointTransformationOut, err := svixClient.Endpoint.TransformationGet(ctx, \"app_id\", \"endpoint_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val endpointTransformationOut = svix.endpoint.transformationGet(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "EndpointTransformationOut endpointTransformationOut = svix.getEndpoint().transformationGet(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "endpoint_transformation_out = svix.endpoint.transformation_get(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let endpoint_transformation_out = svix.endpoint().transformation_get(\"app_id\", \"endpoint_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var endpointTransformationOut = await svix.Endpoint.TransformationGetAsync(\"app_id\", \"endpoint_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint transformation-get \"app_id\" \"endpoint_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "patch": { + "tags": [ + "Endpoint" + ], + "summary": "Set Endpoint Transformation", + "description": "Set or unset the transformation code associated with this endpoint", + "operationId": "v1.endpoint.transformation-partial-update", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointTransformationIn" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "no content" + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.endpoint.transformationPartialUpdate(\"app_id\", \"endpoint_id\", {\n code: null\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.endpoint.transformationPartialUpdate(\"app_id\", \"endpoint_id\", {\n code: null\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.endpoint.transformation_partial_update(\"app_id\", \"endpoint_id\", EndpointTransformationIn(\n code=None\n))" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.endpoint.transformation_partial_update(\"app_id\", \"endpoint_id\", EndpointTransformationIn(\n code=None\n))" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.Endpoint.TransformationPartialUpdate(ctx, \"app_id\", \"endpoint_id\", &EndpointTransformationIn{\n Code: nil,\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.endpoint.transformationPartialUpdate(\"app_id\", \"endpoint_id\", EndpointTransformationIn()\n .code(null)\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getEndpoint().transformationPartialUpdate(\"app_id\", \"endpoint_id\", new EndpointTransformationIn()\n .code(null)\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.endpoint.transformation_partial_update(\"app_id\", \"endpoint_id\", Svix::EndpointTransformationIn.new({\n \"code\": nil\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.endpoint().transformation_partial_update(\"app_id\", \"endpoint_id\", EndpointTransformationIn {\n code: None,\n}).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.Endpoint.TransformationPartialUpdateAsync(\"app_id\", \"endpoint_id\", new EndpointTransformationIn{\n code: null\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint transformation-partial-update \"app_id\" \"endpoint_id\" '{\n \"code\": null\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"code\": null\n }'" + } + ] + } + }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example/": { + "post": { + "tags": [ + "Endpoint" + ], + "summary": "Send Event Type Example Message", + "description": "Send an example message for event", + "operationId": "v1.endpoint.send-example", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + }, + { + "in": "header", + "name": "idempotency-key", + "description": "The request's idempotency key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventExampleIn" + } + } + }, + "required": true + }, + "responses": { + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const messageOut = await svix.endpoint.sendExample(\"app_id\", \"endpoint_id\", {\n eventType: \"user.signup\"\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const messageOut = await svix.endpoint.sendExample(\"app_id\", \"endpoint_id\", {\n eventType: \"user.signup\"\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "message_out = svix.endpoint.send_example(\"app_id\", \"endpoint_id\", EventExampleIn(\n event_type=\"user.signup\"\n), None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "message_out = await svix.endpoint.send_example(\"app_id\", \"endpoint_id\", EventExampleIn(\n event_type=\"user.signup\"\n), None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "messageOut, err := svixClient.Endpoint.SendExample(ctx, \"app_id\", \"endpoint_id\", &EventExampleIn{\n EventType: \"user.signup\",\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val messageOut = svix.endpoint.sendExample(\"app_id\", \"endpoint_id\", EventExampleIn()\n .eventType(\"user.signup\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "MessageOut messageOut = svix.getEndpoint().sendExample(\"app_id\", \"endpoint_id\", new EventExampleIn()\n .eventType(\"user.signup\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "message_out = svix.endpoint.send_example(\"app_id\", \"endpoint_id\", Svix::EventExampleIn.new({\n \"event_type\": \"user.signup\"\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let message_out = svix.endpoint().send_example(\"app_id\", \"endpoint_id\", EventExampleIn {\n event_type: \"user.signup\".to_string(),\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var messageOut = await svix.Endpoint.SendExampleAsync(\"app_id\", \"endpoint_id\", new EventExampleIn{\n eventType: \"user.signup\"\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix endpoint send-example \"app_id\" \"endpoint_id\" '{\n \"eventType\": \"user.signup\"\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"eventType\": \"user.signup\"\n }'" + } + ] + } + }, + "/api/v1/event-type/": { + "get": { + "tags": [ + "Event Type" + ], + "summary": "List Event Types", + "description": "Return the list of event types.", + "operationId": "v1.event-type.list", + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "Limit the number of returned items", + "schema": { + "description": "Limit the number of returned items", + "type": "integer", + "format": "uint64", + "maximum": 250.0, + "minimum": 1.0 + }, + "style": "form" + }, + { + "in": "query", + "name": "iterator", + "description": "The iterator returned from a prior invocation", + "schema": { + "description": "The iterator returned from a prior invocation", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "order", + "description": "The sorting order of the returned items", + "schema": { + "description": "The sorting order of the returned items", + "$ref": "#/components/schemas/Ordering", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "include_archived", + "description": "When `true` archived (deleted but not expunged) items are included in the response", + "schema": { + "description": "When `true` archived (deleted but not expunged) items are included in the response", + "default": false, + "type": "boolean" + }, + "style": "form" + }, + { + "in": "query", + "name": "with_content", + "description": "When `true` the full item (including the schema) is included in the response", + "schema": { + "description": "When `true` the full item (including the schema) is included in the response", + "default": false, + "type": "boolean" + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_EventTypeOut_" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const listResponseEventTypeOut = await svix.eventType.list();" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const listResponseEventTypeOut = await svix.eventType.list();" + }, + { + "label": "Python", + "lang": "Python", + "source": "list_response_event_type_out = svix.event_type.list(None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "list_response_event_type_out = await svix.event_type.list(None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "listResponseEventTypeOut, err := svixClient.EventType.List(ctx, nil)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val listResponseEventTypeOut = svix.eventType.list()" + }, + { + "label": "Java", + "lang": "Java", + "source": "ListResponseEventTypeOut listResponseEventTypeOut = svix.getEventType().list()" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "list_response_event_type_out = svix.event_type.list()" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let list_response_event_type_out = svix.event_type().list(None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var listResponseEventTypeOut = await svix.EventType.ListAsync()" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix event-type list " + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/event-type/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "post": { + "tags": [ + "Event Type" + ], + "summary": "Create Event Type", + "description": "Create new or unarchive existing event type.\n\nUnarchiving an event type will allow endpoints to filter on it and messages to be sent with it.\nEndpoints filtering on the event type before archival will continue to filter on it.\nThis operation does not preserve the description and schemas.", + "operationId": "v1.event-type.create", + "parameters": [ + { + "in": "header", + "name": "idempotency-key", + "description": "The request's idempotency key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventTypeIn" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventTypeOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const eventTypeOut = await svix.eventType.create({\n name: \"user.signup\",\n description: \"A user has signed up\",\n archived: false,\n schemas: {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n featureFlag: \"cool-new-feature\"\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const eventTypeOut = await svix.eventType.create({\n name: \"user.signup\",\n description: \"A user has signed up\",\n archived: false,\n schemas: {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n featureFlag: \"cool-new-feature\"\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "event_type_out = svix.event_type.create(EventTypeIn(\n name=\"user.signup\",\n description=\"A user has signed up\",\n archived=False,\n schemas={\"1\": {\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n feature_flag=\"cool-new-feature\"\n), None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "event_type_out = await svix.event_type.create(EventTypeIn(\n name=\"user.signup\",\n description=\"A user has signed up\",\n archived=False,\n schemas={\"1\": {\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n feature_flag=\"cool-new-feature\"\n), None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "eventTypeOut, err := svixClient.EventType.Create(ctx, &EventTypeIn{\n Name: \"user.signup\",\n Description: \"A user has signed up\",\n Archived: false,\n Schemas: map[interface{}]interface{}{\"1\": map[string]interface{}{\"description\": \"An invoice was paid by a user\", \"properties\": map[interface{}]interface{}{\"invoiceId\": map[string]interface{}{\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": map[string]interface{}{\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": []string{\"invoiceId\", \"userId\"}, \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n FeatureFlag: \"cool-new-feature\",\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val eventTypeOut = svix.eventType.create(EventTypeIn()\n .name(\"user.signup\")\n .description(\"A user has signed up\")\n .archived(false)\n .schemas(\"\"\"{\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}}\"\"\")\n .featureFlag(\"cool-new-feature\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "EventTypeOut eventTypeOut = svix.getEventType().create(new EventTypeIn()\n .name(\"user.signup\")\n .description(\"A user has signed up\")\n .archived(false)\n .schemas(\"{\\\"1\\\":{\\\"description\\\":\\\"An invoice was paid by a user\\\",\\\"properties\\\":{\\\"invoiceId\\\":{\\\"description\\\":\\\"The invoice id\\\",\\\"type\\\":\\\"string\\\"},\\\"userId\\\":{\\\"description\\\":\\\"The user id\\\",\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"invoiceId\\\",\\\"userId\\\"],\\\"title\\\":\\\"Invoice Paid Event\\\",\\\"type\\\":\\\"object\\\"}}\")\n .featureFlag(\"cool-new-feature\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "event_type_out = svix.event_type.create(Svix::EventTypeIn.new({\n \"name\": \"user.signup\",\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"feature_flag\": \"cool-new-feature\"\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let event_type_out = svix.event_type().create(EventTypeIn {\n name: \"user.signup\".to_string(),\n description: \"A user has signed up\".to_string(),\n archived: Some(false),\n schemas: Some(json!({\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}})),\n feature_flag: Some(\"cool-new-feature\".to_string()),\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var eventTypeOut = await svix.EventType.CreateAsync(new EventTypeIn{\n name: \"user.signup\",\n description: \"A user has signed up\",\n archived: false,\n schemas: new {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n featureFlag: \"cool-new-feature\"\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix event-type create '{\n \"name\": \"user.signup\",\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"featureFlag\": \"cool-new-feature\"\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/event-type/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"user.signup\",\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"featureFlag\": \"cool-new-feature\"\n }'" + } + ] + } + }, + "/api/v1/event-type/import/openapi/": { + "post": { + "tags": [ + "Event Type" + ], + "summary": "Event Type Import From Openapi", + "description": "Given an OpenAPI spec, create new or update existing event types.\nIf an existing `archived` event type is updated, it will be unarchvied.\n\nThe importer will convert all webhooks found in the either the `webhooks` or `x-webhooks`\ntop-level.", + "operationId": "v1.event-type.import-openapi", + "parameters": [ + { + "in": "header", + "name": "idempotency-key", + "description": "The request's idempotency key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "description": "Import a list of event types from webhooks defined in an OpenAPI spec.\n\nThe 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**.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventTypeImportOpenApiIn" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventTypeImportOpenApiOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const eventTypeImportOpenApiOut = await svix.eventType.importOpenapi({\n spec: {\"components\":{\"schemas\":{\"Pet\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Pet\"}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n specRaw: {\"components\":{\"schemas\":{\"Pet\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Pet\"}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const eventTypeImportOpenApiOut = await svix.eventType.importOpenapi({\n spec: {\"components\":{\"schemas\":{\"Pet\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Pet\"}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n specRaw: {\"components\":{\"schemas\":{\"Pet\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Pet\"}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "event_type_import_open_api_out = svix.event_type.import_openapi(EventTypeImportOpenApiIn(\n spec={\"components\": {\"schemas\": {\"Pet\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"$ref\": \"#/components/schemas/Pet\"}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n spec_raw={\"components\": {\"schemas\": {\"Pet\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"$ref\": \"#/components/schemas/Pet\"}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n), None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "event_type_import_open_api_out = await svix.event_type.import_openapi(EventTypeImportOpenApiIn(\n spec={\"components\": {\"schemas\": {\"Pet\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"$ref\": \"#/components/schemas/Pet\"}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n spec_raw={\"components\": {\"schemas\": {\"Pet\": {\"properties\": {\"id\": {\"format\": \"int64\", \"type\": \"integer\"}, \"name\": {\"type\": \"string\"}, \"tag\": {\"type\": \"string\"}}, \"required\": [\"id\", \"name\"]}}}, \"info\": {\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": {\"pet.new\": {\"post\": {\"requestBody\": {\"content\": {\"application/json\": {\"schema\": {\"$ref\": \"#/components/schemas/Pet\"}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": {\"200\": {\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n), None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "eventTypeImportOpenApiOut, err := svixClient.EventType.ImportOpenapi(ctx, &EventTypeImportOpenApiIn{\n Spec: map[interface{}]interface{}{\"components\": map[interface{}]interface{}{\"schemas\": map[interface{}]interface{}{\"Pet\": map[interface{}]interface{}{\"properties\": map[interface{}]interface{}{\"id\": map[string]interface{}{\"format\": \"int64\", \"type\": \"integer\"}, \"name\": map[string]interface{}{\"type\": \"string\"}, \"tag\": map[string]interface{}{\"type\": \"string\"}}, \"required\": []string{\"id\", \"name\"}}}}, \"info\": map[string]interface{}{\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": map[interface{}]interface{}{\"pet.new\": map[interface{}]interface{}{\"post\": map[interface{}]interface{}{\"requestBody\": map[interface{}]interface{}{\"content\": map[interface{}]interface{}{\"application/json\": map[interface{}]interface{}{\"schema\": map[string]interface{}{\"$ref\": \"#/components/schemas/Pet\"}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": map[interface{}]interface{}{\"200\": map[string]interface{}{\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n SpecRaw: map[interface{}]interface{}{\"components\": map[interface{}]interface{}{\"schemas\": map[interface{}]interface{}{\"Pet\": map[interface{}]interface{}{\"properties\": map[interface{}]interface{}{\"id\": map[string]interface{}{\"format\": \"int64\", \"type\": \"integer\"}, \"name\": map[string]interface{}{\"type\": \"string\"}, \"tag\": map[string]interface{}{\"type\": \"string\"}}, \"required\": []string{\"id\", \"name\"}}}}, \"info\": map[string]interface{}{\"title\": \"Webhook Example\", \"version\": \"1.0.0\"}, \"openapi\": \"3.1.0\", \"webhooks\": map[interface{}]interface{}{\"pet.new\": map[interface{}]interface{}{\"post\": map[interface{}]interface{}{\"requestBody\": map[interface{}]interface{}{\"content\": map[interface{}]interface{}{\"application/json\": map[interface{}]interface{}{\"schema\": map[string]interface{}{\"$ref\": \"#/components/schemas/Pet\"}}}, \"description\": \"Information about a new pet in the system\"}, \"responses\": map[interface{}]interface{}{\"200\": map[string]interface{}{\"description\": \"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val eventTypeImportOpenApiOut = svix.eventType.importOpenapi(EventTypeImportOpenApiIn()\n .spec(\"\"\"{\"components\":{\"schemas\":{\"Pet\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Pet\"}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\"\"\")\n .specRaw(\"\"\"{\"components\":{\"schemas\":{\"Pet\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Pet\"}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\"\"\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "EventTypeImportOpenApiOut eventTypeImportOpenApiOut = svix.getEventType().importOpenapi(new EventTypeImportOpenApiIn()\n .spec(\"{\\\"components\\\":{\\\"schemas\\\":{\\\"Pet\\\":{\\\"properties\\\":{\\\"id\\\":{\\\"format\\\":\\\"int64\\\",\\\"type\\\":\\\"integer\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"tag\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"id\\\",\\\"name\\\"]}}},\\\"info\\\":{\\\"title\\\":\\\"Webhook Example\\\",\\\"version\\\":\\\"1.0.0\\\"},\\\"openapi\\\":\\\"3.1.0\\\",\\\"webhooks\\\":{\\\"pet.new\\\":{\\\"post\\\":{\\\"requestBody\\\":{\\\"content\\\":{\\\"application/json\\\":{\\\"schema\\\":{\\\"$ref\\\":\\\"#/components/schemas/Pet\\\"}}},\\\"description\\\":\\\"Information about a new pet in the system\\\"},\\\"responses\\\":{\\\"200\\\":{\\\"description\\\":\\\"Return a 200 status to indicate that the data was received successfully\\\"}}}}}}\")\n .specRaw(\"{\\\"components\\\":{\\\"schemas\\\":{\\\"Pet\\\":{\\\"properties\\\":{\\\"id\\\":{\\\"format\\\":\\\"int64\\\",\\\"type\\\":\\\"integer\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"tag\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"id\\\",\\\"name\\\"]}}},\\\"info\\\":{\\\"title\\\":\\\"Webhook Example\\\",\\\"version\\\":\\\"1.0.0\\\"},\\\"openapi\\\":\\\"3.1.0\\\",\\\"webhooks\\\":{\\\"pet.new\\\":{\\\"post\\\":{\\\"requestBody\\\":{\\\"content\\\":{\\\"application/json\\\":{\\\"schema\\\":{\\\"$ref\\\":\\\"#/components/schemas/Pet\\\"}}},\\\"description\\\":\\\"Information about a new pet in the system\\\"},\\\"responses\\\":{\\\"200\\\":{\\\"description\\\":\\\"Return a 200 status to indicate that the data was received successfully\\\"}}}}}}\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "event_type_import_open_api_out = svix.event_type.import_openapi(Svix::EventTypeImportOpenApiIn.new({\n \"spec\": {\"components\":{\"schemas\":{\"Pet\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Pet\"}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n \"spec_raw\": {\"components\":{\"schemas\":{\"Pet\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Pet\"}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let event_type_import_open_api_out = svix.event_type().import_openapi(EventTypeImportOpenApiIn {\n spec: Some(json!({\"components\":{\"schemas\":{\"Pet\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Pet\"}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}})),\n spec_raw: Some(json!({\"components\":{\"schemas\":{\"Pet\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Pet\"}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}})),\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var eventTypeImportOpenApiOut = await svix.EventType.ImportOpenapiAsync(new EventTypeImportOpenApiIn{\n spec: new {\"components\":{\"schemas\":{\"Pet\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Pet\"}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n specRaw: new {\"components\":{\"schemas\":{\"Pet\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Pet\"}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix event-type import-openapi '{\n \"spec\": {\"components\":{\"schemas\":{\"Pet\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Pet\"}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n \"specRaw\": {\"components\":{\"schemas\":{\"Pet\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Pet\"}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/event-type/import/openapi/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"spec\": {\"components\":{\"schemas\":{\"Pet\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Pet\"}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}},\n \"specRaw\": {\"components\":{\"schemas\":{\"Pet\":{\"properties\":{\"id\":{\"format\":\"int64\",\"type\":\"integer\"},\"name\":{\"type\":\"string\"},\"tag\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"]}}},\"info\":{\"title\":\"Webhook Example\",\"version\":\"1.0.0\"},\"openapi\":\"3.1.0\",\"webhooks\":{\"pet.new\":{\"post\":{\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Pet\"}}},\"description\":\"Information about a new pet in the system\"},\"responses\":{\"200\":{\"description\":\"Return a 200 status to indicate that the data was received successfully\"}}}}}}\n }'" + } + ] + } + }, + "/api/v1/event-type/{event_type_name}/": { + "get": { + "tags": [ + "Event Type" + ], + "summary": "Get Event Type", + "description": "Get an event type.", + "operationId": "v1.event-type.get", + "parameters": [ + { + "in": "path", + "name": "event_type_name", + "description": "The event type's name", + "required": true, + "schema": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventTypeOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const eventTypeOut = await svix.eventType.get(\"event_type_name\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const eventTypeOut = await svix.eventType.get(\"event_type_name\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "event_type_out = svix.event_type.get(\"event_type_name\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "event_type_out = await svix.event_type.get(\"event_type_name\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "eventTypeOut, err := svixClient.EventType.Get(ctx, \"event_type_name\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val eventTypeOut = svix.eventType.get(\"event_type_name\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "EventTypeOut eventTypeOut = svix.getEventType().get(\"event_type_name\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "event_type_out = svix.event_type.get(\"event_type_name\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let event_type_out = svix.event_type().get(\"event_type_name\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var eventTypeOut = await svix.EventType.GetAsync(\"event_type_name\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix event-type get \"event_type_name\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/event-type/{event_type_name}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "put": { + "tags": [ + "Event Type" + ], + "summary": "Update Event Type", + "description": "Update an event type.", + "operationId": "v1.event-type.update", + "parameters": [ + { + "in": "path", + "name": "event_type_name", + "description": "The event type's name", + "required": true, + "schema": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventTypeUpdate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventTypeOut" + } + } + } + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventTypeOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const eventTypeOut = await svix.eventType.update(\"event_type_name\", {\n description: \"A user has signed up\",\n archived: false,\n schemas: {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n featureFlag: \"cool-new-feature\"\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const eventTypeOut = await svix.eventType.update(\"event_type_name\", {\n description: \"A user has signed up\",\n archived: false,\n schemas: {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n featureFlag: \"cool-new-feature\"\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "event_type_out = svix.event_type.update(\"event_type_name\", EventTypeUpdate(\n description=\"A user has signed up\",\n archived=False,\n schemas={\"1\": {\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n feature_flag=\"cool-new-feature\"\n))" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "event_type_out = await svix.event_type.update(\"event_type_name\", EventTypeUpdate(\n description=\"A user has signed up\",\n archived=False,\n schemas={\"1\": {\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n feature_flag=\"cool-new-feature\"\n))" + }, + { + "label": "Go", + "lang": "Go", + "source": "eventTypeOut, err := svixClient.EventType.Update(ctx, \"event_type_name\", &EventTypeUpdate{\n Description: \"A user has signed up\",\n Archived: false,\n Schemas: map[interface{}]interface{}{\"1\": map[string]interface{}{\"description\": \"An invoice was paid by a user\", \"properties\": map[interface{}]interface{}{\"invoiceId\": map[string]interface{}{\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": map[string]interface{}{\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": []string{\"invoiceId\", \"userId\"}, \"title\": \"Invoice Paid Event\", \"type\": \"object\"}},\n FeatureFlag: \"cool-new-feature\",\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val eventTypeOut = svix.eventType.update(\"event_type_name\", EventTypeUpdate()\n .description(\"A user has signed up\")\n .archived(false)\n .schemas(\"\"\"{\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}}\"\"\")\n .featureFlag(\"cool-new-feature\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "EventTypeOut eventTypeOut = svix.getEventType().update(\"event_type_name\", new EventTypeUpdate()\n .description(\"A user has signed up\")\n .archived(false)\n .schemas(\"{\\\"1\\\":{\\\"description\\\":\\\"An invoice was paid by a user\\\",\\\"properties\\\":{\\\"invoiceId\\\":{\\\"description\\\":\\\"The invoice id\\\",\\\"type\\\":\\\"string\\\"},\\\"userId\\\":{\\\"description\\\":\\\"The user id\\\",\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"invoiceId\\\",\\\"userId\\\"],\\\"title\\\":\\\"Invoice Paid Event\\\",\\\"type\\\":\\\"object\\\"}}\")\n .featureFlag(\"cool-new-feature\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "event_type_out = svix.event_type.update(\"event_type_name\", Svix::EventTypeUpdate.new({\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"feature_flag\": \"cool-new-feature\"\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let event_type_out = svix.event_type().update(\"event_type_name\", EventTypeUpdate {\n description: \"A user has signed up\".to_string(),\n archived: Some(false),\n schemas: Some(json!({\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}})),\n feature_flag: Some(\"cool-new-feature\".to_string()),\n}).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var eventTypeOut = await svix.EventType.UpdateAsync(\"event_type_name\", new EventTypeUpdate{\n description: \"A user has signed up\",\n archived: false,\n schemas: new {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n featureFlag: \"cool-new-feature\"\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix event-type update \"event_type_name\" '{\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"featureFlag\": \"cool-new-feature\"\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/event-type/{event_type_name}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"description\": \"A user has signed up\",\n \"archived\": false,\n \"schemas\": {\"1\":{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}},\n \"featureFlag\": \"cool-new-feature\"\n }'" + } + ] + }, + "delete": { + "tags": [ + "Event Type" + ], + "summary": "Delete Event Type", + "description": "Archive an event type.\n\nEndpoints already configured to filter on an event type will continue to do so after archival.\nHowever, new messages can not be sent with it and endpoints can not filter on it.\nAn event type can be unarchived with the\n[create operation](#operation/create_event_type_api_v1_event_type__post).", + "operationId": "v1.event-type.delete", + "parameters": [ + { + "in": "path", + "name": "event_type_name", + "description": "The event type's name", + "required": true, + "schema": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "style": "simple" + }, + { + "in": "query", + "name": "expunge", + "description": "By default event types are archived when \"deleted\". Passing this to `true` deletes them entirely.", + "schema": { + "description": "By default event types are archived when \"deleted\". Passing this to `true` deletes them entirely.", + "default": false, + "type": "boolean" + }, + "style": "form" + } + ], + "responses": { + "204": { + "description": "no content" + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.eventType.delete(\"event_type_name\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.eventType.delete(\"event_type_name\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.event_type.delete(\"event_type_name\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.event_type.delete(\"event_type_name\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.EventType.Delete(ctx, \"event_type_name\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.eventType.delete(\"event_type_name\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getEventType().delete(\"event_type_name\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.event_type.delete(\"event_type_name\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.event_type().delete(\"event_type_name\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.EventType.DeleteAsync(\"event_type_name\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix event-type delete \"event_type_name\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/event-type/{event_type_name}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "patch": { + "tags": [ + "Event Type" + ], + "summary": "Patch Event Type", + "description": "Partially update an event type.", + "operationId": "v1.event-type.patch", + "parameters": [ + { + "in": "path", + "name": "event_type_name", + "description": "The event type's name", + "required": true, + "schema": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventTypePatch" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventTypeOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const eventTypeOut = await svix.eventType.patch(\"event_type_name\", {\n schemas: {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"},\n featureFlag: \"cool-new-feature\"\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const eventTypeOut = await svix.eventType.patch(\"event_type_name\", {\n schemas: {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"},\n featureFlag: \"cool-new-feature\"\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "event_type_out = svix.event_type.patch(\"event_type_name\", EventTypePatch(\n schemas={\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"},\n feature_flag=\"cool-new-feature\"\n))" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "event_type_out = await svix.event_type.patch(\"event_type_name\", EventTypePatch(\n schemas={\"description\": \"An invoice was paid by a user\", \"properties\": {\"invoiceId\": {\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": {\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": [\"invoiceId\", \"userId\"], \"title\": \"Invoice Paid Event\", \"type\": \"object\"},\n feature_flag=\"cool-new-feature\"\n))" + }, + { + "label": "Go", + "lang": "Go", + "source": "eventTypeOut, err := svixClient.EventType.Patch(ctx, \"event_type_name\", &EventTypePatch{\n Schemas: map[string]interface{}{\"description\": \"An invoice was paid by a user\", \"properties\": map[interface{}]interface{}{\"invoiceId\": map[string]interface{}{\"description\": \"The invoice id\", \"type\": \"string\"}, \"userId\": map[string]interface{}{\"description\": \"The user id\", \"type\": \"string\"}}, \"required\": []string{\"invoiceId\", \"userId\"}, \"title\": \"Invoice Paid Event\", \"type\": \"object\"},\n FeatureFlag: \"cool-new-feature\",\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val eventTypeOut = svix.eventType.patch(\"event_type_name\", EventTypePatch()\n .schemas(\"\"\"{\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"}\"\"\")\n .featureFlag(\"cool-new-feature\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "EventTypeOut eventTypeOut = svix.getEventType().patch(\"event_type_name\", new EventTypePatch()\n .schemas(\"{\\\"description\\\":\\\"An invoice was paid by a user\\\",\\\"properties\\\":{\\\"invoiceId\\\":{\\\"description\\\":\\\"The invoice id\\\",\\\"type\\\":\\\"string\\\"},\\\"userId\\\":{\\\"description\\\":\\\"The user id\\\",\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"invoiceId\\\",\\\"userId\\\"],\\\"title\\\":\\\"Invoice Paid Event\\\",\\\"type\\\":\\\"object\\\"}\")\n .featureFlag(\"cool-new-feature\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "event_type_out = svix.event_type.patch(\"event_type_name\", Svix::EventTypePatch.new({\n \"schemas\": {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"},\n \"feature_flag\": \"cool-new-feature\"\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let event_type_out = svix.event_type().patch(\"event_type_name\", EventTypePatch {\n schemas: Some(json!({\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"})),\n feature_flag: Some(\"cool-new-feature\".to_string()),\n}).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var eventTypeOut = await svix.EventType.PatchAsync(\"event_type_name\", new EventTypePatch{\n schemas: new {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"},\n featureFlag: \"cool-new-feature\"\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix event-type patch \"event_type_name\" '{\n \"schemas\": {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"},\n \"featureFlag\": \"cool-new-feature\"\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/event-type/{event_type_name}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"schemas\": {\"description\":\"An invoice was paid by a user\",\"properties\":{\"invoiceId\":{\"description\":\"The invoice id\",\"type\":\"string\"},\"userId\":{\"description\":\"The user id\",\"type\":\"string\"}},\"required\":[\"invoiceId\",\"userId\"],\"title\":\"Invoice Paid Event\",\"type\":\"object\"},\n \"featureFlag\": \"cool-new-feature\"\n }'" + } + ] + } + }, + "/api/v1/background-task/": { + "get": { + "tags": [ + "Background Tasks" + ], + "summary": "List Background Tasks", + "description": "List background tasks executed in the past 90 days.", + "operationId": "list_background_tasks", + "parameters": [ + { + "in": "query", + "name": "status", + "description": "Filter the response based on the status", + "schema": { + "description": "Filter the response based on the status", + "$ref": "#/components/schemas/BackgroundTaskStatus", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "task", + "description": "Filter the response based on the type", + "schema": { + "description": "Filter the response based on the type", + "$ref": "#/components/schemas/BackgroundTaskType", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of returned items", + "schema": { + "description": "Limit the number of returned items", + "type": "integer", + "format": "uint64", + "maximum": 250.0, + "minimum": 1.0 + }, + "style": "form" + }, + { + "in": "query", + "name": "iterator", + "description": "The iterator returned from a prior invocation", + "schema": { + "description": "The iterator returned from a prior invocation", + "type": "string", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "order", + "description": "The sorting order of the returned items", + "schema": { + "description": "The sorting order of the returned items", + "$ref": "#/components/schemas/Ordering", + "nullable": true + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_BackgroundTaskOut_" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ] + } + }, + "/api/v1/background-task/{task_id}/": { + "get": { + "tags": [ + "Background Tasks" + ], + "summary": "Get Background Task", + "description": "Get a background task by ID.", + "operationId": "get_background_task", + "parameters": [ + { + "in": "path", + "name": "task_id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BackgroundTaskOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ] + } + }, + "/api/v1/app/{app_id}/msg/": { + "get": { + "tags": [ + "Message" + ], + "summary": "List Messages", + "description": "List all of the application's messages.\n\nThe `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\nwithin a certain window.\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n", + "operationId": "v1.message.list", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of returned items", + "schema": { + "description": "Limit the number of returned items", + "type": "integer", + "format": "uint64", + "maximum": 250.0, + "minimum": 1.0 + }, + "style": "form" + }, + { + "in": "query", + "name": "iterator", + "description": "The iterator returned from a prior invocation", + "schema": { + "description": "The iterator returned from a prior invocation", + "type": "string", + "example": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "channel", + "description": "Filter response based on the channel", + "schema": { + "description": "Filter response based on the channel", + "type": "string", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "project_1337", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "before", + "description": "Only include items created before a certain date", + "schema": { + "description": "Only include items created before a certain date", + "type": "string", + "format": "date-time", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "after", + "description": "Only include items created after a certain date", + "schema": { + "description": "Only include items created after a certain date", + "type": "string", + "format": "date-time", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "with_content", + "description": "When `true` message payloads are included in the response", + "schema": { + "description": "When `true` message payloads are included in the response", + "default": true, + "type": "boolean" + }, + "style": "form" + }, + { + "in": "query", + "name": "event_types", + "description": "Filter response based on the event type", + "schema": { + "description": "Filter response based on the event type", + "type": "array", + "items": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "uniqueItems": true, + "nullable": true + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_MessageOut_" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const listResponseMessageOut = await svix.message.list(\"app_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const listResponseMessageOut = await svix.message.list(\"app_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "list_response_message_out = svix.message.list(\"app_id\", None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "list_response_message_out = await svix.message.list(\"app_id\", None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "listResponseMessageOut, err := svixClient.Message.List(ctx, \"app_id\", nil)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val listResponseMessageOut = svix.message.list(\"app_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "ListResponseMessageOut listResponseMessageOut = svix.getMessage().list(\"app_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "list_response_message_out = svix.message.list(\"app_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let list_response_message_out = svix.message().list(\"app_id\", None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var listResponseMessageOut = await svix.Message.ListAsync(\"app_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix message list \"app_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "post": { + "tags": [ + "Message" + ], + "summary": "Create Message", + "description": "Creates a new message and dispatches it to all of the application's endpoints.\n\nThe `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.\nIf a message with the same `eventId` already exists for any application in your environment, a 409 conflict error will be returned.\n\nThe `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.\nMessages 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.\n\nThe `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.", + "operationId": "v1.message.create", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "query", + "name": "with_content", + "description": "When `true` message payloads are included in the response", + "schema": { + "description": "When `true` message payloads are included in the response", + "default": true, + "type": "boolean" + }, + "style": "form" + }, + { + "in": "header", + "name": "idempotency-key", + "description": "The request's idempotency key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageIn" + } + } + }, + "required": true + }, + "responses": { + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "413": { + "description": "Payload too large", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const messageOut = await svix.message.create(\"app_id\", {\n eventId: \"unique-msg-identifier\",\n eventType: \"user.signup\",\n payload: {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n channels: [\"project_123\", \"group_2\"],\n payloadRetentionPeriod: 90,\n application: null\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const messageOut = await svix.message.create(\"app_id\", {\n eventId: \"unique-msg-identifier\",\n eventType: \"user.signup\",\n payload: {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n channels: [\"project_123\", \"group_2\"],\n payloadRetentionPeriod: 90,\n application: null\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "message_out = svix.message.create(\"app_id\", MessageIn(\n event_id=\"unique-msg-identifier\",\n event_type=\"user.signup\",\n payload={\"email\": \"test@example.com\", \"type\": \"user.created\", \"username\": \"test_user\"},\n channels=[\"project_123\", \"group_2\"],\n payload_retention_period=90,\n application=None\n), None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "message_out = await svix.message.create(\"app_id\", MessageIn(\n event_id=\"unique-msg-identifier\",\n event_type=\"user.signup\",\n payload={\"email\": \"test@example.com\", \"type\": \"user.created\", \"username\": \"test_user\"},\n channels=[\"project_123\", \"group_2\"],\n payload_retention_period=90,\n application=None\n), None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "messageOut, err := svixClient.Message.Create(ctx, \"app_id\", &MessageIn{\n EventId: \"unique-msg-identifier\",\n EventType: \"user.signup\",\n Payload: map[string]interface{}{\"email\": \"test@example.com\", \"type\": \"user.created\", \"username\": \"test_user\"},\n Channels: []string{\"project_123\", \"group_2\"},\n PayloadRetentionPeriod: 90,\n Application: nil,\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val messageOut = svix.message.create(\"app_id\", MessageIn()\n .eventId(\"unique-msg-identifier\")\n .eventType(\"user.signup\")\n .payload(\"\"\"{\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"}\"\"\")\n .channels(arrayOf(\"project_123\", \"group_2\"))\n .payloadRetentionPeriod(90)\n .application(null)\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "MessageOut messageOut = svix.getMessage().create(\"app_id\", new MessageIn()\n .eventId(\"unique-msg-identifier\")\n .eventType(\"user.signup\")\n .payload(\"{\\\"email\\\":\\\"test@example.com\\\",\\\"type\\\":\\\"user.created\\\",\\\"username\\\":\\\"test_user\\\"}\")\n .channels(new String[]{\"project_123\", \"group_2\"})\n .payloadRetentionPeriod(90)\n .application(null)\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "message_out = svix.message.create(\"app_id\", Svix::MessageIn.new({\n \"event_id\": \"unique-msg-identifier\",\n \"event_type\": \"user.signup\",\n \"payload\": {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n \"channels\": [\"project_123\", \"group_2\"],\n \"payload_retention_period\": 90,\n \"application\": nil\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let message_out = svix.message().create(\"app_id\", MessageIn {\n event_id: Some(\"unique-msg-identifier\".to_string()),\n event_type: \"user.signup\".to_string(),\n payload: json!({\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"}),\n channels: Some(vec![\"project_123\".to_string(), \"group_2\".to_string()]),\n payload_retention_period: Some(90),\n application: None,\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var messageOut = await svix.Message.CreateAsync(\"app_id\", new MessageIn{\n eventId: \"unique-msg-identifier\",\n eventType: \"user.signup\",\n payload: new {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n channels: new string[] {\"project_123\", \"group_2\"},\n payloadRetentionPeriod: 90,\n application: null\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix message create \"app_id\" '{\n \"eventId\": \"unique-msg-identifier\",\n \"eventType\": \"user.signup\",\n \"payload\": {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n \"channels\": [\"project_123\", \"group_2\"],\n \"payloadRetentionPeriod\": 90,\n \"application\": null\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"eventId\": \"unique-msg-identifier\",\n \"eventType\": \"user.signup\",\n \"payload\": {\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"},\n \"channels\": [\"project_123\", \"group_2\"],\n \"payloadRetentionPeriod\": 90,\n \"application\": null\n }'" + } + ] + } + }, + "/api/v1/app/{app_id}/msg/{msg_id}/": { + "get": { + "tags": [ + "Message" + ], + "summary": "Get Message", + "description": "Get a message by its ID or eventID.", + "operationId": "v1.message.get", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "msg_id", + "description": "The msg's ID or UID", + "required": true, + "schema": { + "description": "The msg's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-msg-identifier" + }, + "style": "simple" + }, + { + "in": "query", + "name": "with_content", + "description": "When `true` message payloads are included in the response", + "schema": { + "description": "When `true` message payloads are included in the response", + "default": true, + "type": "boolean" + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const messageOut = await svix.message.get(\"app_id\", \"msg_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const messageOut = await svix.message.get(\"app_id\", \"msg_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "message_out = svix.message.get(\"app_id\", \"msg_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "message_out = await svix.message.get(\"app_id\", \"msg_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "messageOut, err := svixClient.Message.Get(ctx, \"app_id\", \"msg_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val messageOut = svix.message.get(\"app_id\", \"msg_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "MessageOut messageOut = svix.getMessage().get(\"app_id\", \"msg_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "message_out = svix.message.get(\"app_id\", \"msg_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let message_out = svix.message().get(\"app_id\", \"msg_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var messageOut = await svix.Message.GetAsync(\"app_id\", \"msg_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix message get \"app_id\" \"msg_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}/msg/{msg_id}/content/": { + "delete": { + "tags": [ + "Message" + ], + "summary": "Delete message payload", + "description": "Delete the given message's payload. Useful in cases when a message was accidentally sent with sensitive content.\n\nThe message can't be replayed or resent once its payload has been deleted or expired.", + "operationId": "v1.message.expunge-content", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "msg_id", + "description": "The msg's ID or UID", + "required": true, + "schema": { + "description": "The msg's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-msg-identifier" + }, + "style": "simple" + } + ], + "responses": { + "204": { + "description": "no content" + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.message.expungeContent(\"app_id\", \"msg_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.message.expungeContent(\"app_id\", \"msg_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.message.expunge_content(\"app_id\", \"msg_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.message.expunge_content(\"app_id\", \"msg_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.Message.ExpungeContent(ctx, \"app_id\", \"msg_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.message.expungeContent(\"app_id\", \"msg_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getMessage().expungeContent(\"app_id\", \"msg_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.message.expunge_content(\"app_id\", \"msg_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.message().expunge_content(\"app_id\", \"msg_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.Message.ExpungeContentAsync(\"app_id\", \"msg_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix message expunge-content \"app_id\" \"msg_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/content/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}/": { + "get": { + "tags": [ + "Message Attempt" + ], + "summary": "List Attempts By Endpoint", + "description": "List attempts by endpoint id\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n", + "operationId": "v1.message-attempt.list-by-endpoint", + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "Limit the number of returned items", + "schema": { + "description": "Limit the number of returned items", + "type": "integer", + "format": "uint64", + "maximum": 250.0, + "minimum": 1.0 + }, + "style": "form" + }, + { + "in": "query", + "name": "iterator", + "description": "The iterator returned from a prior invocation", + "schema": { + "description": "The iterator returned from a prior invocation", + "type": "string", + "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "status", + "description": "Filter response based on the delivery status", + "schema": { + "description": "Filter response based on the delivery status", + "$ref": "#/components/schemas/MessageStatus", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "status_code_class", + "description": "Filter response based on the HTTP status code", + "schema": { + "description": "Filter response based on the HTTP status code", + "$ref": "#/components/schemas/StatusCodeClass", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "channel", + "description": "Filter response based on the channel", + "schema": { + "description": "Filter response based on the channel", + "type": "string", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "project_1337", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "before", + "description": "Only include items created before a certain date", + "schema": { + "description": "Only include items created before a certain date", + "type": "string", + "format": "date-time", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "after", + "description": "Only include items created after a certain date", + "schema": { + "description": "Only include items created after a certain date", + "type": "string", + "format": "date-time", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "with_content", + "description": "When `true` attempt content is included in the response", + "schema": { + "description": "When `true` attempt content is included in the response", + "default": true, + "type": "boolean" + }, + "style": "form" + }, + { + "in": "query", + "name": "event_types", + "description": "Filter response based on the event type", + "schema": { + "description": "Filter response based on the event type", + "type": "array", + "items": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "uniqueItems": true, + "nullable": true + }, + "style": "form" + }, + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_MessageAttemptOut_" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByEndpoint(\"app_id\", \"endpoint_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByEndpoint(\"app_id\", \"endpoint_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "list_response_message_attempt_out = svix.message_attempt.list_by_endpoint(\"app_id\", \"endpoint_id\", None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "list_response_message_attempt_out = await svix.message_attempt.list_by_endpoint(\"app_id\", \"endpoint_id\", None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "listResponseMessageAttemptOut, err := svixClient.MessageAttempt.ListByEndpoint(ctx, \"app_id\", \"endpoint_id\", nil)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val listResponseMessageAttemptOut = svix.messageAttempt.listByEndpoint(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "ListResponseMessageAttemptOut listResponseMessageAttemptOut = svix.getMessageAttempt().listByEndpoint(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "list_response_message_attempt_out = svix.message_attempt.list_by_endpoint(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let list_response_message_attempt_out = svix.message_attempt().list_by_endpoint(\"app_id\", \"endpoint_id\", None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var listResponseMessageAttemptOut = await svix.MessageAttempt.ListByEndpointAsync(\"app_id\", \"endpoint_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix message-attempt list-by-endpoint \"app_id\" \"endpoint_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}/attempt/msg/{msg_id}/": { + "get": { + "tags": [ + "Message Attempt" + ], + "summary": "List Attempts By Msg", + "description": "List attempts by message id\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n", + "operationId": "v1.message-attempt.list-by-msg", + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "Limit the number of returned items", + "schema": { + "description": "Limit the number of returned items", + "type": "integer", + "format": "uint64", + "maximum": 250.0, + "minimum": 1.0 + }, + "style": "form" + }, + { + "in": "query", + "name": "iterator", + "description": "The iterator returned from a prior invocation", + "schema": { + "description": "The iterator returned from a prior invocation", + "type": "string", + "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "status", + "description": "Filter response based on the delivery status", + "schema": { + "description": "Filter response based on the delivery status", + "$ref": "#/components/schemas/MessageStatus", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "status_code_class", + "description": "Filter response based on the HTTP status code", + "schema": { + "description": "Filter response based on the HTTP status code", + "$ref": "#/components/schemas/StatusCodeClass", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "channel", + "description": "Filter response based on the channel", + "schema": { + "description": "Filter response based on the channel", + "type": "string", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "project_1337", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "endpoint_id", + "description": "Filter the attempts based on the attempted endpoint", + "schema": { + "description": "Filter the attempts based on the attempted endpoint", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "before", + "description": "Only include items created before a certain date", + "schema": { + "description": "Only include items created before a certain date", + "type": "string", + "format": "date-time", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "after", + "description": "Only include items created after a certain date", + "schema": { + "description": "Only include items created after a certain date", + "type": "string", + "format": "date-time", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "with_content", + "description": "When `true` attempt content is included in the response", + "schema": { + "description": "When `true` attempt content is included in the response", + "default": true, + "type": "boolean" + }, + "style": "form" + }, + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "msg_id", + "description": "The msg's ID or UID", + "required": true, + "schema": { + "description": "The msg's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-msg-identifier" + }, + "style": "simple" + }, + { + "in": "query", + "name": "event_types", + "description": "Filter response based on the event type", + "schema": { + "description": "Filter response based on the event type", + "type": "array", + "items": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "uniqueItems": true, + "nullable": true + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_MessageAttemptOut_" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByMsg(\"app_id\", \"msg_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByMsg(\"app_id\", \"msg_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "list_response_message_attempt_out = svix.message_attempt.list_by_msg(\"app_id\", \"msg_id\", None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "list_response_message_attempt_out = await svix.message_attempt.list_by_msg(\"app_id\", \"msg_id\", None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "listResponseMessageAttemptOut, err := svixClient.MessageAttempt.ListByMsg(ctx, \"app_id\", \"msg_id\", nil)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val listResponseMessageAttemptOut = svix.messageAttempt.listByMsg(\"app_id\", \"msg_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "ListResponseMessageAttemptOut listResponseMessageAttemptOut = svix.getMessageAttempt().listByMsg(\"app_id\", \"msg_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "list_response_message_attempt_out = svix.message_attempt.list_by_msg(\"app_id\", \"msg_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let list_response_message_attempt_out = svix.message_attempt().list_by_msg(\"app_id\", \"msg_id\", None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var listResponseMessageAttemptOut = await svix.MessageAttempt.ListByMsgAsync(\"app_id\", \"msg_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix message-attempt list-by-msg \"app_id\" \"msg_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/attempt/msg/{msg_id}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg/": { + "get": { + "tags": [ + "Message Attempt" + ], + "summary": "List Attempted Messages", + "description": "List messages for a particular endpoint. Additionally includes metadata about the latest message attempt.\n\nThe `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n", + "operationId": "v1.message-attempt.list-attempted-messages", + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "Limit the number of returned items", + "schema": { + "description": "Limit the number of returned items", + "type": "integer", + "format": "uint64", + "maximum": 250.0, + "minimum": 1.0 + }, + "style": "form" + }, + { + "in": "query", + "name": "iterator", + "description": "The iterator returned from a prior invocation", + "schema": { + "description": "The iterator returned from a prior invocation", + "type": "string", + "example": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "channel", + "description": "Filter response based on the channel", + "schema": { + "description": "Filter response based on the channel", + "type": "string", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "project_1337", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "status", + "description": "Filter response based on the delivery status", + "schema": { + "description": "Filter response based on the delivery status", + "$ref": "#/components/schemas/MessageStatus", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "before", + "description": "Only include items created before a certain date", + "schema": { + "description": "Only include items created before a certain date", + "type": "string", + "format": "date-time", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "after", + "description": "Only include items created after a certain date", + "schema": { + "description": "Only include items created after a certain date", + "type": "string", + "format": "date-time", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "with_content", + "description": "When `true` message payloads are included in the response", + "schema": { + "description": "When `true` message payloads are included in the response", + "default": true, + "type": "boolean" + }, + "style": "form" + }, + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + }, + { + "in": "query", + "name": "event_types", + "description": "Filter response based on the event type", + "schema": { + "description": "Filter response based on the event type", + "type": "array", + "items": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "uniqueItems": true, + "nullable": true + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_EndpointMessageOut_" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const listResponseEndpointMessageOut = await svix.messageAttempt.listAttemptedMessages(\"app_id\", \"endpoint_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const listResponseEndpointMessageOut = await svix.messageAttempt.listAttemptedMessages(\"app_id\", \"endpoint_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "list_response_endpoint_message_out = svix.message_attempt.list_attempted_messages(\"app_id\", \"endpoint_id\", None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "list_response_endpoint_message_out = await svix.message_attempt.list_attempted_messages(\"app_id\", \"endpoint_id\", None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "listResponseEndpointMessageOut, err := svixClient.MessageAttempt.ListAttemptedMessages(ctx, \"app_id\", \"endpoint_id\", nil)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val listResponseEndpointMessageOut = svix.messageAttempt.listAttemptedMessages(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "ListResponseEndpointMessageOut listResponseEndpointMessageOut = svix.getMessageAttempt().listAttemptedMessages(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "list_response_endpoint_message_out = svix.message_attempt.list_attempted_messages(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let list_response_endpoint_message_out = svix.message_attempt().list_attempted_messages(\"app_id\", \"endpoint_id\", None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var listResponseEndpointMessageOut = await svix.MessageAttempt.ListAttemptedMessagesAsync(\"app_id\", \"endpoint_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix message-attempt list-attempted-messages \"app_id\" \"endpoint_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/": { + "get": { + "tags": [ + "Message Attempt" + ], + "summary": "List Attempted Destinations", + "description": "List endpoints attempted by a given message. Additionally includes metadata about the latest message attempt.\nBy default, endpoints are listed in ascending order by ID.", + "operationId": "v1.message-attempt.list-attempted-destinations", + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "Limit the number of returned items", + "schema": { + "description": "Limit the number of returned items", + "type": "integer", + "format": "uint64", + "maximum": 250.0, + "minimum": 1.0 + }, + "style": "form" + }, + { + "in": "query", + "name": "iterator", + "description": "The iterator returned from a prior invocation", + "schema": { + "description": "The iterator returned from a prior invocation", + "type": "string", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true + }, + "style": "form" + }, + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "msg_id", + "description": "The msg's ID or UID", + "required": true, + "schema": { + "description": "The msg's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-msg-identifier" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_MessageEndpointOut_" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const listResponseMessageEndpointOut = await svix.messageAttempt.listAttemptedDestinations(\"app_id\", \"msg_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const listResponseMessageEndpointOut = await svix.messageAttempt.listAttemptedDestinations(\"app_id\", \"msg_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "list_response_message_endpoint_out = svix.message_attempt.list_attempted_destinations(\"app_id\", \"msg_id\", None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "list_response_message_endpoint_out = await svix.message_attempt.list_attempted_destinations(\"app_id\", \"msg_id\", None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "listResponseMessageEndpointOut, err := svixClient.MessageAttempt.ListAttemptedDestinations(ctx, \"app_id\", \"msg_id\", nil)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val listResponseMessageEndpointOut = svix.messageAttempt.listAttemptedDestinations(\"app_id\", \"msg_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "ListResponseMessageEndpointOut listResponseMessageEndpointOut = svix.getMessageAttempt().listAttemptedDestinations(\"app_id\", \"msg_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "list_response_message_endpoint_out = svix.message_attempt.list_attempted_destinations(\"app_id\", \"msg_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let list_response_message_endpoint_out = svix.message_attempt().list_attempted_destinations(\"app_id\", \"msg_id\", None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var listResponseMessageEndpointOut = await svix.MessageAttempt.ListAttemptedDestinationsAsync(\"app_id\", \"msg_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix message-attempt list-attempted-destinations \"app_id\" \"msg_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/endpoint/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/attempt/": { + "get": { + "tags": [ + "Message Attempt" + ], + "summary": "List Attempts For Endpoint", + "description": "DEPRECATED: please use list_attempts with endpoint_id as a query parameter instead.\n\nList the message attempts for a particular endpoint.\n\nReturning the endpoint.\n\nThe `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n", + "operationId": "v1.message-attempt.list-by-endpoint-deprecated", + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "Limit the number of returned items", + "schema": { + "description": "Limit the number of returned items", + "type": "integer", + "format": "uint64", + "maximum": 250.0, + "minimum": 1.0 + }, + "style": "form" + }, + { + "in": "query", + "name": "iterator", + "description": "The iterator returned from a prior invocation", + "schema": { + "description": "The iterator returned from a prior invocation", + "type": "string", + "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "channel", + "description": "Filter response based on the channel", + "schema": { + "description": "Filter response based on the channel", + "type": "string", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "project_1337", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "status", + "description": "Filter response based on the delivery status", + "schema": { + "description": "Filter response based on the delivery status", + "$ref": "#/components/schemas/MessageStatus", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "before", + "description": "Only include items created before a certain date", + "schema": { + "description": "Only include items created before a certain date", + "type": "string", + "format": "date-time", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "after", + "description": "Only include items created after a certain date", + "schema": { + "description": "Only include items created after a certain date", + "type": "string", + "format": "date-time", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "event_types", + "description": "Filter response based on the event type", + "schema": { + "description": "Filter response based on the event type", + "type": "array", + "items": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "uniqueItems": true, + "nullable": true + }, + "style": "form" + }, + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "msg_id", + "description": "The msg's ID or UID", + "required": true, + "schema": { + "description": "The msg's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-msg-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_MessageAttemptEndpointOut_" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "deprecated": true, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const listResponseMessageAttemptEndpointOut = await svix.messageAttempt.listByEndpointDeprecated(\"app_id\", \"msg_id\", \"endpoint_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const listResponseMessageAttemptEndpointOut = await svix.messageAttempt.listByEndpointDeprecated(\"app_id\", \"msg_id\", \"endpoint_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "list_response_message_attempt_endpoint_out = svix.message_attempt.list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\", None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "list_response_message_attempt_endpoint_out = await svix.message_attempt.list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\", None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "listResponseMessageAttemptEndpointOut, err := svixClient.MessageAttempt.ListByEndpointDeprecated(ctx, \"app_id\", \"msg_id\", \"endpoint_id\", nil)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val listResponseMessageAttemptEndpointOut = svix.messageAttempt.listByEndpointDeprecated(\"app_id\", \"msg_id\", \"endpoint_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "ListResponseMessageAttemptEndpointOut listResponseMessageAttemptEndpointOut = svix.getMessageAttempt().listByEndpointDeprecated(\"app_id\", \"msg_id\", \"endpoint_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "list_response_message_attempt_endpoint_out = svix.message_attempt.list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let list_response_message_attempt_endpoint_out = svix.message_attempt().list_by_endpoint_deprecated(\"app_id\", \"msg_id\", \"endpoint_id\", None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var listResponseMessageAttemptEndpointOut = await svix.MessageAttempt.ListByEndpointDeprecatedAsync(\"app_id\", \"msg_id\", \"endpoint_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix message-attempt list-by-endpoint-deprecated \"app_id\" \"msg_id\" \"endpoint_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/attempt/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}/msg/{msg_id}/attempt/": { + "get": { + "tags": [ + "Message Attempt" + ], + "summary": "List Attempts", + "description": "Deprecated: Please use \"List Attempts by Endpoint\" and \"List Attempts by Msg\" instead.\n\nNote that by default this endpoint is limited to retrieving 90 days' worth of data\nrelative to now or, if an iterator is provided, 90 days before/after the time indicated\nby the iterator ID. If you require data beyond those time ranges, you will need to explicitly\nset the `before` or `after` parameter as appropriate.\n\n`msg_id`: Use a message id or a message `eventId`", + "operationId": "v1.message-attempt.list-by-msg-deprecated", + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "Limit the number of returned items", + "schema": { + "description": "Limit the number of returned items", + "type": "integer", + "format": "uint64", + "maximum": 250.0, + "minimum": 1.0 + }, + "style": "form" + }, + { + "in": "query", + "name": "iterator", + "description": "The iterator returned from a prior invocation", + "schema": { + "description": "The iterator returned from a prior invocation", + "type": "string", + "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "endpoint_id", + "description": "Filter the attempts based on the attempted endpoint", + "schema": { + "description": "Filter the attempts based on the attempted endpoint", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "channel", + "description": "Filter response based on the channel", + "schema": { + "description": "Filter response based on the channel", + "type": "string", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "project_1337", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "status", + "description": "Filter response based on the delivery status", + "schema": { + "description": "Filter response based on the delivery status", + "$ref": "#/components/schemas/MessageStatus", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "before", + "description": "Only include items created before a certain date", + "schema": { + "description": "Only include items created before a certain date", + "type": "string", + "format": "date-time", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "after", + "description": "Only include items created after a certain date", + "schema": { + "description": "Only include items created after a certain date", + "type": "string", + "format": "date-time", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "status_code_class", + "description": "Filter response based on the HTTP status code", + "schema": { + "description": "Filter response based on the HTTP status code", + "$ref": "#/components/schemas/StatusCodeClass", + "nullable": true + }, + "style": "form" + }, + { + "in": "query", + "name": "event_types", + "description": "Filter response based on the event type", + "schema": { + "description": "Filter response based on the event type", + "type": "array", + "items": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "uniqueItems": true, + "nullable": true + }, + "style": "form" + }, + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "msg_id", + "description": "The msg's ID or UID", + "required": true, + "schema": { + "description": "The msg's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-msg-identifier" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_MessageAttemptOut_" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "deprecated": true, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByMsgDeprecated(\"app_id\", \"msg_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const listResponseMessageAttemptOut = await svix.messageAttempt.listByMsgDeprecated(\"app_id\", \"msg_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "list_response_message_attempt_out = svix.message_attempt.list_by_msg_deprecated(\"app_id\", \"msg_id\", None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "list_response_message_attempt_out = await svix.message_attempt.list_by_msg_deprecated(\"app_id\", \"msg_id\", None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "listResponseMessageAttemptOut, err := svixClient.MessageAttempt.ListByMsgDeprecated(ctx, \"app_id\", \"msg_id\", nil)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val listResponseMessageAttemptOut = svix.messageAttempt.listByMsgDeprecated(\"app_id\", \"msg_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "ListResponseMessageAttemptOut listResponseMessageAttemptOut = svix.getMessageAttempt().listByMsgDeprecated(\"app_id\", \"msg_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "list_response_message_attempt_out = svix.message_attempt.list_by_msg_deprecated(\"app_id\", \"msg_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let list_response_message_attempt_out = svix.message_attempt().list_by_msg_deprecated(\"app_id\", \"msg_id\", None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var listResponseMessageAttemptOut = await svix.MessageAttempt.ListByMsgDeprecatedAsync(\"app_id\", \"msg_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix message-attempt list-by-msg-deprecated \"app_id\" \"msg_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/attempt/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/": { + "get": { + "tags": [ + "Message Attempt" + ], + "summary": "Get Attempt", + "description": "`msg_id`: Use a message id or a message `eventId`", + "operationId": "v1.message-attempt.get", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "msg_id", + "description": "The msg's ID or UID", + "required": true, + "schema": { + "description": "The msg's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-msg-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "attempt_id", + "description": "The attempt's ID", + "required": true, + "schema": { + "description": "The attempt's ID", + "type": "string", + "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageAttemptOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const messageAttemptOut = await svix.messageAttempt.get(\"app_id\", \"msg_id\", \"attempt_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const messageAttemptOut = await svix.messageAttempt.get(\"app_id\", \"msg_id\", \"attempt_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "message_attempt_out = svix.message_attempt.get(\"app_id\", \"msg_id\", \"attempt_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "message_attempt_out = await svix.message_attempt.get(\"app_id\", \"msg_id\", \"attempt_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "messageAttemptOut, err := svixClient.MessageAttempt.Get(ctx, \"app_id\", \"msg_id\", \"attempt_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val messageAttemptOut = svix.messageAttempt.get(\"app_id\", \"msg_id\", \"attempt_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "MessageAttemptOut messageAttemptOut = svix.getMessageAttempt().get(\"app_id\", \"msg_id\", \"attempt_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "message_attempt_out = svix.message_attempt.get(\"app_id\", \"msg_id\", \"attempt_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let message_attempt_out = svix.message_attempt().get(\"app_id\", \"msg_id\", \"attempt_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var messageAttemptOut = await svix.MessageAttempt.GetAsync(\"app_id\", \"msg_id\", \"attempt_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix message-attempt get \"app_id\" \"msg_id\" \"attempt_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content/": { + "delete": { + "tags": [ + "Message Attempt" + ], + "summary": "Delete attempt response body", + "description": "Deletes the given attempt's response body. Useful when an endpoint accidentally returned sensitive content.", + "operationId": "v1.message-attempt.expunge-content", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "msg_id", + "description": "The msg's ID or UID", + "required": true, + "schema": { + "description": "The msg's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-msg-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "attempt_id", + "description": "The attempt's ID", + "required": true, + "schema": { + "description": "The attempt's ID", + "type": "string", + "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "style": "simple" + } + ], + "responses": { + "204": { + "description": "no content" + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.messageAttempt.expungeContent(\"app_id\", \"msg_id\", \"attempt_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.messageAttempt.expungeContent(\"app_id\", \"msg_id\", \"attempt_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.message_attempt.expunge_content(\"app_id\", \"msg_id\", \"attempt_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.message_attempt.expunge_content(\"app_id\", \"msg_id\", \"attempt_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.MessageAttempt.ExpungeContent(ctx, \"app_id\", \"msg_id\", \"attempt_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.messageAttempt.expungeContent(\"app_id\", \"msg_id\", \"attempt_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getMessageAttempt().expungeContent(\"app_id\", \"msg_id\", \"attempt_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.message_attempt.expunge_content(\"app_id\", \"msg_id\", \"attempt_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.message_attempt().expunge_content(\"app_id\", \"msg_id\", \"attempt_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.MessageAttempt.ExpungeContentAsync(\"app_id\", \"msg_id\", \"attempt_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix message-attempt expunge-content \"app_id\" \"msg_id\" \"attempt_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend/": { + "post": { + "tags": [ + "Message Attempt" + ], + "summary": "Resend Webhook", + "description": "Resend a message to the specified endpoint.", + "operationId": "v1.message-attempt.resend", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "msg_id", + "description": "The msg's ID or UID", + "required": true, + "schema": { + "description": "The msg's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-msg-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "endpoint_id", + "description": "The ep's ID or UID", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier" + }, + "style": "simple" + }, + { + "in": "header", + "name": "idempotency-key", + "description": "The request's idempotency key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "202": { + "description": "no content" + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.messageAttempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.messageAttempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.message_attempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\", None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.message_attempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\", None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.MessageAttempt.Resend(ctx, \"app_id\", \"msg_id\", \"endpoint_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.messageAttempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getMessageAttempt().resend(\"app_id\", \"msg_id\", \"endpoint_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.message_attempt.resend(\"app_id\", \"msg_id\", \"endpoint_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.message_attempt().resend(\"app_id\", \"msg_id\", \"endpoint_id\", None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.MessageAttempt.ResendAsync(\"app_id\", \"msg_id\", \"endpoint_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix message-attempt resend \"app_id\" \"msg_id\" \"endpoint_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/stats/usage/app/": { + "post": { + "tags": [ + "Statistics" + ], + "summary": "Calculate Aggregate App Stats", + "description": "Creates a background task to calculate the message destinations for all applications in the environment.", + "operationId": "calculate_aggregate_app_stats", + "parameters": [ + { + "in": "header", + "name": "idempotency-key", + "description": "The request's idempotency key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AppUsageStatsIn" + } + } + }, + "required": true + }, + "responses": { + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AppUsageStatsOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ] + } + }, + "/api/v1/app/{app_id}/integration/": { + "get": { + "tags": [ + "Integration" + ], + "summary": "List Integrations", + "description": "List the application's integrations.", + "operationId": "v1.integration.list", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of returned items", + "schema": { + "description": "Limit the number of returned items", + "type": "integer", + "format": "uint64", + "maximum": 250.0, + "minimum": 1.0 + }, + "style": "form" + }, + { + "in": "query", + "name": "iterator", + "description": "The iterator returned from a prior invocation", + "schema": { + "description": "The iterator returned from a prior invocation", + "type": "string", + "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "nullable": true + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListResponse_IntegrationOut_" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const listResponseIntegrationOut = await svix.integration.list(\"app_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const listResponseIntegrationOut = await svix.integration.list(\"app_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "list_response_integration_out = svix.integration.list(\"app_id\", None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "list_response_integration_out = await svix.integration.list(\"app_id\", None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "listResponseIntegrationOut, err := svixClient.Integration.List(ctx, \"app_id\", nil)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val listResponseIntegrationOut = svix.integration.list(\"app_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "ListResponseIntegrationOut listResponseIntegrationOut = svix.getIntegration().list(\"app_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "list_response_integration_out = svix.integration.list(\"app_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let list_response_integration_out = svix.integration().list(\"app_id\", None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var listResponseIntegrationOut = await svix.Integration.ListAsync(\"app_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix integration list \"app_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "post": { + "tags": [ + "Integration" + ], + "summary": "Create Integration", + "description": "Create an integration.", + "operationId": "v1.integration.create", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "header", + "name": "idempotency-key", + "description": "The request's idempotency key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationIn" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const integrationOut = await svix.integration.create(\"app_id\", {\n name: \"Example Integration\"\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const integrationOut = await svix.integration.create(\"app_id\", {\n name: \"Example Integration\"\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "integration_out = svix.integration.create(\"app_id\", IntegrationIn(\n name=\"Example Integration\"\n), None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "integration_out = await svix.integration.create(\"app_id\", IntegrationIn(\n name=\"Example Integration\"\n), None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "integrationOut, err := svixClient.Integration.Create(ctx, \"app_id\", &IntegrationIn{\n Name: \"Example Integration\",\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val integrationOut = svix.integration.create(\"app_id\", IntegrationIn()\n .name(\"Example Integration\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "IntegrationOut integrationOut = svix.getIntegration().create(\"app_id\", new IntegrationIn()\n .name(\"Example Integration\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "integration_out = svix.integration.create(\"app_id\", Svix::IntegrationIn.new({\n \"name\": \"Example Integration\"\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let integration_out = svix.integration().create(\"app_id\", IntegrationIn {\n name: \"Example Integration\".to_string(),\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var integrationOut = await svix.Integration.CreateAsync(\"app_id\", new IntegrationIn{\n name: \"Example Integration\"\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix integration create \"app_id\" '{\n \"name\": \"Example Integration\"\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"Example Integration\"\n }'" + } + ] + } + }, + "/api/v1/app/{app_id}/integration/{integ_id}/": { + "get": { + "tags": [ + "Integration" + ], + "summary": "Get Integration", + "description": "Get an integration.", + "operationId": "v1.integration.get", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "integ_id", + "description": "The integ's ID", + "required": true, + "schema": { + "description": "The integ's ID", + "type": "string", + "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const integrationOut = await svix.integration.get(\"app_id\", \"integ_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const integrationOut = await svix.integration.get(\"app_id\", \"integ_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "integration_out = svix.integration.get(\"app_id\", \"integ_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "integration_out = await svix.integration.get(\"app_id\", \"integ_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "integrationOut, err := svixClient.Integration.Get(ctx, \"app_id\", \"integ_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val integrationOut = svix.integration.get(\"app_id\", \"integ_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "IntegrationOut integrationOut = svix.getIntegration().get(\"app_id\", \"integ_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "integration_out = svix.integration.get(\"app_id\", \"integ_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let integration_out = svix.integration().get(\"app_id\", \"integ_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var integrationOut = await svix.Integration.GetAsync(\"app_id\", \"integ_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix integration get \"app_id\" \"integ_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/{integ_id}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + }, + "put": { + "tags": [ + "Integration" + ], + "summary": "Update Integration", + "description": "Update an integration.", + "operationId": "v1.integration.update", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "integ_id", + "description": "The integ's ID", + "required": true, + "schema": { + "description": "The integ's ID", + "type": "string", + "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationUpdate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const integrationOut = await svix.integration.update(\"app_id\", \"integ_id\", {\n name: \"Example Integration\"\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const integrationOut = await svix.integration.update(\"app_id\", \"integ_id\", {\n name: \"Example Integration\"\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "integration_out = svix.integration.update(\"app_id\", \"integ_id\", IntegrationUpdate(\n name=\"Example Integration\"\n))" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "integration_out = await svix.integration.update(\"app_id\", \"integ_id\", IntegrationUpdate(\n name=\"Example Integration\"\n))" + }, + { + "label": "Go", + "lang": "Go", + "source": "integrationOut, err := svixClient.Integration.Update(ctx, \"app_id\", \"integ_id\", &IntegrationUpdate{\n Name: \"Example Integration\",\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val integrationOut = svix.integration.update(\"app_id\", \"integ_id\", IntegrationUpdate()\n .name(\"Example Integration\")\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "IntegrationOut integrationOut = svix.getIntegration().update(\"app_id\", \"integ_id\", new IntegrationUpdate()\n .name(\"Example Integration\")\n)" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "integration_out = svix.integration.update(\"app_id\", \"integ_id\", Svix::IntegrationUpdate.new({\n \"name\": \"Example Integration\"\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let integration_out = svix.integration().update(\"app_id\", \"integ_id\", IntegrationUpdate {\n name: \"Example Integration\".to_string(),\n}).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var integrationOut = await svix.Integration.UpdateAsync(\"app_id\", \"integ_id\", new IntegrationUpdate{\n name: \"Example Integration\"\n})" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix integration update \"app_id\" \"integ_id\" '{\n \"name\": \"Example Integration\"\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/{integ_id}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"Example Integration\"\n }'" + } + ] + }, + "delete": { + "tags": [ + "Integration" + ], + "summary": "Delete Integration", + "description": "Delete an integration.", + "operationId": "v1.integration.delete", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "integ_id", + "description": "The integ's ID", + "required": true, + "schema": { + "description": "The integ's ID", + "type": "string", + "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "style": "simple" + } + ], + "responses": { + "204": { + "description": "no content" + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.integration.delete(\"app_id\", \"integ_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.integration.delete(\"app_id\", \"integ_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.integration.delete(\"app_id\", \"integ_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.integration.delete(\"app_id\", \"integ_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.Integration.Delete(ctx, \"app_id\", \"integ_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.integration.delete(\"app_id\", \"integ_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getIntegration().delete(\"app_id\", \"integ_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.integration.delete(\"app_id\", \"integ_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.integration().delete(\"app_id\", \"integ_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.Integration.DeleteAsync(\"app_id\", \"integ_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix integration delete \"app_id\" \"integ_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/{integ_id}/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}/integration/{integ_id}/key/": { + "get": { + "tags": [ + "Integration" + ], + "summary": "Get Integration Key", + "description": "Get an integration's key.", + "operationId": "v1.integration.get-key", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "integ_id", + "description": "The integ's ID", + "required": true, + "schema": { + "description": "The integ's ID", + "type": "string", + "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationKeyOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const integrationKeyOut = await svix.integration.getKey(\"app_id\", \"integ_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const integrationKeyOut = await svix.integration.getKey(\"app_id\", \"integ_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "integration_key_out = svix.integration.get_key(\"app_id\", \"integ_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "integration_key_out = await svix.integration.get_key(\"app_id\", \"integ_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "integrationKeyOut, err := svixClient.Integration.GetKey(ctx, \"app_id\", \"integ_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val integrationKeyOut = svix.integration.getKey(\"app_id\", \"integ_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "IntegrationKeyOut integrationKeyOut = svix.getIntegration().getKey(\"app_id\", \"integ_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "integration_key_out = svix.integration.get_key(\"app_id\", \"integ_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let integration_key_out = svix.integration().get_key(\"app_id\", \"integ_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var integrationKeyOut = await svix.Integration.GetKeyAsync(\"app_id\", \"integ_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix integration get-key \"app_id\" \"integ_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/{integ_id}/key/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/app/{app_id}/integration/{integ_id}/key/rotate/": { + "post": { + "tags": [ + "Integration" + ], + "summary": "Rotate Integration Key", + "description": "Rotate the integration's key. The previous key will be immediately revoked.", + "operationId": "v1.integration.rotate-key", + "parameters": [ + { + "in": "path", + "name": "app_id", + "description": "The app's ID or UID", + "required": true, + "schema": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "style": "simple" + }, + { + "in": "path", + "name": "integ_id", + "description": "The integ's ID", + "required": true, + "schema": { + "description": "The integ's ID", + "type": "string", + "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "style": "simple" + }, + { + "in": "header", + "name": "idempotency-key", + "description": "The request's idempotency key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationKeyOut" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const integrationKeyOut = await svix.integration.rotateKey(\"app_id\", \"integ_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const integrationKeyOut = await svix.integration.rotateKey(\"app_id\", \"integ_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "integration_key_out = svix.integration.rotate_key(\"app_id\", \"integ_id\", None)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "integration_key_out = await svix.integration.rotate_key(\"app_id\", \"integ_id\", None)" + }, + { + "label": "Go", + "lang": "Go", + "source": "integrationKeyOut, err := svixClient.Integration.RotateKey(ctx, \"app_id\", \"integ_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val integrationKeyOut = svix.integration.rotateKey(\"app_id\", \"integ_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "IntegrationKeyOut integrationKeyOut = svix.getIntegration().rotateKey(\"app_id\", \"integ_id\")" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "integration_key_out = svix.integration.rotate_key(\"app_id\", \"integ_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let integration_key_out = svix.integration().rotate_key(\"app_id\", \"integ_id\", None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var integrationKeyOut = await svix.Integration.RotateKeyAsync(\"app_id\", \"integ_id\")" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix integration rotate-key \"app_id\" \"integ_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/app/{app_id}/integration/{integ_id}/key/rotate/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + }, + "/api/v1/health/": { + "get": { + "tags": [ + "Health" + ], + "summary": "Health", + "description": "Verify the API server is up and running.", + "operationId": "v1.health.get", + "responses": { + "204": { + "description": "no content" + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + } + } + }, + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "await svix.health.get();" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "await svix.health.get();" + }, + { + "label": "Python", + "lang": "Python", + "source": "svix.health.get()" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "await svix.health.get()" + }, + { + "label": "Go", + "lang": "Go", + "source": "err := svixClient.Health.Get(ctx)" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "svix.health.get()" + }, + { + "label": "Java", + "lang": "Java", + "source": "svix.getHealth().get()" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "svix.health.get()" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "svix.health().get().await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "await svix.Health.GetAsync()" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix health get " + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/health/' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'" + } + ] + } + } + }, + "components": { + "securitySchemes": { + "HTTPBearer": { + "type": "http", + "scheme": "bearer", + "bearerFormat": null, + "description": "HTTP Bearer token passed in the `Authorization` header" + } + }, + "schemas": { + "EndpointCreatedEvent": { + "description": "Sent when an endpoint is created.", + "type": "object", + "required": [ + "data", + "type" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/EndpointCreatedEventData" + }, + "type": { + "default": "endpoint.created", + "type": "string", + "enum": [ + "endpoint.created" + ] + } + } + }, + "EndpointCreatedEventData": { + "type": "object", + "required": [ + "appId", + "endpointId" + ], + "properties": { + "appId": { + "description": "The app's ID", + "type": "string", + "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "appUid": { + "description": "The app's UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier", + "nullable": true + }, + "endpointId": { + "description": "The ep's ID", + "type": "string", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "endpointUid": { + "description": "The ep's UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier", + "nullable": true + } + } + }, + "EndpointDeletedEvent": { + "description": "Sent when an endpoint is deleted.", + "type": "object", + "required": [ + "data", + "type" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/EndpointDeletedEventData" + }, + "type": { + "default": "endpoint.deleted", + "type": "string", + "enum": [ + "endpoint.deleted" + ] + } + } + }, + "EndpointDeletedEventData": { + "type": "object", + "required": [ + "appId", + "endpointId" + ], + "properties": { + "appId": { + "description": "The app's ID", + "type": "string", + "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "appUid": { + "description": "The app's UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier", + "nullable": true + }, + "endpointId": { + "description": "The ep's ID", + "type": "string", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "endpointUid": { + "description": "The ep's UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier", + "nullable": true + } + } + }, + "EndpointDisabledEvent": { + "description": "Sent when an endpoint has been automatically disabled after continuous failures.", + "type": "object", + "required": [ + "data", + "type" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/EndpointDisabledEventData" + }, + "type": { + "default": "endpoint.disabled", + "type": "string", + "enum": [ + "endpoint.disabled" + ] + } + } + }, + "EndpointDisabledEventData": { + "description": "Sent when an endpoint has been automatically disabled after continuous failures.", + "type": "object", + "required": [ + "appId", + "endpointId", + "failSince" + ], + "properties": { + "appId": { + "description": "The app's ID", + "type": "string", + "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "appUid": { + "description": "The app's UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier", + "nullable": true + }, + "endpointId": { + "description": "The ep's ID", + "type": "string", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "endpointUid": { + "description": "The ep's UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier", + "nullable": true + }, + "failSince": { + "type": "string", + "format": "date-time" + } + } + }, + "EndpointUpdatedEvent": { + "description": "Sent when an endpoint is updated.", + "type": "object", + "required": [ + "data", + "type" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/EndpointUpdatedEventData" + }, + "type": { + "default": "endpoint.updated", + "type": "string", + "enum": [ + "endpoint.updated" + ] + } + } + }, + "EndpointUpdatedEventData": { + "type": "object", + "required": [ + "appId", + "endpointId" + ], + "properties": { + "appId": { + "description": "The app's ID", + "type": "string", + "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "appUid": { + "description": "The app's UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier", + "nullable": true + }, + "endpointId": { + "description": "The ep's ID", + "type": "string", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "endpointUid": { + "description": "The ep's UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier", + "nullable": true + } + } + }, + "MessageAttemptExhaustedEvent": { + "description": "Sent when a message delivery has failed (all of the retry attempts have been exhausted).", + "type": "object", + "required": [ + "data", + "type" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/MessageAttemptExhaustedEventData" + }, + "type": { + "default": "message.attempt.exhausted", + "type": "string", + "enum": [ + "message.attempt.exhausted" + ] + } + } + }, + "MessageAttemptExhaustedEventData": { + "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.", + "type": "object", + "required": [ + "appId", + "endpointId", + "lastAttempt", + "msgId" + ], + "properties": { + "appId": { + "description": "The app's ID", + "type": "string", + "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "appUid": { + "description": "The app's UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier", + "nullable": true + }, + "msgId": { + "description": "The msg's ID", + "type": "string", + "example": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "msgEventId": { + "description": "The msg's UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-msg-identifier", + "nullable": true + }, + "endpointId": { + "description": "The ep's ID", + "type": "string", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "lastAttempt": { + "$ref": "#/components/schemas/MessageAttemptFailedData" + } + } + }, + "MessageAttemptFailedData": { + "type": "object", + "required": [ + "id", + "responseStatusCode", + "timestamp" + ], + "properties": { + "id": { + "description": "The attempt's ID", + "type": "string", + "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "responseStatusCode": { + "type": "integer", + "format": "int16" + }, + "timestamp": { + "type": "string", + "format": "date-time" + } + } + }, + "MessageAttemptFailingEvent": { + "description": "Sent after a message has been failing for a few times.\nIt's sent on the fourth failure. It complements `message.attempt.exhausted` which is sent after the last failure.", + "type": "object", + "required": [ + "data", + "type" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/MessageAttemptFailingEventData" + }, + "type": { + "default": "message.attempt.failing", + "type": "string", + "enum": [ + "message.attempt.failing" + ] + } + } + }, + "MessageAttemptFailingEventData": { + "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.", + "type": "object", + "required": [ + "appId", + "endpointId", + "lastAttempt", + "msgId" + ], + "properties": { + "appId": { + "description": "The app's ID", + "type": "string", + "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "appUid": { + "description": "The app's UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier", + "nullable": true + }, + "msgId": { + "description": "The msg's ID", + "type": "string", + "example": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "msgEventId": { + "description": "The msg's UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-msg-identifier", + "nullable": true + }, + "endpointId": { + "description": "The ep's ID", + "type": "string", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "lastAttempt": { + "$ref": "#/components/schemas/MessageAttemptFailedData" + } + } + }, + "MessageAttemptRecoveredEvent": { + "description": "Sent on a successful dispatch after an earlier failure op webhook has already been sent.", + "type": "object", + "required": [ + "data", + "type" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/MessageAttemptRecoveredEventData" + }, + "type": { + "default": "message.attempt.recovered", + "type": "string", + "enum": [ + "message.attempt.recovered" + ] + } + } + }, + "MessageAttemptRecoveredEventData": { + "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.", + "type": "object", + "required": [ + "appId", + "endpointId", + "lastAttempt", + "msgId" + ], + "properties": { + "appId": { + "description": "The app's ID", + "type": "string", + "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "appUid": { + "description": "The app's UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier", + "nullable": true + }, + "msgId": { + "description": "The msg's ID", + "type": "string", + "example": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "msgEventId": { + "description": "The msg's UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-msg-identifier", + "nullable": true + }, + "endpointId": { + "description": "The ep's ID", + "type": "string", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "lastAttempt": { + "$ref": "#/components/schemas/MessageAttemptFailedData" + } + } + }, + "AppPortalAccessIn": { + "type": "object", + "properties": { + "featureFlags": { + "description": "The set of feature flags the created token will have access to.", + "type": "array", + "items": { + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "cool-new-feature" + }, + "uniqueItems": true, + "example": [] + } + } + }, + "AppPortalAccessOut": { + "type": "object", + "required": [ + "token", + "url" + ], + "properties": { + "url": { + "type": "string", + "format": "uri", + "maxLength": 65536, + "minLength": 1, + "example": "https://app.svix.com/login#key=eyJhcHBJZCI6ICJhcHBfMXRSdFl" + }, + "token": { + "type": "string", + "example": "appsk_kV3ts5tKPNJN4Dl25cMTfUNdmabxbX0O" + } + } + }, + "HttpErrorOut": { + "title": "HttpError", + "type": "object", + "required": [ + "code", + "detail" + ], + "properties": { + "code": { + "type": "string" + }, + "detail": { + "type": "string" + } + } + }, + "HTTPValidationError": { + "type": "object", + "required": [ + "detail" + ], + "properties": { + "detail": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ValidationError" + } + } + } + }, + "ValidationError": { + "description": "Validation errors have their own schema to provide context for invalid requests eg. mismatched types and out of bounds values. There may be any number of these per 422 UNPROCESSABLE ENTITY error.", + "type": "object", + "required": [ + "loc", + "msg", + "type" + ], + "properties": { + "loc": { + "description": "The location as a [`Vec`] of [`String`]s -- often in the form `[\"body\", \"field_name\"]`, `[\"query\", \"field_name\"]`, etc. They may, however, be arbitrarily deep.", + "type": "array", + "items": { + "type": "string" + } + }, + "msg": { + "description": "The message accompanying the validation error item.", + "type": "string" + }, + "type": { + "description": "The type of error, often \"type_error\" or \"value_error\", but sometimes with more context like as \"value_error.number.not_ge\"", + "type": "string" + } + } + }, + "DashboardAccessOut": { + "type": "object", + "required": [ + "token", + "url" + ], + "properties": { + "url": { + "type": "string", + "format": "uri", + "maxLength": 65536, + "minLength": 1, + "example": "https://app.svix.com/login#key=eyJhcHBJZCI6ICJhcHBfMXRSdFl" + }, + "token": { + "type": "string", + "example": "appsk_kV3ts5tKPNJN4Dl25cMTfUNdmabxbX0O" + } + } + }, + "ApplicationTokenExpireIn": { + "type": "object", + "properties": { + "expiry": { + "description": "How many seconds until the old key is expired.", + "type": "integer", + "format": "int64", + "maximum": 259200.0, + "minimum": 0.0, + "nullable": true, + "example": 60 + } + } + }, + "ApplicationIn": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1, + "example": "My first application" + }, + "rateLimit": { + "type": "integer", + "format": "uint16", + "minimum": 1.0, + "nullable": true + }, + "uid": { + "description": "Optional unique identifier for the application", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier", + "nullable": true + }, + "metadata": { + "default": {}, + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "ApplicationOut": { + "type": "object", + "required": [ + "createdAt", + "id", + "metadata", + "name", + "updatedAt" + ], + "properties": { + "uid": { + "description": "The app's UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier", + "nullable": true + }, + "name": { + "type": "string", + "example": "My first application" + }, + "rateLimit": { + "type": "integer", + "format": "uint16", + "minimum": 0.0, + "nullable": true + }, + "id": { + "description": "The app's ID", + "type": "string", + "example": "app_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "Ordering": { + "description": "Defines the ordering in a listing of results.", + "type": "string", + "enum": [ + "ascending", + "descending" + ] + }, + "ListResponse_ApplicationOut_": { + "type": "object", + "required": [ + "data", + "done" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApplicationOut" + } + }, + "iterator": { + "type": "string", + "nullable": true, + "example": "iterator" + }, + "prevIterator": { + "type": "string", + "nullable": true, + "example": "-iterator" + }, + "done": { + "type": "boolean" + } + } + }, + "ApplicationPatch": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "rateLimit": { + "type": "integer", + "format": "uint16", + "minimum": 0.0, + "nullable": true + }, + "uid": { + "description": "The app's UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier", + "nullable": true + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "EndpointIn": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "description": { + "default": "", + "type": "string", + "example": "An example endpoint name" + }, + "rateLimit": { + "type": "integer", + "format": "uint16", + "minimum": 1.0, + "nullable": true + }, + "uid": { + "description": "Optional unique identifier for the endpoint", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier", + "nullable": true + }, + "url": { + "type": "string", + "format": "uri", + "maxLength": 65536, + "minLength": 1, + "example": "https://example.com/webhook/" + }, + "version": { + "default": 1, + "deprecated": true, + "type": "integer", + "format": "uint16", + "minimum": 1.0, + "nullable": true, + "example": 1 + }, + "disabled": { + "default": false, + "type": "boolean", + "example": false + }, + "filterTypes": { + "type": "array", + "items": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "minItems": 1, + "uniqueItems": true, + "nullable": true, + "example": [ + "user.signup", + "user.deleted" + ] + }, + "channels": { + "description": "List of message channels this endpoint listens to (omit for all)", + "type": "array", + "items": { + "type": "string", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "project_1337" + }, + "maxItems": 10, + "minItems": 1, + "uniqueItems": true, + "nullable": true, + "example": [ + "project_123", + "group_2" + ] + }, + "secret": { + "description": "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.", + "type": "string", + "pattern": "^(whsec_)?[a-zA-Z0-9+/=]{32,100}$", + "example": "whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD", + "nullable": true + }, + "metadata": { + "default": {}, + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "EndpointOut": { + "type": "object", + "required": [ + "createdAt", + "description", + "id", + "metadata", + "updatedAt", + "url", + "version" + ], + "properties": { + "id": { + "description": "The ep's ID", + "type": "string", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "description": "An example endpoint name", + "type": "string" + }, + "rateLimit": { + "type": "integer", + "format": "uint16", + "minimum": 0.0, + "nullable": true + }, + "uid": { + "description": "Optional unique identifier for the endpoint", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier", + "nullable": true + }, + "url": { + "type": "string", + "format": "uri", + "maxLength": 65536, + "minLength": 1, + "example": "https://example.com/webhook/" + }, + "version": { + "deprecated": true, + "type": "integer", + "format": "int32", + "minimum": 1.0, + "example": 1 + }, + "disabled": { + "default": false, + "type": "boolean", + "example": false + }, + "filterTypes": { + "type": "array", + "items": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "minItems": 1, + "uniqueItems": true, + "nullable": true, + "example": [ + "user.signup", + "user.deleted" + ] + }, + "channels": { + "description": "List of message channels this endpoint listens to (omit for all)", + "type": "array", + "items": { + "type": "string", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "project_1337" + }, + "maxItems": 10, + "minItems": 1, + "uniqueItems": true, + "nullable": true, + "example": [ + "project_123", + "group_2" + ] + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "ListResponse_EndpointOut_": { + "type": "object", + "required": [ + "data", + "done" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EndpointOut" + } + }, + "iterator": { + "type": "string", + "nullable": true, + "example": "iterator" + }, + "prevIterator": { + "type": "string", + "nullable": true, + "example": "-iterator" + }, + "done": { + "type": "boolean" + } + } + }, + "EndpointUpdate": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "description": { + "default": "", + "type": "string", + "example": "An example endpoint name" + }, + "rateLimit": { + "type": "integer", + "format": "uint16", + "minimum": 1.0, + "nullable": true + }, + "uid": { + "description": "Optional unique identifier for the endpoint", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier", + "nullable": true + }, + "url": { + "type": "string", + "format": "uri", + "maxLength": 65536, + "minLength": 1, + "example": "https://example.com/webhook/" + }, + "version": { + "default": 1, + "deprecated": true, + "type": "integer", + "format": "uint16", + "minimum": 1.0, + "nullable": true, + "example": 1 + }, + "disabled": { + "default": false, + "type": "boolean", + "example": false + }, + "filterTypes": { + "type": "array", + "items": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "minItems": 1, + "uniqueItems": true, + "nullable": true, + "example": [ + "user.signup", + "user.deleted" + ] + }, + "channels": { + "description": "List of message channels this endpoint listens to (omit for all)", + "type": "array", + "items": { + "type": "string", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "project_1337" + }, + "maxItems": 10, + "minItems": 1, + "uniqueItems": true, + "nullable": true, + "example": [ + "project_123", + "group_2" + ] + }, + "metadata": { + "default": {}, + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "EndpointPatch": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "rateLimit": { + "type": "integer", + "format": "uint16", + "minimum": 0.0, + "nullable": true + }, + "uid": { + "description": "The ep's UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier", + "nullable": true + }, + "url": { + "type": "string", + "format": "uri" + }, + "version": { + "deprecated": true, + "type": "integer", + "format": "uint16", + "minimum": 1.0, + "example": 1 + }, + "disabled": { + "type": "boolean" + }, + "filterTypes": { + "type": "array", + "items": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "uniqueItems": true, + "nullable": true + }, + "channels": { + "type": "array", + "items": { + "type": "string", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "project_1337" + }, + "uniqueItems": true, + "nullable": true + }, + "secret": { + "description": "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.", + "type": "string", + "pattern": "^(whsec_)?[a-zA-Z0-9+/=]{32,100}$", + "example": "whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD", + "nullable": true + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "EndpointSecretOut": { + "type": "object", + "required": [ + "key" + ], + "properties": { + "key": { + "description": "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.", + "type": "string", + "pattern": "^(whsec_)?[a-zA-Z0-9+/=]{32,100}$", + "example": "whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD" + } + } + }, + "EndpointSecretRotateIn": { + "type": "object", + "properties": { + "key": { + "description": "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.", + "default": null, + "type": "string", + "pattern": "^(whsec_)?[a-zA-Z0-9+/=]{32,100}$", + "example": "whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD", + "nullable": true + } + } + }, + "EndpointStats": { + "type": "object", + "required": [ + "fail", + "pending", + "sending", + "success" + ], + "properties": { + "success": { + "type": "integer", + "format": "int64" + }, + "pending": { + "type": "integer", + "format": "int64" + }, + "sending": { + "type": "integer", + "format": "int64" + }, + "fail": { + "type": "integer", + "format": "int64" + } + } + }, + "RecoverIn": { + "type": "object", + "required": [ + "since" + ], + "properties": { + "since": { + "type": "string", + "format": "date-time" + }, + "until": { + "type": "string", + "format": "date-time", + "nullable": true + } + } + }, + "RecoverOut": { + "type": "object", + "required": [ + "id", + "status", + "task" + ], + "properties": { + "id": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "task": { + "$ref": "#/components/schemas/BackgroundTaskType" + } + } + }, + "BackgroundTaskStatus": { + "type": "string", + "enum": [ + "running", + "finished", + "failed" + ] + }, + "BackgroundTaskType": { + "type": "string", + "enum": [ + "endpoint.replay", + "endpoint.recover", + "application.stats", + "message.broadcast", + "sdk.generate" + ] + }, + "ReplayIn": { + "type": "object", + "required": [ + "since" + ], + "properties": { + "since": { + "type": "string", + "format": "date-time" + }, + "until": { + "type": "string", + "format": "date-time", + "nullable": true + } + } + }, + "ReplayOut": { + "type": "object", + "required": [ + "id", + "status", + "task" + ], + "properties": { + "id": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "task": { + "$ref": "#/components/schemas/BackgroundTaskType" + } + } + }, + "EndpointHeadersOut": { + "description": "The value of the headers is returned in the `headers` field.\n\nSensitive headers that have been redacted are returned in the sensitive field.", + "type": "object", + "required": [ + "headers", + "sensitive" + ], + "properties": { + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "example": { + "X-Example": "123", + "X-Foobar": "Bar" + } + }, + "sensitive": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true, + "example": [ + "Authorization" + ] + } + } + }, + "EndpointHeadersPatchIn": { + "type": "object", + "required": [ + "headers" + ], + "properties": { + "headers": { + "type": "object", + "additionalProperties": { + "type": "string", + "nullable": true + }, + "example": { + "X-Example": "123", + "X-Foobar": "Bar" + } + } + } + }, + "EndpointHeadersIn": { + "type": "object", + "required": [ + "headers" + ], + "properties": { + "headers": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "example": { + "X-Example": "123", + "X-Foobar": "Bar" + } + } + } + }, + "EndpointTransformationOut": { + "type": "object", + "properties": { + "code": { + "type": "string", + "maxLength": 51200, + "minLength": 10, + "nullable": true + }, + "enabled": { + "default": false, + "type": "boolean" + } + } + }, + "EndpointTransformationIn": { + "type": "object", + "properties": { + "code": { + "type": "string", + "maxLength": 51200, + "minLength": 10, + "nullable": true + }, + "enabled": { + "type": "boolean" + } + } + }, + "EndpointTransformationSimulateIn": { + "type": "object", + "required": [ + "code", + "eventType", + "payload" + ], + "properties": { + "code": { + "type": "string", + "maxLength": 51200, + "minLength": 10 + }, + "eventType": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "channels": { + "type": "array", + "items": { + "type": "string", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "project_1337" + }, + "uniqueItems": true, + "nullable": true + }, + "payload": { + "type": "object" + } + } + }, + "EndpointTransformationSimulateOut": { + "type": "object", + "required": [ + "payload", + "url" + ], + "properties": { + "url": { + "type": "string", + "format": "uri", + "maxLength": 65536, + "minLength": 1 + }, + "payload": { + "type": "string" + }, + "method": { + "$ref": "#/components/schemas/TransformationHttpMethod", + "nullable": true + } + } + }, + "TransformationHttpMethod": { + "type": "string", + "enum": [ + "POST", + "PUT" + ] + }, + "EventExampleIn": { + "type": "object", + "required": [ + "eventType" + ], + "properties": { + "eventType": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + } + } + }, + "MessageOut": { + "type": "object", + "required": [ + "eventType", + "id", + "payload", + "timestamp" + ], + "properties": { + "eventId": { + "description": "Optional unique identifier for the message", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-msg-identifier", + "nullable": true + }, + "eventType": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "payload": { + "type": "object", + "example": { + "email": "test@example.com", + "type": "user.created", + "username": "test_user" + } + }, + "channels": { + "description": "List of free-form identifiers that endpoints can filter by", + "type": "array", + "items": { + "type": "string", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "project_1337" + }, + "maxItems": 5, + "minItems": 1, + "uniqueItems": true, + "nullable": true, + "example": [ + "project_123", + "group_2" + ] + }, + "id": { + "description": "The msg's ID", + "type": "string", + "example": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "timestamp": { + "type": "string", + "format": "date-time" + } + } + }, + "EventTypeIn": { + "type": "object", + "required": [ + "description", + "name" + ], + "properties": { + "name": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "description": { + "type": "string", + "example": "A user has signed up" + }, + "archived": { + "default": false, + "type": "boolean", + "example": false + }, + "schemas": { + "description": "The schema for the event type for a specific version as a JSON schema.", + "type": "object", + "additionalProperties": { + "type": "object" + }, + "example": { + "1": { + "description": "An invoice was paid by a user", + "properties": { + "invoiceId": { + "description": "The invoice id", + "type": "string" + }, + "userId": { + "description": "The user id", + "type": "string" + } + }, + "required": [ + "invoiceId", + "userId" + ], + "title": "Invoice Paid Event", + "type": "object" + } + }, + "nullable": true + }, + "featureFlag": { + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "cool-new-feature", + "nullable": true + } + } + }, + "EventTypeOut": { + "type": "object", + "required": [ + "createdAt", + "description", + "name", + "updatedAt" + ], + "properties": { + "name": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "description": { + "type": "string", + "example": "A user has signed up" + }, + "archived": { + "default": false, + "type": "boolean", + "example": false + }, + "schemas": { + "description": "The schema for the event type for a specific version as a JSON schema.", + "type": "object", + "additionalProperties": { + "type": "object" + }, + "example": { + "1": { + "description": "An invoice was paid by a user", + "properties": { + "invoiceId": { + "description": "The invoice id", + "type": "string" + }, + "userId": { + "description": "The user id", + "type": "string" + } + }, + "required": [ + "invoiceId", + "userId" + ], + "title": "Invoice Paid Event", + "type": "object" + } + }, + "nullable": true + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "featureFlag": { + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "cool-new-feature", + "nullable": true + } + } + }, + "ListResponse_EventTypeOut_": { + "type": "object", + "required": [ + "data", + "done" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EventTypeOut" + } + }, + "iterator": { + "type": "string", + "nullable": true, + "example": "iterator" + }, + "prevIterator": { + "type": "string", + "nullable": true, + "example": "-iterator" + }, + "done": { + "type": "boolean" + } + } + }, + "EventTypeImportOpenApiIn": { + "description": "Import a list of event types from webhooks defined in an OpenAPI spec.\n\nThe 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**.", + "type": "object", + "properties": { + "spec": { + "description": "A pre-parsed JSON spec.", + "type": "object", + "additionalProperties": { + "type": "object" + }, + "nullable": true, + "example": { + "components": { + "schemas": { + "Pet": { + "properties": { + "id": { + "format": "int64", + "type": "integer" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ] + } + } + }, + "info": { + "title": "Webhook Example", + "version": "1.0.0" + }, + "openapi": "3.1.0", + "webhooks": { + "pet.new": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "description": "Information about a new pet in the system" + }, + "responses": { + "200": { + "description": "Return a 200 status to indicate that the data was received successfully" + } + } + } + } + } + } + }, + "specRaw": { + "description": "A string, parsed by the server as YAML or JSON.", + "type": "string", + "nullable": true, + "example": { + "components": { + "schemas": { + "Pet": { + "properties": { + "id": { + "format": "int64", + "type": "integer" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ] + } + } + }, + "info": { + "title": "Webhook Example", + "version": "1.0.0" + }, + "openapi": "3.1.0", + "webhooks": { + "pet.new": { + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pet" + } + } + }, + "description": "Information about a new pet in the system" + }, + "responses": { + "200": { + "description": "Return a 200 status to indicate that the data was received successfully" + } + } + } + } + } + } + } + } + }, + "EventTypeImportOpenApiOut": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/EventTypeImportOpenApiOutData" + } + } + }, + "EventTypeImportOpenApiOutData": { + "type": "object", + "required": [ + "modified" + ], + "properties": { + "modified": { + "type": "array", + "items": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + } + } + } + }, + "ExportEventTypeOut": { + "type": "object", + "required": [ + "id", + "status", + "task" + ], + "properties": { + "id": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "task": { + "$ref": "#/components/schemas/BackgroundTaskType" + } + } + }, + "EventTypeUpdate": { + "type": "object", + "required": [ + "description" + ], + "properties": { + "description": { + "type": "string", + "example": "A user has signed up" + }, + "archived": { + "default": false, + "type": "boolean", + "example": false + }, + "schemas": { + "description": "The schema for the event type for a specific version as a JSON schema.", + "type": "object", + "additionalProperties": { + "type": "object" + }, + "example": { + "1": { + "description": "An invoice was paid by a user", + "properties": { + "invoiceId": { + "description": "The invoice id", + "type": "string" + }, + "userId": { + "description": "The user id", + "type": "string" + } + }, + "required": [ + "invoiceId", + "userId" + ], + "title": "Invoice Paid Event", + "type": "object" + } + }, + "nullable": true + }, + "featureFlag": { + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "cool-new-feature", + "nullable": true + } + } + }, + "EventTypePatch": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "archived": { + "type": "boolean" + }, + "schemas": { + "type": "object", + "additionalProperties": { + "type": "object" + }, + "example": { + "description": "An invoice was paid by a user", + "properties": { + "invoiceId": { + "description": "The invoice id", + "type": "string" + }, + "userId": { + "description": "The user id", + "type": "string" + } + }, + "required": [ + "invoiceId", + "userId" + ], + "title": "Invoice Paid Event", + "type": "object" + }, + "nullable": true + }, + "featureFlag": { + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "cool-new-feature", + "nullable": true + } + } + }, + "ListResponse_BackgroundTaskOut_": { + "type": "object", + "required": [ + "data", + "done" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BackgroundTaskOut" + } + }, + "iterator": { + "type": "string", + "nullable": true, + "example": "iterator" + }, + "prevIterator": { + "type": "string", + "nullable": true, + "example": "-iterator" + }, + "done": { + "type": "boolean" + } + } + }, + "BackgroundTaskOut": { + "type": "object", + "required": [ + "data", + "id", + "status", + "task" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/BackgroundTaskData" + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "task": { + "$ref": "#/components/schemas/BackgroundTaskType" + } + } + }, + "BackgroundTaskData": { + "type": "object" + }, + "ListResponse_MessageOut_": { + "type": "object", + "required": [ + "data", + "done" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MessageOut" + } + }, + "iterator": { + "type": "string", + "nullable": true, + "example": "iterator" + }, + "prevIterator": { + "type": "string", + "nullable": true, + "example": "-iterator" + }, + "done": { + "type": "boolean" + } + } + }, + "MessageIn": { + "type": "object", + "required": [ + "eventType", + "payload" + ], + "properties": { + "eventId": { + "description": "Optional unique identifier for the message", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-msg-identifier", + "nullable": true + }, + "eventType": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "payload": { + "type": "object", + "example": { + "email": "test@example.com", + "type": "user.created", + "username": "test_user" + } + }, + "channels": { + "description": "List of free-form identifiers that endpoints can filter by", + "type": "array", + "items": { + "type": "string", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "project_1337" + }, + "maxItems": 5, + "minItems": 1, + "uniqueItems": true, + "nullable": true, + "example": [ + "project_123", + "group_2" + ] + }, + "payloadRetentionPeriod": { + "default": 90, + "type": "integer", + "format": "int64", + "maximum": 90.0, + "minimum": 5.0, + "example": 90 + }, + "application": { + "$ref": "#/components/schemas/ApplicationIn", + "nullable": true + } + } + }, + "MessageRawPayloadOut": { + "type": "object", + "required": [ + "payload" + ], + "properties": { + "payload": { + "type": "string", + "example": "{\"email\":\"test@example.com\",\"type\":\"user.created\",\"username\":\"test_user\"}" + } + } + }, + "MessageAttemptOut": { + "type": "object", + "required": [ + "endpointId", + "id", + "msgId", + "response", + "responseStatusCode", + "status", + "timestamp", + "triggerType", + "url" + ], + "properties": { + "url": { + "type": "string", + "format": "uri", + "maxLength": 65536, + "minLength": 1, + "example": "https://example.com/webhook/" + }, + "response": { + "type": "string", + "example": "{}" + }, + "responseStatusCode": { + "type": "integer", + "format": "int16", + "example": 200 + }, + "status": { + "$ref": "#/components/schemas/MessageStatus" + }, + "triggerType": { + "$ref": "#/components/schemas/MessageAttemptTriggerType" + }, + "msgId": { + "description": "The msg's ID", + "type": "string", + "example": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "endpointId": { + "description": "The ep's ID", + "type": "string", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "id": { + "description": "The attempt's ID", + "type": "string", + "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "timestamp": { + "type": "string", + "format": "date-time" + } + } + }, + "MessageStatus": { + "title": "MessageStatus", + "description": "The sending status of the message:\n- Success = 0\n- Pending = 1\n- Fail = 2\n- Sending = 3", + "type": "integer", + "enum": [ + 0, + 1, + 2, + 3 + ], + "x-enum-varnames": [ + "Success", + "Pending", + "Fail", + "Sending" + ] + }, + "MessageAttemptTriggerType": { + "title": "MessageAttemptTriggerType", + "description": "The reason an attempt was made:\n- Scheduled = 0\n- Manual = 1", + "type": "integer", + "enum": [ + 0, + 1 + ], + "x-enum-varnames": [ + "Scheduled", + "Manual" + ] + }, + "StatusCodeClass": { + "title": "StatusCodeClass", + "description": "The different classes of HTTP status codes:\n- CodeNone = 0\n- Code1xx = 100\n- Code2xx = 200\n- Code3xx = 300\n- Code4xx = 400\n- Code5xx = 500", + "type": "integer", + "enum": [ + 0, + 100, + 200, + 300, + 400, + 500 + ], + "x-enum-varnames": [ + "CodeNone", + "Code1xx", + "Code2xx", + "Code3xx", + "Code4xx", + "Code5xx" + ] + }, + "ListResponse_MessageAttemptOut_": { + "type": "object", + "required": [ + "data", + "done" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MessageAttemptOut" + } + }, + "iterator": { + "type": "string", + "nullable": true, + "example": "iterator" + }, + "prevIterator": { + "type": "string", + "nullable": true, + "example": "-iterator" + }, + "done": { + "type": "boolean" + } + } + }, + "ListResponse_EndpointMessageOut_": { + "type": "object", + "required": [ + "data", + "done" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EndpointMessageOut" + } + }, + "iterator": { + "type": "string", + "nullable": true, + "example": "iterator" + }, + "prevIterator": { + "type": "string", + "nullable": true, + "example": "-iterator" + }, + "done": { + "type": "boolean" + } + } + }, + "EndpointMessageOut": { + "description": "A model containing information on a given message plus additional fields on the last attempt for that message.", + "type": "object", + "required": [ + "eventType", + "id", + "payload", + "status", + "timestamp" + ], + "properties": { + "status": { + "$ref": "#/components/schemas/MessageStatus" + }, + "nextAttempt": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "eventId": { + "description": "Optional unique identifier for the message", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-msg-identifier", + "nullable": true + }, + "eventType": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "payload": { + "type": "object", + "example": { + "email": "test@example.com", + "type": "user.created", + "username": "test_user" + } + }, + "channels": { + "description": "List of free-form identifiers that endpoints can filter by", + "type": "array", + "items": { + "type": "string", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "project_1337" + }, + "maxItems": 5, + "minItems": 1, + "uniqueItems": true, + "nullable": true, + "example": [ + "project_123", + "group_2" + ] + }, + "id": { + "description": "The msg's ID", + "type": "string", + "example": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "timestamp": { + "type": "string", + "format": "date-time" + } + } + }, + "ListResponse_MessageEndpointOut_": { + "type": "object", + "required": [ + "data", + "done" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MessageEndpointOut" + } + }, + "iterator": { + "type": "string", + "nullable": true, + "example": "iterator" + }, + "prevIterator": { + "type": "string", + "nullable": true, + "example": "-iterator" + }, + "done": { + "type": "boolean" + } + } + }, + "MessageEndpointOut": { + "type": "object", + "required": [ + "createdAt", + "description", + "id", + "status", + "updatedAt", + "url", + "version" + ], + "properties": { + "id": { + "description": "The ep's ID", + "type": "string", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "status": { + "$ref": "#/components/schemas/MessageStatus" + }, + "nextAttempt": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "description": { + "description": "An example endpoint name", + "type": "string" + }, + "rateLimit": { + "type": "integer", + "format": "uint16", + "minimum": 0.0, + "nullable": true + }, + "uid": { + "description": "Optional unique identifier for the endpoint", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-ep-identifier", + "nullable": true + }, + "url": { + "type": "string", + "format": "uri", + "maxLength": 65536, + "minLength": 1, + "example": "https://example.com/webhook/" + }, + "version": { + "deprecated": true, + "type": "integer", + "format": "int32", + "minimum": 1.0, + "example": 1 + }, + "disabled": { + "default": false, + "type": "boolean", + "example": false + }, + "filterTypes": { + "type": "array", + "items": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "minItems": 1, + "uniqueItems": true, + "nullable": true, + "example": [ + "user.signup", + "user.deleted" + ] + }, + "channels": { + "description": "List of message channels this endpoint listens to (omit for all)", + "type": "array", + "items": { + "type": "string", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "project_1337" + }, + "maxItems": 10, + "minItems": 1, + "uniqueItems": true, + "nullable": true, + "example": [ + "project_123", + "group_2" + ] + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "ListResponse_MessageAttemptEndpointOut_": { + "type": "object", + "required": [ + "data", + "done" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MessageAttemptEndpointOut" + } + }, + "iterator": { + "type": "string", + "nullable": true, + "example": "iterator" + }, + "prevIterator": { + "type": "string", + "nullable": true, + "example": "-iterator" + }, + "done": { + "type": "boolean" + } + } + }, + "MessageAttemptEndpointOut": { + "type": "object", + "required": [ + "endpointId", + "id", + "msgId", + "response", + "responseStatusCode", + "status", + "timestamp", + "triggerType", + "url" + ], + "properties": { + "url": { + "type": "string", + "format": "uri", + "maxLength": 65536, + "minLength": 1, + "example": "https://example.com/webhook/" + }, + "response": { + "type": "string", + "example": "{}" + }, + "responseStatusCode": { + "type": "integer", + "format": "int16", + "example": 200 + }, + "status": { + "$ref": "#/components/schemas/MessageStatus" + }, + "triggerType": { + "$ref": "#/components/schemas/MessageAttemptTriggerType" + }, + "msgId": { + "description": "The msg's ID", + "type": "string", + "example": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "endpointId": { + "description": "The ep's ID", + "type": "string", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "id": { + "description": "The attempt's ID", + "type": "string", + "example": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "timestamp": { + "type": "string", + "format": "date-time" + } + } + }, + "AppUsageStatsIn": { + "type": "object", + "required": [ + "since", + "until" + ], + "properties": { + "since": { + "type": "string", + "format": "date-time" + }, + "until": { + "type": "string", + "format": "date-time" + }, + "appIds": { + "type": "array", + "items": { + "description": "The app's ID or UID", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-app-identifier" + }, + "uniqueItems": true, + "nullable": true + } + } + }, + "AppUsageStatsOut": { + "type": "object", + "required": [ + "id", + "status", + "task" + ], + "properties": { + "id": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "task": { + "$ref": "#/components/schemas/BackgroundTaskType" + } + } + }, + "ListResponse_IntegrationOut_": { + "type": "object", + "required": [ + "data", + "done" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/IntegrationOut" + } + }, + "iterator": { + "type": "string", + "nullable": true, + "example": "iterator" + }, + "prevIterator": { + "type": "string", + "nullable": true, + "example": "-iterator" + }, + "done": { + "type": "boolean" + } + } + }, + "IntegrationOut": { + "type": "object", + "required": [ + "createdAt", + "id", + "name", + "updatedAt" + ], + "properties": { + "name": { + "type": "string", + "example": "Example Integration" + }, + "id": { + "description": "The integ's ID", + "type": "string", + "example": "integ_1srOrx2ZWZBpBUvZwXKQmoEYga2" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "IntegrationIn": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "example": "Example Integration" + } + } + }, + "IntegrationUpdate": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "example": "Example Integration" + } + } + }, + "IntegrationKeyOut": { + "type": "object", + "required": [ + "key" + ], + "properties": { + "key": { + "type": "string", + "example": "integsk_kV3ts5tKPNJN4Dl25cMTfUNdmabxbX0O" + } + } + }, + "MessageBroadcastIn": { + "type": "object", + "required": [ + "eventType", + "payload" + ], + "properties": { + "eventId": { + "description": "Optional unique identifier for the message", + "type": "string", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "unique-msg-identifier", + "nullable": true + }, + "eventType": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "payload": { + "type": "object", + "example": { + "email": "test@example.com", + "type": "user.created", + "username": "test_user" + } + }, + "channels": { + "description": "List of free-form identifiers that endpoints can filter by", + "type": "array", + "items": { + "type": "string", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "project_1337" + }, + "maxItems": 5, + "minItems": 1, + "uniqueItems": true, + "nullable": true, + "example": [ + "project_123", + "group_2" + ] + }, + "payloadRetentionPeriod": { + "default": 90, + "type": "integer", + "format": "int64", + "maximum": 90.0, + "minimum": 5.0, + "example": 90 + } + } + }, + "MessageBroadcastOut": { + "type": "object", + "required": [ + "id", + "status", + "task" + ], + "properties": { + "id": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/BackgroundTaskStatus" + }, + "task": { + "$ref": "#/components/schemas/BackgroundTaskType" + } + } + }, + "ListResponse_TemplateOut_": { + "type": "object", + "required": [ + "data", + "done" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TemplateOut" + } + }, + "iterator": { + "type": "string", + "nullable": true, + "example": "iterator" + }, + "prevIterator": { + "type": "string", + "nullable": true, + "example": "-iterator" + }, + "done": { + "type": "boolean" + } + } + }, + "TemplateOut": { + "type": "object", + "required": [ + "createdAt", + "description", + "id", + "instructions", + "kind", + "logo", + "name", + "orgId", + "transformation", + "updatedAt" + ], + "properties": { + "id": { + "type": "string" + }, + "orgId": { + "type": "string" + }, + "kind": { + "$ref": "#/components/schemas/TransformationTemplateKind" + }, + "name": { + "type": "string" + }, + "logo": { + "type": "string", + "format": "uri" + }, + "description": { + "type": "string" + }, + "instructions": { + "type": "string" + }, + "instructionsLink": { + "type": "string", + "format": "uri", + "nullable": true + }, + "filterTypes": { + "type": "array", + "items": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "minItems": 1, + "uniqueItems": true, + "nullable": true, + "example": [ + "user.signup", + "user.deleted" + ] + }, + "transformation": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "featureFlag": { + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "cool-new-feature", + "nullable": true + } + } + }, + "TransformationTemplateKind": { + "type": "string", + "enum": [ + "Custom", + "Slack", + "Discord", + "Teams", + "Inngest", + "Segment" + ] + }, + "TemplateIn": { + "type": "object", + "required": [ + "logo", + "name", + "transformation" + ], + "properties": { + "name": { + "type": "string" + }, + "logo": { + "type": "string", + "format": "uri" + }, + "description": { + "default": "", + "type": "string" + }, + "kind": { + "default": "Custom", + "$ref": "#/components/schemas/TransformationTemplateKind" + }, + "instructions": { + "default": "", + "type": "string" + }, + "instructionsLink": { + "default": null, + "type": "string", + "format": "uri", + "nullable": true + }, + "filterTypes": { + "type": "array", + "items": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "minItems": 1, + "uniqueItems": true, + "nullable": true, + "example": [ + "user.signup", + "user.deleted" + ] + }, + "transformation": { + "type": "string", + "maxLength": 51200, + "minLength": 10 + }, + "featureFlag": { + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "cool-new-feature", + "nullable": true + } + } + }, + "TemplateUpdate": { + "type": "object", + "required": [ + "logo", + "transformation" + ], + "properties": { + "name": { + "default": "", + "type": "string" + }, + "logo": { + "type": "string", + "format": "uri" + }, + "description": { + "default": "", + "type": "string" + }, + "kind": { + "default": "Custom", + "$ref": "#/components/schemas/TransformationTemplateKind" + }, + "instructions": { + "default": "", + "type": "string" + }, + "instructionsLink": { + "type": "string", + "format": "uri", + "nullable": true + }, + "filterTypes": { + "type": "array", + "items": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "minItems": 1, + "uniqueItems": true, + "nullable": true, + "example": [ + "user.signup", + "user.deleted" + ] + }, + "transformation": { + "type": "string", + "maxLength": 51200, + "minLength": 10 + }, + "featureFlag": { + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "cool-new-feature", + "nullable": true + } + } + }, + "TemplatePatch": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "logo": { + "type": "string", + "format": "uri" + }, + "description": { + "type": "string" + }, + "kind": { + "$ref": "#/components/schemas/TransformationTemplateKind" + }, + "instructions": { + "type": "string" + }, + "instructionsLink": { + "type": "string", + "format": "uri", + "nullable": true + }, + "filterTypes": { + "type": "array", + "items": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "minItems": 1, + "uniqueItems": true, + "nullable": true, + "example": [ + "user.signup", + "user.deleted" + ] + }, + "transformation": { + "type": "string", + "maxLength": 51200, + "minLength": 10 + }, + "featureFlag": { + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "cool-new-feature", + "nullable": true + } + } + }, + "TransformationSimulateIn": { + "type": "object", + "required": [ + "code", + "eventType", + "payload" + ], + "properties": { + "code": { + "type": "string", + "maxLength": 51200, + "minLength": 10 + }, + "eventType": { + "description": "The event type's name", + "type": "string", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "user.signup" + }, + "channels": { + "type": "array", + "items": { + "type": "string", + "maxLength": 128, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "example": "project_1337" + }, + "uniqueItems": true, + "nullable": true + }, + "payload": { + "type": "object" + } + } + }, + "TransformationSimulateOut": { + "type": "object", + "required": [ + "payload", + "url" + ], + "properties": { + "url": { + "type": "string", + "format": "uri", + "maxLength": 65536, + "minLength": 1 + }, + "payload": { + "type": "string" + }, + "method": { + "$ref": "#/components/schemas/TransformationHttpMethod", + "nullable": true + } + } + }, + "OauthPayloadIn": { + "type": "object", + "required": [ + "code", + "redirectUri" + ], + "properties": { + "code": { + "type": "string" + }, + "redirectUri": { + "type": "string" + } + } + }, + "OauthPayloadOut": { + "type": "object", + "properties": { + "error": { + "type": "string", + "nullable": true + }, + "incomingWebhookUrl": { + "type": "string", + "format": "uri", + "nullable": true + }, + "channel": { + "type": "string", + "nullable": true + } + } + }, + "OneTimeTokenIn": { + "type": "object", + "required": [ + "oneTimeToken" + ], + "properties": { + "oneTimeToken": { + "type": "string" + } + } + }, + "OneTimeTokenOut": { + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "type": "string" + } + } + } + } + }, + "tags": [ + { + "name": "Application", + "description": "Consumer Applications are where messages are sent to. In most cases you would want to have one application for each of your users." + }, + { + "name": "Message", + "description": "Messages are the webhook events being sent." + }, + { + "name": "Message Attempt", + "description": "Attempts to deliver `Message`s to `Endpoint`s." + }, + { + "name": "Endpoint", + "description": "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)." + }, + { + "name": "Integration", + "description": "Integrations are services your users connect an application to. An integration can manage the application and its endpoints." + }, + { + "name": "Event Type", + "description": "Event types are identifiers denoting the type of message being sent. Event types are primarily used to decide which events are sent to which endpoint." + }, + { + "name": "Authentication", + "description": "Easily give your users access to our pre-built management UI." + }, + { + "name": "Health", + "description": "Health checks for the API." + }, + { + "name": "Webhooks", + "description": "The webhooks the Svix service sends to notify you of events." + }, + { + "name": "Background Tasks", + "description": "The background tasks that have been executed for your environment." + } + ], + "x-tagGroups": [ + { + "name": "General", + "tags": [ + "Application", + "Event Type", + "Background Tasks" + ] + }, + { + "name": "Application specific", + "tags": [ + "Authentication", + "Endpoint", + "Message", + "Message Attempt", + "Integration" + ] + }, + { + "name": "Utility", + "tags": [ + "Health" + ] + }, + { + "name": "Webhooks", + "tags": [ + "Webhooks" + ] + } + ], + "x-webhooks": { + "endpoint.created": { + "post": { + "description": "Sent when an endpoint is created.", + "operationId": "endpoint.created", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointCreatedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2XX status to indicate that the data was received successfully" + } + }, + "summary": "endpoint.created", + "tags": [ + "Webhooks" + ] + } + }, + "endpoint.deleted": { + "post": { + "description": "Sent when an endpoint is deleted.", + "operationId": "endpoint.deleted", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointDeletedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2XX status to indicate that the data was received successfully" + } + }, + "summary": "endpoint.deleted", + "tags": [ + "Webhooks" + ] + } + }, + "endpoint.disabled": { + "post": { + "description": "Sent when an endpoint has been automatically disabled after continuous failures.", + "operationId": "endpoint.disabled", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointDisabledEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2XX status to indicate that the data was received successfully" + } + }, + "summary": "endpoint.disabled", + "tags": [ + "Webhooks" + ] + } + }, + "endpoint.updated": { + "post": { + "description": "Sent when an endpoint is updated.", + "operationId": "endpoint.updated", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndpointUpdatedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2XX status to indicate that the data was received successfully" + } + }, + "summary": "endpoint.updated", + "tags": [ + "Webhooks" + ] + } + }, + "message.attempt.exhausted": { + "post": { + "description": "Sent when a message delivery has failed (all of the retry attempts have been exhausted).", + "operationId": "message.attempt.exhausted", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageAttemptExhaustedEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2XX status to indicate that the data was received successfully" + } + }, + "summary": "message.attempt.exhausted", + "tags": [ + "Webhooks" + ] + } + }, + "message.attempt.failing": { + "post": { + "description": "Sent after a message has been failing for a few times.\nIt's sent on the fourth failure. It complements `message.attempt.exhausted` which is sent after the last failure.", + "operationId": "message.attempt.failing", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageAttemptFailingEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2XX status to indicate that the data was received successfully" + } + }, + "summary": "message.attempt.failing", + "tags": [ + "Webhooks" + ] + } + }, + "message.attempt.recovered": { + "post": { + "description": "Sent on a successful dispatch after an earlier failure op webhook has already been sent.", + "operationId": "message.attempt.recovered", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageAttemptRecoveredEvent" + } + } + } + }, + "responses": { + "2XX": { + "description": "Return any 2XX status to indicate that the data was received successfully" + } + }, + "summary": "message.attempt.recovered", + "tags": [ + "Webhooks" + ] + } + } + } +} diff --git a/test/Api/ApplicationApiTest.php b/test/Api/ApplicationApiTest.php new file mode 100644 index 0000000..0d24a46 --- /dev/null +++ b/test/Api/ApplicationApiTest.php @@ -0,0 +1,145 @@ + ## 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 + * Please update the test case below to test the endpoint. + */ + +namespace Svix\ApiClient\Test\Api; + +use \Svix\ApiClient\Configuration; +use \Svix\ApiClient\ApiException; +use \Svix\ApiClient\ObjectSerializer; +use PHPUnit\Framework\TestCase; + +/** + * ApplicationApiTest Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ApplicationApiTest extends TestCase +{ + + /** + * Setup before running any test cases + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test case for v1ApplicationCreate + * + * Create Application. + * + */ + public function testV1ApplicationCreate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1ApplicationDelete + * + * Delete Application. + * + */ + public function testV1ApplicationDelete() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1ApplicationGet + * + * Get Application. + * + */ + public function testV1ApplicationGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1ApplicationList + * + * List Applications. + * + */ + public function testV1ApplicationList() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1ApplicationPatch + * + * Patch Application. + * + */ + public function testV1ApplicationPatch() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1ApplicationUpdate + * + * Update Application. + * + */ + public function testV1ApplicationUpdate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/AuthenticationApiTest.php b/test/Api/AuthenticationApiTest.php new file mode 100644 index 0000000..e0185c0 --- /dev/null +++ b/test/Api/AuthenticationApiTest.php @@ -0,0 +1,121 @@ + ## 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 + * Please update the test case below to test the endpoint. + */ + +namespace Svix\ApiClient\Test\Api; + +use \Svix\ApiClient\Configuration; +use \Svix\ApiClient\ApiException; +use \Svix\ApiClient\ObjectSerializer; +use PHPUnit\Framework\TestCase; + +/** + * AuthenticationApiTest Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class AuthenticationApiTest extends TestCase +{ + + /** + * Setup before running any test cases + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test case for v1AuthenticationAppPortalAccess + * + * Get Consumer App Portal Access. + * + */ + public function testV1AuthenticationAppPortalAccess() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1AuthenticationDashboardAccess + * + * Dashboard Access. + * + */ + public function testV1AuthenticationDashboardAccess() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1AuthenticationExpireAll + * + * Expire All. + * + */ + public function testV1AuthenticationExpireAll() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1AuthenticationLogout + * + * Logout. + * + */ + public function testV1AuthenticationLogout() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/BackgroundTasksApiTest.php b/test/Api/BackgroundTasksApiTest.php new file mode 100644 index 0000000..1c06586 --- /dev/null +++ b/test/Api/BackgroundTasksApiTest.php @@ -0,0 +1,97 @@ + ## 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 + * Please update the test case below to test the endpoint. + */ + +namespace Svix\ApiClient\Test\Api; + +use \Svix\ApiClient\Configuration; +use \Svix\ApiClient\ApiException; +use \Svix\ApiClient\ObjectSerializer; +use PHPUnit\Framework\TestCase; + +/** + * BackgroundTasksApiTest Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class BackgroundTasksApiTest extends TestCase +{ + + /** + * Setup before running any test cases + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test case for getBackgroundTask + * + * Get Background Task. + * + */ + public function testGetBackgroundTask() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listBackgroundTasks + * + * List Background Tasks. + * + */ + public function testListBackgroundTasks() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/EndpointApiTest.php b/test/Api/EndpointApiTest.php new file mode 100644 index 0000000..75b5464 --- /dev/null +++ b/test/Api/EndpointApiTest.php @@ -0,0 +1,277 @@ + ## 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 + * Please update the test case below to test the endpoint. + */ + +namespace Svix\ApiClient\Test\Api; + +use \Svix\ApiClient\Configuration; +use \Svix\ApiClient\ApiException; +use \Svix\ApiClient\ObjectSerializer; +use PHPUnit\Framework\TestCase; + +/** + * EndpointApiTest Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointApiTest extends TestCase +{ + + /** + * Setup before running any test cases + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test case for v1EndpointCreate + * + * Create Endpoint. + * + */ + public function testV1EndpointCreate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EndpointDelete + * + * Delete Endpoint. + * + */ + public function testV1EndpointDelete() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EndpointGet + * + * Get Endpoint. + * + */ + public function testV1EndpointGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EndpointGetHeaders + * + * Get Endpoint Headers. + * + */ + public function testV1EndpointGetHeaders() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EndpointGetSecret + * + * Get Endpoint Secret. + * + */ + public function testV1EndpointGetSecret() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EndpointGetStats + * + * Endpoint Stats. + * + */ + public function testV1EndpointGetStats() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EndpointList + * + * List Endpoints. + * + */ + public function testV1EndpointList() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EndpointPatch + * + * Patch Endpoint. + * + */ + public function testV1EndpointPatch() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EndpointPatchHeaders + * + * Patch Endpoint Headers. + * + */ + public function testV1EndpointPatchHeaders() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EndpointRecover + * + * Recover Failed Webhooks. + * + */ + public function testV1EndpointRecover() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EndpointReplay + * + * Replay Missing Webhooks. + * + */ + public function testV1EndpointReplay() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EndpointRotateSecret + * + * Rotate Endpoint Secret. + * + */ + public function testV1EndpointRotateSecret() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EndpointSendExample + * + * Send Event Type Example Message. + * + */ + public function testV1EndpointSendExample() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EndpointTransformationGet + * + * Get Endpoint Transformation. + * + */ + public function testV1EndpointTransformationGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EndpointTransformationPartialUpdate + * + * Set Endpoint Transformation. + * + */ + public function testV1EndpointTransformationPartialUpdate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EndpointUpdate + * + * Update Endpoint. + * + */ + public function testV1EndpointUpdate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EndpointUpdateHeaders + * + * Update Endpoint Headers. + * + */ + public function testV1EndpointUpdateHeaders() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/EventTypeApiTest.php b/test/Api/EventTypeApiTest.php new file mode 100644 index 0000000..15ffb59 --- /dev/null +++ b/test/Api/EventTypeApiTest.php @@ -0,0 +1,157 @@ + ## 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 + * Please update the test case below to test the endpoint. + */ + +namespace Svix\ApiClient\Test\Api; + +use \Svix\ApiClient\Configuration; +use \Svix\ApiClient\ApiException; +use \Svix\ApiClient\ObjectSerializer; +use PHPUnit\Framework\TestCase; + +/** + * EventTypeApiTest Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EventTypeApiTest extends TestCase +{ + + /** + * Setup before running any test cases + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test case for v1EventTypeCreate + * + * Create Event Type. + * + */ + public function testV1EventTypeCreate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EventTypeDelete + * + * Delete Event Type. + * + */ + public function testV1EventTypeDelete() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EventTypeGet + * + * Get Event Type. + * + */ + public function testV1EventTypeGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EventTypeImportOpenapi + * + * Event Type Import From Openapi. + * + */ + public function testV1EventTypeImportOpenapi() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EventTypeList + * + * List Event Types. + * + */ + public function testV1EventTypeList() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EventTypePatch + * + * Patch Event Type. + * + */ + public function testV1EventTypePatch() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1EventTypeUpdate + * + * Update Event Type. + * + */ + public function testV1EventTypeUpdate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/HealthApiTest.php b/test/Api/HealthApiTest.php new file mode 100644 index 0000000..a55d393 --- /dev/null +++ b/test/Api/HealthApiTest.php @@ -0,0 +1,85 @@ + ## 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 + * Please update the test case below to test the endpoint. + */ + +namespace Svix\ApiClient\Test\Api; + +use \Svix\ApiClient\Configuration; +use \Svix\ApiClient\ApiException; +use \Svix\ApiClient\ObjectSerializer; +use PHPUnit\Framework\TestCase; + +/** + * HealthApiTest Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class HealthApiTest extends TestCase +{ + + /** + * Setup before running any test cases + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test case for v1HealthGet + * + * Health. + * + */ + public function testV1HealthGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/IntegrationApiTest.php b/test/Api/IntegrationApiTest.php new file mode 100644 index 0000000..4c8d453 --- /dev/null +++ b/test/Api/IntegrationApiTest.php @@ -0,0 +1,157 @@ + ## 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 + * Please update the test case below to test the endpoint. + */ + +namespace Svix\ApiClient\Test\Api; + +use \Svix\ApiClient\Configuration; +use \Svix\ApiClient\ApiException; +use \Svix\ApiClient\ObjectSerializer; +use PHPUnit\Framework\TestCase; + +/** + * IntegrationApiTest Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class IntegrationApiTest extends TestCase +{ + + /** + * Setup before running any test cases + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test case for v1IntegrationCreate + * + * Create Integration. + * + */ + public function testV1IntegrationCreate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1IntegrationDelete + * + * Delete Integration. + * + */ + public function testV1IntegrationDelete() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1IntegrationGet + * + * Get Integration. + * + */ + public function testV1IntegrationGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1IntegrationGetKey + * + * Get Integration Key. + * + */ + public function testV1IntegrationGetKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1IntegrationList + * + * List Integrations. + * + */ + public function testV1IntegrationList() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1IntegrationRotateKey + * + * Rotate Integration Key. + * + */ + public function testV1IntegrationRotateKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1IntegrationUpdate + * + * Update Integration. + * + */ + public function testV1IntegrationUpdate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/MessageApiTest.php b/test/Api/MessageApiTest.php new file mode 100644 index 0000000..99060a2 --- /dev/null +++ b/test/Api/MessageApiTest.php @@ -0,0 +1,121 @@ + ## 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 + * Please update the test case below to test the endpoint. + */ + +namespace Svix\ApiClient\Test\Api; + +use \Svix\ApiClient\Configuration; +use \Svix\ApiClient\ApiException; +use \Svix\ApiClient\ObjectSerializer; +use PHPUnit\Framework\TestCase; + +/** + * MessageApiTest Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class MessageApiTest extends TestCase +{ + + /** + * Setup before running any test cases + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test case for v1MessageCreate + * + * Create Message. + * + */ + public function testV1MessageCreate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1MessageExpungeContent + * + * Delete message payload. + * + */ + public function testV1MessageExpungeContent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1MessageGet + * + * Get Message. + * + */ + public function testV1MessageGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1MessageList + * + * List Messages. + * + */ + public function testV1MessageList() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/MessageAttemptApiTest.php b/test/Api/MessageAttemptApiTest.php new file mode 100644 index 0000000..30130b7 --- /dev/null +++ b/test/Api/MessageAttemptApiTest.php @@ -0,0 +1,181 @@ + ## 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 + * Please update the test case below to test the endpoint. + */ + +namespace Svix\ApiClient\Test\Api; + +use \Svix\ApiClient\Configuration; +use \Svix\ApiClient\ApiException; +use \Svix\ApiClient\ObjectSerializer; +use PHPUnit\Framework\TestCase; + +/** + * MessageAttemptApiTest Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class MessageAttemptApiTest extends TestCase +{ + + /** + * Setup before running any test cases + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test case for v1MessageAttemptExpungeContent + * + * Delete attempt response body. + * + */ + public function testV1MessageAttemptExpungeContent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1MessageAttemptGet + * + * Get Attempt. + * + */ + public function testV1MessageAttemptGet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1MessageAttemptListAttemptedDestinations + * + * List Attempted Destinations. + * + */ + public function testV1MessageAttemptListAttemptedDestinations() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1MessageAttemptListAttemptedMessages + * + * List Attempted Messages. + * + */ + public function testV1MessageAttemptListAttemptedMessages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1MessageAttemptListByEndpoint + * + * List Attempts By Endpoint. + * + */ + public function testV1MessageAttemptListByEndpoint() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1MessageAttemptListByEndpointDeprecated + * + * List Attempts For Endpoint. + * + */ + public function testV1MessageAttemptListByEndpointDeprecated() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1MessageAttemptListByMsg + * + * List Attempts By Msg. + * + */ + public function testV1MessageAttemptListByMsg() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1MessageAttemptListByMsgDeprecated + * + * List Attempts. + * + */ + public function testV1MessageAttemptListByMsgDeprecated() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for v1MessageAttemptResend + * + * Resend Webhook. + * + */ + public function testV1MessageAttemptResend() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/StatisticsApiTest.php b/test/Api/StatisticsApiTest.php new file mode 100644 index 0000000..397a8a0 --- /dev/null +++ b/test/Api/StatisticsApiTest.php @@ -0,0 +1,85 @@ + ## 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 + * Please update the test case below to test the endpoint. + */ + +namespace Svix\ApiClient\Test\Api; + +use \Svix\ApiClient\Configuration; +use \Svix\ApiClient\ApiException; +use \Svix\ApiClient\ObjectSerializer; +use PHPUnit\Framework\TestCase; + +/** + * StatisticsApiTest Class Doc Comment + * + * @category Class + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class StatisticsApiTest extends TestCase +{ + + /** + * Setup before running any test cases + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test case for calculateAggregateAppStats + * + * Calculate Aggregate App Stats. + * + */ + public function testCalculateAggregateAppStats() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/AppPortalAccessInTest.php b/test/Model/AppPortalAccessInTest.php new file mode 100644 index 0000000..4f125cd --- /dev/null +++ b/test/Model/AppPortalAccessInTest.php @@ -0,0 +1,90 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * AppPortalAccessInTest Class Doc Comment + * + * @category Class + * @description AppPortalAccessIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class AppPortalAccessInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "AppPortalAccessIn" + */ + public function testAppPortalAccessIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "feature_flags" + */ + public function testPropertyFeatureFlags() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/AppPortalAccessOutTest.php b/test/Model/AppPortalAccessOutTest.php new file mode 100644 index 0000000..5bc8e07 --- /dev/null +++ b/test/Model/AppPortalAccessOutTest.php @@ -0,0 +1,99 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * AppPortalAccessOutTest Class Doc Comment + * + * @category Class + * @description AppPortalAccessOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class AppPortalAccessOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "AppPortalAccessOut" + */ + public function testAppPortalAccessOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "token" + */ + public function testPropertyToken() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/AppUsageStatsInTest.php b/test/Model/AppUsageStatsInTest.php new file mode 100644 index 0000000..eaee574 --- /dev/null +++ b/test/Model/AppUsageStatsInTest.php @@ -0,0 +1,108 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * AppUsageStatsInTest Class Doc Comment + * + * @category Class + * @description AppUsageStatsIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class AppUsageStatsInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "AppUsageStatsIn" + */ + public function testAppUsageStatsIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "since" + */ + public function testPropertySince() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "until" + */ + public function testPropertyUntil() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "app_ids" + */ + public function testPropertyAppIds() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/AppUsageStatsOutTest.php b/test/Model/AppUsageStatsOutTest.php new file mode 100644 index 0000000..0f76dc0 --- /dev/null +++ b/test/Model/AppUsageStatsOutTest.php @@ -0,0 +1,108 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * AppUsageStatsOutTest Class Doc Comment + * + * @category Class + * @description AppUsageStatsOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class AppUsageStatsOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "AppUsageStatsOut" + */ + public function testAppUsageStatsOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "task" + */ + public function testPropertyTask() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ApplicationInTest.php b/test/Model/ApplicationInTest.php new file mode 100644 index 0000000..d221d2e --- /dev/null +++ b/test/Model/ApplicationInTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ApplicationInTest Class Doc Comment + * + * @category Class + * @description ApplicationIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ApplicationInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ApplicationIn" + */ + public function testApplicationIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "rate_limit" + */ + public function testPropertyRateLimit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "uid" + */ + public function testPropertyUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "metadata" + */ + public function testPropertyMetadata() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ApplicationOutTest.php b/test/Model/ApplicationOutTest.php new file mode 100644 index 0000000..c368f24 --- /dev/null +++ b/test/Model/ApplicationOutTest.php @@ -0,0 +1,144 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ApplicationOutTest Class Doc Comment + * + * @category Class + * @description ApplicationOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ApplicationOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ApplicationOut" + */ + public function testApplicationOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "uid" + */ + public function testPropertyUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "rate_limit" + */ + public function testPropertyRateLimit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "created_at" + */ + public function testPropertyCreatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updated_at" + */ + public function testPropertyUpdatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "metadata" + */ + public function testPropertyMetadata() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ApplicationPatchTest.php b/test/Model/ApplicationPatchTest.php new file mode 100644 index 0000000..8b1a8b1 --- /dev/null +++ b/test/Model/ApplicationPatchTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ApplicationPatchTest Class Doc Comment + * + * @category Class + * @description ApplicationPatch + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ApplicationPatchTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ApplicationPatch" + */ + public function testApplicationPatch() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "rate_limit" + */ + public function testPropertyRateLimit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "uid" + */ + public function testPropertyUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "metadata" + */ + public function testPropertyMetadata() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ApplicationTokenExpireInTest.php b/test/Model/ApplicationTokenExpireInTest.php new file mode 100644 index 0000000..938628b --- /dev/null +++ b/test/Model/ApplicationTokenExpireInTest.php @@ -0,0 +1,90 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ApplicationTokenExpireInTest Class Doc Comment + * + * @category Class + * @description ApplicationTokenExpireIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ApplicationTokenExpireInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ApplicationTokenExpireIn" + */ + public function testApplicationTokenExpireIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "expiry" + */ + public function testPropertyExpiry() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/BackgroundTaskOutTest.php b/test/Model/BackgroundTaskOutTest.php new file mode 100644 index 0000000..595e1a1 --- /dev/null +++ b/test/Model/BackgroundTaskOutTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * BackgroundTaskOutTest Class Doc Comment + * + * @category Class + * @description BackgroundTaskOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class BackgroundTaskOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "BackgroundTaskOut" + */ + public function testBackgroundTaskOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "task" + */ + public function testPropertyTask() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/BackgroundTaskStatusTest.php b/test/Model/BackgroundTaskStatusTest.php new file mode 100644 index 0000000..7aebd00 --- /dev/null +++ b/test/Model/BackgroundTaskStatusTest.php @@ -0,0 +1,81 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * BackgroundTaskStatusTest Class Doc Comment + * + * @category Class + * @description BackgroundTaskStatus + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class BackgroundTaskStatusTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "BackgroundTaskStatus" + */ + public function testBackgroundTaskStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/BackgroundTaskTypeTest.php b/test/Model/BackgroundTaskTypeTest.php new file mode 100644 index 0000000..f98960f --- /dev/null +++ b/test/Model/BackgroundTaskTypeTest.php @@ -0,0 +1,81 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * BackgroundTaskTypeTest Class Doc Comment + * + * @category Class + * @description BackgroundTaskType + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class BackgroundTaskTypeTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "BackgroundTaskType" + */ + public function testBackgroundTaskType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DashboardAccessOutTest.php b/test/Model/DashboardAccessOutTest.php new file mode 100644 index 0000000..36bb59f --- /dev/null +++ b/test/Model/DashboardAccessOutTest.php @@ -0,0 +1,99 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * DashboardAccessOutTest Class Doc Comment + * + * @category Class + * @description DashboardAccessOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class DashboardAccessOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "DashboardAccessOut" + */ + public function testDashboardAccessOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "token" + */ + public function testPropertyToken() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointCreatedEventDataTest.php b/test/Model/EndpointCreatedEventDataTest.php new file mode 100644 index 0000000..222b6a7 --- /dev/null +++ b/test/Model/EndpointCreatedEventDataTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointCreatedEventDataTest Class Doc Comment + * + * @category Class + * @description EndpointCreatedEventData + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointCreatedEventDataTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointCreatedEventData" + */ + public function testEndpointCreatedEventData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "app_id" + */ + public function testPropertyAppId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "app_uid" + */ + public function testPropertyAppUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "endpoint_id" + */ + public function testPropertyEndpointId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "endpoint_uid" + */ + public function testPropertyEndpointUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointCreatedEventTest.php b/test/Model/EndpointCreatedEventTest.php new file mode 100644 index 0000000..fe82c28 --- /dev/null +++ b/test/Model/EndpointCreatedEventTest.php @@ -0,0 +1,99 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointCreatedEventTest Class Doc Comment + * + * @category Class + * @description Sent when an endpoint is created. + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointCreatedEventTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointCreatedEvent" + */ + public function testEndpointCreatedEvent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointDeletedEventDataTest.php b/test/Model/EndpointDeletedEventDataTest.php new file mode 100644 index 0000000..b1ba100 --- /dev/null +++ b/test/Model/EndpointDeletedEventDataTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointDeletedEventDataTest Class Doc Comment + * + * @category Class + * @description EndpointDeletedEventData + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointDeletedEventDataTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointDeletedEventData" + */ + public function testEndpointDeletedEventData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "app_id" + */ + public function testPropertyAppId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "app_uid" + */ + public function testPropertyAppUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "endpoint_id" + */ + public function testPropertyEndpointId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "endpoint_uid" + */ + public function testPropertyEndpointUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointDeletedEventTest.php b/test/Model/EndpointDeletedEventTest.php new file mode 100644 index 0000000..c0b1084 --- /dev/null +++ b/test/Model/EndpointDeletedEventTest.php @@ -0,0 +1,99 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointDeletedEventTest Class Doc Comment + * + * @category Class + * @description Sent when an endpoint is deleted. + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointDeletedEventTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointDeletedEvent" + */ + public function testEndpointDeletedEvent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointDisabledEventDataTest.php b/test/Model/EndpointDisabledEventDataTest.php new file mode 100644 index 0000000..67254d2 --- /dev/null +++ b/test/Model/EndpointDisabledEventDataTest.php @@ -0,0 +1,126 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointDisabledEventDataTest 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 + */ +class EndpointDisabledEventDataTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointDisabledEventData" + */ + public function testEndpointDisabledEventData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "app_id" + */ + public function testPropertyAppId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "app_uid" + */ + public function testPropertyAppUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "endpoint_id" + */ + public function testPropertyEndpointId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "endpoint_uid" + */ + public function testPropertyEndpointUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fail_since" + */ + public function testPropertyFailSince() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointDisabledEventTest.php b/test/Model/EndpointDisabledEventTest.php new file mode 100644 index 0000000..5b80f4b --- /dev/null +++ b/test/Model/EndpointDisabledEventTest.php @@ -0,0 +1,99 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointDisabledEventTest 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 + */ +class EndpointDisabledEventTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointDisabledEvent" + */ + public function testEndpointDisabledEvent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointHeadersInTest.php b/test/Model/EndpointHeadersInTest.php new file mode 100644 index 0000000..315223e --- /dev/null +++ b/test/Model/EndpointHeadersInTest.php @@ -0,0 +1,90 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointHeadersInTest Class Doc Comment + * + * @category Class + * @description EndpointHeadersIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointHeadersInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointHeadersIn" + */ + public function testEndpointHeadersIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "headers" + */ + public function testPropertyHeaders() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointHeadersOutTest.php b/test/Model/EndpointHeadersOutTest.php new file mode 100644 index 0000000..0cad32a --- /dev/null +++ b/test/Model/EndpointHeadersOutTest.php @@ -0,0 +1,99 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointHeadersOutTest 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 + */ +class EndpointHeadersOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointHeadersOut" + */ + public function testEndpointHeadersOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "headers" + */ + public function testPropertyHeaders() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sensitive" + */ + public function testPropertySensitive() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointHeadersPatchInTest.php b/test/Model/EndpointHeadersPatchInTest.php new file mode 100644 index 0000000..0d2cd87 --- /dev/null +++ b/test/Model/EndpointHeadersPatchInTest.php @@ -0,0 +1,90 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointHeadersPatchInTest Class Doc Comment + * + * @category Class + * @description EndpointHeadersPatchIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointHeadersPatchInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointHeadersPatchIn" + */ + public function testEndpointHeadersPatchIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "headers" + */ + public function testPropertyHeaders() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointInTest.php b/test/Model/EndpointInTest.php new file mode 100644 index 0000000..7a669a0 --- /dev/null +++ b/test/Model/EndpointInTest.php @@ -0,0 +1,171 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointInTest Class Doc Comment + * + * @category Class + * @description EndpointIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointIn" + */ + public function testEndpointIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "rate_limit" + */ + public function testPropertyRateLimit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "uid" + */ + public function testPropertyUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "version" + */ + public function testPropertyVersion() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disabled" + */ + public function testPropertyDisabled() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filter_types" + */ + public function testPropertyFilterTypes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channels" + */ + public function testPropertyChannels() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "secret" + */ + public function testPropertySecret() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "metadata" + */ + public function testPropertyMetadata() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointMessageOutTest.php b/test/Model/EndpointMessageOutTest.php new file mode 100644 index 0000000..7508035 --- /dev/null +++ b/test/Model/EndpointMessageOutTest.php @@ -0,0 +1,153 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointMessageOutTest 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 + */ +class EndpointMessageOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointMessageOut" + */ + public function testEndpointMessageOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_attempt" + */ + public function testPropertyNextAttempt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "event_id" + */ + public function testPropertyEventId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "event_type" + */ + public function testPropertyEventType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payload" + */ + public function testPropertyPayload() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channels" + */ + public function testPropertyChannels() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timestamp" + */ + public function testPropertyTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointOutTest.php b/test/Model/EndpointOutTest.php new file mode 100644 index 0000000..58e0dc4 --- /dev/null +++ b/test/Model/EndpointOutTest.php @@ -0,0 +1,189 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointOutTest Class Doc Comment + * + * @category Class + * @description EndpointOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointOut" + */ + public function testEndpointOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "metadata" + */ + public function testPropertyMetadata() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "rate_limit" + */ + public function testPropertyRateLimit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "uid" + */ + public function testPropertyUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "version" + */ + public function testPropertyVersion() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disabled" + */ + public function testPropertyDisabled() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filter_types" + */ + public function testPropertyFilterTypes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channels" + */ + public function testPropertyChannels() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "created_at" + */ + public function testPropertyCreatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updated_at" + */ + public function testPropertyUpdatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointPatchTest.php b/test/Model/EndpointPatchTest.php new file mode 100644 index 0000000..af4ddc1 --- /dev/null +++ b/test/Model/EndpointPatchTest.php @@ -0,0 +1,171 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointPatchTest Class Doc Comment + * + * @category Class + * @description EndpointPatch + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointPatchTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointPatch" + */ + public function testEndpointPatch() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "rate_limit" + */ + public function testPropertyRateLimit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "uid" + */ + public function testPropertyUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "version" + */ + public function testPropertyVersion() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disabled" + */ + public function testPropertyDisabled() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filter_types" + */ + public function testPropertyFilterTypes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channels" + */ + public function testPropertyChannels() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "secret" + */ + public function testPropertySecret() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "metadata" + */ + public function testPropertyMetadata() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointSecretOutTest.php b/test/Model/EndpointSecretOutTest.php new file mode 100644 index 0000000..d5cb482 --- /dev/null +++ b/test/Model/EndpointSecretOutTest.php @@ -0,0 +1,90 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointSecretOutTest Class Doc Comment + * + * @category Class + * @description EndpointSecretOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointSecretOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointSecretOut" + */ + public function testEndpointSecretOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "key" + */ + public function testPropertyKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointSecretRotateInTest.php b/test/Model/EndpointSecretRotateInTest.php new file mode 100644 index 0000000..f0d539b --- /dev/null +++ b/test/Model/EndpointSecretRotateInTest.php @@ -0,0 +1,90 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointSecretRotateInTest Class Doc Comment + * + * @category Class + * @description EndpointSecretRotateIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointSecretRotateInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointSecretRotateIn" + */ + public function testEndpointSecretRotateIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "key" + */ + public function testPropertyKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointStatsTest.php b/test/Model/EndpointStatsTest.php new file mode 100644 index 0000000..fdea874 --- /dev/null +++ b/test/Model/EndpointStatsTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointStatsTest Class Doc Comment + * + * @category Class + * @description EndpointStats + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointStatsTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointStats" + */ + public function testEndpointStats() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "success" + */ + public function testPropertySuccess() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "pending" + */ + public function testPropertyPending() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sending" + */ + public function testPropertySending() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fail" + */ + public function testPropertyFail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointTransformationInTest.php b/test/Model/EndpointTransformationInTest.php new file mode 100644 index 0000000..88a28a5 --- /dev/null +++ b/test/Model/EndpointTransformationInTest.php @@ -0,0 +1,99 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointTransformationInTest Class Doc Comment + * + * @category Class + * @description EndpointTransformationIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointTransformationInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointTransformationIn" + */ + public function testEndpointTransformationIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enabled" + */ + public function testPropertyEnabled() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointTransformationOutTest.php b/test/Model/EndpointTransformationOutTest.php new file mode 100644 index 0000000..8815348 --- /dev/null +++ b/test/Model/EndpointTransformationOutTest.php @@ -0,0 +1,99 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointTransformationOutTest Class Doc Comment + * + * @category Class + * @description EndpointTransformationOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointTransformationOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointTransformationOut" + */ + public function testEndpointTransformationOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enabled" + */ + public function testPropertyEnabled() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointTransformationSimulateInTest.php b/test/Model/EndpointTransformationSimulateInTest.php new file mode 100644 index 0000000..4bc627f --- /dev/null +++ b/test/Model/EndpointTransformationSimulateInTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointTransformationSimulateInTest Class Doc Comment + * + * @category Class + * @description EndpointTransformationSimulateIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointTransformationSimulateInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointTransformationSimulateIn" + */ + public function testEndpointTransformationSimulateIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "event_type" + */ + public function testPropertyEventType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channels" + */ + public function testPropertyChannels() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payload" + */ + public function testPropertyPayload() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointTransformationSimulateOutTest.php b/test/Model/EndpointTransformationSimulateOutTest.php new file mode 100644 index 0000000..01788ac --- /dev/null +++ b/test/Model/EndpointTransformationSimulateOutTest.php @@ -0,0 +1,108 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointTransformationSimulateOutTest Class Doc Comment + * + * @category Class + * @description EndpointTransformationSimulateOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointTransformationSimulateOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointTransformationSimulateOut" + */ + public function testEndpointTransformationSimulateOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payload" + */ + public function testPropertyPayload() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "method" + */ + public function testPropertyMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointUpdateTest.php b/test/Model/EndpointUpdateTest.php new file mode 100644 index 0000000..903044e --- /dev/null +++ b/test/Model/EndpointUpdateTest.php @@ -0,0 +1,162 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointUpdateTest Class Doc Comment + * + * @category Class + * @description EndpointUpdate + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointUpdateTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointUpdate" + */ + public function testEndpointUpdate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "rate_limit" + */ + public function testPropertyRateLimit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "uid" + */ + public function testPropertyUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "version" + */ + public function testPropertyVersion() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disabled" + */ + public function testPropertyDisabled() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filter_types" + */ + public function testPropertyFilterTypes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channels" + */ + public function testPropertyChannels() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "metadata" + */ + public function testPropertyMetadata() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointUpdatedEventDataTest.php b/test/Model/EndpointUpdatedEventDataTest.php new file mode 100644 index 0000000..c1053c2 --- /dev/null +++ b/test/Model/EndpointUpdatedEventDataTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointUpdatedEventDataTest Class Doc Comment + * + * @category Class + * @description EndpointUpdatedEventData + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointUpdatedEventDataTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointUpdatedEventData" + */ + public function testEndpointUpdatedEventData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "app_id" + */ + public function testPropertyAppId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "app_uid" + */ + public function testPropertyAppUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "endpoint_id" + */ + public function testPropertyEndpointId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "endpoint_uid" + */ + public function testPropertyEndpointUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EndpointUpdatedEventTest.php b/test/Model/EndpointUpdatedEventTest.php new file mode 100644 index 0000000..59e8c01 --- /dev/null +++ b/test/Model/EndpointUpdatedEventTest.php @@ -0,0 +1,99 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EndpointUpdatedEventTest Class Doc Comment + * + * @category Class + * @description Sent when an endpoint is updated. + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EndpointUpdatedEventTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EndpointUpdatedEvent" + */ + public function testEndpointUpdatedEvent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EventExampleInTest.php b/test/Model/EventExampleInTest.php new file mode 100644 index 0000000..7148ba1 --- /dev/null +++ b/test/Model/EventExampleInTest.php @@ -0,0 +1,90 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EventExampleInTest Class Doc Comment + * + * @category Class + * @description EventExampleIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EventExampleInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EventExampleIn" + */ + public function testEventExampleIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "event_type" + */ + public function testPropertyEventType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EventTypeImportOpenApiInTest.php b/test/Model/EventTypeImportOpenApiInTest.php new file mode 100644 index 0000000..e40cc7d --- /dev/null +++ b/test/Model/EventTypeImportOpenApiInTest.php @@ -0,0 +1,99 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EventTypeImportOpenApiInTest 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 + */ +class EventTypeImportOpenApiInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EventTypeImportOpenApiIn" + */ + public function testEventTypeImportOpenApiIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "spec" + */ + public function testPropertySpec() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "spec_raw" + */ + public function testPropertySpecRaw() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EventTypeImportOpenApiOutDataTest.php b/test/Model/EventTypeImportOpenApiOutDataTest.php new file mode 100644 index 0000000..08ec959 --- /dev/null +++ b/test/Model/EventTypeImportOpenApiOutDataTest.php @@ -0,0 +1,90 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EventTypeImportOpenApiOutDataTest Class Doc Comment + * + * @category Class + * @description EventTypeImportOpenApiOutData + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EventTypeImportOpenApiOutDataTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EventTypeImportOpenApiOutData" + */ + public function testEventTypeImportOpenApiOutData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "modified" + */ + public function testPropertyModified() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EventTypeImportOpenApiOutTest.php b/test/Model/EventTypeImportOpenApiOutTest.php new file mode 100644 index 0000000..da721f3 --- /dev/null +++ b/test/Model/EventTypeImportOpenApiOutTest.php @@ -0,0 +1,90 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EventTypeImportOpenApiOutTest Class Doc Comment + * + * @category Class + * @description EventTypeImportOpenApiOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EventTypeImportOpenApiOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EventTypeImportOpenApiOut" + */ + public function testEventTypeImportOpenApiOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EventTypeInTest.php b/test/Model/EventTypeInTest.php new file mode 100644 index 0000000..359967d --- /dev/null +++ b/test/Model/EventTypeInTest.php @@ -0,0 +1,126 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EventTypeInTest Class Doc Comment + * + * @category Class + * @description EventTypeIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EventTypeInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EventTypeIn" + */ + public function testEventTypeIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "archived" + */ + public function testPropertyArchived() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "schemas" + */ + public function testPropertySchemas() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "feature_flag" + */ + public function testPropertyFeatureFlag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EventTypeOutTest.php b/test/Model/EventTypeOutTest.php new file mode 100644 index 0000000..66303f3 --- /dev/null +++ b/test/Model/EventTypeOutTest.php @@ -0,0 +1,144 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EventTypeOutTest Class Doc Comment + * + * @category Class + * @description EventTypeOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EventTypeOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EventTypeOut" + */ + public function testEventTypeOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "archived" + */ + public function testPropertyArchived() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "schemas" + */ + public function testPropertySchemas() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "created_at" + */ + public function testPropertyCreatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updated_at" + */ + public function testPropertyUpdatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "feature_flag" + */ + public function testPropertyFeatureFlag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EventTypePatchTest.php b/test/Model/EventTypePatchTest.php new file mode 100644 index 0000000..f673a67 --- /dev/null +++ b/test/Model/EventTypePatchTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EventTypePatchTest Class Doc Comment + * + * @category Class + * @description EventTypePatch + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EventTypePatchTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EventTypePatch" + */ + public function testEventTypePatch() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "archived" + */ + public function testPropertyArchived() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "schemas" + */ + public function testPropertySchemas() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "feature_flag" + */ + public function testPropertyFeatureFlag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EventTypeUpdateTest.php b/test/Model/EventTypeUpdateTest.php new file mode 100644 index 0000000..51ce79b --- /dev/null +++ b/test/Model/EventTypeUpdateTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * EventTypeUpdateTest Class Doc Comment + * + * @category Class + * @description EventTypeUpdate + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class EventTypeUpdateTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "EventTypeUpdate" + */ + public function testEventTypeUpdate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "archived" + */ + public function testPropertyArchived() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "schemas" + */ + public function testPropertySchemas() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "feature_flag" + */ + public function testPropertyFeatureFlag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ExportEventTypeOutTest.php b/test/Model/ExportEventTypeOutTest.php new file mode 100644 index 0000000..d941fa3 --- /dev/null +++ b/test/Model/ExportEventTypeOutTest.php @@ -0,0 +1,108 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ExportEventTypeOutTest Class Doc Comment + * + * @category Class + * @description ExportEventTypeOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ExportEventTypeOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ExportEventTypeOut" + */ + public function testExportEventTypeOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "task" + */ + public function testPropertyTask() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/HTTPValidationErrorTest.php b/test/Model/HTTPValidationErrorTest.php new file mode 100644 index 0000000..8711cb1 --- /dev/null +++ b/test/Model/HTTPValidationErrorTest.php @@ -0,0 +1,90 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * HTTPValidationErrorTest Class Doc Comment + * + * @category Class + * @description HTTPValidationError + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class HTTPValidationErrorTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "HTTPValidationError" + */ + public function testHTTPValidationError() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "detail" + */ + public function testPropertyDetail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/HttpErrorOutTest.php b/test/Model/HttpErrorOutTest.php new file mode 100644 index 0000000..6fbe6cd --- /dev/null +++ b/test/Model/HttpErrorOutTest.php @@ -0,0 +1,99 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * HttpErrorOutTest Class Doc Comment + * + * @category Class + * @description HttpErrorOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class HttpErrorOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "HttpErrorOut" + */ + public function testHttpErrorOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "detail" + */ + public function testPropertyDetail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IntegrationInTest.php b/test/Model/IntegrationInTest.php new file mode 100644 index 0000000..eb2ec17 --- /dev/null +++ b/test/Model/IntegrationInTest.php @@ -0,0 +1,90 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * IntegrationInTest Class Doc Comment + * + * @category Class + * @description IntegrationIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class IntegrationInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "IntegrationIn" + */ + public function testIntegrationIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IntegrationKeyOutTest.php b/test/Model/IntegrationKeyOutTest.php new file mode 100644 index 0000000..4d193b2 --- /dev/null +++ b/test/Model/IntegrationKeyOutTest.php @@ -0,0 +1,90 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * IntegrationKeyOutTest Class Doc Comment + * + * @category Class + * @description IntegrationKeyOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class IntegrationKeyOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "IntegrationKeyOut" + */ + public function testIntegrationKeyOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "key" + */ + public function testPropertyKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IntegrationOutTest.php b/test/Model/IntegrationOutTest.php new file mode 100644 index 0000000..3952921 --- /dev/null +++ b/test/Model/IntegrationOutTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * IntegrationOutTest Class Doc Comment + * + * @category Class + * @description IntegrationOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class IntegrationOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "IntegrationOut" + */ + public function testIntegrationOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "created_at" + */ + public function testPropertyCreatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updated_at" + */ + public function testPropertyUpdatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IntegrationUpdateTest.php b/test/Model/IntegrationUpdateTest.php new file mode 100644 index 0000000..5a90aba --- /dev/null +++ b/test/Model/IntegrationUpdateTest.php @@ -0,0 +1,90 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * IntegrationUpdateTest Class Doc Comment + * + * @category Class + * @description IntegrationUpdate + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class IntegrationUpdateTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "IntegrationUpdate" + */ + public function testIntegrationUpdate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListResponseApplicationOutTest.php b/test/Model/ListResponseApplicationOutTest.php new file mode 100644 index 0000000..17fbebd --- /dev/null +++ b/test/Model/ListResponseApplicationOutTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ListResponseApplicationOutTest Class Doc Comment + * + * @category Class + * @description ListResponseApplicationOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ListResponseApplicationOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ListResponseApplicationOut" + */ + public function testListResponseApplicationOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "iterator" + */ + public function testPropertyIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_iterator" + */ + public function testPropertyPrevIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "done" + */ + public function testPropertyDone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListResponseBackgroundTaskOutTest.php b/test/Model/ListResponseBackgroundTaskOutTest.php new file mode 100644 index 0000000..a396038 --- /dev/null +++ b/test/Model/ListResponseBackgroundTaskOutTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ListResponseBackgroundTaskOutTest Class Doc Comment + * + * @category Class + * @description ListResponseBackgroundTaskOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ListResponseBackgroundTaskOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ListResponseBackgroundTaskOut" + */ + public function testListResponseBackgroundTaskOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "iterator" + */ + public function testPropertyIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_iterator" + */ + public function testPropertyPrevIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "done" + */ + public function testPropertyDone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListResponseEndpointMessageOutTest.php b/test/Model/ListResponseEndpointMessageOutTest.php new file mode 100644 index 0000000..eaa1e21 --- /dev/null +++ b/test/Model/ListResponseEndpointMessageOutTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ListResponseEndpointMessageOutTest Class Doc Comment + * + * @category Class + * @description ListResponseEndpointMessageOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ListResponseEndpointMessageOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ListResponseEndpointMessageOut" + */ + public function testListResponseEndpointMessageOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "iterator" + */ + public function testPropertyIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_iterator" + */ + public function testPropertyPrevIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "done" + */ + public function testPropertyDone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListResponseEndpointOutTest.php b/test/Model/ListResponseEndpointOutTest.php new file mode 100644 index 0000000..48e0d2c --- /dev/null +++ b/test/Model/ListResponseEndpointOutTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ListResponseEndpointOutTest Class Doc Comment + * + * @category Class + * @description ListResponseEndpointOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ListResponseEndpointOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ListResponseEndpointOut" + */ + public function testListResponseEndpointOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "iterator" + */ + public function testPropertyIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_iterator" + */ + public function testPropertyPrevIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "done" + */ + public function testPropertyDone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListResponseEventTypeOutTest.php b/test/Model/ListResponseEventTypeOutTest.php new file mode 100644 index 0000000..bb7188b --- /dev/null +++ b/test/Model/ListResponseEventTypeOutTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ListResponseEventTypeOutTest Class Doc Comment + * + * @category Class + * @description ListResponseEventTypeOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ListResponseEventTypeOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ListResponseEventTypeOut" + */ + public function testListResponseEventTypeOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "iterator" + */ + public function testPropertyIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_iterator" + */ + public function testPropertyPrevIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "done" + */ + public function testPropertyDone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListResponseIntegrationOutTest.php b/test/Model/ListResponseIntegrationOutTest.php new file mode 100644 index 0000000..6228d8f --- /dev/null +++ b/test/Model/ListResponseIntegrationOutTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ListResponseIntegrationOutTest Class Doc Comment + * + * @category Class + * @description ListResponseIntegrationOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ListResponseIntegrationOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ListResponseIntegrationOut" + */ + public function testListResponseIntegrationOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "iterator" + */ + public function testPropertyIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_iterator" + */ + public function testPropertyPrevIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "done" + */ + public function testPropertyDone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListResponseMessageAttemptEndpointOutTest.php b/test/Model/ListResponseMessageAttemptEndpointOutTest.php new file mode 100644 index 0000000..9d62cc2 --- /dev/null +++ b/test/Model/ListResponseMessageAttemptEndpointOutTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ListResponseMessageAttemptEndpointOutTest Class Doc Comment + * + * @category Class + * @description ListResponseMessageAttemptEndpointOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ListResponseMessageAttemptEndpointOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ListResponseMessageAttemptEndpointOut" + */ + public function testListResponseMessageAttemptEndpointOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "iterator" + */ + public function testPropertyIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_iterator" + */ + public function testPropertyPrevIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "done" + */ + public function testPropertyDone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListResponseMessageAttemptOutTest.php b/test/Model/ListResponseMessageAttemptOutTest.php new file mode 100644 index 0000000..dd1df7f --- /dev/null +++ b/test/Model/ListResponseMessageAttemptOutTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ListResponseMessageAttemptOutTest Class Doc Comment + * + * @category Class + * @description ListResponseMessageAttemptOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ListResponseMessageAttemptOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ListResponseMessageAttemptOut" + */ + public function testListResponseMessageAttemptOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "iterator" + */ + public function testPropertyIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_iterator" + */ + public function testPropertyPrevIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "done" + */ + public function testPropertyDone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListResponseMessageEndpointOutTest.php b/test/Model/ListResponseMessageEndpointOutTest.php new file mode 100644 index 0000000..41c2704 --- /dev/null +++ b/test/Model/ListResponseMessageEndpointOutTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ListResponseMessageEndpointOutTest Class Doc Comment + * + * @category Class + * @description ListResponseMessageEndpointOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ListResponseMessageEndpointOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ListResponseMessageEndpointOut" + */ + public function testListResponseMessageEndpointOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "iterator" + */ + public function testPropertyIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_iterator" + */ + public function testPropertyPrevIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "done" + */ + public function testPropertyDone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListResponseMessageOutTest.php b/test/Model/ListResponseMessageOutTest.php new file mode 100644 index 0000000..22c06a0 --- /dev/null +++ b/test/Model/ListResponseMessageOutTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ListResponseMessageOutTest Class Doc Comment + * + * @category Class + * @description ListResponseMessageOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ListResponseMessageOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ListResponseMessageOut" + */ + public function testListResponseMessageOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "iterator" + */ + public function testPropertyIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_iterator" + */ + public function testPropertyPrevIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "done" + */ + public function testPropertyDone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ListResponseTemplateOutTest.php b/test/Model/ListResponseTemplateOutTest.php new file mode 100644 index 0000000..f2e3c0e --- /dev/null +++ b/test/Model/ListResponseTemplateOutTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ListResponseTemplateOutTest Class Doc Comment + * + * @category Class + * @description ListResponseTemplateOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ListResponseTemplateOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ListResponseTemplateOut" + */ + public function testListResponseTemplateOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "iterator" + */ + public function testPropertyIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_iterator" + */ + public function testPropertyPrevIterator() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "done" + */ + public function testPropertyDone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageAttemptEndpointOutTest.php b/test/Model/MessageAttemptEndpointOutTest.php new file mode 100644 index 0000000..9517df2 --- /dev/null +++ b/test/Model/MessageAttemptEndpointOutTest.php @@ -0,0 +1,162 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * MessageAttemptEndpointOutTest Class Doc Comment + * + * @category Class + * @description MessageAttemptEndpointOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class MessageAttemptEndpointOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "MessageAttemptEndpointOut" + */ + public function testMessageAttemptEndpointOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "response" + */ + public function testPropertyResponse() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "response_status_code" + */ + public function testPropertyResponseStatusCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "trigger_type" + */ + public function testPropertyTriggerType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "msg_id" + */ + public function testPropertyMsgId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "endpoint_id" + */ + public function testPropertyEndpointId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timestamp" + */ + public function testPropertyTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageAttemptExhaustedEventDataTest.php b/test/Model/MessageAttemptExhaustedEventDataTest.php new file mode 100644 index 0000000..408d68a --- /dev/null +++ b/test/Model/MessageAttemptExhaustedEventDataTest.php @@ -0,0 +1,135 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * MessageAttemptExhaustedEventDataTest 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 + */ +class MessageAttemptExhaustedEventDataTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "MessageAttemptExhaustedEventData" + */ + public function testMessageAttemptExhaustedEventData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "app_id" + */ + public function testPropertyAppId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "app_uid" + */ + public function testPropertyAppUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "msg_id" + */ + public function testPropertyMsgId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "msg_event_id" + */ + public function testPropertyMsgEventId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "endpoint_id" + */ + public function testPropertyEndpointId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_attempt" + */ + public function testPropertyLastAttempt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageAttemptExhaustedEventTest.php b/test/Model/MessageAttemptExhaustedEventTest.php new file mode 100644 index 0000000..049188b --- /dev/null +++ b/test/Model/MessageAttemptExhaustedEventTest.php @@ -0,0 +1,99 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * MessageAttemptExhaustedEventTest 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 + */ +class MessageAttemptExhaustedEventTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "MessageAttemptExhaustedEvent" + */ + public function testMessageAttemptExhaustedEvent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageAttemptFailedDataTest.php b/test/Model/MessageAttemptFailedDataTest.php new file mode 100644 index 0000000..4359ed5 --- /dev/null +++ b/test/Model/MessageAttemptFailedDataTest.php @@ -0,0 +1,108 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * MessageAttemptFailedDataTest Class Doc Comment + * + * @category Class + * @description MessageAttemptFailedData + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class MessageAttemptFailedDataTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "MessageAttemptFailedData" + */ + public function testMessageAttemptFailedData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "response_status_code" + */ + public function testPropertyResponseStatusCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timestamp" + */ + public function testPropertyTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageAttemptFailingEventDataTest.php b/test/Model/MessageAttemptFailingEventDataTest.php new file mode 100644 index 0000000..d51d847 --- /dev/null +++ b/test/Model/MessageAttemptFailingEventDataTest.php @@ -0,0 +1,135 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * MessageAttemptFailingEventDataTest 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 + */ +class MessageAttemptFailingEventDataTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "MessageAttemptFailingEventData" + */ + public function testMessageAttemptFailingEventData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "app_id" + */ + public function testPropertyAppId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "app_uid" + */ + public function testPropertyAppUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "msg_id" + */ + public function testPropertyMsgId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "msg_event_id" + */ + public function testPropertyMsgEventId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "endpoint_id" + */ + public function testPropertyEndpointId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_attempt" + */ + public function testPropertyLastAttempt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageAttemptFailingEventTest.php b/test/Model/MessageAttemptFailingEventTest.php new file mode 100644 index 0000000..9ec640f --- /dev/null +++ b/test/Model/MessageAttemptFailingEventTest.php @@ -0,0 +1,99 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * MessageAttemptFailingEventTest 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 + */ +class MessageAttemptFailingEventTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "MessageAttemptFailingEvent" + */ + public function testMessageAttemptFailingEvent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageAttemptOutTest.php b/test/Model/MessageAttemptOutTest.php new file mode 100644 index 0000000..db6e53a --- /dev/null +++ b/test/Model/MessageAttemptOutTest.php @@ -0,0 +1,162 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * MessageAttemptOutTest Class Doc Comment + * + * @category Class + * @description MessageAttemptOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class MessageAttemptOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "MessageAttemptOut" + */ + public function testMessageAttemptOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "response" + */ + public function testPropertyResponse() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "response_status_code" + */ + public function testPropertyResponseStatusCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "trigger_type" + */ + public function testPropertyTriggerType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "msg_id" + */ + public function testPropertyMsgId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "endpoint_id" + */ + public function testPropertyEndpointId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timestamp" + */ + public function testPropertyTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageAttemptRecoveredEventDataTest.php b/test/Model/MessageAttemptRecoveredEventDataTest.php new file mode 100644 index 0000000..e487a30 --- /dev/null +++ b/test/Model/MessageAttemptRecoveredEventDataTest.php @@ -0,0 +1,135 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * MessageAttemptRecoveredEventDataTest 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 + */ +class MessageAttemptRecoveredEventDataTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "MessageAttemptRecoveredEventData" + */ + public function testMessageAttemptRecoveredEventData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "app_id" + */ + public function testPropertyAppId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "app_uid" + */ + public function testPropertyAppUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "msg_id" + */ + public function testPropertyMsgId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "msg_event_id" + */ + public function testPropertyMsgEventId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "endpoint_id" + */ + public function testPropertyEndpointId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_attempt" + */ + public function testPropertyLastAttempt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageAttemptRecoveredEventTest.php b/test/Model/MessageAttemptRecoveredEventTest.php new file mode 100644 index 0000000..ace96e4 --- /dev/null +++ b/test/Model/MessageAttemptRecoveredEventTest.php @@ -0,0 +1,99 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * MessageAttemptRecoveredEventTest Class Doc Comment + * + * @category Class + * @description Sent on a successful dispatch after an earlier failure op webhook has already been sent. + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class MessageAttemptRecoveredEventTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "MessageAttemptRecoveredEvent" + */ + public function testMessageAttemptRecoveredEvent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageAttemptTriggerTypeTest.php b/test/Model/MessageAttemptTriggerTypeTest.php new file mode 100644 index 0000000..1461e9b --- /dev/null +++ b/test/Model/MessageAttemptTriggerTypeTest.php @@ -0,0 +1,81 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * MessageAttemptTriggerTypeTest Class Doc Comment + * + * @category Class + * @description The reason an attempt was made: - Scheduled = 0 - Manual = 1 + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class MessageAttemptTriggerTypeTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "MessageAttemptTriggerType" + */ + public function testMessageAttemptTriggerType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageBroadcastInTest.php b/test/Model/MessageBroadcastInTest.php new file mode 100644 index 0000000..93c27f2 --- /dev/null +++ b/test/Model/MessageBroadcastInTest.php @@ -0,0 +1,126 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * MessageBroadcastInTest Class Doc Comment + * + * @category Class + * @description MessageBroadcastIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class MessageBroadcastInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "MessageBroadcastIn" + */ + public function testMessageBroadcastIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "event_id" + */ + public function testPropertyEventId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "event_type" + */ + public function testPropertyEventType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payload" + */ + public function testPropertyPayload() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channels" + */ + public function testPropertyChannels() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payload_retention_period" + */ + public function testPropertyPayloadRetentionPeriod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageBroadcastOutTest.php b/test/Model/MessageBroadcastOutTest.php new file mode 100644 index 0000000..065f8c8 --- /dev/null +++ b/test/Model/MessageBroadcastOutTest.php @@ -0,0 +1,108 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * MessageBroadcastOutTest Class Doc Comment + * + * @category Class + * @description MessageBroadcastOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class MessageBroadcastOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "MessageBroadcastOut" + */ + public function testMessageBroadcastOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "task" + */ + public function testPropertyTask() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageEndpointOutTest.php b/test/Model/MessageEndpointOutTest.php new file mode 100644 index 0000000..5053015 --- /dev/null +++ b/test/Model/MessageEndpointOutTest.php @@ -0,0 +1,198 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * MessageEndpointOutTest Class Doc Comment + * + * @category Class + * @description MessageEndpointOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class MessageEndpointOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "MessageEndpointOut" + */ + public function testMessageEndpointOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_attempt" + */ + public function testPropertyNextAttempt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "rate_limit" + */ + public function testPropertyRateLimit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "uid" + */ + public function testPropertyUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "version" + */ + public function testPropertyVersion() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disabled" + */ + public function testPropertyDisabled() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filter_types" + */ + public function testPropertyFilterTypes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channels" + */ + public function testPropertyChannels() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "created_at" + */ + public function testPropertyCreatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updated_at" + */ + public function testPropertyUpdatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageInTest.php b/test/Model/MessageInTest.php new file mode 100644 index 0000000..ea4bebc --- /dev/null +++ b/test/Model/MessageInTest.php @@ -0,0 +1,135 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * MessageInTest Class Doc Comment + * + * @category Class + * @description MessageIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class MessageInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "MessageIn" + */ + public function testMessageIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "event_id" + */ + public function testPropertyEventId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "event_type" + */ + public function testPropertyEventType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payload" + */ + public function testPropertyPayload() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channels" + */ + public function testPropertyChannels() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payload_retention_period" + */ + public function testPropertyPayloadRetentionPeriod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "application" + */ + public function testPropertyApplication() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageOutTest.php b/test/Model/MessageOutTest.php new file mode 100644 index 0000000..39577d0 --- /dev/null +++ b/test/Model/MessageOutTest.php @@ -0,0 +1,135 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * MessageOutTest Class Doc Comment + * + * @category Class + * @description MessageOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class MessageOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "MessageOut" + */ + public function testMessageOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "event_id" + */ + public function testPropertyEventId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "event_type" + */ + public function testPropertyEventType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payload" + */ + public function testPropertyPayload() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channels" + */ + public function testPropertyChannels() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timestamp" + */ + public function testPropertyTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageRawPayloadOutTest.php b/test/Model/MessageRawPayloadOutTest.php new file mode 100644 index 0000000..043387f --- /dev/null +++ b/test/Model/MessageRawPayloadOutTest.php @@ -0,0 +1,90 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * MessageRawPayloadOutTest Class Doc Comment + * + * @category Class + * @description MessageRawPayloadOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class MessageRawPayloadOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "MessageRawPayloadOut" + */ + public function testMessageRawPayloadOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payload" + */ + public function testPropertyPayload() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MessageStatusTest.php b/test/Model/MessageStatusTest.php new file mode 100644 index 0000000..ae6d8b3 --- /dev/null +++ b/test/Model/MessageStatusTest.php @@ -0,0 +1,81 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * MessageStatusTest Class Doc Comment + * + * @category Class + * @description The sending status of the message: - Success = 0 - Pending = 1 - Fail = 2 - Sending = 3 + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class MessageStatusTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "MessageStatus" + */ + public function testMessageStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OauthPayloadInTest.php b/test/Model/OauthPayloadInTest.php new file mode 100644 index 0000000..fc03c82 --- /dev/null +++ b/test/Model/OauthPayloadInTest.php @@ -0,0 +1,99 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * OauthPayloadInTest Class Doc Comment + * + * @category Class + * @description OauthPayloadIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class OauthPayloadInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "OauthPayloadIn" + */ + public function testOauthPayloadIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "redirect_uri" + */ + public function testPropertyRedirectUri() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OauthPayloadOutTest.php b/test/Model/OauthPayloadOutTest.php new file mode 100644 index 0000000..ddb6870 --- /dev/null +++ b/test/Model/OauthPayloadOutTest.php @@ -0,0 +1,108 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * OauthPayloadOutTest Class Doc Comment + * + * @category Class + * @description OauthPayloadOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class OauthPayloadOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "OauthPayloadOut" + */ + public function testOauthPayloadOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error" + */ + public function testPropertyError() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "incoming_webhook_url" + */ + public function testPropertyIncomingWebhookUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channel" + */ + public function testPropertyChannel() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OneTimeTokenInTest.php b/test/Model/OneTimeTokenInTest.php new file mode 100644 index 0000000..70eaff4 --- /dev/null +++ b/test/Model/OneTimeTokenInTest.php @@ -0,0 +1,90 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * OneTimeTokenInTest Class Doc Comment + * + * @category Class + * @description OneTimeTokenIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class OneTimeTokenInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "OneTimeTokenIn" + */ + public function testOneTimeTokenIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "one_time_token" + */ + public function testPropertyOneTimeToken() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OneTimeTokenOutTest.php b/test/Model/OneTimeTokenOutTest.php new file mode 100644 index 0000000..a2c7d9c --- /dev/null +++ b/test/Model/OneTimeTokenOutTest.php @@ -0,0 +1,90 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * OneTimeTokenOutTest Class Doc Comment + * + * @category Class + * @description OneTimeTokenOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class OneTimeTokenOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "OneTimeTokenOut" + */ + public function testOneTimeTokenOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "token" + */ + public function testPropertyToken() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OrderingTest.php b/test/Model/OrderingTest.php new file mode 100644 index 0000000..23cdcff --- /dev/null +++ b/test/Model/OrderingTest.php @@ -0,0 +1,81 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * OrderingTest Class Doc Comment + * + * @category Class + * @description Defines the ordering in a listing of results. + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class OrderingTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "Ordering" + */ + public function testOrdering() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/RecoverInTest.php b/test/Model/RecoverInTest.php new file mode 100644 index 0000000..965a465 --- /dev/null +++ b/test/Model/RecoverInTest.php @@ -0,0 +1,99 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * RecoverInTest Class Doc Comment + * + * @category Class + * @description RecoverIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class RecoverInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "RecoverIn" + */ + public function testRecoverIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "since" + */ + public function testPropertySince() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "until" + */ + public function testPropertyUntil() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/RecoverOutTest.php b/test/Model/RecoverOutTest.php new file mode 100644 index 0000000..5e4047a --- /dev/null +++ b/test/Model/RecoverOutTest.php @@ -0,0 +1,108 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * RecoverOutTest Class Doc Comment + * + * @category Class + * @description RecoverOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class RecoverOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "RecoverOut" + */ + public function testRecoverOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "task" + */ + public function testPropertyTask() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ReplayInTest.php b/test/Model/ReplayInTest.php new file mode 100644 index 0000000..0f55fe1 --- /dev/null +++ b/test/Model/ReplayInTest.php @@ -0,0 +1,99 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ReplayInTest Class Doc Comment + * + * @category Class + * @description ReplayIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ReplayInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ReplayIn" + */ + public function testReplayIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "since" + */ + public function testPropertySince() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "until" + */ + public function testPropertyUntil() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ReplayOutTest.php b/test/Model/ReplayOutTest.php new file mode 100644 index 0000000..814dabd --- /dev/null +++ b/test/Model/ReplayOutTest.php @@ -0,0 +1,108 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ReplayOutTest Class Doc Comment + * + * @category Class + * @description ReplayOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ReplayOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ReplayOut" + */ + public function testReplayOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "task" + */ + public function testPropertyTask() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/StatusCodeClassTest.php b/test/Model/StatusCodeClassTest.php new file mode 100644 index 0000000..9a559e7 --- /dev/null +++ b/test/Model/StatusCodeClassTest.php @@ -0,0 +1,81 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * StatusCodeClassTest Class Doc Comment + * + * @category Class + * @description The different classes of HTTP status codes: - CodeNone = 0 - Code1xx = 100 - Code2xx = 200 - Code3xx = 300 - Code4xx = 400 - Code5xx = 500 + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class StatusCodeClassTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "StatusCodeClass" + */ + public function testStatusCodeClass() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TemplateInTest.php b/test/Model/TemplateInTest.php new file mode 100644 index 0000000..4893625 --- /dev/null +++ b/test/Model/TemplateInTest.php @@ -0,0 +1,162 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * TemplateInTest Class Doc Comment + * + * @category Class + * @description TemplateIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class TemplateInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "TemplateIn" + */ + public function testTemplateIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "logo" + */ + public function testPropertyLogo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "kind" + */ + public function testPropertyKind() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "instructions" + */ + public function testPropertyInstructions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "instructions_link" + */ + public function testPropertyInstructionsLink() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filter_types" + */ + public function testPropertyFilterTypes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "transformation" + */ + public function testPropertyTransformation() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "feature_flag" + */ + public function testPropertyFeatureFlag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TemplateOutTest.php b/test/Model/TemplateOutTest.php new file mode 100644 index 0000000..bbec6b2 --- /dev/null +++ b/test/Model/TemplateOutTest.php @@ -0,0 +1,198 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * TemplateOutTest Class Doc Comment + * + * @category Class + * @description TemplateOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class TemplateOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "TemplateOut" + */ + public function testTemplateOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "org_id" + */ + public function testPropertyOrgId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "kind" + */ + public function testPropertyKind() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "logo" + */ + public function testPropertyLogo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "instructions" + */ + public function testPropertyInstructions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "instructions_link" + */ + public function testPropertyInstructionsLink() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filter_types" + */ + public function testPropertyFilterTypes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "transformation" + */ + public function testPropertyTransformation() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "created_at" + */ + public function testPropertyCreatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updated_at" + */ + public function testPropertyUpdatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "feature_flag" + */ + public function testPropertyFeatureFlag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TemplatePatchTest.php b/test/Model/TemplatePatchTest.php new file mode 100644 index 0000000..24bba36 --- /dev/null +++ b/test/Model/TemplatePatchTest.php @@ -0,0 +1,162 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * TemplatePatchTest Class Doc Comment + * + * @category Class + * @description TemplatePatch + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class TemplatePatchTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "TemplatePatch" + */ + public function testTemplatePatch() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "logo" + */ + public function testPropertyLogo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "kind" + */ + public function testPropertyKind() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "instructions" + */ + public function testPropertyInstructions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "instructions_link" + */ + public function testPropertyInstructionsLink() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filter_types" + */ + public function testPropertyFilterTypes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "transformation" + */ + public function testPropertyTransformation() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "feature_flag" + */ + public function testPropertyFeatureFlag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TemplateUpdateTest.php b/test/Model/TemplateUpdateTest.php new file mode 100644 index 0000000..944dfa9 --- /dev/null +++ b/test/Model/TemplateUpdateTest.php @@ -0,0 +1,162 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * TemplateUpdateTest Class Doc Comment + * + * @category Class + * @description TemplateUpdate + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class TemplateUpdateTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "TemplateUpdate" + */ + public function testTemplateUpdate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "logo" + */ + public function testPropertyLogo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "kind" + */ + public function testPropertyKind() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "instructions" + */ + public function testPropertyInstructions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "instructions_link" + */ + public function testPropertyInstructionsLink() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filter_types" + */ + public function testPropertyFilterTypes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "transformation" + */ + public function testPropertyTransformation() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "feature_flag" + */ + public function testPropertyFeatureFlag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TransformationHttpMethodTest.php b/test/Model/TransformationHttpMethodTest.php new file mode 100644 index 0000000..cb73bae --- /dev/null +++ b/test/Model/TransformationHttpMethodTest.php @@ -0,0 +1,81 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * TransformationHttpMethodTest Class Doc Comment + * + * @category Class + * @description TransformationHttpMethod + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class TransformationHttpMethodTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "TransformationHttpMethod" + */ + public function testTransformationHttpMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TransformationSimulateInTest.php b/test/Model/TransformationSimulateInTest.php new file mode 100644 index 0000000..4fb7ca9 --- /dev/null +++ b/test/Model/TransformationSimulateInTest.php @@ -0,0 +1,117 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * TransformationSimulateInTest Class Doc Comment + * + * @category Class + * @description TransformationSimulateIn + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class TransformationSimulateInTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "TransformationSimulateIn" + */ + public function testTransformationSimulateIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "event_type" + */ + public function testPropertyEventType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "channels" + */ + public function testPropertyChannels() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payload" + */ + public function testPropertyPayload() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TransformationSimulateOutTest.php b/test/Model/TransformationSimulateOutTest.php new file mode 100644 index 0000000..8ba5390 --- /dev/null +++ b/test/Model/TransformationSimulateOutTest.php @@ -0,0 +1,108 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * TransformationSimulateOutTest Class Doc Comment + * + * @category Class + * @description TransformationSimulateOut + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class TransformationSimulateOutTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "TransformationSimulateOut" + */ + public function testTransformationSimulateOut() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payload" + */ + public function testPropertyPayload() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "method" + */ + public function testPropertyMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TransformationTemplateKindTest.php b/test/Model/TransformationTemplateKindTest.php new file mode 100644 index 0000000..936d804 --- /dev/null +++ b/test/Model/TransformationTemplateKindTest.php @@ -0,0 +1,81 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * TransformationTemplateKindTest Class Doc Comment + * + * @category Class + * @description TransformationTemplateKind + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class TransformationTemplateKindTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "TransformationTemplateKind" + */ + public function testTransformationTemplateKind() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ValidationErrorTest.php b/test/Model/ValidationErrorTest.php new file mode 100644 index 0000000..e01e6a7 --- /dev/null +++ b/test/Model/ValidationErrorTest.php @@ -0,0 +1,108 @@ + ## 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 + * Please update the test case below to test the model. + */ + +namespace Svix\ApiClient\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * ValidationErrorTest Class Doc Comment + * + * @category Class + * @description Validation errors have their own schema to provide context for invalid requests eg. mismatched types and out of bounds values. There may be any number of these per 422 UNPROCESSABLE ENTITY error. + * @package Svix\ApiClient + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ValidationErrorTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "ValidationError" + */ + public function testValidationError() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "loc" + */ + public function testPropertyLoc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "msg" + */ + public function testPropertyMsg() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +}