@getopenpay/client
Version:
OpenPay API TypeScript SDK
65 lines (64 loc) • 2.33 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* OpenPay API
* super charge your subscription management.
*
* The version of the OpenAPI document: 1.2.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfWebhookDeliveryResult = instanceOfWebhookDeliveryResult;
exports.WebhookDeliveryResultFromJSON = WebhookDeliveryResultFromJSON;
exports.WebhookDeliveryResultFromJSONTyped = WebhookDeliveryResultFromJSONTyped;
exports.WebhookDeliveryResultToJSON = WebhookDeliveryResultToJSON;
exports.WebhookDeliveryResultToJSONTyped = WebhookDeliveryResultToJSONTyped;
/**
* Check if a given object implements the WebhookDeliveryResult interface.
*/
function instanceOfWebhookDeliveryResult(value) {
if (!('attemptTime' in value) || value['attemptTime'] === undefined)
return false;
if (!('eventId' in value) || value['eventId'] === undefined)
return false;
if (!('responseCode' in value) || value['responseCode'] === undefined)
return false;
if (!('webhookId' in value) || value['webhookId'] === undefined)
return false;
return true;
}
function WebhookDeliveryResultFromJSON(json) {
return WebhookDeliveryResultFromJSONTyped(json, false);
}
function WebhookDeliveryResultFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'attemptTime': (new Date(json['attempt_time'])),
'eventId': json['event_id'],
'responseCode': json['response_code'],
'responseText': json['response_text'] == null ? undefined : json['response_text'],
'webhookId': json['webhook_id'],
};
}
function WebhookDeliveryResultToJSON(json) {
return WebhookDeliveryResultToJSONTyped(json, false);
}
function WebhookDeliveryResultToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'attempt_time': ((value['attemptTime']).toISOString()),
'event_id': value['eventId'],
'response_code': value['responseCode'],
'response_text': value['responseText'],
'webhook_id': value['webhookId'],
};
}