diff --git a/docs/APIError.md b/docs/APIError.md index 90974ab..4d15eaa 100644 --- a/docs/APIError.md +++ b/docs/APIError.md @@ -1,32 +1,35 @@ # DyspatchClient.APIError ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **String** | Error code: * server_error - Internal server error. * invalid_parameter - Validation error, parameter will contain invalid field and message will contain the reason. * invalid_body - Body could not be parsed, message will contain the reason. * invalid_request - Validation error, the protocol used to make the request was not https. * unauthorized - Credentials were found but permissions were not sufficient. * unauthenticated - Credentials were not found or were not valid. * not_found - The requested resource was not found. * rate_limited - The request was refused because a rate limit was exceeded. There is an account wide rate limit of 3600 requests per-minute, although that is subject to change. The current remaining rate limit can be viewed by checking the X-Ratelimit-Remaining header. | [optional] +**code** | **String** | Error code: * server_error - Internal server error. * invalid_parameter - Validation error, parameter will contain invalid field and message will contain the reason. * invalid_body - Body could not be parsed, message will contain the reason. * invalid_request - Validation error, the protocol used to make the request was not https. * unauthorized - Credentials were found but permissions were not sufficient. * unauthenticated - Credentials were not found or were not valid. * not_found - The requested resource was not found. * rate_limited - The request was refused because a rate limit was exceeded. There is an account wide rate limit of 3600 requests per-minute, although that is subject to change. The current remaining rate limit can be viewed by checking the X-Ratelimit-Remaining header. * prohibited_action - The request was refused because an action was not valid for the requested resource. Typically this will happen if you try to make changes to a locked resource. | [optional] **message** | **String** | Human readable error message | [optional] -**parameter** | **String** | The invalid parameter, if 'code' is invalid_parameter | [optional] +**parameter** | **String** | The invalid parameter, if 'code' is invalid_parameter | [optional] + - ## Enum: CodeEnum -* `serverError` (value: `"server_error"`) +* `server_error` (value: `"server_error"`) -* `invalidParameter` (value: `"invalid_parameter"`) +* `invalid_parameter` (value: `"invalid_parameter"`) -* `invalidBody` (value: `"invalid_body"`) +* `invalid_body` (value: `"invalid_body"`) -* `invalidRequest` (value: `"invalid_request"`) +* `invalid_request` (value: `"invalid_request"`) * `unauthorized` (value: `"unauthorized"`) * `unauthenticated` (value: `"unauthenticated"`) -* `notFound` (value: `"not_found"`) +* `not_found` (value: `"not_found"`) + +* `rate_limited` (value: `"rate_limited"`) -* `rateLimited` (value: `"rate_limited"`) +* `prohibited_action` (value: `"prohibited_action"`) diff --git a/docs/CompiledRead.md b/docs/CompiledRead.md index 2f038a6..2a05e6d 100644 --- a/docs/CompiledRead.md +++ b/docs/CompiledRead.md @@ -1,6 +1,7 @@ # DyspatchClient.CompiledRead ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **sender** | **String** | Sender address | [optional] diff --git a/docs/Cursor.md b/docs/Cursor.md index 3945617..8be0884 100644 --- a/docs/Cursor.md +++ b/docs/Cursor.md @@ -1,6 +1,7 @@ # DyspatchClient.Cursor ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **next** | **String** | A cursor to fetch the next page of results | [optional] diff --git a/docs/DraftMetaRead.md b/docs/DraftMetaRead.md index 7d5d1e1..e54367d 100644 --- a/docs/DraftMetaRead.md +++ b/docs/DraftMetaRead.md @@ -1,6 +1,7 @@ # DyspatchClient.DraftMetaRead ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **String** | An opaque, unique identifier for a draft | [optional] diff --git a/docs/DraftRead.md b/docs/DraftRead.md index 2eceed0..99c6f45 100644 --- a/docs/DraftRead.md +++ b/docs/DraftRead.md @@ -1,6 +1,7 @@ # DyspatchClient.DraftRead ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **String** | An opaque, unique identifier for a draft | [optional] @@ -10,6 +11,6 @@ Name | Type | Description | Notes **compiled** | [**CompiledRead**](CompiledRead.md) | | [optional] **createdAt** | **Date** | The time of initial creation | [optional] **updatedAt** | **Date** | The time of last update | [optional] -**localizations** | [**[LocalizationMetaRead]**](LocalizationMetaRead.md) | A list of the Template's available localizations | [optional] +**localizations** | [**[LocalizationMetaRead]**](LocalizationMetaRead.md) | A list of the Template's available localizations | [optional] diff --git a/docs/DraftsApi.md b/docs/DraftsApi.md index 8e223bb..c18c3cb 100644 --- a/docs/DraftsApi.md +++ b/docs/DraftsApi.md @@ -4,62 +4,61 @@ All URIs are relative to *https://api.dyspatch.io* Method | HTTP request | Description ------------- | ------------- | ------------- -[**draftsDraftIdGet**](DraftsApi.md#draftsDraftIdGet) | **GET** /drafts/{draftId} | Get Draft by ID -[**draftsDraftIdLocalizationKeysGet**](DraftsApi.md#draftsDraftIdLocalizationKeysGet) | **GET** /drafts/{draftId}/localizationKeys | Get Localization Keys -[**draftsDraftIdLocalizationsGet**](DraftsApi.md#draftsDraftIdLocalizationsGet) | **GET** /drafts/{draftId}/localizations | Get Localizations on a Draft -[**draftsDraftIdLocalizationsLanguageIdDelete**](DraftsApi.md#draftsDraftIdLocalizationsLanguageIdDelete) | **DELETE** /drafts/{draftId}/localizations/{languageId} | Remove a Localization -[**draftsDraftIdLocalizationsLanguageIdPut**](DraftsApi.md#draftsDraftIdLocalizationsLanguageIdPut) | **PUT** /drafts/{draftId}/localizations/{languageId} | Create or Update a Localization -[**draftsDraftIdLocalizationsLanguageIdTranslationsPut**](DraftsApi.md#draftsDraftIdLocalizationsLanguageIdTranslationsPut) | **PUT** /drafts/{draftId}/localizations/{languageId}/translations | Set Translations for Language -[**draftsDraftIdPublishRequestPost**](DraftsApi.md#draftsDraftIdPublishRequestPost) | **POST** /drafts/{draftId}/publishRequest | Submit the Draft for Approval -[**draftsGet**](DraftsApi.md#draftsGet) | **GET** /drafts | List Drafts +[**deleteLocalization**](DraftsApi.md#deleteLocalization) | **DELETE** /drafts/{draftId}/localizations/{languageId} | Remove a localization +[**getDraftById**](DraftsApi.md#getDraftById) | **GET** /drafts/{draftId} | Get Draft by ID +[**getDraftLocalizationKeys**](DraftsApi.md#getDraftLocalizationKeys) | **GET** /drafts/{draftId}/localizationKeys | Get localization keys +[**getDrafts**](DraftsApi.md#getDrafts) | **GET** /drafts | List Drafts +[**getLocalizationForDraft**](DraftsApi.md#getLocalizationForDraft) | **GET** /drafts/{draftId}/localizations | Get localizations on a draft +[**saveLocalization**](DraftsApi.md#saveLocalization) | **PUT** /drafts/{draftId}/localizations/{languageId} | Create or update a localization +[**setTranslation**](DraftsApi.md#setTranslation) | **PUT** /drafts/{draftId}/localizations/{languageId}/translations | Set translations for language +[**submitDraftForApproval**](DraftsApi.md#submitDraftForApproval) | **POST** /drafts/{draftId}/publishRequest | Submit the draft for approval - -# **draftsDraftIdGet** -> DraftRead draftsDraftIdGet(draftId, targetLanguage) -Get Draft by ID +## deleteLocalization + +> deleteLocalization(draftId, languageId, accept) -Gets a draft object with the matching ID. The \"compiled\" field will contain the unlocalized default template object. +Remove a localization + +Deletes the localization with the given language ID if it exists ### Example -```javascript -var DyspatchClient = require('dyspatch-client'); -var defaultClient = DyspatchClient.ApiClient.instance; +```javascript +import DyspatchClient from 'dyspatch-client'; +let defaultClient = DyspatchClient.ApiClient.instance; // Configure API key authorization: Bearer -var Bearer = defaultClient.authentications['Bearer']; +let Bearer = defaultClient.authentications['Bearer']; Bearer.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Bearer.apiKeyPrefix = 'Token'; -var apiInstance = new DyspatchClient.DraftsApi(); - -var draftId = "draftId_example"; // String | A draft ID - -var targetLanguage = "targetLanguage_example"; // String | The type of templating language to compile as. Should only be used for visual templates. - - -var callback = function(error, data, response) { +let apiInstance = new DyspatchClient.DraftsApi(); +let draftId = "draftId_example"; // String | A draft ID +let languageId = "languageId_example"; // String | A language ID (eg: en-US) +let accept = "accept_example"; // String | A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" +apiInstance.deleteLocalization(draftId, languageId, accept, (error, data, response) => { if (error) { console.error(error); } else { - console.log('API called successfully. Returned data: ' + data); + console.log('API called successfully.'); } -}; -apiInstance.draftsDraftIdGet(draftId, targetLanguage, callback); +}); ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **draftId** | **String**| A draft ID | - **targetLanguage** | **String**| The type of templating language to compile as. Should only be used for visual templates. | + **languageId** | **String**| A language ID (eg: en-US) | + **accept** | **String**| A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" | ### Return type -[**DraftRead**](DraftRead.md) +null (empty response body) ### Authorization @@ -67,56 +66,54 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/vnd.dyspatch.2019.10+json +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## getDraftById - -# **draftsDraftIdLocalizationKeysGet** -> [LocalizationKeyRead] draftsDraftIdLocalizationKeysGet(draftId, , opts) +> DraftRead getDraftById(draftId, targetLanguage, accept) -Get Localization Keys +Get Draft by ID -Returns the list of values that need to be translated for the draft. Set the `Accept` header to `application/vnd.dyspatch.2019.10+json` to get a JSON object, or `text/vnd.dyspatch.2019.10+x-gettext-translation` to get the POT file. +Gets a draft object with the matching ID. The \"compiled\" field will contain the template in the default, unlocalized form. ### Example -```javascript -var DyspatchClient = require('dyspatch-client'); -var defaultClient = DyspatchClient.ApiClient.instance; +```javascript +import DyspatchClient from 'dyspatch-client'; +let defaultClient = DyspatchClient.ApiClient.instance; // Configure API key authorization: Bearer -var Bearer = defaultClient.authentications['Bearer']; +let Bearer = defaultClient.authentications['Bearer']; Bearer.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Bearer.apiKeyPrefix = 'Token'; -var apiInstance = new DyspatchClient.DraftsApi(); - -var draftId = "draftId_example"; // String | A draft ID - -var opts = { - 'accept': "accept_example" // String | A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\". -}; - -var callback = function(error, data, response) { +let apiInstance = new DyspatchClient.DraftsApi(); +let draftId = "draftId_example"; // String | A draft ID +let targetLanguage = "targetLanguage_example"; // String | The type of templating language to compile as. Should only be used for visual templates. +let accept = "accept_example"; // String | A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" +apiInstance.getDraftById(draftId, targetLanguage, accept, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.draftsDraftIdLocalizationKeysGet(draftId, , opts, callback); +}); ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **draftId** | **String**| A draft ID | - **accept** | **String**| A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\". | [optional] + **targetLanguage** | **String**| The type of templating language to compile as. Should only be used for visual templates. | + **accept** | **String**| A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" | ### Return type -[**[LocalizationKeyRead]**](LocalizationKeyRead.md) +[**DraftRead**](DraftRead.md) ### Authorization @@ -124,52 +121,52 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/vnd.dyspatch.2019.10+json, text/vnd.dyspatch.2019.10+x-gettext-translation +- **Content-Type**: Not defined +- **Accept**: application/vnd.dyspatch.2019.10+json, */* + - -# **draftsDraftIdLocalizationsGet** -> [LocalizationMetaRead] draftsDraftIdLocalizationsGet(draftId, ) +## getDraftLocalizationKeys -Get Localizations on a Draft +> [LocalizationKeyRead] getDraftLocalizationKeys(draftId, accept) -Returns localization metadata object for a template draft. +Get localization keys + +Returns the list of values that need to be translated for the draft. Set the `Accept` header to `application/vnd.dyspatch.2019.10+json` to get a JSON object, or `text/vnd.dyspatch.2019.10+x-gettext-translation` to get the POT file. ### Example -```javascript -var DyspatchClient = require('dyspatch-client'); -var defaultClient = DyspatchClient.ApiClient.instance; +```javascript +import DyspatchClient from 'dyspatch-client'; +let defaultClient = DyspatchClient.ApiClient.instance; // Configure API key authorization: Bearer -var Bearer = defaultClient.authentications['Bearer']; +let Bearer = defaultClient.authentications['Bearer']; Bearer.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Bearer.apiKeyPrefix = 'Token'; -var apiInstance = new DyspatchClient.DraftsApi(); - -var draftId = "draftId_example"; // String | A draft ID - - -var callback = function(error, data, response) { +let apiInstance = new DyspatchClient.DraftsApi(); +let draftId = "draftId_example"; // String | A draft ID +let accept = "accept_example"; // String | A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" +apiInstance.getDraftLocalizationKeys(draftId, accept, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.draftsDraftIdLocalizationsGet(draftId, , callback); +}); ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **draftId** | **String**| A draft ID | + **accept** | **String**| A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" | ### Return type -[**[LocalizationMetaRead]**](LocalizationMetaRead.md) +[**[LocalizationKeyRead]**](LocalizationKeyRead.md) ### Authorization @@ -177,55 +174,56 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/vnd.dyspatch.2019.10+json +- **Content-Type**: Not defined +- **Accept**: application/vnd.dyspatch.2019.10+json, text/vnd.dyspatch.2019.10+x-gettext-translation - -# **draftsDraftIdLocalizationsLanguageIdDelete** -> draftsDraftIdLocalizationsLanguageIdDelete(draftId, languageId) -Remove a Localization +## getDrafts + +> DraftsRead getDrafts(accept, opts) + +List Drafts -Deletes the localization with the given `languageId` if it exists. +Returns all drafts for your organization. ### Example -```javascript -var DyspatchClient = require('dyspatch-client'); -var defaultClient = DyspatchClient.ApiClient.instance; +```javascript +import DyspatchClient from 'dyspatch-client'; +let defaultClient = DyspatchClient.ApiClient.instance; // Configure API key authorization: Bearer -var Bearer = defaultClient.authentications['Bearer']; +let Bearer = defaultClient.authentications['Bearer']; Bearer.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Bearer.apiKeyPrefix = 'Token'; -var apiInstance = new DyspatchClient.DraftsApi(); - -var draftId = "draftId_example"; // String | A draft ID - -var languageId = "languageId_example"; // String | A language ID (eg: en-US) - - -var callback = function(error, data, response) { +let apiInstance = new DyspatchClient.DraftsApi(); +let accept = "accept_example"; // String | A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" +let opts = { + 'cursor': "cursor_example", // String | A cursor value used to retrieve a specific page from a paginated result set. + 'status': "status_example" // String | Filter the list of drafts by a particular status +}; +apiInstance.getDrafts(accept, opts, (error, data, response) => { if (error) { console.error(error); } else { - console.log('API called successfully.'); + console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.draftsDraftIdLocalizationsLanguageIdDelete(draftId, languageId, callback); +}); ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **draftId** | **String**| A draft ID | - **languageId** | **String**| A language ID (eg: en-US) | + **accept** | **String**| A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" | + **cursor** | **String**| A cursor value used to retrieve a specific page from a paginated result set. | [optional] + **status** | **String**| Filter the list of drafts by a particular status | [optional] ### Return type -null (empty response body) +[**DraftsRead**](DraftsRead.md) ### Authorization @@ -233,58 +231,52 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/vnd.dyspatch.2019.10+json +- **Content-Type**: Not defined +- **Accept**: application/vnd.dyspatch.2019.10+json, */* - -# **draftsDraftIdLocalizationsLanguageIdPut** -> draftsDraftIdLocalizationsLanguageIdPut(draftId, languageIdbody) -Create or Update a Localization +## getLocalizationForDraft -Inserts a localization or sets the name on an existing localization that already uses the `languageId`. +> [LocalizationMetaRead] getLocalizationForDraft(draftId, accept) + +Get localizations on a draft + +Returns localization metadata for the draft ### Example -```javascript -var DyspatchClient = require('dyspatch-client'); -var defaultClient = DyspatchClient.ApiClient.instance; +```javascript +import DyspatchClient from 'dyspatch-client'; +let defaultClient = DyspatchClient.ApiClient.instance; // Configure API key authorization: Bearer -var Bearer = defaultClient.authentications['Bearer']; +let Bearer = defaultClient.authentications['Bearer']; Bearer.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Bearer.apiKeyPrefix = 'Token'; -var apiInstance = new DyspatchClient.DraftsApi(); - -var draftId = "draftId_example"; // String | A draft ID - -var languageId = "languageId_example"; // String | A language ID (eg: en-US) - -var body = new DyspatchClient.Body(); // Body | - - -var callback = function(error, data, response) { +let apiInstance = new DyspatchClient.DraftsApi(); +let draftId = "draftId_example"; // String | A draft ID +let accept = "accept_example"; // String | A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" +apiInstance.getLocalizationForDraft(draftId, accept, (error, data, response) => { if (error) { console.error(error); } else { - console.log('API called successfully.'); + console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.draftsDraftIdLocalizationsLanguageIdPut(draftId, languageIdbody, callback); +}); ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **draftId** | **String**| A draft ID | - **languageId** | **String**| A language ID (eg: en-US) | - **body** | [**Body**](Body.md)| | + **accept** | **String**| A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" | ### Return type -null (empty response body) +[**[LocalizationMetaRead]**](LocalizationMetaRead.md) ### Authorization @@ -292,54 +284,52 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/vnd.dyspatch.2019.10+json +- **Content-Type**: Not defined +- **Accept**: application/vnd.dyspatch.2019.10+json + - -# **draftsDraftIdLocalizationsLanguageIdTranslationsPut** -> draftsDraftIdLocalizationsLanguageIdTranslationsPut(draftId, languageIdbody) +## saveLocalization -Set Translations for Language +> saveLocalization(draftId, languageId, accept, inlineObject) -Completely replaces any existing translations for the given language with those provided in request body. Variables embedded in keys or values are expected to be in the format `%(my_variable)s` and will automatically convert to the correct Dyspatch format depending on the type of template. Accepts key/value pairs in JSON format or in gettext PO file format. For JSON set `Content-Type` header to `application/json`. For gettext PO format set `Content-Type` header to `text/x-gettext-translation`. +Create or update a localization + +Inserts a localization or sets the name on an existing localization that already uses the languageId ### Example -```javascript -var DyspatchClient = require('dyspatch-client'); -var defaultClient = DyspatchClient.ApiClient.instance; +```javascript +import DyspatchClient from 'dyspatch-client'; +let defaultClient = DyspatchClient.ApiClient.instance; // Configure API key authorization: Bearer -var Bearer = defaultClient.authentications['Bearer']; +let Bearer = defaultClient.authentications['Bearer']; Bearer.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Bearer.apiKeyPrefix = 'Token'; -var apiInstance = new DyspatchClient.DraftsApi(); - -var draftId = "draftId_example"; // String | A draft ID - -var languageId = "languageId_example"; // String | A language ID (eg: en-US) - -var body = null; // Object | - - -var callback = function(error, data, response) { +let apiInstance = new DyspatchClient.DraftsApi(); +let draftId = "draftId_example"; // String | A draft ID +let languageId = "languageId_example"; // String | A language ID (eg: en-US) +let accept = "accept_example"; // String | A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" +let inlineObject = new DyspatchClient.InlineObject(); // InlineObject | +apiInstance.saveLocalization(draftId, languageId, accept, inlineObject, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully.'); } -}; -apiInstance.draftsDraftIdLocalizationsLanguageIdTranslationsPut(draftId, languageIdbody, callback); +}); ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **draftId** | **String**| A draft ID | **languageId** | **String**| A language ID (eg: en-US) | - **body** | **Object**| | + **accept** | **String**| A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" | + **inlineObject** | [**InlineObject**](InlineObject.md)| | ### Return type @@ -351,48 +341,52 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/vnd.dyspatch.2019.10+json +- **Content-Type**: application/json +- **Accept**: Not defined + - -# **draftsDraftIdPublishRequestPost** -> draftsDraftIdPublishRequestPost(draftId, ) +## setTranslation -Submit the Draft for Approval +> setTranslation(draftId, languageId, accept, requestBody) -Moves the draft into [submitted and locked state](https://docs.dyspatch.io/templates/submitting_a_template/#awaiting-approval). This will allow your email stakeholders to review the template draft and provide feedback. +Set translations for language + +Completely replaces any existing translations for the given language with those provided in request body. Variables embedded in keys or values are expected to be in the format `%(my_variable)s` and will automatically convert to the correct Dyspatch format depending on the type of template. Accepts key/value pairs in JSON format or in gettext PO file format. For JSON set `Content-Type` header to `application/json`. For gettext PO format set `Content-Type` header to `text/x-gettext-translation`. ### Example -```javascript -var DyspatchClient = require('dyspatch-client'); -var defaultClient = DyspatchClient.ApiClient.instance; +```javascript +import DyspatchClient from 'dyspatch-client'; +let defaultClient = DyspatchClient.ApiClient.instance; // Configure API key authorization: Bearer -var Bearer = defaultClient.authentications['Bearer']; +let Bearer = defaultClient.authentications['Bearer']; Bearer.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Bearer.apiKeyPrefix = 'Token'; -var apiInstance = new DyspatchClient.DraftsApi(); - -var draftId = "draftId_example"; // String | A draft ID - - -var callback = function(error, data, response) { +let apiInstance = new DyspatchClient.DraftsApi(); +let draftId = "draftId_example"; // String | A draft ID +let languageId = "languageId_example"; // String | A language ID (eg: en-US) +let accept = "accept_example"; // String | A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" +let requestBody = {key: "null"}; // {String: String} | +apiInstance.setTranslation(draftId, languageId, accept, requestBody, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully.'); } -}; -apiInstance.draftsDraftIdPublishRequestPost(draftId, , callback); +}); ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **draftId** | **String**| A draft ID | + **languageId** | **String**| A language ID (eg: en-US) | + **accept** | **String**| A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" | + **requestBody** | [**{String: String}**](String.md)| | ### Return type @@ -404,55 +398,52 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/vnd.dyspatch.2019.10+json +- **Content-Type**: application/json +- **Accept**: Not defined - -# **draftsGet** -> DraftsRead draftsGet(opts) -List Drafts +## submitDraftForApproval -Gets a list of all drafts for your oranization. Up to 25 results returned before results are paginated. +> submitDraftForApproval(draftId, accept) + +Submit the draft for approval + +Moves the draft into submitted state. ### Example -```javascript -var DyspatchClient = require('dyspatch-client'); -var defaultClient = DyspatchClient.ApiClient.instance; +```javascript +import DyspatchClient from 'dyspatch-client'; +let defaultClient = DyspatchClient.ApiClient.instance; // Configure API key authorization: Bearer -var Bearer = defaultClient.authentications['Bearer']; +let Bearer = defaultClient.authentications['Bearer']; Bearer.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Bearer.apiKeyPrefix = 'Token'; -var apiInstance = new DyspatchClient.DraftsApi(); - -var opts = { - 'cursor': "cursor_example", // String | A cursor value used to retrieve a specific page from a paginated result set. - 'status': "status_example" // String | Filter the list of drafts by a particular status -}; - -var callback = function(error, data, response) { +let apiInstance = new DyspatchClient.DraftsApi(); +let draftId = "draftId_example"; // String | A draft ID +let accept = "accept_example"; // String | A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" +apiInstance.submitDraftForApproval(draftId, accept, (error, data, response) => { if (error) { console.error(error); } else { - console.log('API called successfully. Returned data: ' + data); + console.log('API called successfully.'); } -}; -apiInstance.draftsGet(opts, callback); +}); ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **cursor** | **String**| A cursor value used to retrieve a specific page from a paginated result set. | [optional] - **status** | **String**| Filter the list of drafts by a particular status | [optional] + **draftId** | **String**| A draft ID | + **accept** | **String**| A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" | ### Return type -[**DraftsRead**](DraftsRead.md) +null (empty response body) ### Authorization @@ -460,6 +451,6 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/vnd.dyspatch.2019.10+json +- **Content-Type**: Not defined +- **Accept**: */* diff --git a/docs/DraftsRead.md b/docs/DraftsRead.md index 2dd3532..1b6ba70 100644 --- a/docs/DraftsRead.md +++ b/docs/DraftsRead.md @@ -1,6 +1,7 @@ # DyspatchClient.DraftsRead ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cursor** | [**Cursor**](Cursor.md) | | [optional] diff --git a/docs/InlineObject.md b/docs/InlineObject.md new file mode 100644 index 0000000..5aa28ad --- /dev/null +++ b/docs/InlineObject.md @@ -0,0 +1,9 @@ +# DyspatchClient.InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + diff --git a/docs/LocalizationKeyRead.md b/docs/LocalizationKeyRead.md index 5730702..c7c257a 100644 --- a/docs/LocalizationKeyRead.md +++ b/docs/LocalizationKeyRead.md @@ -1,6 +1,7 @@ # DyspatchClient.LocalizationKeyRead ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **key** | **String** | | [optional] diff --git a/docs/LocalizationMetaRead.md b/docs/LocalizationMetaRead.md index 431a676..5687a3c 100644 --- a/docs/LocalizationMetaRead.md +++ b/docs/LocalizationMetaRead.md @@ -1,12 +1,12 @@ # DyspatchClient.LocalizationMetaRead ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **String** | An opaque, unique identifier for a localization | [optional] -**language** | **String** | A language identifier comprised of a language and a country identifier. See [supported languages](https://docs.dyspatch.io/localization/supported_languages/). | [optional] +**localization** | **String** | An opaque, unique identifier for a localization | [optional] +**language** | **String** | A language identifier comprised of a language and a country identifier. See [supported languages](https://docs.dyspatch.io/localization/supported_languages/). | [optional] **name** | **String** | The user-specified name of a localization | [optional] **url** | **String** | The API url for a specific localization | [optional] -**draft** | **String** | An opaque, unique identifier for a draft | [optional] diff --git a/docs/LocalizationRead.md b/docs/LocalizationRead.md index bca70a5..0c19eae 100644 --- a/docs/LocalizationRead.md +++ b/docs/LocalizationRead.md @@ -1,10 +1,11 @@ # DyspatchClient.LocalizationRead ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **String** | An opaque, unique identifier for a localization | [optional] -**language** | **String** | A language identifier comprised of a language and a country identifier. See [supported languages](https://docs.dyspatch.io/localization/supported_languages/). | [optional] +**language** | **String** | A language identifier comprised of a language and a country identifier. See [supported languages](https://docs.dyspatch.io/localization/supported_languages/). | [optional] **url** | **String** | The API url for a specific localization | [optional] **template** | **String** | An opaque, unique identifier for a template | [optional] **compiled** | [**CompiledRead**](CompiledRead.md) | | [optional] diff --git a/docs/LocalizationsApi.md b/docs/LocalizationsApi.md index 04afb59..352b347 100644 --- a/docs/LocalizationsApi.md +++ b/docs/LocalizationsApi.md @@ -4,51 +4,50 @@ All URIs are relative to *https://api.dyspatch.io* Method | HTTP request | Description ------------- | ------------- | ------------- -[**localizationsLocalizationIdGet**](LocalizationsApi.md#localizationsLocalizationIdGet) | **GET** /localizations/{localizationId} | Get Localization Object by ID +[**getLocalizationById**](LocalizationsApi.md#getLocalizationById) | **GET** /localizations/{localizationId} | Get Localization Object by ID - -# **localizationsLocalizationIdGet** -> LocalizationRead localizationsLocalizationIdGet(localizationId, targetLanguage) + +## getLocalizationById + +> LocalizationRead getLocalizationById(localizationId, targetLanguage, accept) Get Localization Object by ID -Returns a specific localization object with a matching ID. +Returns a specific localization object with a matching ID ### Example -```javascript -var DyspatchClient = require('dyspatch-client'); -var defaultClient = DyspatchClient.ApiClient.instance; +```javascript +import DyspatchClient from 'dyspatch-client'; +let defaultClient = DyspatchClient.ApiClient.instance; // Configure API key authorization: Bearer -var Bearer = defaultClient.authentications['Bearer']; +let Bearer = defaultClient.authentications['Bearer']; Bearer.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Bearer.apiKeyPrefix = 'Token'; -var apiInstance = new DyspatchClient.LocalizationsApi(); - -var localizationId = "localizationId_example"; // String | A localization ID - -var targetLanguage = "targetLanguage_example"; // String | The type of templating language to compile as. Should only be used for visual templates. - - -var callback = function(error, data, response) { +let apiInstance = new DyspatchClient.LocalizationsApi(); +let localizationId = "localizationId_example"; // String | A localization ID +let targetLanguage = "targetLanguage_example"; // String | The type of templating language to compile as. Should only be used for visual templates. +let accept = "accept_example"; // String | A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" +apiInstance.getLocalizationById(localizationId, targetLanguage, accept, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.localizationsLocalizationIdGet(localizationId, targetLanguage, callback); +}); ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **localizationId** | **String**| A localization ID | **targetLanguage** | **String**| The type of templating language to compile as. Should only be used for visual templates. | + **accept** | **String**| A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" | ### Return type @@ -60,6 +59,6 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/vnd.dyspatch.2019.10+json +- **Content-Type**: Not defined +- **Accept**: application/vnd.dyspatch.2019.10+json, */* diff --git a/docs/TemplateMetaRead.md b/docs/TemplateMetaRead.md index 4ce1a2e..c557ed9 100644 --- a/docs/TemplateMetaRead.md +++ b/docs/TemplateMetaRead.md @@ -1,13 +1,14 @@ # DyspatchClient.TemplateMetaRead ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **String** | An opaque, unique identifier for a template | [optional] **name** | **String** | The name of a template | [optional] **description** | **String** | A description of the template | [optional] **url** | **String** | The API url for a specific template | [optional] -**localizations** | [**[LocalizationMetaRead]**](LocalizationMetaRead.md) | A list of the template's available localization objects | [optional] +**localizations** | [**[LocalizationMetaRead]**](LocalizationMetaRead.md) | A list of the template's available localization objects | [optional] **createdAt** | **Date** | The time of initial creation | [optional] **updatedAt** | **Date** | The time of last update | [optional] diff --git a/docs/TemplateRead.md b/docs/TemplateRead.md index 69be961..6a73aee 100644 --- a/docs/TemplateRead.md +++ b/docs/TemplateRead.md @@ -1,6 +1,7 @@ # DyspatchClient.TemplateRead ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **String** | An opaque, unique identifier for a template | [optional] @@ -10,6 +11,6 @@ Name | Type | Description | Notes **compiled** | [**CompiledRead**](CompiledRead.md) | | [optional] **createdAt** | **Date** | The time of initial creation | [optional] **updatedAt** | **Date** | The time of last update | [optional] -**localizations** | [**[LocalizationMetaRead]**](LocalizationMetaRead.md) | A list of the Template's available localizations | [optional] +**localizations** | [**[LocalizationMetaRead]**](LocalizationMetaRead.md) | A list of the Template's available localizations | [optional] diff --git a/docs/TemplatesApi.md b/docs/TemplatesApi.md index f62c7b3..3653124 100644 --- a/docs/TemplatesApi.md +++ b/docs/TemplatesApi.md @@ -4,54 +4,55 @@ All URIs are relative to *https://api.dyspatch.io* Method | HTTP request | Description ------------- | ------------- | ------------- -[**templatesGet**](TemplatesApi.md#templatesGet) | **GET** /templates | List Templates -[**templatesTemplateIdGet**](TemplatesApi.md#templatesTemplateIdGet) | **GET** /templates/{templateId} | Get Template by ID +[**getTemplateById**](TemplatesApi.md#getTemplateById) | **GET** /templates/{templateId} | Get Template by ID +[**getTemplates**](TemplatesApi.md#getTemplates) | **GET** /templates | List Templates - -# **templatesGet** -> TemplatesRead templatesGet(opts) -List Templates +## getTemplateById -Gets a list of Template Metadata objects for all templates. Up to 25 results returned before results are paginated. +> TemplateRead getTemplateById(templateId, targetLanguage, accept) + +Get Template by ID + +Gets a template object with the matching ID. If the template has published content the \"compiled\" field will contain the template . ### Example -```javascript -var DyspatchClient = require('dyspatch-client'); -var defaultClient = DyspatchClient.ApiClient.instance; +```javascript +import DyspatchClient from 'dyspatch-client'; +let defaultClient = DyspatchClient.ApiClient.instance; // Configure API key authorization: Bearer -var Bearer = defaultClient.authentications['Bearer']; +let Bearer = defaultClient.authentications['Bearer']; Bearer.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Bearer.apiKeyPrefix = 'Token'; -var apiInstance = new DyspatchClient.TemplatesApi(); - -var opts = { - 'cursor': "cursor_example", // String | A cursor value used to retrieve a specific page from a paginated result set. -}; - -var callback = function(error, data, response) { +let apiInstance = new DyspatchClient.TemplatesApi(); +let templateId = "templateId_example"; // String | A template ID +let targetLanguage = "targetLanguage_example"; // String | The type of templating language to compile as. Should only be used for visual templates. +let accept = "accept_example"; // String | A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" +apiInstance.getTemplateById(templateId, targetLanguage, accept, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.templatesGet(opts, callback); +}); ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **cursor** | **String**| A cursor value used to retrieve a specific page from a paginated result set. | [optional] + **templateId** | **String**| A template ID | + **targetLanguage** | **String**| The type of templating language to compile as. Should only be used for visual templates. | + **accept** | **String**| A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" | ### Return type -[**TemplatesRead**](TemplatesRead.md) +[**TemplateRead**](TemplateRead.md) ### Authorization @@ -59,55 +60,54 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/vnd.dyspatch.2019.10+json +- **Content-Type**: Not defined +- **Accept**: application/vnd.dyspatch.2019.10+json, */* - -# **templatesTemplateIdGet** -> TemplateRead templatesTemplateIdGet(templateId, targetLanguage) -Get Template by ID +## getTemplates -Gets a template object with the matching ID. If the template has published content the \"compiled\" field will contain the template . +> TemplatesRead getTemplates(accept, opts) + +List Templates + +Gets a list of Template Metadata objects for all templates. Up to 25 results returned before results are paginated. ### Example -```javascript -var DyspatchClient = require('dyspatch-client'); -var defaultClient = DyspatchClient.ApiClient.instance; +```javascript +import DyspatchClient from 'dyspatch-client'; +let defaultClient = DyspatchClient.ApiClient.instance; // Configure API key authorization: Bearer -var Bearer = defaultClient.authentications['Bearer']; +let Bearer = defaultClient.authentications['Bearer']; Bearer.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Bearer.apiKeyPrefix = 'Token'; -var apiInstance = new DyspatchClient.TemplatesApi(); - -var templateId = "templateId_example"; // String | A template ID - -var targetLanguage = "targetLanguage_example"; // String | The type of templating language to compile as. Should only be used for visual templates. - - -var callback = function(error, data, response) { +let apiInstance = new DyspatchClient.TemplatesApi(); +let accept = "accept_example"; // String | A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" +let opts = { + 'cursor': "cursor_example" // String | A cursor value used to retrieve a specific page from a paginated result set. +}; +apiInstance.getTemplates(accept, opts, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } -}; -apiInstance.templatesTemplateIdGet(templateId, targetLanguage, callback); +}); ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **templateId** | **String**| A template ID | - **targetLanguage** | **String**| The type of templating language to compile as. Should only be used for visual templates. | + **accept** | **String**| A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" | + **cursor** | **String**| A cursor value used to retrieve a specific page from a paginated result set. | [optional] ### Return type -[**TemplateRead**](TemplateRead.md) +[**TemplatesRead**](TemplatesRead.md) ### Authorization @@ -115,6 +115,6 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/vnd.dyspatch.2019.10+json +- **Content-Type**: Not defined +- **Accept**: application/vnd.dyspatch.2019.10+json, */* diff --git a/docs/TemplatesRead.md b/docs/TemplatesRead.md index 9d91017..419fc34 100644 --- a/docs/TemplatesRead.md +++ b/docs/TemplatesRead.md @@ -1,6 +1,7 @@ # DyspatchClient.TemplatesRead ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cursor** | [**Cursor**](Cursor.md) | | [optional] diff --git a/package.json b/package.json index 54a8a34..278cef3 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,46 @@ { "name": "dyspatch-client", - "version": "3.0.1", - "description": "The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. For more information, please visit https://docs.dyspatch.io", + "version": "4.0.0", + "description": "_IntroductionThe_Dyspatch_API_is_based_on_the_REST_paradigm_and_features_resource_based_URLs_with_standard_HTTP_response_codes_to_indicate_errors__We_use_standard_HTTP_authentication_and_request_verbs_and_all_responses_are_JSON_formatted__See_our__Implementation_Guide_https__docs_dyspatch_io_development_implementing_dyspatch__for_more_details_on_how_to_implement_Dyspatch__API_Client_Libraries_Dyspatch_provides_API_Clients_for_popular_languages_and_web_frameworks____Java_https__github_com_getdyspatch_dyspatch_java____Javascript_https__github_com_getdyspatch_dyspatch_javascript____Python_https__github_com_getdyspatch_dyspatch_python____C_https__github_com_getdyspatch_dyspatch_dotnet____Go_https__github_com_getdyspatch_dyspatch_golang____Ruby_https__github_com_getdyspatch_dyspatch_ruby", "license": "Apache-2.0", - "main": "src/index.js", + "main": "dist/index.js", "scripts": { - "test": "mocha --recursive" + "build": "babel src -d dist", + "prepack": "npm run build", + "test": "mocha --require @babel/register --recursive" }, "browser": { "fs": false }, "dependencies": { - "superagent": "3.7.0", - "querystring": "0.2.0" + "@babel/cli": "^7.0.0", + "superagent": "3.7.0" }, "devDependencies": { - "mocha": "~2.3.4", - "sinon": "1.17.3", - "expect.js": "~0.3.1" - } + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-decorators": "^7.0.0", + "@babel/plugin-proposal-do-expressions": "^7.0.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-export-namespace-from": "^7.0.0", + "@babel/plugin-proposal-function-bind": "^7.0.0", + "@babel/plugin-proposal-function-sent": "^7.0.0", + "@babel/plugin-proposal-json-strings": "^7.0.0", + "@babel/plugin-proposal-logical-assignment-operators": "^7.0.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", + "@babel/plugin-proposal-numeric-separator": "^7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.0.0", + "@babel/plugin-proposal-pipeline-operator": "^7.0.0", + "@babel/plugin-proposal-throw-expressions": "^7.0.0", + "@babel/plugin-syntax-dynamic-import": "^7.0.0", + "@babel/plugin-syntax-import-meta": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "@babel/register": "^7.0.0", + "expect.js": "^0.3.1", + "mocha": "^5.2.0", + "sinon": "^7.2.0" + }, + "files": [ + "dist" + ] } diff --git a/src/ApiClient.js b/src/ApiClient.js index 2846c47..fb3caf9 100644 --- a/src/ApiClient.js +++ b/src/ApiClient.js @@ -1,601 +1,652 @@ -/* +/** * Dyspatch API - * # Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) * - * OpenAPI spec version: 2019.10 + * The version of the OpenAPI document: 2019.10 * Contact: support@dyspatch.io * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.4.10 - * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['superagent', 'querystring'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('superagent'), require('querystring')); - } else { - // Browser globals (root is window) - if (!root.DyspatchClient) { - root.DyspatchClient = {}; - } - root.DyspatchClient.ApiClient = factory(root.superagent, root.querystring); - } -}(this, function(superagent, querystring) { - 'use strict'; - /** - * @module ApiClient - * @version 3.0.1 - */ +import superagent from "superagent"; +import querystring from "querystring"; + +/** +* @module ApiClient +* @version 4.0.0 +*/ + +/** +* Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an +* application to use this class directly - the *Api and model classes provide the public API for the service. The +* contents of this file should be regarded as internal but are documented for completeness. +* @alias module:ApiClient +* @class +*/ +class ApiClient { + constructor() { + /** + * The base URL against which to resolve every API call's (relative) path. + * @type {String} + * @default https://api.dyspatch.io + */ + this.basePath = 'https://api.dyspatch.io'.replace(/\/+$/, ''); + + /** + * The authentication methods to be included for all API calls. + * @type {Array.} + */ + this.authentications = { + 'Bearer': {type: 'apiKey', 'in': 'header', name: 'Authorization'} + } - /** - * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an - * application to use this class directly - the *Api and model classes provide the public API for the service. The - * contents of this file should be regarded as internal but are documented for completeness. - * @alias module:ApiClient - * @class - */ - var exports = function() { - /** - * The base URL against which to resolve every API call's (relative) path. - * @type {String} - * @default https://api.dyspatch.io - */ - this.basePath = 'https://api.dyspatch.io'.replace(/\/+$/, ''); + /** + * The default HTTP headers to be included for all API calls. + * @type {Array.} + * @default {} + */ + this.defaultHeaders = {}; + + /** + * The default HTTP timeout for all API calls. + * @type {Number} + * @default 60000 + */ + this.timeout = 60000; + + /** + * If set to false an additional timestamp parameter is added to all API GET calls to + * prevent browser caching + * @type {Boolean} + * @default true + */ + this.cache = true; + + /** + * If set to true, the client will save the cookies from each server + * response, and return them in the next request. + * @default false + */ + this.enableCookies = false; + + /* + * Used to save and return cookies in a node.js (non-browser) setting, + * if this.enableCookies is set to true. + */ + if (typeof window === 'undefined') { + this.agent = new superagent.agent(); + } - /** - * The authentication methods to be included for all API calls. - * @type {Array.} - */ - this.authentications = { - 'Bearer': {type: 'apiKey', 'in': 'header', name: 'Authorization'} - }; - /** - * The default HTTP headers to be included for all API calls. - * @type {Array.} - * @default {} - */ - this.defaultHeaders = {}; + /* + * Allow user to override superagent agent + */ + this.requestAgent = null; - /** - * The default HTTP timeout for all API calls. - * @type {Number} - * @default 60000 - */ - this.timeout = 60000; + /* + * Allow user to add superagent plugins + */ + this.plugins = null; - /** - * If set to false an additional timestamp parameter is added to all API GET calls to - * prevent browser caching - * @type {Boolean} - * @default true - */ - this.cache = true; + } /** - * If set to true, the client will save the cookies from each server - * response, and return them in the next request. - * @default false - */ - this.enableCookies = false; + * Returns a string representation for an actual parameter. + * @param param The actual parameter. + * @returns {String} The string representation of param. + */ + paramToString(param) { + if (param == undefined || param == null) { + return ''; + } + if (param instanceof Date) { + return param.toJSON(); + } - /* - * Used to save and return cookies in a node.js (non-browser) setting, - * if this.enableCookies is set to true. - */ - if (typeof window === 'undefined') { - this.agent = new superagent.agent(); + return param.toString(); } - /* - * Allow user to override superagent agent - */ - this.requestAgent = null; - }; + /** + * Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values. + * NOTE: query parameters are not handled here. + * @param {String} path The path to append to the base URL. + * @param {Object} pathParams The parameter values to append. + * @param {String} apiBasePath Base path defined in the path, operation level to override the default one + * @returns {String} The encoded path with parameter values substituted. + */ + buildUrl(path, pathParams, apiBasePath) { + if (!path.match(/^\//)) { + path = '/' + path; + } - /** - * Returns a string representation for an actual parameter. - * @param param The actual parameter. - * @returns {String} The string representation of param. - */ - exports.prototype.paramToString = function(param) { - if (param == undefined || param == null) { - return ''; - } - if (param instanceof Date) { - return param.toISOString(); - } - return param.toString(); - }; + var url = this.basePath + path; - /** - * Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values. - * NOTE: query parameters are not handled here. - * @param {String} path The path to append to the base URL. - * @param {Object} pathParams The parameter values to append. - * @returns {String} The encoded path with parameter values substituted. - */ - exports.prototype.buildUrl = function(path, pathParams) { - if (!path.match(/^\//)) { - path = '/' + path; - } - var url = this.basePath + path; - var _this = this; - url = url.replace(/\{([\w-]+)\}/g, function(fullMatch, key) { - var value; - if (pathParams.hasOwnProperty(key)) { - value = _this.paramToString(pathParams[key]); - } else { - value = fullMatch; - } - return encodeURIComponent(value); - }); - return url; - }; + // use API (operation, path) base path if defined + if (apiBasePath !== null && apiBasePath !== undefined) { + url = apiBasePath + path; + } - /** - * Checks whether the given content type represents JSON.
- * JSON content type examples:
- *
    - *
  • application/json
  • - *
  • application/json; charset=UTF8
  • - *
  • APPLICATION/JSON
  • - *
- * @param {String} contentType The MIME content type to check. - * @returns {Boolean} true if contentType represents JSON, otherwise false. - */ - exports.prototype.isJsonMime = function(contentType) { - return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i)); - }; + url = url.replace(/\{([\w-]+)\}/g, (fullMatch, key) => { + var value; + if (pathParams.hasOwnProperty(key)) { + value = this.paramToString(pathParams[key]); + } else { + value = fullMatch; + } - /** - * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first. - * @param {Array.} contentTypes - * @returns {String} The chosen content type, preferring JSON. - */ - exports.prototype.jsonPreferredMime = function(contentTypes) { - for (var i = 0; i < contentTypes.length; i++) { - if (this.isJsonMime(contentTypes[i])) { - return contentTypes[i]; - } - } - return contentTypes[0]; - }; + return encodeURIComponent(value); + }); - /** - * Checks whether the given parameter value represents file-like content. - * @param param The parameter to check. - * @returns {Boolean} true if param represents a file. - */ - exports.prototype.isFileParam = function(param) { - // fs.ReadStream in Node.js and Electron (but not in runtime like browserify) - if (typeof require === 'function') { - var fs; - try { - fs = require('fs'); - } catch (err) {} - if (fs && fs.ReadStream && param instanceof fs.ReadStream) { - return true; - } - } - // Buffer in Node.js - if (typeof Buffer === 'function' && param instanceof Buffer) { - return true; + return url; } - // Blob in browser - if (typeof Blob === 'function' && param instanceof Blob) { - return true; - } - // File in browser (it seems File object is also instance of Blob, but keep this for safe) - if (typeof File === 'function' && param instanceof File) { - return true; + + /** + * Checks whether the given content type represents JSON.
+ * JSON content type examples:
+ *
    + *
  • application/json
  • + *
  • application/json; charset=UTF8
  • + *
  • APPLICATION/JSON
  • + *
+ * @param {String} contentType The MIME content type to check. + * @returns {Boolean} true if contentType represents JSON, otherwise false. + */ + isJsonMime(contentType) { + return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i)); } - return false; - }; - /** - * Normalizes parameter values: - *
    - *
  • remove nils
  • - *
  • keep files and arrays
  • - *
  • format to string with `paramToString` for other cases
  • - *
- * @param {Object.} params The parameters as object properties. - * @returns {Object.} normalized parameters. - */ - exports.prototype.normalizeParams = function(params) { - var newParams = {}; - for (var key in params) { - if (params.hasOwnProperty(key) && params[key] != undefined && params[key] != null) { - var value = params[key]; - if (this.isFileParam(value) || Array.isArray(value)) { - newParams[key] = value; - } else { - newParams[key] = this.paramToString(value); + /** + * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first. + * @param {Array.} contentTypes + * @returns {String} The chosen content type, preferring JSON. + */ + jsonPreferredMime(contentTypes) { + for (var i = 0; i < contentTypes.length; i++) { + if (this.isJsonMime(contentTypes[i])) { + return contentTypes[i]; + } } - } + + return contentTypes[0]; } - return newParams; - }; - /** - * Enumeration of collection format separator strategies. - * @enum {String} - * @readonly - */ - exports.CollectionFormatEnum = { - /** - * Comma-separated values. Value: csv - * @const - */ - CSV: ',', - /** - * Space-separated values. Value: ssv - * @const - */ - SSV: ' ', /** - * Tab-separated values. Value: tsv - * @const - */ - TSV: '\t', - /** - * Pipe(|)-separated values. Value: pipes - * @const - */ - PIPES: '|', - /** - * Native array. Value: multi - * @const - */ - MULTI: 'multi' - }; + * Checks whether the given parameter value represents file-like content. + * @param param The parameter to check. + * @returns {Boolean} true if param represents a file. + */ + isFileParam(param) { + // fs.ReadStream in Node.js and Electron (but not in runtime like browserify) + if (typeof require === 'function') { + let fs; + try { + fs = require('fs'); + } catch (err) {} + if (fs && fs.ReadStream && param instanceof fs.ReadStream) { + return true; + } + } - /** - * Builds a string representation of an array-type actual parameter, according to the given collection format. - * @param {Array} param An array parameter. - * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. - * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns - * param as is if collectionFormat is multi. - */ - exports.prototype.buildCollectionParam = function buildCollectionParam(param, collectionFormat) { - if (param == null) { - return null; - } - switch (collectionFormat) { - case 'csv': - return param.map(this.paramToString).join(','); - case 'ssv': - return param.map(this.paramToString).join(' '); - case 'tsv': - return param.map(this.paramToString).join('\t'); - case 'pipes': - return param.map(this.paramToString).join('|'); - case 'multi': - // return the array directly as SuperAgent will handle it as expected - return param.map(this.paramToString); - default: - throw new Error('Unknown collection format: ' + collectionFormat); + // Buffer in Node.js + if (typeof Buffer === 'function' && param instanceof Buffer) { + return true; + } + + // Blob in browser + if (typeof Blob === 'function' && param instanceof Blob) { + return true; + } + + // File in browser (it seems File object is also instance of Blob, but keep this for safe) + if (typeof File === 'function' && param instanceof File) { + return true; + } + + return false; } - }; - /** - * Applies authentication headers to the request. - * @param {Object} request The request object created by a superagent() call. - * @param {Array.} authNames An array of authentication method names. - */ - exports.prototype.applyAuthToRequest = function(request, authNames) { - var _this = this; - authNames.forEach(function(authName) { - var auth = _this.authentications[authName]; - switch (auth.type) { - case 'basic': - if (auth.username || auth.password) { - request.auth(auth.username || '', auth.password || ''); - } - break; - case 'apiKey': - if (auth.apiKey) { - var data = {}; - if (auth.apiKeyPrefix) { - data[auth.name] = auth.apiKeyPrefix + ' ' + auth.apiKey; - } else { - data[auth.name] = auth.apiKey; - } - if (auth['in'] === 'header') { - request.set(data); - } else { - request.query(data); + /** + * Normalizes parameter values: + *
    + *
  • remove nils
  • + *
  • keep files and arrays
  • + *
  • format to string with `paramToString` for other cases
  • + *
+ * @param {Object.} params The parameters as object properties. + * @returns {Object.} normalized parameters. + */ + normalizeParams(params) { + var newParams = {}; + for (var key in params) { + if (params.hasOwnProperty(key) && params[key] != undefined && params[key] != null) { + var value = params[key]; + if (this.isFileParam(value) || Array.isArray(value)) { + newParams[key] = value; + } else { + newParams[key] = this.paramToString(value); + } } - } - break; - case 'oauth2': - if (auth.accessToken) { - request.set({'Authorization': 'Bearer ' + auth.accessToken}); - } - break; - default: - throw new Error('Unknown authentication type: ' + auth.type); - } - }); - }; + } - /** - * Deserializes an HTTP response body into a value of the specified type. - * @param {Object} response A SuperAgent response object. - * @param {(String|Array.|Object.|Function)} returnType The type to return. Pass a string for simple types - * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To - * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: - * all properties on data will be converted to this type. - * @returns A value of the specified type. - */ - exports.prototype.deserialize = function deserialize(response, returnType) { - if (response == null || returnType == null || response.status == 204) { - return null; - } - // Rely on SuperAgent for parsing response body. - // See http://visionmedia.github.io/superagent/#parsing-response-bodies - var data = response.body; - if (data == null || (typeof data === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length)) { - // SuperAgent does not always produce a body; use the unparsed response as a fallback - data = response.text; + return newParams; } - return exports.convertToType(data, returnType); - }; - /** - * Callback function to receive the result of the operation. - * @callback module:ApiClient~callApiCallback - * @param {String} error Error message, if any. - * @param data The data returned by the service call. - * @param {String} response The complete HTTP response. - */ - - /** - * Invokes the REST service using the supplied settings and parameters. - * @param {String} path The base URL to invoke. - * @param {String} httpMethod The HTTP method to use. - * @param {Object.} pathParams A map of path parameters and their values. - * @param {Object.} queryParams A map of query parameters and their values. - * @param {Object.} collectionQueryParams A map of collection query parameters and their values. - * @param {Object.} headerParams A map of header parameters and their values. - * @param {Object.} formParams A map of form parameters and their values. - * @param {Object} bodyParam The value to pass as the request body. - * @param {Array.} authNames An array of authentication type names. - * @param {Array.} contentTypes An array of request MIME types. - * @param {Array.} accepts An array of acceptable response MIME types. - * @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the - * constructor for a complex type. - * @param {module:ApiClient~callApiCallback} callback The callback function. - * @returns {Object} The SuperAgent request object. - */ - exports.prototype.callApi = function callApi(path, httpMethod, pathParams, - queryParams, collectionQueryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, - returnType, callback) { - - var _this = this; - var url = this.buildUrl(path, pathParams); - var request = superagent(httpMethod, url); - - // apply authentications - this.applyAuthToRequest(request, authNames); - - // set collection query parameters - for (var key in collectionQueryParams) { - if (collectionQueryParams.hasOwnProperty(key)) { - var param = collectionQueryParams[key]; - if (param.collectionFormat === 'csv') { - // SuperAgent normally percent-encodes all reserved characters in a query parameter. However, - // commas are used as delimiters for the 'csv' collectionFormat so they must not be encoded. We - // must therefore construct and encode 'csv' collection query parameters manually. - if (param.value != null) { - var value = param.value.map(this.paramToString).map(encodeURIComponent).join(','); - request.query(encodeURIComponent(key) + "=" + value); - } - } else { - // All other collection query parameters should be treated as ordinary query parameters. - queryParams[key] = this.buildCollectionParam(param.value, param.collectionFormat); + /** + * Builds a string representation of an array-type actual parameter, according to the given collection format. + * @param {Array} param An array parameter. + * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. + * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns + * param as is if collectionFormat is multi. + */ + buildCollectionParam(param, collectionFormat) { + if (param == null) { + return null; + } + switch (collectionFormat) { + case 'csv': + return param.map(this.paramToString).join(','); + case 'ssv': + return param.map(this.paramToString).join(' '); + case 'tsv': + return param.map(this.paramToString).join('\t'); + case 'pipes': + return param.map(this.paramToString).join('|'); + case 'multi': + //return the array directly as SuperAgent will handle it as expected + return param.map(this.paramToString); + default: + throw new Error('Unknown collection format: ' + collectionFormat); } - } } - // set query parameters - if (httpMethod.toUpperCase() === 'GET' && this.cache === false) { - queryParams['_'] = new Date().getTime(); + /** + * Applies authentication headers to the request. + * @param {Object} request The request object created by a superagent() call. + * @param {Array.} authNames An array of authentication method names. + */ + applyAuthToRequest(request, authNames) { + authNames.forEach((authName) => { + var auth = this.authentications[authName]; + switch (auth.type) { + case 'basic': + if (auth.username || auth.password) { + request.auth(auth.username || '', auth.password || ''); + } + + break; + case 'bearer': + if (auth.accessToken) { + request.set({'Authorization': 'Bearer ' + auth.accessToken}); + } + + break; + case 'apiKey': + if (auth.apiKey) { + var data = {}; + if (auth.apiKeyPrefix) { + data[auth.name] = auth.apiKeyPrefix + ' ' + auth.apiKey; + } else { + data[auth.name] = auth.apiKey; + } + + if (auth['in'] === 'header') { + request.set(data); + } else { + request.query(data); + } + } + + break; + case 'oauth2': + if (auth.accessToken) { + request.set({'Authorization': 'Bearer ' + auth.accessToken}); + } + + break; + default: + throw new Error('Unknown authentication type: ' + auth.type); + } + }); } - request.query(this.normalizeParams(queryParams)); - // set header parameters - request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); + /** + * Deserializes an HTTP response body into a value of the specified type. + * @param {Object} response A SuperAgent response object. + * @param {(String|Array.|Object.|Function)} returnType The type to return. Pass a string for simple types + * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To + * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: + * all properties on data will be converted to this type. + * @returns A value of the specified type. + */ + deserialize(response, returnType) { + if (response == null || returnType == null || response.status == 204) { + return null; + } + // Rely on SuperAgent for parsing response body. + // See http://visionmedia.github.io/superagent/#parsing-response-bodies + var data = response.body; + if (data == null || (typeof data === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length)) { + // SuperAgent does not always produce a body; use the unparsed response as a fallback + data = response.text; + } - // set requestAgent if it is set by user - if (this.requestAgent) { - request.agent(this.requestAgent); + return ApiClient.convertToType(data, returnType); } - // set request timeout - request.timeout(this.timeout); - - var contentType = this.jsonPreferredMime(contentTypes); - if (contentType) { - // Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746) - if(contentType != 'multipart/form-data') { - request.type(contentType); - } - } else if (!request.header['Content-Type']) { - request.type('application/json'); - } + /** + * Callback function to receive the result of the operation. + * @callback module:ApiClient~callApiCallback + * @param {String} error Error message, if any. + * @param data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Invokes the REST service using the supplied settings and parameters. + * @param {String} path The base URL to invoke. + * @param {String} httpMethod The HTTP method to use. + * @param {Object.} pathParams A map of path parameters and their values. + * @param {Object.} queryParams A map of query parameters and their values. + * @param {Object.} headerParams A map of header parameters and their values. + * @param {Object.} formParams A map of form parameters and their values. + * @param {Object} bodyParam The value to pass as the request body. + * @param {Array.} authNames An array of authentication type names. + * @param {Array.} contentTypes An array of request MIME types. + * @param {Array.} accepts An array of acceptable response MIME types. + * @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the + * constructor for a complex type. + * @param {String} apiBasePath base path defined in the operation/path level to override the default one + * @param {module:ApiClient~callApiCallback} callback The callback function. + * @returns {Object} The SuperAgent request object. + */ + callApi(path, httpMethod, pathParams, + queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, + returnType, apiBasePath, callback) { + + var url = this.buildUrl(path, pathParams, apiBasePath); + var request = superagent(httpMethod, url); + + if (this.plugins !== null) { + for (var index in this.plugins) { + if (this.plugins.hasOwnProperty(index)) { + request.use(this.plugins[index]) + } + } + } + + // apply authentications + this.applyAuthToRequest(request, authNames); - if (contentType === 'application/x-www-form-urlencoded') { - request.send(querystring.stringify(this.normalizeParams(formParams))); - } else if (contentType == 'multipart/form-data') { - var _formParams = this.normalizeParams(formParams); - for (var key in _formParams) { - if (_formParams.hasOwnProperty(key)) { - if (this.isFileParam(_formParams[key])) { - // file field - request.attach(key, _formParams[key]); - } else { - request.field(key, _formParams[key]); - } + // set query parameters + if (httpMethod.toUpperCase() === 'GET' && this.cache === false) { + queryParams['_'] = new Date().getTime(); } - } - } else if (bodyParam) { - request.send(bodyParam); - } - var accept = this.jsonPreferredMime(accepts); - if (accept) { - request.accept(accept); - } + request.query(this.normalizeParams(queryParams)); - if (returnType === 'Blob') { - request.responseType('blob'); - } else if (returnType === 'String') { - request.responseType('string'); - } + // set header parameters + request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); - // Attach previously saved cookies, if enabled - if (this.enableCookies){ - if (typeof window === 'undefined') { - this.agent.attachCookies(request); - } - else { - request.withCredentials(); - } - } + // set requestAgent if it is set by user + if (this.requestAgent) { + request.agent(this.requestAgent); + } + // set request timeout + request.timeout(this.timeout); - request.end(function(error, response) { - if (callback) { - var data = null; - if (!error) { - try { - data = _this.deserialize(response, returnType); - if (_this.enableCookies && typeof window === 'undefined'){ - _this.agent.saveCookies(response); + var contentType = this.jsonPreferredMime(contentTypes); + if (contentType) { + // Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746) + if(contentType != 'multipart/form-data') { + request.type(contentType); } - } catch (err) { - error = err; - } + } else if (!request.header['Content-Type']) { + request.type('application/json'); } - callback(error, data, response); - } - }); - return request; - }; + if (contentType === 'application/x-www-form-urlencoded') { + request.send(querystring.stringify(this.normalizeParams(formParams))); + } else if (contentType == 'multipart/form-data') { + var _formParams = this.normalizeParams(formParams); + for (var key in _formParams) { + if (_formParams.hasOwnProperty(key)) { + if (this.isFileParam(_formParams[key])) { + // file field + request.attach(key, _formParams[key]); + } else { + request.field(key, _formParams[key]); + } + } + } + } else if (bodyParam !== null && bodyParam !== undefined) { + request.send(bodyParam); + } - /** - * Parses a string representation of a date value. - * @param {String} str The date value as an ISO-8601 full-date or date-time string. - * @returns {Date} The parsed date object. - */ - exports.parseDate = function(str) { - // OpenAPI 2.0 & 3.0 specs state that: - // - date values are serialized as ISO-8601 full-date strings. - // - date-time values are serialized as ISO-8601 date-time strings, in which the timezone offset is mandatory. - return new Date(str); - }; + var accept = this.jsonPreferredMime(accepts); + if (accept) { + request.accept(accept); + } - /** - * Converts a value to the specified type. - * @param {(String|Object)} data The data to convert, as a string or object. - * @param {(String|Array.|Object.|Function)} type The type to return. Pass a string for simple types - * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To - * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: - * all properties on data will be converted to this type. - * @returns An instance of the specified type or null or undefined if data is null or undefined. - */ - exports.convertToType = function(data, type) { - if (data === null || data === undefined) - return data - - switch (type) { - case 'Boolean': - return Boolean(data); - case 'Integer': - return parseInt(data, 10); - case 'Number': - return parseFloat(data); - case 'String': - return String(data); - case 'Date': - return this.parseDate(String(data)); - case 'Blob': - return data; - default: - if (type === Object) { - // generic object, return directly - return data; - } else if (typeof type === 'function') { - // for model type like: User - return type.constructFromObject(data); - } else if (Array.isArray(type)) { - // for array type like: ['String'] - var itemType = type[0]; - return data.map(function(item) { - return exports.convertToType(item, itemType); - }); - } else if (typeof type === 'object') { - // for plain object type like: {'String': 'Integer'} - var keyType, valueType; - for (var k in type) { - if (type.hasOwnProperty(k)) { - keyType = k; - valueType = type[k]; - break; + if (returnType === 'Blob') { + request.responseType('blob'); + } else if (returnType === 'String') { + request.responseType('string'); + } + + // Attach previously saved cookies, if enabled + if (this.enableCookies){ + if (typeof window === 'undefined') { + this.agent._attachCookies(request); } - } - var result = {}; - for (var k in data) { - if (data.hasOwnProperty(k)) { - var key = exports.convertToType(k, keyType); - var value = exports.convertToType(data[k], valueType); - result[key] = value; + else { + request.withCredentials(); } - } - return result; - } else { - // for unknown type, return the data directly - return data; } + + request.end((error, response) => { + if (callback) { + var data = null; + if (!error) { + try { + data = this.deserialize(response, returnType); + if (this.enableCookies && typeof window === 'undefined'){ + this.agent._saveCookies(response); + } + } catch (err) { + error = err; + } + } + + callback(error, data, response); + } + }); + + return request; } - }; - /** - * Constructs a new map or array model from REST data. - * @param data {Object|Array} The REST data. - * @param obj {Object|Array} The target object or array. - */ - exports.constructFromObject = function(data, obj, itemType) { - if (Array.isArray(data)) { - for (var i = 0; i < data.length; i++) { - if (data.hasOwnProperty(i)) - obj[i] = exports.convertToType(data[i], itemType); - } - } else { - for (var k in data) { - if (data.hasOwnProperty(k)) - obj[k] = exports.convertToType(data[k], itemType); - } + /** + * Parses an ISO-8601 string representation of a date value. + * @param {String} str The date value as a string. + * @returns {Date} The parsed date object. + */ + static parseDate(str) { + return new Date(str); + } + + /** + * Converts a value to the specified type. + * @param {(String|Object)} data The data to convert, as a string or object. + * @param {(String|Array.|Object.|Function)} type The type to return. Pass a string for simple types + * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To + * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: + * all properties on data will be converted to this type. + * @returns An instance of the specified type or null or undefined if data is null or undefined. + */ + static convertToType(data, type) { + if (data === null || data === undefined) + return data + + switch (type) { + case 'Boolean': + return Boolean(data); + case 'Integer': + return parseInt(data, 10); + case 'Number': + return parseFloat(data); + case 'String': + return String(data); + case 'Date': + return ApiClient.parseDate(String(data)); + case 'Blob': + return data; + default: + if (type === Object) { + // generic object, return directly + return data; + } else if (typeof type.constructFromObject === 'function') { + // for model type like User and enum class + return type.constructFromObject(data); + } else if (Array.isArray(type)) { + // for array type like: ['String'] + var itemType = type[0]; + + return data.map((item) => { + return ApiClient.convertToType(item, itemType); + }); + } else if (typeof type === 'object') { + // for plain object type like: {'String': 'Integer'} + var keyType, valueType; + for (var k in type) { + if (type.hasOwnProperty(k)) { + keyType = k; + valueType = type[k]; + break; + } + } + + var result = {}; + for (var k in data) { + if (data.hasOwnProperty(k)) { + var key = ApiClient.convertToType(k, keyType); + var value = ApiClient.convertToType(data[k], valueType); + result[key] = value; + } + } + + return result; + } else { + // for unknown type, return the data directly + return data; + } + } } - }; /** - * The default API client implementation. - * @type {module:ApiClient} - */ - exports.instance = new exports(); + * Gets an array of host settings + * @returns An array of host settings + */ + hostSettings() { + return [ + { + 'url': "https://api.dyspatch.io", + 'description': "No description provided", + } + ]; + } + + getBasePathFromSettings(index, variables={}) { + var servers = this.hostSettings(); + + // check array index out of bound + if (index < 0 || index >= servers.length) { + throw new Error("Invalid index " + index + " when selecting the host settings. Must be less than " + servers.length); + } + + var server = servers[index]; + var url = server['url']; + + // go through variable and assign a value + for (var variable_name in server['variables']) { + if (variable_name in variables) { + let variable = server['variables'][variable_name]; + if ( !('enum_values' in variable) || variable['enum_values'].includes(variables[variable_name]) ) { + url = url.replace("{" + variable_name + "}", variables[variable_name]); + } else { + throw new Error("The variable `" + variable_name + "` in the host URL has invalid value " + variables[variable_name] + ". Must be " + server['variables'][variable_name]['enum_values'] + "."); + } + } else { + // use default value + url = url.replace("{" + variable_name + "}", server['variables'][variable_name]['default_value']) + } + } + return url; + } + + /** + * Constructs a new map or array model from REST data. + * @param data {Object|Array} The REST data. + * @param obj {Object|Array} The target object or array. + */ + static constructFromObject(data, obj, itemType) { + if (Array.isArray(data)) { + for (var i = 0; i < data.length; i++) { + if (data.hasOwnProperty(i)) + obj[i] = ApiClient.convertToType(data[i], itemType); + } + } else { + for (var k in data) { + if (data.hasOwnProperty(k)) + obj[k] = ApiClient.convertToType(data[k], itemType); + } + } + }; +} - return exports; -})); +/** + * Enumeration of collection format separator strategies. + * @enum {String} + * @readonly + */ +ApiClient.CollectionFormatEnum = { + /** + * Comma-separated values. Value: csv + * @const + */ + CSV: ',', + + /** + * Space-separated values. Value: ssv + * @const + */ + SSV: ' ', + + /** + * Tab-separated values. Value: tsv + * @const + */ + TSV: '\t', + + /** + * Pipe(|)-separated values. Value: pipes + * @const + */ + PIPES: '|', + + /** + * Native array. Value: multi + * @const + */ + MULTI: 'multi' +}; + +/** +* The default API client implementation. +* @type {module:ApiClient} +*/ +ApiClient.instance = new ApiClient(); +export default ApiClient; diff --git a/src/dyspatch-client/APIError.js b/src/dyspatch-client/APIError.js index 16aa540..431ddc1 100644 --- a/src/dyspatch-client/APIError.js +++ b/src/dyspatch-client/APIError.js @@ -1,144 +1,154 @@ -/* +/** * Dyspatch API - * # Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) * - * OpenAPI spec version: 2019.10 + * The version of the OpenAPI document: 2019.10 * Contact: support@dyspatch.io * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.4.10 - * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient')); - } else { - // Browser globals (root is window) - if (!root.DyspatchClient) { - root.DyspatchClient = {}; +import ApiClient from '../ApiClient'; + +/** + * The APIError model module. + * @module dyspatch-client/APIError + * @version 4.0.0 + */ +class APIError { + /** + * Constructs a new APIError. + * possible errors from the api + * @alias module:dyspatch-client/APIError + */ + constructor() { + + APIError.initialize(this); } - root.DyspatchClient.APIError = factory(root.DyspatchClient.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; - - /** - * The APIError model module. - * @module dyspatch-client/APIError - * @version 3.0.1 - */ - - /** - * Constructs a new APIError. - * @alias module:dyspatch-client/APIError - * @class - */ - var exports = function() { - }; - - /** - * Constructs a APIError from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:dyspatch-client/APIError} obj Optional instance to populate. - * @return {module:dyspatch-client/APIError} The populated APIError instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - if (data.hasOwnProperty('code')) - obj.code = ApiClient.convertToType(data['code'], 'String'); - if (data.hasOwnProperty('message')) - obj.message = ApiClient.convertToType(data['message'], 'String'); - if (data.hasOwnProperty('parameter')) - obj.parameter = ApiClient.convertToType(data['parameter'], 'String'); + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { } - return obj; - } - - /** - * Error code: * server_error - Internal server error. * invalid_parameter - Validation error, parameter will contain invalid field and message will contain the reason. * invalid_body - Body could not be parsed, message will contain the reason. * invalid_request - Validation error, the protocol used to make the request was not https. * unauthorized - Credentials were found but permissions were not sufficient. * unauthenticated - Credentials were not found or were not valid. * not_found - The requested resource was not found. * rate_limited - The request was refused because a rate limit was exceeded. There is an account wide rate limit of 3600 requests per-minute, although that is subject to change. The current remaining rate limit can be viewed by checking the X-Ratelimit-Remaining header. - * @member {module:dyspatch-client/APIError.CodeEnum} code - */ - exports.prototype.code = undefined; - - /** - * Human readable error message - * @member {String} message - */ - exports.prototype.message = undefined; - - /** - * The invalid parameter, if 'code' is invalid_parameter - * @member {String} parameter - */ - exports.prototype.parameter = undefined; - - - /** - * Allowed values for the code property. - * @enum {String} - * @readonly - */ - exports.CodeEnum = { + + /** + * Constructs a APIError from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:dyspatch-client/APIError} obj Optional instance to populate. + * @return {module:dyspatch-client/APIError} The populated APIError instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new APIError(); + + if (data.hasOwnProperty('code')) { + obj['code'] = ApiClient.convertToType(data['code'], 'String'); + } + if (data.hasOwnProperty('message')) { + obj['message'] = ApiClient.convertToType(data['message'], 'String'); + } + if (data.hasOwnProperty('parameter')) { + obj['parameter'] = ApiClient.convertToType(data['parameter'], 'String'); + } + } + return obj; + } + + +} + +/** + * Error code: * server_error - Internal server error. * invalid_parameter - Validation error, parameter will contain invalid field and message will contain the reason. * invalid_body - Body could not be parsed, message will contain the reason. * invalid_request - Validation error, the protocol used to make the request was not https. * unauthorized - Credentials were found but permissions were not sufficient. * unauthenticated - Credentials were not found or were not valid. * not_found - The requested resource was not found. * rate_limited - The request was refused because a rate limit was exceeded. There is an account wide rate limit of 3600 requests per-minute, although that is subject to change. The current remaining rate limit can be viewed by checking the X-Ratelimit-Remaining header. * prohibited_action - The request was refused because an action was not valid for the requested resource. Typically this will happen if you try to make changes to a locked resource. + * @member {module:dyspatch-client/APIError.CodeEnum} code + */ +APIError.prototype['code'] = undefined; + +/** + * Human readable error message + * @member {String} message + */ +APIError.prototype['message'] = undefined; + +/** + * The invalid parameter, if 'code' is invalid_parameter + * @member {String} parameter + */ +APIError.prototype['parameter'] = undefined; + + + + + +/** + * Allowed values for the code property. + * @enum {String} + * @readonly + */ +APIError['CodeEnum'] = { + /** * value: "server_error" * @const */ - serverError: "server_error", + "server_error": "server_error", /** * value: "invalid_parameter" * @const */ - invalidParameter: "invalid_parameter", + "invalid_parameter": "invalid_parameter", /** * value: "invalid_body" * @const */ - invalidBody: "invalid_body", + "invalid_body": "invalid_body", /** * value: "invalid_request" * @const */ - invalidRequest: "invalid_request", + "invalid_request": "invalid_request", /** * value: "unauthorized" * @const */ - unauthorized: "unauthorized", + "unauthorized": "unauthorized", /** * value: "unauthenticated" * @const */ - unauthenticated: "unauthenticated", + "unauthenticated": "unauthenticated", /** * value: "not_found" * @const */ - notFound: "not_found", + "not_found": "not_found", /** * value: "rate_limited" * @const */ - rateLimited: "rate_limited" - }; + "rate_limited": "rate_limited", + + /** + * value: "prohibited_action" + * @const + */ + "prohibited_action": "prohibited_action" +}; + + - return exports; +export default APIError; -})); diff --git a/src/dyspatch-client/CompiledRead.js b/src/dyspatch-client/CompiledRead.js index 973311d..5b194af 100644 --- a/src/dyspatch-client/CompiledRead.js +++ b/src/dyspatch-client/CompiledRead.js @@ -1,104 +1,109 @@ -/* +/** * Dyspatch API - * # Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) * - * OpenAPI spec version: 2019.10 + * The version of the OpenAPI document: 2019.10 * Contact: support@dyspatch.io * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.4.10 - * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient')); - } else { - // Browser globals (root is window) - if (!root.DyspatchClient) { - root.DyspatchClient = {}; +import ApiClient from '../ApiClient'; + +/** + * The CompiledRead model module. + * @module dyspatch-client/CompiledRead + * @version 4.0.0 + */ +class CompiledRead { + /** + * Constructs a new CompiledRead. + * revision data + * @alias module:dyspatch-client/CompiledRead + */ + constructor() { + + CompiledRead.initialize(this); } - root.DyspatchClient.CompiledRead = factory(root.DyspatchClient.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; - - /** - * The CompiledRead model module. - * @module dyspatch-client/CompiledRead - * @version 3.0.1 - */ - - /** - * Constructs a new CompiledRead. - * @alias module:dyspatch-client/CompiledRead - * @class - */ - var exports = function() { - }; - - /** - * Constructs a CompiledRead from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:dyspatch-client/CompiledRead} obj Optional instance to populate. - * @return {module:dyspatch-client/CompiledRead} The populated CompiledRead instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - if (data.hasOwnProperty('sender')) - obj.sender = ApiClient.convertToType(data['sender'], 'String'); - if (data.hasOwnProperty('replyTo')) - obj.replyTo = ApiClient.convertToType(data['replyTo'], 'String'); - if (data.hasOwnProperty('subject')) - obj.subject = ApiClient.convertToType(data['subject'], 'Blob'); - if (data.hasOwnProperty('html')) - obj.html = ApiClient.convertToType(data['html'], 'Blob'); - if (data.hasOwnProperty('text')) - obj.text = ApiClient.convertToType(data['text'], 'Blob'); + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a CompiledRead from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:dyspatch-client/CompiledRead} obj Optional instance to populate. + * @return {module:dyspatch-client/CompiledRead} The populated CompiledRead instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new CompiledRead(); + + if (data.hasOwnProperty('sender')) { + obj['sender'] = ApiClient.convertToType(data['sender'], 'String'); + } + if (data.hasOwnProperty('replyTo')) { + obj['replyTo'] = ApiClient.convertToType(data['replyTo'], 'String'); + } + if (data.hasOwnProperty('subject')) { + obj['subject'] = ApiClient.convertToType(data['subject'], 'Blob'); + } + if (data.hasOwnProperty('html')) { + obj['html'] = ApiClient.convertToType(data['html'], 'Blob'); + } + if (data.hasOwnProperty('text')) { + obj['text'] = ApiClient.convertToType(data['text'], 'Blob'); + } + } + return obj; } - return obj; - } - - /** - * Sender address - * @member {String} sender - */ - exports.prototype.sender = undefined; - - /** - * Reply-To address - * @member {String} replyTo - */ - exports.prototype.replyTo = undefined; - - /** - * Base64 encoded template subject line - * @member {Blob} subject - */ - exports.prototype.subject = undefined; - - /** - * Base64 encoded template HTML body - * @member {Blob} html - */ - exports.prototype.html = undefined; - - /** - * Base64 encoded template text body - * @member {Blob} text - */ - exports.prototype.text = undefined; - - return exports; - -})); + + +} + +/** + * Sender address + * @member {String} sender + */ +CompiledRead.prototype['sender'] = undefined; + +/** + * Reply-To address + * @member {String} replyTo + */ +CompiledRead.prototype['replyTo'] = undefined; + +/** + * Base64 encoded template subject line + * @member {Blob} subject + */ +CompiledRead.prototype['subject'] = undefined; + +/** + * Base64 encoded template HTML body + * @member {Blob} html + */ +CompiledRead.prototype['html'] = undefined; + +/** + * Base64 encoded template text body + * @member {Blob} text + */ +CompiledRead.prototype['text'] = undefined; + + + + + + +export default CompiledRead; + diff --git a/src/dyspatch-client/Cursor.js b/src/dyspatch-client/Cursor.js index 9543969..fa12462 100644 --- a/src/dyspatch-client/Cursor.js +++ b/src/dyspatch-client/Cursor.js @@ -1,81 +1,82 @@ -/* +/** * Dyspatch API - * # Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) * - * OpenAPI spec version: 2019.10 + * The version of the OpenAPI document: 2019.10 * Contact: support@dyspatch.io * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.4.10 - * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient')); - } else { - // Browser globals (root is window) - if (!root.DyspatchClient) { - root.DyspatchClient = {}; +import ApiClient from '../ApiClient'; + +/** + * The Cursor model module. + * @module dyspatch-client/Cursor + * @version 4.0.0 + */ +class Cursor { + /** + * Constructs a new Cursor. + * Information about paginated results + * @alias module:dyspatch-client/Cursor + */ + constructor() { + + Cursor.initialize(this); } - root.DyspatchClient.Cursor = factory(root.DyspatchClient.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; - - /** - * The Cursor model module. - * @module dyspatch-client/Cursor - * @version 3.0.1 - */ - - /** - * Constructs a new Cursor. - * Information about paginated results - * @alias module:dyspatch-client/Cursor - * @class - */ - var exports = function() { - }; - - /** - * Constructs a Cursor from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:dyspatch-client/Cursor} obj Optional instance to populate. - * @return {module:dyspatch-client/Cursor} The populated Cursor instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - if (data.hasOwnProperty('next')) - obj.next = ApiClient.convertToType(data['next'], 'String'); - if (data.hasOwnProperty('hasMore')) - obj.hasMore = ApiClient.convertToType(data['hasMore'], 'Boolean'); + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { } - return obj; - } - /** - * A cursor to fetch the next page of results - * @member {String} next - */ - exports.prototype.next = undefined; + /** + * Constructs a Cursor from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:dyspatch-client/Cursor} obj Optional instance to populate. + * @return {module:dyspatch-client/Cursor} The populated Cursor instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new Cursor(); + + if (data.hasOwnProperty('next')) { + obj['next'] = ApiClient.convertToType(data['next'], 'String'); + } + if (data.hasOwnProperty('hasMore')) { + obj['hasMore'] = ApiClient.convertToType(data['hasMore'], 'Boolean'); + } + } + return obj; + } + + +} + +/** + * A cursor to fetch the next page of results + * @member {String} next + */ +Cursor.prototype['next'] = undefined; + +/** + * Whether there is a next page of results + * @member {Boolean} hasMore + */ +Cursor.prototype['hasMore'] = undefined; + + + + - /** - * Whether there is a next page of results - * @member {Boolean} hasMore - */ - exports.prototype.hasMore = undefined; - return exports; +export default Cursor; -})); diff --git a/src/dyspatch-client/DraftMetaRead.js b/src/dyspatch-client/DraftMetaRead.js index 81521b2..a332cf2 100644 --- a/src/dyspatch-client/DraftMetaRead.js +++ b/src/dyspatch-client/DraftMetaRead.js @@ -1,120 +1,127 @@ -/* +/** * Dyspatch API - * # Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) * - * OpenAPI spec version: 2019.10 + * The version of the OpenAPI document: 2019.10 * Contact: support@dyspatch.io * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.4.10 - * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient')); - } else { - // Browser globals (root is window) - if (!root.DyspatchClient) { - root.DyspatchClient = {}; +import ApiClient from '../ApiClient'; + +/** + * The DraftMetaRead model module. + * @module dyspatch-client/DraftMetaRead + * @version 4.0.0 + */ +class DraftMetaRead { + /** + * Constructs a new DraftMetaRead. + * draft metadata + * @alias module:dyspatch-client/DraftMetaRead + */ + constructor() { + + DraftMetaRead.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { } - root.DyspatchClient.DraftMetaRead = factory(root.DyspatchClient.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; - - /** - * The DraftMetaRead model module. - * @module dyspatch-client/DraftMetaRead - * @version 3.0.1 - */ - - /** - * Constructs a new DraftMetaRead. - * @alias module:dyspatch-client/DraftMetaRead - * @class - */ - var exports = function() { - }; - - /** - * Constructs a DraftMetaRead from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:dyspatch-client/DraftMetaRead} obj Optional instance to populate. - * @return {module:dyspatch-client/DraftMetaRead} The populated DraftMetaRead instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - if (data.hasOwnProperty('id')) - obj.id = ApiClient.convertToType(data['id'], 'String'); - if (data.hasOwnProperty('templateId')) - obj.templateId = ApiClient.convertToType(data['templateId'], 'String'); - if (data.hasOwnProperty('name')) - obj.name = ApiClient.convertToType(data['name'], 'String'); - if (data.hasOwnProperty('description')) - obj.description = ApiClient.convertToType(data['description'], 'String'); - if (data.hasOwnProperty('url')) - obj.url = ApiClient.convertToType(data['url'], 'String'); - if (data.hasOwnProperty('createdAt')) - obj.createdAt = ApiClient.convertToType(data['createdAt'], 'Date'); - if (data.hasOwnProperty('updatedAt')) - obj.updatedAt = ApiClient.convertToType(data['updatedAt'], 'Date'); + + /** + * Constructs a DraftMetaRead from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:dyspatch-client/DraftMetaRead} obj Optional instance to populate. + * @return {module:dyspatch-client/DraftMetaRead} The populated DraftMetaRead instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new DraftMetaRead(); + + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'String'); + } + if (data.hasOwnProperty('templateId')) { + obj['templateId'] = ApiClient.convertToType(data['templateId'], 'String'); + } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + if (data.hasOwnProperty('description')) { + obj['description'] = ApiClient.convertToType(data['description'], 'String'); + } + if (data.hasOwnProperty('url')) { + obj['url'] = ApiClient.convertToType(data['url'], 'String'); + } + if (data.hasOwnProperty('createdAt')) { + obj['createdAt'] = ApiClient.convertToType(data['createdAt'], 'Date'); + } + if (data.hasOwnProperty('updatedAt')) { + obj['updatedAt'] = ApiClient.convertToType(data['updatedAt'], 'Date'); + } + } + return obj; } - return obj; - } - - /** - * An opaque, unique identifier for a draft - * @member {String} id - */ - exports.prototype.id = undefined; - - /** - * An opaque, unique identifier for a template - * @member {String} templateId - */ - exports.prototype.templateId = undefined; - - /** - * The name of a draft - * @member {String} name - */ - exports.prototype.name = undefined; - - /** - * A description of the draft - * @member {String} description - */ - exports.prototype.description = undefined; - - /** - * The API url for a specific draft - * @member {String} url - */ - exports.prototype.url = undefined; - - /** - * The time of initial creation - * @member {Date} createdAt - */ - exports.prototype.createdAt = undefined; - - /** - * The time of last update - * @member {Date} updatedAt - */ - exports.prototype.updatedAt = undefined; - - return exports; - -})); + + +} + +/** + * An opaque, unique identifier for a draft + * @member {String} id + */ +DraftMetaRead.prototype['id'] = undefined; + +/** + * An opaque, unique identifier for a template + * @member {String} templateId + */ +DraftMetaRead.prototype['templateId'] = undefined; + +/** + * The name of a draft + * @member {String} name + */ +DraftMetaRead.prototype['name'] = undefined; + +/** + * A description of the draft + * @member {String} description + */ +DraftMetaRead.prototype['description'] = undefined; + +/** + * The API url for a specific draft + * @member {String} url + */ +DraftMetaRead.prototype['url'] = undefined; + +/** + * The time of initial creation + * @member {Date} createdAt + */ +DraftMetaRead.prototype['createdAt'] = undefined; + +/** + * The time of last update + * @member {Date} updatedAt + */ +DraftMetaRead.prototype['updatedAt'] = undefined; + + + + + + +export default DraftMetaRead; + diff --git a/src/dyspatch-client/DraftRead.js b/src/dyspatch-client/DraftRead.js index 07fce03..9b4d274 100644 --- a/src/dyspatch-client/DraftRead.js +++ b/src/dyspatch-client/DraftRead.js @@ -1,127 +1,137 @@ -/* +/** * Dyspatch API - * # Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) * - * OpenAPI spec version: 2019.10 + * The version of the OpenAPI document: 2019.10 * Contact: support@dyspatch.io * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.4.10 - * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'dyspatch-client/CompiledRead', 'dyspatch-client/LocalizationMetaRead'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('./CompiledRead'), require('./LocalizationMetaRead')); - } else { - // Browser globals (root is window) - if (!root.DyspatchClient) { - root.DyspatchClient = {}; +import ApiClient from '../ApiClient'; +import CompiledRead from './CompiledRead'; +import LocalizationMetaRead from './LocalizationMetaRead'; + +/** + * The DraftRead model module. + * @module dyspatch-client/DraftRead + * @version 4.0.0 + */ +class DraftRead { + /** + * Constructs a new DraftRead. + * template draft metadata included latest draft revision + * @alias module:dyspatch-client/DraftRead + */ + constructor() { + + DraftRead.initialize(this); } - root.DyspatchClient.DraftRead = factory(root.DyspatchClient.ApiClient, root.DyspatchClient.CompiledRead, root.DyspatchClient.LocalizationMetaRead); - } -}(this, function(ApiClient, CompiledRead, LocalizationMetaRead) { - 'use strict'; - - /** - * The DraftRead model module. - * @module dyspatch-client/DraftRead - * @version 3.0.1 - */ - - /** - * Constructs a new DraftRead. - * @alias module:dyspatch-client/DraftRead - * @class - */ - var exports = function() { - }; - - /** - * Constructs a DraftRead from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:dyspatch-client/DraftRead} obj Optional instance to populate. - * @return {module:dyspatch-client/DraftRead} The populated DraftRead instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - if (data.hasOwnProperty('id')) - obj.id = ApiClient.convertToType(data['id'], 'String'); - if (data.hasOwnProperty('template')) - obj.template = ApiClient.convertToType(data['template'], 'String'); - if (data.hasOwnProperty('name')) - obj.name = ApiClient.convertToType(data['name'], 'String'); - if (data.hasOwnProperty('url')) - obj.url = ApiClient.convertToType(data['url'], 'String'); - if (data.hasOwnProperty('compiled')) - obj.compiled = CompiledRead.constructFromObject(data['compiled']); - if (data.hasOwnProperty('createdAt')) - obj.createdAt = ApiClient.convertToType(data['createdAt'], 'Date'); - if (data.hasOwnProperty('updatedAt')) - obj.updatedAt = ApiClient.convertToType(data['updatedAt'], 'Date'); - if (data.hasOwnProperty('localizations')) - obj.localizations = ApiClient.convertToType(data['localizations'], [LocalizationMetaRead]); + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { } - return obj; - } - - /** - * An opaque, unique identifier for a draft - * @member {String} id - */ - exports.prototype.id = undefined; - - /** - * An opaque, unique identifier for a template - * @member {String} template - */ - exports.prototype.template = undefined; - - /** - * The name of a draft - * @member {String} name - */ - exports.prototype.name = undefined; - - /** - * The API url for a specific draft - * @member {String} url - */ - exports.prototype.url = undefined; - - /** - * @member {module:dyspatch-client/CompiledRead} compiled - */ - exports.prototype.compiled = undefined; - - /** - * The time of initial creation - * @member {Date} createdAt - */ - exports.prototype.createdAt = undefined; - - /** - * The time of last update - * @member {Date} updatedAt - */ - exports.prototype.updatedAt = undefined; - - /** - * A list of the Template's available localizations - * @member {Array.} localizations - */ - exports.prototype.localizations = undefined; - - return exports; - -})); + + /** + * Constructs a DraftRead from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:dyspatch-client/DraftRead} obj Optional instance to populate. + * @return {module:dyspatch-client/DraftRead} The populated DraftRead instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new DraftRead(); + + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'String'); + } + if (data.hasOwnProperty('template')) { + obj['template'] = ApiClient.convertToType(data['template'], 'String'); + } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + if (data.hasOwnProperty('url')) { + obj['url'] = ApiClient.convertToType(data['url'], 'String'); + } + if (data.hasOwnProperty('compiled')) { + obj['compiled'] = CompiledRead.constructFromObject(data['compiled']); + } + if (data.hasOwnProperty('createdAt')) { + obj['createdAt'] = ApiClient.convertToType(data['createdAt'], 'Date'); + } + if (data.hasOwnProperty('updatedAt')) { + obj['updatedAt'] = ApiClient.convertToType(data['updatedAt'], 'Date'); + } + if (data.hasOwnProperty('localizations')) { + obj['localizations'] = ApiClient.convertToType(data['localizations'], [LocalizationMetaRead]); + } + } + return obj; + } + + +} + +/** + * An opaque, unique identifier for a draft + * @member {String} id + */ +DraftRead.prototype['id'] = undefined; + +/** + * An opaque, unique identifier for a template + * @member {String} template + */ +DraftRead.prototype['template'] = undefined; + +/** + * The name of a draft + * @member {String} name + */ +DraftRead.prototype['name'] = undefined; + +/** + * The API url for a specific draft + * @member {String} url + */ +DraftRead.prototype['url'] = undefined; + +/** + * @member {module:dyspatch-client/CompiledRead} compiled + */ +DraftRead.prototype['compiled'] = undefined; + +/** + * The time of initial creation + * @member {Date} createdAt + */ +DraftRead.prototype['createdAt'] = undefined; + +/** + * The time of last update + * @member {Date} updatedAt + */ +DraftRead.prototype['updatedAt'] = undefined; + +/** + * A list of the Template's available localizations + * @member {Array.} localizations + */ +DraftRead.prototype['localizations'] = undefined; + + + + + + +export default DraftRead; + diff --git a/src/dyspatch-client/DraftsApi.js b/src/dyspatch-client/DraftsApi.js index 8b8cdd2..545edc0 100644 --- a/src/dyspatch-client/DraftsApi.js +++ b/src/dyspatch-client/DraftsApi.js @@ -1,56 +1,101 @@ -/* +/** * Dyspatch API - * # Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) * - * OpenAPI spec version: 2019.10 + * The version of the OpenAPI document: 2019.10 * Contact: support@dyspatch.io * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.4.10 - * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'dyspatch-client/APIError', 'dyspatch-client/Body', 'dyspatch-client/DraftRead', 'dyspatch-client/DraftsRead', 'dyspatch-client/LocalizationKeyRead', 'dyspatch-client/LocalizationMetaRead'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('../dyspatch-client/APIError'), require('../dyspatch-client/Body'), require('../dyspatch-client/DraftRead'), require('../dyspatch-client/DraftsRead'), require('../dyspatch-client/LocalizationKeyRead'), require('../dyspatch-client/LocalizationMetaRead')); - } else { - // Browser globals (root is window) - if (!root.DyspatchClient) { - root.DyspatchClient = {}; + +import ApiClient from "../ApiClient"; +import APIError from '../dyspatch-client/APIError'; +import DraftRead from '../dyspatch-client/DraftRead'; +import DraftsRead from '../dyspatch-client/DraftsRead'; +import InlineObject from '../dyspatch-client/InlineObject'; +import LocalizationKeyRead from '../dyspatch-client/LocalizationKeyRead'; +import LocalizationMetaRead from '../dyspatch-client/LocalizationMetaRead'; + +/** +* Drafts service. +* @module dyspatch-client/DraftsApi +* @version 4.0.0 +*/ +export default class DraftsApi { + + /** + * Constructs a new DraftsApi. + * @alias module:dyspatch-client/DraftsApi + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; } - root.DyspatchClient.DraftsApi = factory(root.DyspatchClient.ApiClient, root.DyspatchClient.APIError, root.DyspatchClient.Body, root.DyspatchClient.DraftRead, root.DyspatchClient.DraftsRead, root.DyspatchClient.LocalizationKeyRead, root.DyspatchClient.LocalizationMetaRead); - } -}(this, function(ApiClient, APIError, Body, DraftRead, DraftsRead, LocalizationKeyRead, LocalizationMetaRead) { - 'use strict'; - - /** - * Drafts service. - * @module dyspatch-client/DraftsApi - * @version 3.0.1 - */ - - /** - * Constructs a new DraftsApi. - * @alias module:dyspatch-client/DraftsApi - * @class - * @param {module:ApiClient} [apiClient] Optional API client implementation to use, - * default to {@link module:ApiClient#instance} if unspecified. - */ - var exports = function(apiClient) { - this.apiClient = apiClient || ApiClient.instance; /** - * Callback function to receive the result of the draftsDraftIdGet operation. - * @callback module:dyspatch-client/DraftsApi~draftsDraftIdGetCallback + * Callback function to receive the result of the deleteLocalization operation. + * @callback module:dyspatch-client/DraftsApi~deleteLocalizationCallback + * @param {String} error Error message, if any. + * @param data This operation does not return a value. + * @param {String} response The complete HTTP response. + */ + + /** + * Remove a localization + * Deletes the localization with the given language ID if it exists + * @param {String} draftId A draft ID + * @param {String} languageId A language ID (eg: en-US) + * @param {String} accept A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" + * @param {module:dyspatch-client/DraftsApi~deleteLocalizationCallback} callback The callback function, accepting three arguments: error, data, response + */ + deleteLocalization(draftId, languageId, accept, callback) { + let postBody = null; + // verify the required parameter 'draftId' is set + if (draftId === undefined || draftId === null) { + throw new Error("Missing the required parameter 'draftId' when calling deleteLocalization"); + } + // verify the required parameter 'languageId' is set + if (languageId === undefined || languageId === null) { + throw new Error("Missing the required parameter 'languageId' when calling deleteLocalization"); + } + // verify the required parameter 'accept' is set + if (accept === undefined || accept === null) { + throw new Error("Missing the required parameter 'accept' when calling deleteLocalization"); + } + + let pathParams = { + 'draftId': draftId, + 'languageId': languageId + }; + let queryParams = { + }; + let headerParams = { + 'Accept': accept + }; + let formParams = { + }; + + let authNames = ['Bearer']; + let contentTypes = []; + let accepts = []; + let returnType = null; + return this.apiClient.callApi( + '/drafts/{draftId}/localizations/{languageId}', 'DELETE', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the getDraftById operation. + * @callback module:dyspatch-client/DraftsApi~getDraftByIdCallback * @param {String} error Error message, if any. * @param {module:dyspatch-client/DraftRead} data The data returned by the service call. * @param {String} response The complete HTTP response. @@ -58,419 +103,363 @@ /** * Get Draft by ID - * Gets a draft object with the matching ID. The \"compiled\" field will contain the unlocalized default template object. + * Gets a draft object with the matching ID. The \"compiled\" field will contain the template in the default, unlocalized form. * @param {String} draftId A draft ID * @param {module:dyspatch-client/String} targetLanguage The type of templating language to compile as. Should only be used for visual templates. - * @param {module:dyspatch-client/DraftsApi~draftsDraftIdGetCallback} callback The callback function, accepting three arguments: error, data, response + * @param {String} accept A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" + * @param {module:dyspatch-client/DraftsApi~getDraftByIdCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:dyspatch-client/DraftRead} */ - this.draftsDraftIdGet = function(draftId, targetLanguage, callback) { - var postBody = null; - + getDraftById(draftId, targetLanguage, accept, callback) { + let postBody = null; // verify the required parameter 'draftId' is set if (draftId === undefined || draftId === null) { - throw new Error("Missing the required parameter 'draftId' when calling draftsDraftIdGet"); + throw new Error("Missing the required parameter 'draftId' when calling getDraftById"); } - // verify the required parameter 'targetLanguage' is set if (targetLanguage === undefined || targetLanguage === null) { - throw new Error("Missing the required parameter 'targetLanguage' when calling draftsDraftIdGet"); + throw new Error("Missing the required parameter 'targetLanguage' when calling getDraftById"); + } + // verify the required parameter 'accept' is set + if (accept === undefined || accept === null) { + throw new Error("Missing the required parameter 'accept' when calling getDraftById"); } - - var pathParams = { + let pathParams = { 'draftId': draftId }; - var queryParams = { - 'targetLanguage': targetLanguage, + let queryParams = { + 'targetLanguage': targetLanguage }; - var collectionQueryParams = { + let headerParams = { + 'Accept': accept }; - var headerParams = { + let formParams = { }; - var formParams = { - }; - - var authNames = ['Bearer']; - var contentTypes = []; - var accepts = ['application/vnd.dyspatch.2019.10+json']; - var returnType = DraftRead; + let authNames = ['Bearer']; + let contentTypes = []; + let accepts = ['application/vnd.dyspatch.2019.10+json', '*/*']; + let returnType = DraftRead; return this.apiClient.callApi( '/drafts/{draftId}', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, - authNames, contentTypes, accepts, returnType, callback + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback ); } /** - * Callback function to receive the result of the draftsDraftIdLocalizationKeysGet operation. - * @callback module:dyspatch-client/DraftsApi~draftsDraftIdLocalizationKeysGetCallback + * Callback function to receive the result of the getDraftLocalizationKeys operation. + * @callback module:dyspatch-client/DraftsApi~getDraftLocalizationKeysCallback * @param {String} error Error message, if any. * @param {Array.} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** - * Get Localization Keys + * Get localization keys * Returns the list of values that need to be translated for the draft. Set the `Accept` header to `application/vnd.dyspatch.2019.10+json` to get a JSON object, or `text/vnd.dyspatch.2019.10+x-gettext-translation` to get the POT file. * @param {String} draftId A draft ID - * @param {Object} opts Optional parameters - * @param {String} opts.accept A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\". - * @param {module:dyspatch-client/DraftsApi~draftsDraftIdLocalizationKeysGetCallback} callback The callback function, accepting three arguments: error, data, response + * @param {String} accept A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" + * @param {module:dyspatch-client/DraftsApi~getDraftLocalizationKeysCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link Array.} */ - this.draftsDraftIdLocalizationKeysGet = function(draftId, opts, callback) { - opts = opts || {}; - var postBody = null; - + getDraftLocalizationKeys(draftId, accept, callback) { + let postBody = null; // verify the required parameter 'draftId' is set if (draftId === undefined || draftId === null) { - throw new Error("Missing the required parameter 'draftId' when calling draftsDraftIdLocalizationKeysGet"); + throw new Error("Missing the required parameter 'draftId' when calling getDraftLocalizationKeys"); + } + // verify the required parameter 'accept' is set + if (accept === undefined || accept === null) { + throw new Error("Missing the required parameter 'accept' when calling getDraftLocalizationKeys"); } - - var pathParams = { + let pathParams = { 'draftId': draftId }; - var queryParams = { - }; - var collectionQueryParams = { + let queryParams = { }; - var headerParams = { - 'Accept': opts['accept'] + let headerParams = { + 'Accept': accept }; - var formParams = { + let formParams = { }; - var authNames = ['Bearer']; - var contentTypes = []; - var accepts = ['application/vnd.dyspatch.2019.10+json', 'text/vnd.dyspatch.2019.10+x-gettext-translation']; - var returnType = [LocalizationKeyRead]; - + let authNames = ['Bearer']; + let contentTypes = []; + let accepts = ['application/vnd.dyspatch.2019.10+json', 'text/vnd.dyspatch.2019.10+x-gettext-translation']; + let returnType = [LocalizationKeyRead]; return this.apiClient.callApi( '/drafts/{draftId}/localizationKeys', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, - authNames, contentTypes, accepts, returnType, callback + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback ); } /** - * Callback function to receive the result of the draftsDraftIdLocalizationsGet operation. - * @callback module:dyspatch-client/DraftsApi~draftsDraftIdLocalizationsGetCallback + * Callback function to receive the result of the getDrafts operation. + * @callback module:dyspatch-client/DraftsApi~getDraftsCallback * @param {String} error Error message, if any. - * @param {Array.} data The data returned by the service call. + * @param {module:dyspatch-client/DraftsRead} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** - * Get Localizations on a Draft - * Returns localization metadata object for a template draft. - * @param {String} draftId A draft ID - * @param {module:dyspatch-client/DraftsApi~draftsDraftIdLocalizationsGetCallback} callback The callback function, accepting three arguments: error, data, response - * data is of type: {@link Array.} + * List Drafts + * Returns all drafts for your organization. + * @param {String} accept A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" + * @param {Object} opts Optional parameters + * @param {String} opts.cursor A cursor value used to retrieve a specific page from a paginated result set. + * @param {module:dyspatch-client/String} opts.status Filter the list of drafts by a particular status + * @param {module:dyspatch-client/DraftsApi~getDraftsCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:dyspatch-client/DraftsRead} */ - this.draftsDraftIdLocalizationsGet = function(draftId, callback) { - var postBody = null; - - // verify the required parameter 'draftId' is set - if (draftId === undefined || draftId === null) { - throw new Error("Missing the required parameter 'draftId' when calling draftsDraftIdLocalizationsGet"); + getDrafts(accept, opts, callback) { + opts = opts || {}; + let postBody = null; + // verify the required parameter 'accept' is set + if (accept === undefined || accept === null) { + throw new Error("Missing the required parameter 'accept' when calling getDrafts"); } - - var pathParams = { - 'draftId': draftId + let pathParams = { }; - var queryParams = { - }; - var collectionQueryParams = { + let queryParams = { + 'cursor': opts['cursor'], + 'status': opts['status'] }; - var headerParams = { + let headerParams = { + 'Accept': accept }; - var formParams = { + let formParams = { }; - var authNames = ['Bearer']; - var contentTypes = []; - var accepts = ['application/vnd.dyspatch.2019.10+json']; - var returnType = [LocalizationMetaRead]; - + let authNames = ['Bearer']; + let contentTypes = []; + let accepts = ['application/vnd.dyspatch.2019.10+json', '*/*']; + let returnType = DraftsRead; return this.apiClient.callApi( - '/drafts/{draftId}/localizations', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, - authNames, contentTypes, accepts, returnType, callback + '/drafts', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback ); } /** - * Callback function to receive the result of the draftsDraftIdLocalizationsLanguageIdDelete operation. - * @callback module:dyspatch-client/DraftsApi~draftsDraftIdLocalizationsLanguageIdDeleteCallback + * Callback function to receive the result of the getLocalizationForDraft operation. + * @callback module:dyspatch-client/DraftsApi~getLocalizationForDraftCallback * @param {String} error Error message, if any. - * @param data This operation does not return a value. + * @param {Array.} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** - * Remove a Localization - * Deletes the localization with the given `languageId` if it exists. + * Get localizations on a draft + * Returns localization metadata for the draft * @param {String} draftId A draft ID - * @param {String} languageId A language ID (eg: en-US) - * @param {module:dyspatch-client/DraftsApi~draftsDraftIdLocalizationsLanguageIdDeleteCallback} callback The callback function, accepting three arguments: error, data, response + * @param {String} accept A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" + * @param {module:dyspatch-client/DraftsApi~getLocalizationForDraftCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link Array.} */ - this.draftsDraftIdLocalizationsLanguageIdDelete = function(draftId, languageId, callback) { - var postBody = null; - + getLocalizationForDraft(draftId, accept, callback) { + let postBody = null; // verify the required parameter 'draftId' is set if (draftId === undefined || draftId === null) { - throw new Error("Missing the required parameter 'draftId' when calling draftsDraftIdLocalizationsLanguageIdDelete"); + throw new Error("Missing the required parameter 'draftId' when calling getLocalizationForDraft"); } - - // verify the required parameter 'languageId' is set - if (languageId === undefined || languageId === null) { - throw new Error("Missing the required parameter 'languageId' when calling draftsDraftIdLocalizationsLanguageIdDelete"); + // verify the required parameter 'accept' is set + if (accept === undefined || accept === null) { + throw new Error("Missing the required parameter 'accept' when calling getLocalizationForDraft"); } - - var pathParams = { - 'draftId': draftId, - 'languageId': languageId - }; - var queryParams = { + let pathParams = { + 'draftId': draftId }; - var collectionQueryParams = { + let queryParams = { }; - var headerParams = { + let headerParams = { + 'Accept': accept }; - var formParams = { + let formParams = { }; - var authNames = ['Bearer']; - var contentTypes = []; - var accepts = ['application/vnd.dyspatch.2019.10+json']; - var returnType = null; - + let authNames = ['Bearer']; + let contentTypes = []; + let accepts = ['application/vnd.dyspatch.2019.10+json']; + let returnType = [LocalizationMetaRead]; return this.apiClient.callApi( - '/drafts/{draftId}/localizations/{languageId}', 'DELETE', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, - authNames, contentTypes, accepts, returnType, callback + '/drafts/{draftId}/localizations', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback ); } /** - * Callback function to receive the result of the draftsDraftIdLocalizationsLanguageIdPut operation. - * @callback module:dyspatch-client/DraftsApi~draftsDraftIdLocalizationsLanguageIdPutCallback + * Callback function to receive the result of the saveLocalization operation. + * @callback module:dyspatch-client/DraftsApi~saveLocalizationCallback * @param {String} error Error message, if any. * @param data This operation does not return a value. * @param {String} response The complete HTTP response. */ /** - * Create or Update a Localization - * Inserts a localization or sets the name on an existing localization that already uses the `languageId`. + * Create or update a localization + * Inserts a localization or sets the name on an existing localization that already uses the languageId * @param {String} draftId A draft ID * @param {String} languageId A language ID (eg: en-US) - * @param {module:dyspatch-client/Body} body - * @param {module:dyspatch-client/DraftsApi~draftsDraftIdLocalizationsLanguageIdPutCallback} callback The callback function, accepting three arguments: error, data, response + * @param {String} accept A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" + * @param {module:dyspatch-client/InlineObject} inlineObject + * @param {module:dyspatch-client/DraftsApi~saveLocalizationCallback} callback The callback function, accepting three arguments: error, data, response */ - this.draftsDraftIdLocalizationsLanguageIdPut = function(draftId, languageId, body, callback) { - var postBody = body; - + saveLocalization(draftId, languageId, accept, inlineObject, callback) { + let postBody = inlineObject; // verify the required parameter 'draftId' is set if (draftId === undefined || draftId === null) { - throw new Error("Missing the required parameter 'draftId' when calling draftsDraftIdLocalizationsLanguageIdPut"); + throw new Error("Missing the required parameter 'draftId' when calling saveLocalization"); } - // verify the required parameter 'languageId' is set if (languageId === undefined || languageId === null) { - throw new Error("Missing the required parameter 'languageId' when calling draftsDraftIdLocalizationsLanguageIdPut"); + throw new Error("Missing the required parameter 'languageId' when calling saveLocalization"); } - - // verify the required parameter 'body' is set - if (body === undefined || body === null) { - throw new Error("Missing the required parameter 'body' when calling draftsDraftIdLocalizationsLanguageIdPut"); + // verify the required parameter 'accept' is set + if (accept === undefined || accept === null) { + throw new Error("Missing the required parameter 'accept' when calling saveLocalization"); + } + // verify the required parameter 'inlineObject' is set + if (inlineObject === undefined || inlineObject === null) { + throw new Error("Missing the required parameter 'inlineObject' when calling saveLocalization"); } - - var pathParams = { + let pathParams = { 'draftId': draftId, 'languageId': languageId }; - var queryParams = { - }; - var collectionQueryParams = { + let queryParams = { }; - var headerParams = { + let headerParams = { + 'Accept': accept }; - var formParams = { + let formParams = { }; - var authNames = ['Bearer']; - var contentTypes = []; - var accepts = ['application/vnd.dyspatch.2019.10+json']; - var returnType = null; - + let authNames = ['Bearer']; + let contentTypes = ['application/json']; + let accepts = []; + let returnType = null; return this.apiClient.callApi( '/drafts/{draftId}/localizations/{languageId}', 'PUT', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, - authNames, contentTypes, accepts, returnType, callback + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback ); } /** - * Callback function to receive the result of the draftsDraftIdLocalizationsLanguageIdTranslationsPut operation. - * @callback module:dyspatch-client/DraftsApi~draftsDraftIdLocalizationsLanguageIdTranslationsPutCallback + * Callback function to receive the result of the setTranslation operation. + * @callback module:dyspatch-client/DraftsApi~setTranslationCallback * @param {String} error Error message, if any. * @param data This operation does not return a value. * @param {String} response The complete HTTP response. */ /** - * Set Translations for Language + * Set translations for language * Completely replaces any existing translations for the given language with those provided in request body. Variables embedded in keys or values are expected to be in the format `%(my_variable)s` and will automatically convert to the correct Dyspatch format depending on the type of template. Accepts key/value pairs in JSON format or in gettext PO file format. For JSON set `Content-Type` header to `application/json`. For gettext PO format set `Content-Type` header to `text/x-gettext-translation`. * @param {String} draftId A draft ID * @param {String} languageId A language ID (eg: en-US) - * @param {Object} body - * @param {module:dyspatch-client/DraftsApi~draftsDraftIdLocalizationsLanguageIdTranslationsPutCallback} callback The callback function, accepting three arguments: error, data, response + * @param {String} accept A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" + * @param {Object.} requestBody + * @param {module:dyspatch-client/DraftsApi~setTranslationCallback} callback The callback function, accepting three arguments: error, data, response */ - this.draftsDraftIdLocalizationsLanguageIdTranslationsPut = function(draftId, languageId, body, callback) { - var postBody = body; - + setTranslation(draftId, languageId, accept, requestBody, callback) { + let postBody = requestBody; // verify the required parameter 'draftId' is set if (draftId === undefined || draftId === null) { - throw new Error("Missing the required parameter 'draftId' when calling draftsDraftIdLocalizationsLanguageIdTranslationsPut"); + throw new Error("Missing the required parameter 'draftId' when calling setTranslation"); } - // verify the required parameter 'languageId' is set if (languageId === undefined || languageId === null) { - throw new Error("Missing the required parameter 'languageId' when calling draftsDraftIdLocalizationsLanguageIdTranslationsPut"); + throw new Error("Missing the required parameter 'languageId' when calling setTranslation"); } - - // verify the required parameter 'body' is set - if (body === undefined || body === null) { - throw new Error("Missing the required parameter 'body' when calling draftsDraftIdLocalizationsLanguageIdTranslationsPut"); + // verify the required parameter 'accept' is set + if (accept === undefined || accept === null) { + throw new Error("Missing the required parameter 'accept' when calling setTranslation"); + } + // verify the required parameter 'requestBody' is set + if (requestBody === undefined || requestBody === null) { + throw new Error("Missing the required parameter 'requestBody' when calling setTranslation"); } - - var pathParams = { + let pathParams = { 'draftId': draftId, 'languageId': languageId }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { + 'Accept': accept }; - var headerParams = { + let formParams = { }; - var formParams = { - }; - - var authNames = ['Bearer']; - var contentTypes = []; - var accepts = ['application/vnd.dyspatch.2019.10+json']; - var returnType = null; + let authNames = ['Bearer']; + let contentTypes = ['application/json']; + let accepts = []; + let returnType = null; return this.apiClient.callApi( '/drafts/{draftId}/localizations/{languageId}/translations', 'PUT', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, - authNames, contentTypes, accepts, returnType, callback + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback ); } /** - * Callback function to receive the result of the draftsDraftIdPublishRequestPost operation. - * @callback module:dyspatch-client/DraftsApi~draftsDraftIdPublishRequestPostCallback + * Callback function to receive the result of the submitDraftForApproval operation. + * @callback module:dyspatch-client/DraftsApi~submitDraftForApprovalCallback * @param {String} error Error message, if any. * @param data This operation does not return a value. * @param {String} response The complete HTTP response. */ /** - * Submit the Draft for Approval - * Moves the draft into [submitted and locked state](https://docs.dyspatch.io/templates/submitting_a_template/#awaiting-approval). This will allow your email stakeholders to review the template draft and provide feedback. + * Submit the draft for approval + * Moves the draft into submitted state. * @param {String} draftId A draft ID - * @param {module:dyspatch-client/DraftsApi~draftsDraftIdPublishRequestPostCallback} callback The callback function, accepting three arguments: error, data, response + * @param {String} accept A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" + * @param {module:dyspatch-client/DraftsApi~submitDraftForApprovalCallback} callback The callback function, accepting three arguments: error, data, response */ - this.draftsDraftIdPublishRequestPost = function(draftId, callback) { - var postBody = null; - + submitDraftForApproval(draftId, accept, callback) { + let postBody = null; // verify the required parameter 'draftId' is set if (draftId === undefined || draftId === null) { - throw new Error("Missing the required parameter 'draftId' when calling draftsDraftIdPublishRequestPost"); + throw new Error("Missing the required parameter 'draftId' when calling submitDraftForApproval"); + } + // verify the required parameter 'accept' is set + if (accept === undefined || accept === null) { + throw new Error("Missing the required parameter 'accept' when calling submitDraftForApproval"); } - - var pathParams = { + let pathParams = { 'draftId': draftId }; - var queryParams = { + let queryParams = { }; - var collectionQueryParams = { + let headerParams = { + 'Accept': accept }; - var headerParams = { + let formParams = { }; - var formParams = { - }; - - var authNames = ['Bearer']; - var contentTypes = []; - var accepts = ['application/vnd.dyspatch.2019.10+json']; - var returnType = null; + let authNames = ['Bearer']; + let contentTypes = []; + let accepts = ['*/*']; + let returnType = null; return this.apiClient.callApi( '/drafts/{draftId}/publishRequest', 'POST', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, - authNames, contentTypes, accepts, returnType, callback + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback ); } - /** - * Callback function to receive the result of the draftsGet operation. - * @callback module:dyspatch-client/DraftsApi~draftsGetCallback - * @param {String} error Error message, if any. - * @param {module:dyspatch-client/DraftsRead} data The data returned by the service call. - * @param {String} response The complete HTTP response. - */ - - /** - * List Drafts - * Gets a list of all drafts for your oranization. Up to 25 results returned before results are paginated. - * @param {Object} opts Optional parameters - * @param {String} opts.cursor A cursor value used to retrieve a specific page from a paginated result set. - * @param {module:dyspatch-client/String} opts.status Filter the list of drafts by a particular status - * @param {module:dyspatch-client/DraftsApi~draftsGetCallback} callback The callback function, accepting three arguments: error, data, response - * data is of type: {@link module:dyspatch-client/DraftsRead} - */ - this.draftsGet = function(opts, callback) { - opts = opts || {}; - var postBody = null; - - - var pathParams = { - }; - var queryParams = { - 'cursor': opts['cursor'], - 'status': opts['status'], - }; - var collectionQueryParams = { - }; - var headerParams = { - }; - var formParams = { - }; - - var authNames = ['Bearer']; - var contentTypes = []; - var accepts = ['application/vnd.dyspatch.2019.10+json']; - var returnType = DraftsRead; - - return this.apiClient.callApi( - '/drafts', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, - authNames, contentTypes, accepts, returnType, callback - ); - } - }; - return exports; -})); +} diff --git a/src/dyspatch-client/DraftsRead.js b/src/dyspatch-client/DraftsRead.js index 9bd2ea6..1783b0d 100644 --- a/src/dyspatch-client/DraftsRead.js +++ b/src/dyspatch-client/DraftsRead.js @@ -1,79 +1,83 @@ -/* +/** * Dyspatch API - * # Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) * - * OpenAPI spec version: 2019.10 + * The version of the OpenAPI document: 2019.10 * Contact: support@dyspatch.io * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.4.10 - * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'dyspatch-client/Cursor', 'dyspatch-client/DraftMetaRead'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('./Cursor'), require('./DraftMetaRead')); - } else { - // Browser globals (root is window) - if (!root.DyspatchClient) { - root.DyspatchClient = {}; +import ApiClient from '../ApiClient'; +import Cursor from './Cursor'; +import DraftMetaRead from './DraftMetaRead'; + +/** + * The DraftsRead model module. + * @module dyspatch-client/DraftsRead + * @version 4.0.0 + */ +class DraftsRead { + /** + * Constructs a new DraftsRead. + * list of draft metadata + * @alias module:dyspatch-client/DraftsRead + */ + constructor() { + + DraftsRead.initialize(this); } - root.DyspatchClient.DraftsRead = factory(root.DyspatchClient.ApiClient, root.DyspatchClient.Cursor, root.DyspatchClient.DraftMetaRead); - } -}(this, function(ApiClient, Cursor, DraftMetaRead) { - 'use strict'; - - /** - * The DraftsRead model module. - * @module dyspatch-client/DraftsRead - * @version 3.0.1 - */ - - /** - * Constructs a new DraftsRead. - * @alias module:dyspatch-client/DraftsRead - * @class - */ - var exports = function() { - }; - - /** - * Constructs a DraftsRead from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:dyspatch-client/DraftsRead} obj Optional instance to populate. - * @return {module:dyspatch-client/DraftsRead} The populated DraftsRead instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - if (data.hasOwnProperty('cursor')) - obj.cursor = Cursor.constructFromObject(data['cursor']); - if (data.hasOwnProperty('data')) - obj.data = ApiClient.convertToType(data['data'], [DraftMetaRead]); + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { } - return obj; - } - /** - * @member {module:dyspatch-client/Cursor} cursor - */ - exports.prototype.cursor = undefined; + /** + * Constructs a DraftsRead from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:dyspatch-client/DraftsRead} obj Optional instance to populate. + * @return {module:dyspatch-client/DraftsRead} The populated DraftsRead instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new DraftsRead(); + + if (data.hasOwnProperty('cursor')) { + obj['cursor'] = Cursor.constructFromObject(data['cursor']); + } + if (data.hasOwnProperty('data')) { + obj['data'] = ApiClient.convertToType(data['data'], [DraftMetaRead]); + } + } + return obj; + } + + +} + +/** + * @member {module:dyspatch-client/Cursor} cursor + */ +DraftsRead.prototype['cursor'] = undefined; + +/** + * A list of draft metadata objects + * @member {Array.} data + */ +DraftsRead.prototype['data'] = undefined; + + + + - /** - * A list of draft metadata objects - * @member {Array.} data - */ - exports.prototype.data = undefined; - return exports; +export default DraftsRead; -})); diff --git a/src/dyspatch-client/InlineObject.js b/src/dyspatch-client/InlineObject.js new file mode 100644 index 0000000..653c254 --- /dev/null +++ b/src/dyspatch-client/InlineObject.js @@ -0,0 +1,71 @@ +/** + * Dyspatch API + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) + * + * The version of the OpenAPI document: 2019.10 + * Contact: support@dyspatch.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The InlineObject model module. + * @module dyspatch-client/InlineObject + * @version 4.0.0 + */ +class InlineObject { + /** + * Constructs a new InlineObject. + * @alias module:dyspatch-client/InlineObject + */ + constructor() { + + InlineObject.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a InlineObject from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:dyspatch-client/InlineObject} obj Optional instance to populate. + * @return {module:dyspatch-client/InlineObject} The populated InlineObject instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new InlineObject(); + + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {String} name + */ +InlineObject.prototype['name'] = undefined; + + + + + + +export default InlineObject; + diff --git a/src/dyspatch-client/LocalizationKeyRead.js b/src/dyspatch-client/LocalizationKeyRead.js index 7a79991..8acbc51 100644 --- a/src/dyspatch-client/LocalizationKeyRead.js +++ b/src/dyspatch-client/LocalizationKeyRead.js @@ -1,78 +1,80 @@ -/* +/** * Dyspatch API - * # Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) * - * OpenAPI spec version: 2019.10 + * The version of the OpenAPI document: 2019.10 * Contact: support@dyspatch.io * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.4.10 - * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient')); - } else { - // Browser globals (root is window) - if (!root.DyspatchClient) { - root.DyspatchClient = {}; +import ApiClient from '../ApiClient'; + +/** + * The LocalizationKeyRead model module. + * @module dyspatch-client/LocalizationKeyRead + * @version 4.0.0 + */ +class LocalizationKeyRead { + /** + * Constructs a new LocalizationKeyRead. + * localization key + * @alias module:dyspatch-client/LocalizationKeyRead + */ + constructor() { + + LocalizationKeyRead.initialize(this); } - root.DyspatchClient.LocalizationKeyRead = factory(root.DyspatchClient.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; - - /** - * The LocalizationKeyRead model module. - * @module dyspatch-client/LocalizationKeyRead - * @version 3.0.1 - */ - - /** - * Constructs a new LocalizationKeyRead. - * @alias module:dyspatch-client/LocalizationKeyRead - * @class - */ - var exports = function() { - }; - - /** - * Constructs a LocalizationKeyRead from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:dyspatch-client/LocalizationKeyRead} obj Optional instance to populate. - * @return {module:dyspatch-client/LocalizationKeyRead} The populated LocalizationKeyRead instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - if (data.hasOwnProperty('key')) - obj.key = ApiClient.convertToType(data['key'], 'String'); - if (data.hasOwnProperty('comment')) - obj.comment = ApiClient.convertToType(data['comment'], 'String'); + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { } - return obj; - } - /** - * @member {String} key - */ - exports.prototype.key = undefined; + /** + * Constructs a LocalizationKeyRead from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:dyspatch-client/LocalizationKeyRead} obj Optional instance to populate. + * @return {module:dyspatch-client/LocalizationKeyRead} The populated LocalizationKeyRead instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new LocalizationKeyRead(); + + if (data.hasOwnProperty('key')) { + obj['key'] = ApiClient.convertToType(data['key'], 'String'); + } + if (data.hasOwnProperty('comment')) { + obj['comment'] = ApiClient.convertToType(data['comment'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {String} key + */ +LocalizationKeyRead.prototype['key'] = undefined; + +/** + * @member {String} comment + */ +LocalizationKeyRead.prototype['comment'] = undefined; + + + + - /** - * @member {String} comment - */ - exports.prototype.comment = undefined; - return exports; +export default LocalizationKeyRead; -})); diff --git a/src/dyspatch-client/LocalizationMetaRead.js b/src/dyspatch-client/LocalizationMetaRead.js index 886bdf0..0984b8f 100644 --- a/src/dyspatch-client/LocalizationMetaRead.js +++ b/src/dyspatch-client/LocalizationMetaRead.js @@ -1,104 +1,100 @@ -/* +/** * Dyspatch API - * # Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) * - * OpenAPI spec version: 2019.10 + * The version of the OpenAPI document: 2019.10 * Contact: support@dyspatch.io * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.4.10 - * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient')); - } else { - // Browser globals (root is window) - if (!root.DyspatchClient) { - root.DyspatchClient = {}; +import ApiClient from '../ApiClient'; + +/** + * The LocalizationMetaRead model module. + * @module dyspatch-client/LocalizationMetaRead + * @version 4.0.0 + */ +class LocalizationMetaRead { + /** + * Constructs a new LocalizationMetaRead. + * localization metadata + * @alias module:dyspatch-client/LocalizationMetaRead + */ + constructor() { + + LocalizationMetaRead.initialize(this); } - root.DyspatchClient.LocalizationMetaRead = factory(root.DyspatchClient.ApiClient); - } -}(this, function(ApiClient) { - 'use strict'; - - /** - * The LocalizationMetaRead model module. - * @module dyspatch-client/LocalizationMetaRead - * @version 3.0.1 - */ - - /** - * Constructs a new LocalizationMetaRead. - * @alias module:dyspatch-client/LocalizationMetaRead - * @class - */ - var exports = function() { - }; - - /** - * Constructs a LocalizationMetaRead from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:dyspatch-client/LocalizationMetaRead} obj Optional instance to populate. - * @return {module:dyspatch-client/LocalizationMetaRead} The populated LocalizationMetaRead instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - if (data.hasOwnProperty('id')) - obj.id = ApiClient.convertToType(data['id'], 'String'); - if (data.hasOwnProperty('language')) - obj.language = ApiClient.convertToType(data['language'], 'String'); - if (data.hasOwnProperty('name')) - obj.name = ApiClient.convertToType(data['name'], 'String'); - if (data.hasOwnProperty('url')) - obj.url = ApiClient.convertToType(data['url'], 'String'); - if (data.hasOwnProperty('draft')) - obj.draft = ApiClient.convertToType(data['draft'], 'String'); + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { } - return obj; - } - - /** - * An opaque, unique identifier for a localization - * @member {String} id - */ - exports.prototype.id = undefined; - - /** - * A language identifier comprised of a language and a country identifier. See [supported languages](https://docs.dyspatch.io/localization/supported_languages/). - * @member {String} language - */ - exports.prototype.language = undefined; - - /** - * The user-specified name of a localization - * @member {String} name - */ - exports.prototype.name = undefined; - - /** - * The API url for a specific localization - * @member {String} url - */ - exports.prototype.url = undefined; - - /** - * An opaque, unique identifier for a draft - * @member {String} draft - */ - exports.prototype.draft = undefined; - - return exports; - -})); + + /** + * Constructs a LocalizationMetaRead from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:dyspatch-client/LocalizationMetaRead} obj Optional instance to populate. + * @return {module:dyspatch-client/LocalizationMetaRead} The populated LocalizationMetaRead instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new LocalizationMetaRead(); + + if (data.hasOwnProperty('localization')) { + obj['localization'] = ApiClient.convertToType(data['localization'], 'String'); + } + if (data.hasOwnProperty('language')) { + obj['language'] = ApiClient.convertToType(data['language'], 'String'); + } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + if (data.hasOwnProperty('url')) { + obj['url'] = ApiClient.convertToType(data['url'], 'String'); + } + } + return obj; + } + + +} + +/** + * An opaque, unique identifier for a localization + * @member {String} localization + */ +LocalizationMetaRead.prototype['localization'] = undefined; + +/** + * A language identifier comprised of a language and a country identifier. See [supported languages](https://docs.dyspatch.io/localization/supported_languages/). + * @member {String} language + */ +LocalizationMetaRead.prototype['language'] = undefined; + +/** + * The user-specified name of a localization + * @member {String} name + */ +LocalizationMetaRead.prototype['name'] = undefined; + +/** + * The API url for a specific localization + * @member {String} url + */ +LocalizationMetaRead.prototype['url'] = undefined; + + + + + + +export default LocalizationMetaRead; + diff --git a/src/dyspatch-client/LocalizationRead.js b/src/dyspatch-client/LocalizationRead.js index 97f2621..7dfd59c 100644 --- a/src/dyspatch-client/LocalizationRead.js +++ b/src/dyspatch-client/LocalizationRead.js @@ -1,127 +1,136 @@ -/* +/** * Dyspatch API - * # Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) * - * OpenAPI spec version: 2019.10 + * The version of the OpenAPI document: 2019.10 * Contact: support@dyspatch.io * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.4.10 - * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'dyspatch-client/CompiledRead'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('./CompiledRead')); - } else { - // Browser globals (root is window) - if (!root.DyspatchClient) { - root.DyspatchClient = {}; +import ApiClient from '../ApiClient'; +import CompiledRead from './CompiledRead'; + +/** + * The LocalizationRead model module. + * @module dyspatch-client/LocalizationRead + * @version 4.0.0 + */ +class LocalizationRead { + /** + * Constructs a new LocalizationRead. + * localization metadata and latest revision for associated template + * @alias module:dyspatch-client/LocalizationRead + */ + constructor() { + + LocalizationRead.initialize(this); } - root.DyspatchClient.LocalizationRead = factory(root.DyspatchClient.ApiClient, root.DyspatchClient.CompiledRead); - } -}(this, function(ApiClient, CompiledRead) { - 'use strict'; - - /** - * The LocalizationRead model module. - * @module dyspatch-client/LocalizationRead - * @version 3.0.1 - */ - - /** - * Constructs a new LocalizationRead. - * @alias module:dyspatch-client/LocalizationRead - * @class - */ - var exports = function() { - }; - - /** - * Constructs a LocalizationRead from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:dyspatch-client/LocalizationRead} obj Optional instance to populate. - * @return {module:dyspatch-client/LocalizationRead} The populated LocalizationRead instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - if (data.hasOwnProperty('id')) - obj.id = ApiClient.convertToType(data['id'], 'String'); - if (data.hasOwnProperty('language')) - obj.language = ApiClient.convertToType(data['language'], 'String'); - if (data.hasOwnProperty('url')) - obj.url = ApiClient.convertToType(data['url'], 'String'); - if (data.hasOwnProperty('template')) - obj.template = ApiClient.convertToType(data['template'], 'String'); - if (data.hasOwnProperty('compiled')) - obj.compiled = CompiledRead.constructFromObject(data['compiled']); - if (data.hasOwnProperty('createdAt')) - obj.createdAt = ApiClient.convertToType(data['createdAt'], 'Date'); - if (data.hasOwnProperty('updatedAt')) - obj.updatedAt = ApiClient.convertToType(data['updatedAt'], 'Date'); - if (data.hasOwnProperty('name')) - obj.name = ApiClient.convertToType(data['name'], 'String'); + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { } - return obj; - } - - /** - * An opaque, unique identifier for a localization - * @member {String} id - */ - exports.prototype.id = undefined; - - /** - * A language identifier comprised of a language and a country identifier. See [supported languages](https://docs.dyspatch.io/localization/supported_languages/). - * @member {String} language - */ - exports.prototype.language = undefined; - - /** - * The API url for a specific localization - * @member {String} url - */ - exports.prototype.url = undefined; - - /** - * An opaque, unique identifier for a template - * @member {String} template - */ - exports.prototype.template = undefined; - - /** - * @member {module:dyspatch-client/CompiledRead} compiled - */ - exports.prototype.compiled = undefined; - - /** - * The time of initial creation - * @member {Date} createdAt - */ - exports.prototype.createdAt = undefined; - - /** - * The time of last update - * @member {Date} updatedAt - */ - exports.prototype.updatedAt = undefined; - - /** - * The user-specified name of a localization - * @member {String} name - */ - exports.prototype.name = undefined; - - return exports; - -})); + + /** + * Constructs a LocalizationRead from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:dyspatch-client/LocalizationRead} obj Optional instance to populate. + * @return {module:dyspatch-client/LocalizationRead} The populated LocalizationRead instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new LocalizationRead(); + + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'String'); + } + if (data.hasOwnProperty('language')) { + obj['language'] = ApiClient.convertToType(data['language'], 'String'); + } + if (data.hasOwnProperty('url')) { + obj['url'] = ApiClient.convertToType(data['url'], 'String'); + } + if (data.hasOwnProperty('template')) { + obj['template'] = ApiClient.convertToType(data['template'], 'String'); + } + if (data.hasOwnProperty('compiled')) { + obj['compiled'] = CompiledRead.constructFromObject(data['compiled']); + } + if (data.hasOwnProperty('createdAt')) { + obj['createdAt'] = ApiClient.convertToType(data['createdAt'], 'Date'); + } + if (data.hasOwnProperty('updatedAt')) { + obj['updatedAt'] = ApiClient.convertToType(data['updatedAt'], 'Date'); + } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + } + return obj; + } + + +} + +/** + * An opaque, unique identifier for a localization + * @member {String} id + */ +LocalizationRead.prototype['id'] = undefined; + +/** + * A language identifier comprised of a language and a country identifier. See [supported languages](https://docs.dyspatch.io/localization/supported_languages/). + * @member {String} language + */ +LocalizationRead.prototype['language'] = undefined; + +/** + * The API url for a specific localization + * @member {String} url + */ +LocalizationRead.prototype['url'] = undefined; + +/** + * An opaque, unique identifier for a template + * @member {String} template + */ +LocalizationRead.prototype['template'] = undefined; + +/** + * @member {module:dyspatch-client/CompiledRead} compiled + */ +LocalizationRead.prototype['compiled'] = undefined; + +/** + * The time of initial creation + * @member {Date} createdAt + */ +LocalizationRead.prototype['createdAt'] = undefined; + +/** + * The time of last update + * @member {Date} updatedAt + */ +LocalizationRead.prototype['updatedAt'] = undefined; + +/** + * The user-specified name of a localization + * @member {String} name + */ +LocalizationRead.prototype['name'] = undefined; + + + + + + +export default LocalizationRead; + diff --git a/src/dyspatch-client/LocalizationsApi.js b/src/dyspatch-client/LocalizationsApi.js index 2be7fbc..7d639ee 100644 --- a/src/dyspatch-client/LocalizationsApi.js +++ b/src/dyspatch-client/LocalizationsApi.js @@ -1,56 +1,43 @@ -/* +/** * Dyspatch API - * # Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) * - * OpenAPI spec version: 2019.10 + * The version of the OpenAPI document: 2019.10 * Contact: support@dyspatch.io * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.4.10 - * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'dyspatch-client/APIError', 'dyspatch-client/LocalizationRead'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('../dyspatch-client/APIError'), require('../dyspatch-client/LocalizationRead')); - } else { - // Browser globals (root is window) - if (!root.DyspatchClient) { - root.DyspatchClient = {}; - } - root.DyspatchClient.LocalizationsApi = factory(root.DyspatchClient.ApiClient, root.DyspatchClient.APIError, root.DyspatchClient.LocalizationRead); - } -}(this, function(ApiClient, APIError, LocalizationRead) { - 'use strict'; - /** - * Localizations service. - * @module dyspatch-client/LocalizationsApi - * @version 3.0.1 - */ +import ApiClient from "../ApiClient"; +import APIError from '../dyspatch-client/APIError'; +import LocalizationRead from '../dyspatch-client/LocalizationRead'; - /** - * Constructs a new LocalizationsApi. - * @alias module:dyspatch-client/LocalizationsApi - * @class - * @param {module:ApiClient} [apiClient] Optional API client implementation to use, - * default to {@link module:ApiClient#instance} if unspecified. - */ - var exports = function(apiClient) { - this.apiClient = apiClient || ApiClient.instance; +/** +* Localizations service. +* @module dyspatch-client/LocalizationsApi +* @version 4.0.0 +*/ +export default class LocalizationsApi { + + /** + * Constructs a new LocalizationsApi. + * @alias module:dyspatch-client/LocalizationsApi + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + } /** - * Callback function to receive the result of the localizationsLocalizationIdGet operation. - * @callback module:dyspatch-client/LocalizationsApi~localizationsLocalizationIdGetCallback + * Callback function to receive the result of the getLocalizationById operation. + * @callback module:dyspatch-client/LocalizationsApi~getLocalizationByIdCallback * @param {String} error Error message, if any. * @param {module:dyspatch-client/LocalizationRead} data The data returned by the service call. * @param {String} response The complete HTTP response. @@ -58,51 +45,50 @@ /** * Get Localization Object by ID - * Returns a specific localization object with a matching ID. + * Returns a specific localization object with a matching ID * @param {String} localizationId A localization ID * @param {module:dyspatch-client/String} targetLanguage The type of templating language to compile as. Should only be used for visual templates. - * @param {module:dyspatch-client/LocalizationsApi~localizationsLocalizationIdGetCallback} callback The callback function, accepting three arguments: error, data, response + * @param {String} accept A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" + * @param {module:dyspatch-client/LocalizationsApi~getLocalizationByIdCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:dyspatch-client/LocalizationRead} */ - this.localizationsLocalizationIdGet = function(localizationId, targetLanguage, callback) { - var postBody = null; - + getLocalizationById(localizationId, targetLanguage, accept, callback) { + let postBody = null; // verify the required parameter 'localizationId' is set if (localizationId === undefined || localizationId === null) { - throw new Error("Missing the required parameter 'localizationId' when calling localizationsLocalizationIdGet"); + throw new Error("Missing the required parameter 'localizationId' when calling getLocalizationById"); } - // verify the required parameter 'targetLanguage' is set if (targetLanguage === undefined || targetLanguage === null) { - throw new Error("Missing the required parameter 'targetLanguage' when calling localizationsLocalizationIdGet"); + throw new Error("Missing the required parameter 'targetLanguage' when calling getLocalizationById"); + } + // verify the required parameter 'accept' is set + if (accept === undefined || accept === null) { + throw new Error("Missing the required parameter 'accept' when calling getLocalizationById"); } - - var pathParams = { + let pathParams = { 'localizationId': localizationId }; - var queryParams = { - 'targetLanguage': targetLanguage, + let queryParams = { + 'targetLanguage': targetLanguage }; - var collectionQueryParams = { + let headerParams = { + 'Accept': accept }; - var headerParams = { + let formParams = { }; - var formParams = { - }; - - var authNames = ['Bearer']; - var contentTypes = []; - var accepts = ['application/vnd.dyspatch.2019.10+json']; - var returnType = LocalizationRead; + let authNames = ['Bearer']; + let contentTypes = []; + let accepts = ['application/vnd.dyspatch.2019.10+json', '*/*']; + let returnType = LocalizationRead; return this.apiClient.callApi( '/localizations/{localizationId}', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, - authNames, contentTypes, accepts, returnType, callback + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback ); } - }; - return exports; -})); + +} diff --git a/src/dyspatch-client/TemplateMetaRead.js b/src/dyspatch-client/TemplateMetaRead.js index e78c0a7..94d83b3 100644 --- a/src/dyspatch-client/TemplateMetaRead.js +++ b/src/dyspatch-client/TemplateMetaRead.js @@ -1,120 +1,128 @@ -/* +/** * Dyspatch API - * # Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) * - * OpenAPI spec version: 2019.10 + * The version of the OpenAPI document: 2019.10 * Contact: support@dyspatch.io * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.4.10 - * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'dyspatch-client/LocalizationMetaRead'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('./LocalizationMetaRead')); - } else { - // Browser globals (root is window) - if (!root.DyspatchClient) { - root.DyspatchClient = {}; +import ApiClient from '../ApiClient'; +import LocalizationMetaRead from './LocalizationMetaRead'; + +/** + * The TemplateMetaRead model module. + * @module dyspatch-client/TemplateMetaRead + * @version 4.0.0 + */ +class TemplateMetaRead { + /** + * Constructs a new TemplateMetaRead. + * the template metadata + * @alias module:dyspatch-client/TemplateMetaRead + */ + constructor() { + + TemplateMetaRead.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { } - root.DyspatchClient.TemplateMetaRead = factory(root.DyspatchClient.ApiClient, root.DyspatchClient.LocalizationMetaRead); - } -}(this, function(ApiClient, LocalizationMetaRead) { - 'use strict'; - - /** - * The TemplateMetaRead model module. - * @module dyspatch-client/TemplateMetaRead - * @version 3.0.1 - */ - - /** - * Constructs a new TemplateMetaRead. - * @alias module:dyspatch-client/TemplateMetaRead - * @class - */ - var exports = function() { - }; - - /** - * Constructs a TemplateMetaRead from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:dyspatch-client/TemplateMetaRead} obj Optional instance to populate. - * @return {module:dyspatch-client/TemplateMetaRead} The populated TemplateMetaRead instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - if (data.hasOwnProperty('id')) - obj.id = ApiClient.convertToType(data['id'], 'String'); - if (data.hasOwnProperty('name')) - obj.name = ApiClient.convertToType(data['name'], 'String'); - if (data.hasOwnProperty('description')) - obj.description = ApiClient.convertToType(data['description'], 'String'); - if (data.hasOwnProperty('url')) - obj.url = ApiClient.convertToType(data['url'], 'String'); - if (data.hasOwnProperty('localizations')) - obj.localizations = ApiClient.convertToType(data['localizations'], [LocalizationMetaRead]); - if (data.hasOwnProperty('createdAt')) - obj.createdAt = ApiClient.convertToType(data['createdAt'], 'Date'); - if (data.hasOwnProperty('updatedAt')) - obj.updatedAt = ApiClient.convertToType(data['updatedAt'], 'Date'); + + /** + * Constructs a TemplateMetaRead from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:dyspatch-client/TemplateMetaRead} obj Optional instance to populate. + * @return {module:dyspatch-client/TemplateMetaRead} The populated TemplateMetaRead instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new TemplateMetaRead(); + + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'String'); + } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + if (data.hasOwnProperty('description')) { + obj['description'] = ApiClient.convertToType(data['description'], 'String'); + } + if (data.hasOwnProperty('url')) { + obj['url'] = ApiClient.convertToType(data['url'], 'String'); + } + if (data.hasOwnProperty('localizations')) { + obj['localizations'] = ApiClient.convertToType(data['localizations'], [LocalizationMetaRead]); + } + if (data.hasOwnProperty('createdAt')) { + obj['createdAt'] = ApiClient.convertToType(data['createdAt'], 'Date'); + } + if (data.hasOwnProperty('updatedAt')) { + obj['updatedAt'] = ApiClient.convertToType(data['updatedAt'], 'Date'); + } + } + return obj; } - return obj; - } - - /** - * An opaque, unique identifier for a template - * @member {String} id - */ - exports.prototype.id = undefined; - - /** - * The name of a template - * @member {String} name - */ - exports.prototype.name = undefined; - - /** - * A description of the template - * @member {String} description - */ - exports.prototype.description = undefined; - - /** - * The API url for a specific template - * @member {String} url - */ - exports.prototype.url = undefined; - - /** - * A list of the template's available localization objects - * @member {Array.} localizations - */ - exports.prototype.localizations = undefined; - - /** - * The time of initial creation - * @member {Date} createdAt - */ - exports.prototype.createdAt = undefined; - - /** - * The time of last update - * @member {Date} updatedAt - */ - exports.prototype.updatedAt = undefined; - - return exports; - -})); + + +} + +/** + * An opaque, unique identifier for a template + * @member {String} id + */ +TemplateMetaRead.prototype['id'] = undefined; + +/** + * The name of a template + * @member {String} name + */ +TemplateMetaRead.prototype['name'] = undefined; + +/** + * A description of the template + * @member {String} description + */ +TemplateMetaRead.prototype['description'] = undefined; + +/** + * The API url for a specific template + * @member {String} url + */ +TemplateMetaRead.prototype['url'] = undefined; + +/** + * A list of the template's available localization objects + * @member {Array.} localizations + */ +TemplateMetaRead.prototype['localizations'] = undefined; + +/** + * The time of initial creation + * @member {Date} createdAt + */ +TemplateMetaRead.prototype['createdAt'] = undefined; + +/** + * The time of last update + * @member {Date} updatedAt + */ +TemplateMetaRead.prototype['updatedAt'] = undefined; + + + + + + +export default TemplateMetaRead; + diff --git a/src/dyspatch-client/TemplateRead.js b/src/dyspatch-client/TemplateRead.js index 9cd033d..736ee82 100644 --- a/src/dyspatch-client/TemplateRead.js +++ b/src/dyspatch-client/TemplateRead.js @@ -1,127 +1,137 @@ -/* +/** * Dyspatch API - * # Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) * - * OpenAPI spec version: 2019.10 + * The version of the OpenAPI document: 2019.10 * Contact: support@dyspatch.io * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.4.10 - * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'dyspatch-client/CompiledRead', 'dyspatch-client/LocalizationMetaRead'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('./CompiledRead'), require('./LocalizationMetaRead')); - } else { - // Browser globals (root is window) - if (!root.DyspatchClient) { - root.DyspatchClient = {}; +import ApiClient from '../ApiClient'; +import CompiledRead from './CompiledRead'; +import LocalizationMetaRead from './LocalizationMetaRead'; + +/** + * The TemplateRead model module. + * @module dyspatch-client/TemplateRead + * @version 4.0.0 + */ +class TemplateRead { + /** + * Constructs a new TemplateRead. + * list of template metadata + * @alias module:dyspatch-client/TemplateRead + */ + constructor() { + + TemplateRead.initialize(this); } - root.DyspatchClient.TemplateRead = factory(root.DyspatchClient.ApiClient, root.DyspatchClient.CompiledRead, root.DyspatchClient.LocalizationMetaRead); - } -}(this, function(ApiClient, CompiledRead, LocalizationMetaRead) { - 'use strict'; - - /** - * The TemplateRead model module. - * @module dyspatch-client/TemplateRead - * @version 3.0.1 - */ - - /** - * Constructs a new TemplateRead. - * @alias module:dyspatch-client/TemplateRead - * @class - */ - var exports = function() { - }; - - /** - * Constructs a TemplateRead from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:dyspatch-client/TemplateRead} obj Optional instance to populate. - * @return {module:dyspatch-client/TemplateRead} The populated TemplateRead instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - if (data.hasOwnProperty('id')) - obj.id = ApiClient.convertToType(data['id'], 'String'); - if (data.hasOwnProperty('name')) - obj.name = ApiClient.convertToType(data['name'], 'String'); - if (data.hasOwnProperty('description')) - obj.description = ApiClient.convertToType(data['description'], 'String'); - if (data.hasOwnProperty('url')) - obj.url = ApiClient.convertToType(data['url'], 'String'); - if (data.hasOwnProperty('compiled')) - obj.compiled = CompiledRead.constructFromObject(data['compiled']); - if (data.hasOwnProperty('createdAt')) - obj.createdAt = ApiClient.convertToType(data['createdAt'], 'Date'); - if (data.hasOwnProperty('updatedAt')) - obj.updatedAt = ApiClient.convertToType(data['updatedAt'], 'Date'); - if (data.hasOwnProperty('localizations')) - obj.localizations = ApiClient.convertToType(data['localizations'], [LocalizationMetaRead]); + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { } - return obj; - } - - /** - * An opaque, unique identifier for a template - * @member {String} id - */ - exports.prototype.id = undefined; - - /** - * The name of a template - * @member {String} name - */ - exports.prototype.name = undefined; - - /** - * A description of the template - * @member {String} description - */ - exports.prototype.description = undefined; - - /** - * The API url for a specific template - * @member {String} url - */ - exports.prototype.url = undefined; - - /** - * @member {module:dyspatch-client/CompiledRead} compiled - */ - exports.prototype.compiled = undefined; - - /** - * The time of initial creation - * @member {Date} createdAt - */ - exports.prototype.createdAt = undefined; - - /** - * The time of last update - * @member {Date} updatedAt - */ - exports.prototype.updatedAt = undefined; - - /** - * A list of the Template's available localizations - * @member {Array.} localizations - */ - exports.prototype.localizations = undefined; - - return exports; - -})); + + /** + * Constructs a TemplateRead from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:dyspatch-client/TemplateRead} obj Optional instance to populate. + * @return {module:dyspatch-client/TemplateRead} The populated TemplateRead instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new TemplateRead(); + + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'String'); + } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + if (data.hasOwnProperty('description')) { + obj['description'] = ApiClient.convertToType(data['description'], 'String'); + } + if (data.hasOwnProperty('url')) { + obj['url'] = ApiClient.convertToType(data['url'], 'String'); + } + if (data.hasOwnProperty('compiled')) { + obj['compiled'] = CompiledRead.constructFromObject(data['compiled']); + } + if (data.hasOwnProperty('createdAt')) { + obj['createdAt'] = ApiClient.convertToType(data['createdAt'], 'Date'); + } + if (data.hasOwnProperty('updatedAt')) { + obj['updatedAt'] = ApiClient.convertToType(data['updatedAt'], 'Date'); + } + if (data.hasOwnProperty('localizations')) { + obj['localizations'] = ApiClient.convertToType(data['localizations'], [LocalizationMetaRead]); + } + } + return obj; + } + + +} + +/** + * An opaque, unique identifier for a template + * @member {String} id + */ +TemplateRead.prototype['id'] = undefined; + +/** + * The name of a template + * @member {String} name + */ +TemplateRead.prototype['name'] = undefined; + +/** + * A description of the template + * @member {String} description + */ +TemplateRead.prototype['description'] = undefined; + +/** + * The API url for a specific template + * @member {String} url + */ +TemplateRead.prototype['url'] = undefined; + +/** + * @member {module:dyspatch-client/CompiledRead} compiled + */ +TemplateRead.prototype['compiled'] = undefined; + +/** + * The time of initial creation + * @member {Date} createdAt + */ +TemplateRead.prototype['createdAt'] = undefined; + +/** + * The time of last update + * @member {Date} updatedAt + */ +TemplateRead.prototype['updatedAt'] = undefined; + +/** + * A list of the Template's available localizations + * @member {Array.} localizations + */ +TemplateRead.prototype['localizations'] = undefined; + + + + + + +export default TemplateRead; + diff --git a/src/dyspatch-client/TemplatesApi.js b/src/dyspatch-client/TemplatesApi.js index 1b6b1ba..042b911 100644 --- a/src/dyspatch-client/TemplatesApi.js +++ b/src/dyspatch-client/TemplatesApi.js @@ -1,153 +1,142 @@ -/* +/** * Dyspatch API - * # Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) * - * OpenAPI spec version: 2019.10 + * The version of the OpenAPI document: 2019.10 * Contact: support@dyspatch.io * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.4.10 - * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'dyspatch-client/APIError', 'dyspatch-client/TemplateRead', 'dyspatch-client/TemplatesRead'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('../dyspatch-client/APIError'), require('../dyspatch-client/TemplateRead'), require('../dyspatch-client/TemplatesRead')); - } else { - // Browser globals (root is window) - if (!root.DyspatchClient) { - root.DyspatchClient = {}; - } - root.DyspatchClient.TemplatesApi = factory(root.DyspatchClient.ApiClient, root.DyspatchClient.APIError, root.DyspatchClient.TemplateRead, root.DyspatchClient.TemplatesRead); - } -}(this, function(ApiClient, APIError, TemplateRead, TemplatesRead) { - 'use strict'; - /** - * Templates service. - * @module dyspatch-client/TemplatesApi - * @version 3.0.1 - */ +import ApiClient from "../ApiClient"; +import APIError from '../dyspatch-client/APIError'; +import TemplateRead from '../dyspatch-client/TemplateRead'; +import TemplatesRead from '../dyspatch-client/TemplatesRead'; + +/** +* Templates service. +* @module dyspatch-client/TemplatesApi +* @version 4.0.0 +*/ +export default class TemplatesApi { - /** - * Constructs a new TemplatesApi. - * @alias module:dyspatch-client/TemplatesApi - * @class - * @param {module:ApiClient} [apiClient] Optional API client implementation to use, - * default to {@link module:ApiClient#instance} if unspecified. - */ - var exports = function(apiClient) { - this.apiClient = apiClient || ApiClient.instance; + /** + * Constructs a new TemplatesApi. + * @alias module:dyspatch-client/TemplatesApi + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + } /** - * Callback function to receive the result of the templatesGet operation. - * @callback module:dyspatch-client/TemplatesApi~templatesGetCallback + * Callback function to receive the result of the getTemplateById operation. + * @callback module:dyspatch-client/TemplatesApi~getTemplateByIdCallback * @param {String} error Error message, if any. - * @param {module:dyspatch-client/TemplatesRead} data The data returned by the service call. + * @param {module:dyspatch-client/TemplateRead} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** - * List Templates - * Gets a list of Template Metadata objects for all templates. Up to 25 results returned before results are paginated. - * @param {Object} opts Optional parameters - * @param {String} opts.cursor A cursor value used to retrieve a specific page from a paginated result set. - * @param {module:dyspatch-client/TemplatesApi~templatesGetCallback} callback The callback function, accepting three arguments: error, data, response - * data is of type: {@link module:dyspatch-client/TemplatesRead} + * Get Template by ID + * Gets a template object with the matching ID. If the template has published content the \"compiled\" field will contain the template . + * @param {String} templateId A template ID + * @param {module:dyspatch-client/String} targetLanguage The type of templating language to compile as. Should only be used for visual templates. + * @param {String} accept A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" + * @param {module:dyspatch-client/TemplatesApi~getTemplateByIdCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:dyspatch-client/TemplateRead} */ - this.templatesGet = function(opts, callback) { - opts = opts || {}; - var postBody = null; - + getTemplateById(templateId, targetLanguage, accept, callback) { + let postBody = null; + // verify the required parameter 'templateId' is set + if (templateId === undefined || templateId === null) { + throw new Error("Missing the required parameter 'templateId' when calling getTemplateById"); + } + // verify the required parameter 'targetLanguage' is set + if (targetLanguage === undefined || targetLanguage === null) { + throw new Error("Missing the required parameter 'targetLanguage' when calling getTemplateById"); + } + // verify the required parameter 'accept' is set + if (accept === undefined || accept === null) { + throw new Error("Missing the required parameter 'accept' when calling getTemplateById"); + } - var pathParams = { - }; - var queryParams = { - 'cursor': opts['cursor'], + let pathParams = { + 'templateId': templateId }; - var collectionQueryParams = { + let queryParams = { + 'targetLanguage': targetLanguage }; - var headerParams = { + let headerParams = { + 'Accept': accept }; - var formParams = { + let formParams = { }; - var authNames = ['Bearer']; - var contentTypes = []; - var accepts = ['application/vnd.dyspatch.2019.10+json']; - var returnType = TemplatesRead; - + let authNames = ['Bearer']; + let contentTypes = []; + let accepts = ['application/vnd.dyspatch.2019.10+json', '*/*']; + let returnType = TemplateRead; return this.apiClient.callApi( - '/templates', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, - authNames, contentTypes, accepts, returnType, callback + '/templates/{templateId}', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback ); } /** - * Callback function to receive the result of the templatesTemplateIdGet operation. - * @callback module:dyspatch-client/TemplatesApi~templatesTemplateIdGetCallback + * Callback function to receive the result of the getTemplates operation. + * @callback module:dyspatch-client/TemplatesApi~getTemplatesCallback * @param {String} error Error message, if any. - * @param {module:dyspatch-client/TemplateRead} data The data returned by the service call. + * @param {module:dyspatch-client/TemplatesRead} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** - * Get Template by ID - * Gets a template object with the matching ID. If the template has published content the \"compiled\" field will contain the template . - * @param {String} templateId A template ID - * @param {module:dyspatch-client/String} targetLanguage The type of templating language to compile as. Should only be used for visual templates. - * @param {module:dyspatch-client/TemplatesApi~templatesTemplateIdGetCallback} callback The callback function, accepting three arguments: error, data, response - * data is of type: {@link module:dyspatch-client/TemplateRead} + * List Templates + * Gets a list of Template Metadata objects for all templates. Up to 25 results returned before results are paginated. + * @param {String} accept A version of the API that should be used for the request. For example, to use version \"2019.10\", set the value to \"application/vnd.dyspatch.2019.10+json\" + * @param {Object} opts Optional parameters + * @param {String} opts.cursor A cursor value used to retrieve a specific page from a paginated result set. + * @param {module:dyspatch-client/TemplatesApi~getTemplatesCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:dyspatch-client/TemplatesRead} */ - this.templatesTemplateIdGet = function(templateId, targetLanguage, callback) { - var postBody = null; - - // verify the required parameter 'templateId' is set - if (templateId === undefined || templateId === null) { - throw new Error("Missing the required parameter 'templateId' when calling templatesTemplateIdGet"); - } - - // verify the required parameter 'targetLanguage' is set - if (targetLanguage === undefined || targetLanguage === null) { - throw new Error("Missing the required parameter 'targetLanguage' when calling templatesTemplateIdGet"); + getTemplates(accept, opts, callback) { + opts = opts || {}; + let postBody = null; + // verify the required parameter 'accept' is set + if (accept === undefined || accept === null) { + throw new Error("Missing the required parameter 'accept' when calling getTemplates"); } - - var pathParams = { - 'templateId': templateId + let pathParams = { }; - var queryParams = { - 'targetLanguage': targetLanguage, + let queryParams = { + 'cursor': opts['cursor'] }; - var collectionQueryParams = { + let headerParams = { + 'Accept': accept }; - var headerParams = { + let formParams = { }; - var formParams = { - }; - - var authNames = ['Bearer']; - var contentTypes = []; - var accepts = ['application/vnd.dyspatch.2019.10+json']; - var returnType = TemplateRead; + let authNames = ['Bearer']; + let contentTypes = []; + let accepts = ['application/vnd.dyspatch.2019.10+json', '*/*']; + let returnType = TemplatesRead; return this.apiClient.callApi( - '/templates/{templateId}', 'GET', - pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, - authNames, contentTypes, accepts, returnType, callback + '/templates', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback ); } - }; - return exports; -})); + +} diff --git a/src/dyspatch-client/TemplatesRead.js b/src/dyspatch-client/TemplatesRead.js index f6bb02d..1d05005 100644 --- a/src/dyspatch-client/TemplatesRead.js +++ b/src/dyspatch-client/TemplatesRead.js @@ -1,79 +1,83 @@ -/* +/** * Dyspatch API - * # Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) * - * OpenAPI spec version: 2019.10 + * The version of the OpenAPI document: 2019.10 * Contact: support@dyspatch.io * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.4.10 - * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'dyspatch-client/Cursor', 'dyspatch-client/TemplateMetaRead'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('../ApiClient'), require('./Cursor'), require('./TemplateMetaRead')); - } else { - // Browser globals (root is window) - if (!root.DyspatchClient) { - root.DyspatchClient = {}; +import ApiClient from '../ApiClient'; +import Cursor from './Cursor'; +import TemplateMetaRead from './TemplateMetaRead'; + +/** + * The TemplatesRead model module. + * @module dyspatch-client/TemplatesRead + * @version 4.0.0 + */ +class TemplatesRead { + /** + * Constructs a new TemplatesRead. + * list of template metadata + * @alias module:dyspatch-client/TemplatesRead + */ + constructor() { + + TemplatesRead.initialize(this); } - root.DyspatchClient.TemplatesRead = factory(root.DyspatchClient.ApiClient, root.DyspatchClient.Cursor, root.DyspatchClient.TemplateMetaRead); - } -}(this, function(ApiClient, Cursor, TemplateMetaRead) { - 'use strict'; - - /** - * The TemplatesRead model module. - * @module dyspatch-client/TemplatesRead - * @version 3.0.1 - */ - - /** - * Constructs a new TemplatesRead. - * @alias module:dyspatch-client/TemplatesRead - * @class - */ - var exports = function() { - }; - - /** - * Constructs a TemplatesRead from a plain JavaScript object, optionally creating a new instance. - * Copies all relevant properties from data to obj if supplied or a new instance if not. - * @param {Object} data The plain JavaScript object bearing properties of interest. - * @param {module:dyspatch-client/TemplatesRead} obj Optional instance to populate. - * @return {module:dyspatch-client/TemplatesRead} The populated TemplatesRead instance. - */ - exports.constructFromObject = function(data, obj) { - if (data) { - obj = obj || new exports(); - if (data.hasOwnProperty('cursor')) - obj.cursor = Cursor.constructFromObject(data['cursor']); - if (data.hasOwnProperty('data')) - obj.data = ApiClient.convertToType(data['data'], [TemplateMetaRead]); + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { } - return obj; - } - /** - * @member {module:dyspatch-client/Cursor} cursor - */ - exports.prototype.cursor = undefined; + /** + * Constructs a TemplatesRead from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:dyspatch-client/TemplatesRead} obj Optional instance to populate. + * @return {module:dyspatch-client/TemplatesRead} The populated TemplatesRead instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new TemplatesRead(); + + if (data.hasOwnProperty('cursor')) { + obj['cursor'] = Cursor.constructFromObject(data['cursor']); + } + if (data.hasOwnProperty('data')) { + obj['data'] = ApiClient.convertToType(data['data'], [TemplateMetaRead]); + } + } + return obj; + } + + +} + +/** + * @member {module:dyspatch-client/Cursor} cursor + */ +TemplatesRead.prototype['cursor'] = undefined; + +/** + * A list of template metadata objects + * @member {Array.} data + */ +TemplatesRead.prototype['data'] = undefined; + + + + - /** - * A list of template metadata objects - * @member {Array.} data - */ - exports.prototype.data = undefined; - return exports; +export default TemplatesRead; -})); diff --git a/src/index.js b/src/index.js index 1626387..5454a35 100644 --- a/src/index.js +++ b/src/index.js @@ -1,218 +1,167 @@ -/* +/** * Dyspatch API - * # Introduction The Dyspatch API is based on the REST paradigm and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) * - * OpenAPI spec version: 2019.10 + * The version of the OpenAPI document: 2019.10 * Contact: support@dyspatch.io * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * - * Swagger Codegen version: 2.4.10 - * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech * Do not edit the class manually. * */ -(function(factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['ApiClient', 'dyspatch-client/APIError', 'dyspatch-client/Body', 'dyspatch-client/CompiledRead', 'dyspatch-client/CreatedAt', 'dyspatch-client/Cursor', 'dyspatch-client/DraftDescription', 'dyspatch-client/DraftId', 'dyspatch-client/DraftMetaRead', 'dyspatch-client/DraftName', 'dyspatch-client/DraftRead', 'dyspatch-client/DraftUrl', 'dyspatch-client/DraftsRead', 'dyspatch-client/LanguageId', 'dyspatch-client/LocalizationId', 'dyspatch-client/LocalizationKeyRead', 'dyspatch-client/LocalizationMetaRead', 'dyspatch-client/LocalizationName', 'dyspatch-client/LocalizationRead', 'dyspatch-client/LocalizationUrl', 'dyspatch-client/TemplateDescription', 'dyspatch-client/TemplateId', 'dyspatch-client/TemplateMetaRead', 'dyspatch-client/TemplateName', 'dyspatch-client/TemplateRead', 'dyspatch-client/TemplateUrl', 'dyspatch-client/TemplatesRead', 'dyspatch-client/UpdatedAt', 'dyspatch-client/DraftsApi', 'dyspatch-client/LocalizationsApi', 'dyspatch-client/TemplatesApi'], factory); - } else if (typeof module === 'object' && module.exports) { - // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('./ApiClient'), require('./dyspatch-client/APIError'), require('./dyspatch-client/Body'), require('./dyspatch-client/CompiledRead'), require('./dyspatch-client/CreatedAt'), require('./dyspatch-client/Cursor'), require('./dyspatch-client/DraftDescription'), require('./dyspatch-client/DraftId'), require('./dyspatch-client/DraftMetaRead'), require('./dyspatch-client/DraftName'), require('./dyspatch-client/DraftRead'), require('./dyspatch-client/DraftUrl'), require('./dyspatch-client/DraftsRead'), require('./dyspatch-client/LanguageId'), require('./dyspatch-client/LocalizationId'), require('./dyspatch-client/LocalizationKeyRead'), require('./dyspatch-client/LocalizationMetaRead'), require('./dyspatch-client/LocalizationName'), require('./dyspatch-client/LocalizationRead'), require('./dyspatch-client/LocalizationUrl'), require('./dyspatch-client/TemplateDescription'), require('./dyspatch-client/TemplateId'), require('./dyspatch-client/TemplateMetaRead'), require('./dyspatch-client/TemplateName'), require('./dyspatch-client/TemplateRead'), require('./dyspatch-client/TemplateUrl'), require('./dyspatch-client/TemplatesRead'), require('./dyspatch-client/UpdatedAt'), require('./dyspatch-client/DraftsApi'), require('./dyspatch-client/LocalizationsApi'), require('./dyspatch-client/TemplatesApi')); - } -}(function(ApiClient, APIError, Body, CompiledRead, CreatedAt, Cursor, DraftDescription, DraftId, DraftMetaRead, DraftName, DraftRead, DraftUrl, DraftsRead, LanguageId, LocalizationId, LocalizationKeyRead, LocalizationMetaRead, LocalizationName, LocalizationRead, LocalizationUrl, TemplateDescription, TemplateId, TemplateMetaRead, TemplateName, TemplateRead, TemplateUrl, TemplatesRead, UpdatedAt, DraftsApi, LocalizationsApi, TemplatesApi) { - 'use strict'; - - /** - * _IntroductionThe_Dyspatch_API_is_based_on_the_REST_paradigm_and_features_resource_based_URLs_with_standard_HTTP_responsecodes_to_indicate_errors__We_use_standard_HTTP_authentication_and_request_verbs_and_all_responses_are_JSON_formatted_See_our__Implementation_Guide_httpsdocs_dyspatch_iodevelopmentimplementing_dyspatch_for_more_details_onhow_to_implement_Dyspatch__API_Client_LibrariesDyspatch_provides_API_Clients_for_the_following_languages_and_web_frameworks___Java_httpsgithub_comgetdyspatchdyspatch_java___Javascript_httpsgithub_comgetdyspatchdyspatch_javascript___Python_httpsgithub_comgetdyspatchdyspatch_python___C_httpsgithub_comgetdyspatchdyspatch_dotnet___Go_httpsgithub_comgetdyspatchdyspatch_golang___Ruby_httpsgithub_comgetdyspatchdyspatch_ruby.
- * The index module provides access to constructors for all the classes which comprise the public API. - *

- * An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: - *

-   * var DyspatchClient = require('index'); // See note below*.
-   * var xxxSvc = new DyspatchClient.XxxApi(); // Allocate the API class we're going to use.
-   * var yyyModel = new DyspatchClient.Yyy(); // Construct a model instance.
-   * yyyModel.someProperty = 'someValue';
-   * ...
-   * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
-   * ...
-   * 
- * *NOTE: For a top-level AMD script, use require(['index'], function(){...}) - * and put the application logic within the callback function. - *

- *

- * A non-AMD browser application (discouraged) might do something like this: - *

-   * var xxxSvc = new DyspatchClient.XxxApi(); // Allocate the API class we're going to use.
-   * var yyy = new DyspatchClient.Yyy(); // Construct a model instance.
-   * yyyModel.someProperty = 'someValue';
-   * ...
-   * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
-   * ...
-   * 
- *

- * @module index - * @version 3.0.1 - */ - var exports = { + +import ApiClient from './ApiClient'; +import APIError from './dyspatch-client/APIError'; +import CompiledRead from './dyspatch-client/CompiledRead'; +import Cursor from './dyspatch-client/Cursor'; +import DraftMetaRead from './dyspatch-client/DraftMetaRead'; +import DraftRead from './dyspatch-client/DraftRead'; +import DraftsRead from './dyspatch-client/DraftsRead'; +import InlineObject from './dyspatch-client/InlineObject'; +import LocalizationKeyRead from './dyspatch-client/LocalizationKeyRead'; +import LocalizationMetaRead from './dyspatch-client/LocalizationMetaRead'; +import LocalizationRead from './dyspatch-client/LocalizationRead'; +import TemplateMetaRead from './dyspatch-client/TemplateMetaRead'; +import TemplateRead from './dyspatch-client/TemplateRead'; +import TemplatesRead from './dyspatch-client/TemplatesRead'; +import DraftsApi from './dyspatch-client/DraftsApi'; +import LocalizationsApi from './dyspatch-client/LocalizationsApi'; +import TemplatesApi from './dyspatch-client/TemplatesApi'; + + +/** +* _IntroductionThe_Dyspatch_API_is_based_on_the_REST_paradigm_and_features_resource_based_URLs_with_standard_HTTP_response_codes_to_indicate_errors__We_use_standard_HTTP_authentication_and_request_verbs_and_all_responses_are_JSON_formatted__See_our__Implementation_Guide_https__docs_dyspatch_io_development_implementing_dyspatch__for_more_details_on_how_to_implement_Dyspatch__API_Client_Libraries_Dyspatch_provides_API_Clients_for_popular_languages_and_web_frameworks____Java_https__github_com_getdyspatch_dyspatch_java____Javascript_https__github_com_getdyspatch_dyspatch_javascript____Python_https__github_com_getdyspatch_dyspatch_python____C_https__github_com_getdyspatch_dyspatch_dotnet____Go_https__github_com_getdyspatch_dyspatch_golang____Ruby_https__github_com_getdyspatch_dyspatch_ruby.
+* The index module provides access to constructors for all the classes which comprise the public API. +*

+* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: +*

+* var DyspatchClient = require('index'); // See note below*.
+* var xxxSvc = new DyspatchClient.XxxApi(); // Allocate the API class we're going to use.
+* var yyyModel = new DyspatchClient.Yyy(); // Construct a model instance.
+* yyyModel.someProperty = 'someValue';
+* ...
+* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
+* ...
+* 
+* *NOTE: For a top-level AMD script, use require(['index'], function(){...}) +* and put the application logic within the callback function. +*

+*

+* A non-AMD browser application (discouraged) might do something like this: +*

+* var xxxSvc = new DyspatchClient.XxxApi(); // Allocate the API class we're going to use.
+* var yyy = new DyspatchClient.Yyy(); // Construct a model instance.
+* yyyModel.someProperty = 'someValue';
+* ...
+* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
+* ...
+* 
+*

+* @module index +* @version 4.0.0 +*/ +export { /** * The ApiClient constructor. * @property {module:ApiClient} */ - ApiClient: ApiClient, + ApiClient, + /** * The APIError model constructor. * @property {module:dyspatch-client/APIError} */ - APIError: APIError, - /** - * The Body model constructor. - * @property {module:dyspatch-client/Body} - */ - Body: Body, + APIError, + /** * The CompiledRead model constructor. * @property {module:dyspatch-client/CompiledRead} */ - CompiledRead: CompiledRead, - /** - * The CreatedAt model constructor. - * @property {module:dyspatch-client/CreatedAt} - */ - CreatedAt: CreatedAt, + CompiledRead, + /** * The Cursor model constructor. * @property {module:dyspatch-client/Cursor} */ - Cursor: Cursor, - /** - * The DraftDescription model constructor. - * @property {module:dyspatch-client/DraftDescription} - */ - DraftDescription: DraftDescription, - /** - * The DraftId model constructor. - * @property {module:dyspatch-client/DraftId} - */ - DraftId: DraftId, + Cursor, + /** * The DraftMetaRead model constructor. * @property {module:dyspatch-client/DraftMetaRead} */ - DraftMetaRead: DraftMetaRead, - /** - * The DraftName model constructor. - * @property {module:dyspatch-client/DraftName} - */ - DraftName: DraftName, + DraftMetaRead, + /** * The DraftRead model constructor. * @property {module:dyspatch-client/DraftRead} */ - DraftRead: DraftRead, - /** - * The DraftUrl model constructor. - * @property {module:dyspatch-client/DraftUrl} - */ - DraftUrl: DraftUrl, + DraftRead, + /** * The DraftsRead model constructor. * @property {module:dyspatch-client/DraftsRead} */ - DraftsRead: DraftsRead, - /** - * The LanguageId model constructor. - * @property {module:dyspatch-client/LanguageId} - */ - LanguageId: LanguageId, + DraftsRead, + /** - * The LocalizationId model constructor. - * @property {module:dyspatch-client/LocalizationId} + * The InlineObject model constructor. + * @property {module:dyspatch-client/InlineObject} */ - LocalizationId: LocalizationId, + InlineObject, + /** * The LocalizationKeyRead model constructor. * @property {module:dyspatch-client/LocalizationKeyRead} */ - LocalizationKeyRead: LocalizationKeyRead, + LocalizationKeyRead, + /** * The LocalizationMetaRead model constructor. * @property {module:dyspatch-client/LocalizationMetaRead} */ - LocalizationMetaRead: LocalizationMetaRead, - /** - * The LocalizationName model constructor. - * @property {module:dyspatch-client/LocalizationName} - */ - LocalizationName: LocalizationName, + LocalizationMetaRead, + /** * The LocalizationRead model constructor. * @property {module:dyspatch-client/LocalizationRead} */ - LocalizationRead: LocalizationRead, - /** - * The LocalizationUrl model constructor. - * @property {module:dyspatch-client/LocalizationUrl} - */ - LocalizationUrl: LocalizationUrl, - /** - * The TemplateDescription model constructor. - * @property {module:dyspatch-client/TemplateDescription} - */ - TemplateDescription: TemplateDescription, - /** - * The TemplateId model constructor. - * @property {module:dyspatch-client/TemplateId} - */ - TemplateId: TemplateId, + LocalizationRead, + /** * The TemplateMetaRead model constructor. * @property {module:dyspatch-client/TemplateMetaRead} */ - TemplateMetaRead: TemplateMetaRead, - /** - * The TemplateName model constructor. - * @property {module:dyspatch-client/TemplateName} - */ - TemplateName: TemplateName, + TemplateMetaRead, + /** * The TemplateRead model constructor. * @property {module:dyspatch-client/TemplateRead} */ - TemplateRead: TemplateRead, - /** - * The TemplateUrl model constructor. - * @property {module:dyspatch-client/TemplateUrl} - */ - TemplateUrl: TemplateUrl, + TemplateRead, + /** * The TemplatesRead model constructor. * @property {module:dyspatch-client/TemplatesRead} */ - TemplatesRead: TemplatesRead, - /** - * The UpdatedAt model constructor. - * @property {module:dyspatch-client/UpdatedAt} - */ - UpdatedAt: UpdatedAt, - /** - * The DraftsApi service constructor. - * @property {module:dyspatch-client/DraftsApi} - */ - DraftsApi: DraftsApi, + TemplatesRead, + /** - * The LocalizationsApi service constructor. - * @property {module:dyspatch-client/LocalizationsApi} - */ - LocalizationsApi: LocalizationsApi, + * The DraftsApi service constructor. + * @property {module:dyspatch-client/DraftsApi} + */ + DraftsApi, + /** - * The TemplatesApi service constructor. - * @property {module:dyspatch-client/TemplatesApi} - */ - TemplatesApi: TemplatesApi - }; + * The LocalizationsApi service constructor. + * @property {module:dyspatch-client/LocalizationsApi} + */ + LocalizationsApi, - return exports; -})); + /** + * The TemplatesApi service constructor. + * @property {module:dyspatch-client/TemplatesApi} + */ + TemplatesApi +}; diff --git a/test/api/DraftsApi.spec.js b/test/api/DraftsApi.spec.js new file mode 100644 index 0000000..319ce99 --- /dev/null +++ b/test/api/DraftsApi.spec.js @@ -0,0 +1,133 @@ +/** + * Dyspatch API + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) + * + * The version of the OpenAPI document: 2019.10 + * Contact: support@dyspatch.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.DyspatchClient); + } +}(this, function(expect, DyspatchClient) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new DyspatchClient.DraftsApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('DraftsApi', function() { + describe('deleteLocalization', function() { + it('should call deleteLocalization successfully', function(done) { + //uncomment below and update the code to test deleteLocalization + //instance.deleteLocalization(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getDraftById', function() { + it('should call getDraftById successfully', function(done) { + //uncomment below and update the code to test getDraftById + //instance.getDraftById(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getDraftLocalizationKeys', function() { + it('should call getDraftLocalizationKeys successfully', function(done) { + //uncomment below and update the code to test getDraftLocalizationKeys + //instance.getDraftLocalizationKeys(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getDrafts', function() { + it('should call getDrafts successfully', function(done) { + //uncomment below and update the code to test getDrafts + //instance.getDrafts(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getLocalizationForDraft', function() { + it('should call getLocalizationForDraft successfully', function(done) { + //uncomment below and update the code to test getLocalizationForDraft + //instance.getLocalizationForDraft(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('saveLocalization', function() { + it('should call saveLocalization successfully', function(done) { + //uncomment below and update the code to test saveLocalization + //instance.saveLocalization(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('setTranslation', function() { + it('should call setTranslation successfully', function(done) { + //uncomment below and update the code to test setTranslation + //instance.setTranslation(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('submitDraftForApproval', function() { + it('should call submitDraftForApproval successfully', function(done) { + //uncomment below and update the code to test submitDraftForApproval + //instance.submitDraftForApproval(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/test/api/LocalizationsApi.spec.js b/test/api/LocalizationsApi.spec.js new file mode 100644 index 0000000..06a3602 --- /dev/null +++ b/test/api/LocalizationsApi.spec.js @@ -0,0 +1,63 @@ +/** + * Dyspatch API + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) + * + * The version of the OpenAPI document: 2019.10 + * Contact: support@dyspatch.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.DyspatchClient); + } +}(this, function(expect, DyspatchClient) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new DyspatchClient.LocalizationsApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('LocalizationsApi', function() { + describe('getLocalizationById', function() { + it('should call getLocalizationById successfully', function(done) { + //uncomment below and update the code to test getLocalizationById + //instance.getLocalizationById(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/test/api/TemplatesApi.spec.js b/test/api/TemplatesApi.spec.js new file mode 100644 index 0000000..ca4c39e --- /dev/null +++ b/test/api/TemplatesApi.spec.js @@ -0,0 +1,73 @@ +/** + * Dyspatch API + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) + * + * The version of the OpenAPI document: 2019.10 + * Contact: support@dyspatch.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.DyspatchClient); + } +}(this, function(expect, DyspatchClient) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new DyspatchClient.TemplatesApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('TemplatesApi', function() { + describe('getTemplateById', function() { + it('should call getTemplateById successfully', function(done) { + //uncomment below and update the code to test getTemplateById + //instance.getTemplateById(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getTemplates', function() { + it('should call getTemplates successfully', function(done) { + //uncomment below and update the code to test getTemplates + //instance.getTemplates(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/test/model/APIError.spec.js b/test/model/APIError.spec.js new file mode 100644 index 0000000..9dffd36 --- /dev/null +++ b/test/model/APIError.spec.js @@ -0,0 +1,77 @@ +/** + * Dyspatch API + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) + * + * The version of the OpenAPI document: 2019.10 + * Contact: support@dyspatch.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.DyspatchClient); + } +}(this, function(expect, DyspatchClient) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new DyspatchClient.APIError(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('APIError', function() { + it('should create an instance of APIError', function() { + // uncomment below and update the code to test APIError + //var instane = new DyspatchClient.APIError(); + //expect(instance).to.be.a(DyspatchClient.APIError); + }); + + it('should have the property code (base name: "code")', function() { + // uncomment below and update the code to test the property code + //var instane = new DyspatchClient.APIError(); + //expect(instance).to.be(); + }); + + it('should have the property message (base name: "message")', function() { + // uncomment below and update the code to test the property message + //var instane = new DyspatchClient.APIError(); + //expect(instance).to.be(); + }); + + it('should have the property parameter (base name: "parameter")', function() { + // uncomment below and update the code to test the property parameter + //var instane = new DyspatchClient.APIError(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/CompiledRead.spec.js b/test/model/CompiledRead.spec.js new file mode 100644 index 0000000..883a1b2 --- /dev/null +++ b/test/model/CompiledRead.spec.js @@ -0,0 +1,89 @@ +/** + * Dyspatch API + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) + * + * The version of the OpenAPI document: 2019.10 + * Contact: support@dyspatch.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.DyspatchClient); + } +}(this, function(expect, DyspatchClient) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new DyspatchClient.CompiledRead(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('CompiledRead', function() { + it('should create an instance of CompiledRead', function() { + // uncomment below and update the code to test CompiledRead + //var instane = new DyspatchClient.CompiledRead(); + //expect(instance).to.be.a(DyspatchClient.CompiledRead); + }); + + it('should have the property sender (base name: "sender")', function() { + // uncomment below and update the code to test the property sender + //var instane = new DyspatchClient.CompiledRead(); + //expect(instance).to.be(); + }); + + it('should have the property replyTo (base name: "replyTo")', function() { + // uncomment below and update the code to test the property replyTo + //var instane = new DyspatchClient.CompiledRead(); + //expect(instance).to.be(); + }); + + it('should have the property subject (base name: "subject")', function() { + // uncomment below and update the code to test the property subject + //var instane = new DyspatchClient.CompiledRead(); + //expect(instance).to.be(); + }); + + it('should have the property html (base name: "html")', function() { + // uncomment below and update the code to test the property html + //var instane = new DyspatchClient.CompiledRead(); + //expect(instance).to.be(); + }); + + it('should have the property text (base name: "text")', function() { + // uncomment below and update the code to test the property text + //var instane = new DyspatchClient.CompiledRead(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/Cursor.spec.js b/test/model/Cursor.spec.js new file mode 100644 index 0000000..45d1b91 --- /dev/null +++ b/test/model/Cursor.spec.js @@ -0,0 +1,71 @@ +/** + * Dyspatch API + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) + * + * The version of the OpenAPI document: 2019.10 + * Contact: support@dyspatch.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.DyspatchClient); + } +}(this, function(expect, DyspatchClient) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new DyspatchClient.Cursor(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('Cursor', function() { + it('should create an instance of Cursor', function() { + // uncomment below and update the code to test Cursor + //var instane = new DyspatchClient.Cursor(); + //expect(instance).to.be.a(DyspatchClient.Cursor); + }); + + it('should have the property next (base name: "next")', function() { + // uncomment below and update the code to test the property next + //var instane = new DyspatchClient.Cursor(); + //expect(instance).to.be(); + }); + + it('should have the property hasMore (base name: "hasMore")', function() { + // uncomment below and update the code to test the property hasMore + //var instane = new DyspatchClient.Cursor(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/DraftMetaRead.spec.js b/test/model/DraftMetaRead.spec.js new file mode 100644 index 0000000..5eee801 --- /dev/null +++ b/test/model/DraftMetaRead.spec.js @@ -0,0 +1,101 @@ +/** + * Dyspatch API + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) + * + * The version of the OpenAPI document: 2019.10 + * Contact: support@dyspatch.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.DyspatchClient); + } +}(this, function(expect, DyspatchClient) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new DyspatchClient.DraftMetaRead(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('DraftMetaRead', function() { + it('should create an instance of DraftMetaRead', function() { + // uncomment below and update the code to test DraftMetaRead + //var instane = new DyspatchClient.DraftMetaRead(); + //expect(instance).to.be.a(DyspatchClient.DraftMetaRead); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new DyspatchClient.DraftMetaRead(); + //expect(instance).to.be(); + }); + + it('should have the property templateId (base name: "templateId")', function() { + // uncomment below and update the code to test the property templateId + //var instane = new DyspatchClient.DraftMetaRead(); + //expect(instance).to.be(); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new DyspatchClient.DraftMetaRead(); + //expect(instance).to.be(); + }); + + it('should have the property description (base name: "description")', function() { + // uncomment below and update the code to test the property description + //var instane = new DyspatchClient.DraftMetaRead(); + //expect(instance).to.be(); + }); + + it('should have the property url (base name: "url")', function() { + // uncomment below and update the code to test the property url + //var instane = new DyspatchClient.DraftMetaRead(); + //expect(instance).to.be(); + }); + + it('should have the property createdAt (base name: "createdAt")', function() { + // uncomment below and update the code to test the property createdAt + //var instane = new DyspatchClient.DraftMetaRead(); + //expect(instance).to.be(); + }); + + it('should have the property updatedAt (base name: "updatedAt")', function() { + // uncomment below and update the code to test the property updatedAt + //var instane = new DyspatchClient.DraftMetaRead(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/DraftRead.spec.js b/test/model/DraftRead.spec.js new file mode 100644 index 0000000..b733b2b --- /dev/null +++ b/test/model/DraftRead.spec.js @@ -0,0 +1,107 @@ +/** + * Dyspatch API + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) + * + * The version of the OpenAPI document: 2019.10 + * Contact: support@dyspatch.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.DyspatchClient); + } +}(this, function(expect, DyspatchClient) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new DyspatchClient.DraftRead(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('DraftRead', function() { + it('should create an instance of DraftRead', function() { + // uncomment below and update the code to test DraftRead + //var instane = new DyspatchClient.DraftRead(); + //expect(instance).to.be.a(DyspatchClient.DraftRead); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new DyspatchClient.DraftRead(); + //expect(instance).to.be(); + }); + + it('should have the property template (base name: "template")', function() { + // uncomment below and update the code to test the property template + //var instane = new DyspatchClient.DraftRead(); + //expect(instance).to.be(); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new DyspatchClient.DraftRead(); + //expect(instance).to.be(); + }); + + it('should have the property url (base name: "url")', function() { + // uncomment below and update the code to test the property url + //var instane = new DyspatchClient.DraftRead(); + //expect(instance).to.be(); + }); + + it('should have the property compiled (base name: "compiled")', function() { + // uncomment below and update the code to test the property compiled + //var instane = new DyspatchClient.DraftRead(); + //expect(instance).to.be(); + }); + + it('should have the property createdAt (base name: "createdAt")', function() { + // uncomment below and update the code to test the property createdAt + //var instane = new DyspatchClient.DraftRead(); + //expect(instance).to.be(); + }); + + it('should have the property updatedAt (base name: "updatedAt")', function() { + // uncomment below and update the code to test the property updatedAt + //var instane = new DyspatchClient.DraftRead(); + //expect(instance).to.be(); + }); + + it('should have the property localizations (base name: "localizations")', function() { + // uncomment below and update the code to test the property localizations + //var instane = new DyspatchClient.DraftRead(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/DraftsRead.spec.js b/test/model/DraftsRead.spec.js new file mode 100644 index 0000000..8741e6b --- /dev/null +++ b/test/model/DraftsRead.spec.js @@ -0,0 +1,71 @@ +/** + * Dyspatch API + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) + * + * The version of the OpenAPI document: 2019.10 + * Contact: support@dyspatch.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.DyspatchClient); + } +}(this, function(expect, DyspatchClient) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new DyspatchClient.DraftsRead(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('DraftsRead', function() { + it('should create an instance of DraftsRead', function() { + // uncomment below and update the code to test DraftsRead + //var instane = new DyspatchClient.DraftsRead(); + //expect(instance).to.be.a(DyspatchClient.DraftsRead); + }); + + it('should have the property cursor (base name: "cursor")', function() { + // uncomment below and update the code to test the property cursor + //var instane = new DyspatchClient.DraftsRead(); + //expect(instance).to.be(); + }); + + it('should have the property data (base name: "data")', function() { + // uncomment below and update the code to test the property data + //var instane = new DyspatchClient.DraftsRead(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/InlineObject.spec.js b/test/model/InlineObject.spec.js new file mode 100644 index 0000000..af570a9 --- /dev/null +++ b/test/model/InlineObject.spec.js @@ -0,0 +1,65 @@ +/** + * Dyspatch API + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) + * + * The version of the OpenAPI document: 2019.10 + * Contact: support@dyspatch.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.DyspatchClient); + } +}(this, function(expect, DyspatchClient) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new DyspatchClient.InlineObject(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('InlineObject', function() { + it('should create an instance of InlineObject', function() { + // uncomment below and update the code to test InlineObject + //var instane = new DyspatchClient.InlineObject(); + //expect(instance).to.be.a(DyspatchClient.InlineObject); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new DyspatchClient.InlineObject(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/LocalizationKeyRead.spec.js b/test/model/LocalizationKeyRead.spec.js new file mode 100644 index 0000000..300799b --- /dev/null +++ b/test/model/LocalizationKeyRead.spec.js @@ -0,0 +1,71 @@ +/** + * Dyspatch API + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) + * + * The version of the OpenAPI document: 2019.10 + * Contact: support@dyspatch.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.DyspatchClient); + } +}(this, function(expect, DyspatchClient) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new DyspatchClient.LocalizationKeyRead(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('LocalizationKeyRead', function() { + it('should create an instance of LocalizationKeyRead', function() { + // uncomment below and update the code to test LocalizationKeyRead + //var instane = new DyspatchClient.LocalizationKeyRead(); + //expect(instance).to.be.a(DyspatchClient.LocalizationKeyRead); + }); + + it('should have the property key (base name: "key")', function() { + // uncomment below and update the code to test the property key + //var instane = new DyspatchClient.LocalizationKeyRead(); + //expect(instance).to.be(); + }); + + it('should have the property comment (base name: "comment")', function() { + // uncomment below and update the code to test the property comment + //var instane = new DyspatchClient.LocalizationKeyRead(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/LocalizationMetaRead.spec.js b/test/model/LocalizationMetaRead.spec.js new file mode 100644 index 0000000..26c468d --- /dev/null +++ b/test/model/LocalizationMetaRead.spec.js @@ -0,0 +1,83 @@ +/** + * Dyspatch API + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) + * + * The version of the OpenAPI document: 2019.10 + * Contact: support@dyspatch.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.DyspatchClient); + } +}(this, function(expect, DyspatchClient) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new DyspatchClient.LocalizationMetaRead(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('LocalizationMetaRead', function() { + it('should create an instance of LocalizationMetaRead', function() { + // uncomment below and update the code to test LocalizationMetaRead + //var instane = new DyspatchClient.LocalizationMetaRead(); + //expect(instance).to.be.a(DyspatchClient.LocalizationMetaRead); + }); + + it('should have the property localization (base name: "localization")', function() { + // uncomment below and update the code to test the property localization + //var instane = new DyspatchClient.LocalizationMetaRead(); + //expect(instance).to.be(); + }); + + it('should have the property language (base name: "language")', function() { + // uncomment below and update the code to test the property language + //var instane = new DyspatchClient.LocalizationMetaRead(); + //expect(instance).to.be(); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new DyspatchClient.LocalizationMetaRead(); + //expect(instance).to.be(); + }); + + it('should have the property url (base name: "url")', function() { + // uncomment below and update the code to test the property url + //var instane = new DyspatchClient.LocalizationMetaRead(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/LocalizationRead.spec.js b/test/model/LocalizationRead.spec.js new file mode 100644 index 0000000..04ab936 --- /dev/null +++ b/test/model/LocalizationRead.spec.js @@ -0,0 +1,107 @@ +/** + * Dyspatch API + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) + * + * The version of the OpenAPI document: 2019.10 + * Contact: support@dyspatch.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.DyspatchClient); + } +}(this, function(expect, DyspatchClient) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new DyspatchClient.LocalizationRead(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('LocalizationRead', function() { + it('should create an instance of LocalizationRead', function() { + // uncomment below and update the code to test LocalizationRead + //var instane = new DyspatchClient.LocalizationRead(); + //expect(instance).to.be.a(DyspatchClient.LocalizationRead); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new DyspatchClient.LocalizationRead(); + //expect(instance).to.be(); + }); + + it('should have the property language (base name: "language")', function() { + // uncomment below and update the code to test the property language + //var instane = new DyspatchClient.LocalizationRead(); + //expect(instance).to.be(); + }); + + it('should have the property url (base name: "url")', function() { + // uncomment below and update the code to test the property url + //var instane = new DyspatchClient.LocalizationRead(); + //expect(instance).to.be(); + }); + + it('should have the property template (base name: "template")', function() { + // uncomment below and update the code to test the property template + //var instane = new DyspatchClient.LocalizationRead(); + //expect(instance).to.be(); + }); + + it('should have the property compiled (base name: "compiled")', function() { + // uncomment below and update the code to test the property compiled + //var instane = new DyspatchClient.LocalizationRead(); + //expect(instance).to.be(); + }); + + it('should have the property createdAt (base name: "createdAt")', function() { + // uncomment below and update the code to test the property createdAt + //var instane = new DyspatchClient.LocalizationRead(); + //expect(instance).to.be(); + }); + + it('should have the property updatedAt (base name: "updatedAt")', function() { + // uncomment below and update the code to test the property updatedAt + //var instane = new DyspatchClient.LocalizationRead(); + //expect(instance).to.be(); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new DyspatchClient.LocalizationRead(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/TemplateMetaRead.spec.js b/test/model/TemplateMetaRead.spec.js new file mode 100644 index 0000000..bd5f4f6 --- /dev/null +++ b/test/model/TemplateMetaRead.spec.js @@ -0,0 +1,101 @@ +/** + * Dyspatch API + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) + * + * The version of the OpenAPI document: 2019.10 + * Contact: support@dyspatch.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.DyspatchClient); + } +}(this, function(expect, DyspatchClient) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new DyspatchClient.TemplateMetaRead(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('TemplateMetaRead', function() { + it('should create an instance of TemplateMetaRead', function() { + // uncomment below and update the code to test TemplateMetaRead + //var instane = new DyspatchClient.TemplateMetaRead(); + //expect(instance).to.be.a(DyspatchClient.TemplateMetaRead); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new DyspatchClient.TemplateMetaRead(); + //expect(instance).to.be(); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new DyspatchClient.TemplateMetaRead(); + //expect(instance).to.be(); + }); + + it('should have the property description (base name: "description")', function() { + // uncomment below and update the code to test the property description + //var instane = new DyspatchClient.TemplateMetaRead(); + //expect(instance).to.be(); + }); + + it('should have the property url (base name: "url")', function() { + // uncomment below and update the code to test the property url + //var instane = new DyspatchClient.TemplateMetaRead(); + //expect(instance).to.be(); + }); + + it('should have the property localizations (base name: "localizations")', function() { + // uncomment below and update the code to test the property localizations + //var instane = new DyspatchClient.TemplateMetaRead(); + //expect(instance).to.be(); + }); + + it('should have the property createdAt (base name: "createdAt")', function() { + // uncomment below and update the code to test the property createdAt + //var instane = new DyspatchClient.TemplateMetaRead(); + //expect(instance).to.be(); + }); + + it('should have the property updatedAt (base name: "updatedAt")', function() { + // uncomment below and update the code to test the property updatedAt + //var instane = new DyspatchClient.TemplateMetaRead(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/TemplateRead.spec.js b/test/model/TemplateRead.spec.js new file mode 100644 index 0000000..721349d --- /dev/null +++ b/test/model/TemplateRead.spec.js @@ -0,0 +1,107 @@ +/** + * Dyspatch API + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) + * + * The version of the OpenAPI document: 2019.10 + * Contact: support@dyspatch.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.DyspatchClient); + } +}(this, function(expect, DyspatchClient) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new DyspatchClient.TemplateRead(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('TemplateRead', function() { + it('should create an instance of TemplateRead', function() { + // uncomment below and update the code to test TemplateRead + //var instane = new DyspatchClient.TemplateRead(); + //expect(instance).to.be.a(DyspatchClient.TemplateRead); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instane = new DyspatchClient.TemplateRead(); + //expect(instance).to.be(); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instane = new DyspatchClient.TemplateRead(); + //expect(instance).to.be(); + }); + + it('should have the property description (base name: "description")', function() { + // uncomment below and update the code to test the property description + //var instane = new DyspatchClient.TemplateRead(); + //expect(instance).to.be(); + }); + + it('should have the property url (base name: "url")', function() { + // uncomment below and update the code to test the property url + //var instane = new DyspatchClient.TemplateRead(); + //expect(instance).to.be(); + }); + + it('should have the property compiled (base name: "compiled")', function() { + // uncomment below and update the code to test the property compiled + //var instane = new DyspatchClient.TemplateRead(); + //expect(instance).to.be(); + }); + + it('should have the property createdAt (base name: "createdAt")', function() { + // uncomment below and update the code to test the property createdAt + //var instane = new DyspatchClient.TemplateRead(); + //expect(instance).to.be(); + }); + + it('should have the property updatedAt (base name: "updatedAt")', function() { + // uncomment below and update the code to test the property updatedAt + //var instane = new DyspatchClient.TemplateRead(); + //expect(instance).to.be(); + }); + + it('should have the property localizations (base name: "localizations")', function() { + // uncomment below and update the code to test the property localizations + //var instane = new DyspatchClient.TemplateRead(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/TemplatesRead.spec.js b/test/model/TemplatesRead.spec.js new file mode 100644 index 0000000..ed78fa3 --- /dev/null +++ b/test/model/TemplatesRead.spec.js @@ -0,0 +1,71 @@ +/** + * Dyspatch API + * # Introduction The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our [Implementation Guide](https://docs.dyspatch.io/development/implementing_dyspatch/) for more details on how to implement Dyspatch. ## API Client Libraries Dyspatch provides API Clients for popular languages and web frameworks. - [Java](https://github.com/getdyspatch/dyspatch-java) - [Javascript](https://github.com/getdyspatch/dyspatch-javascript) - [Python](https://github.com/getdyspatch/dyspatch-python) - [C#](https://github.com/getdyspatch/dyspatch-dotnet) - [Go](https://github.com/getdyspatch/dyspatch-golang) - [Ruby](https://github.com/getdyspatch/dyspatch-ruby) + * + * The version of the OpenAPI document: 2019.10 + * Contact: support@dyspatch.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.DyspatchClient); + } +}(this, function(expect, DyspatchClient) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new DyspatchClient.TemplatesRead(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('TemplatesRead', function() { + it('should create an instance of TemplatesRead', function() { + // uncomment below and update the code to test TemplatesRead + //var instane = new DyspatchClient.TemplatesRead(); + //expect(instance).to.be.a(DyspatchClient.TemplatesRead); + }); + + it('should have the property cursor (base name: "cursor")', function() { + // uncomment below and update the code to test the property cursor + //var instane = new DyspatchClient.TemplatesRead(); + //expect(instance).to.be(); + }); + + it('should have the property data (base name: "data")', function() { + // uncomment below and update the code to test the property data + //var instane = new DyspatchClient.TemplatesRead(); + //expect(instance).to.be(); + }); + + }); + +}));