cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
154 lines (129 loc) • 6.05 kB
JavaScript
/**
* CyberSource Merged Spec
* All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
*
* OpenAPI spec version: 0.0.1
*
* 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.38
*
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Notificationsubscriptionsv2webhooksProducts1', 'model/Notificationsubscriptionsv2webhooksRetryPolicy', 'model/Notificationsubscriptionsv2webhooksSecurityPolicy'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Notificationsubscriptionsv2webhooksProducts1'), require('./Notificationsubscriptionsv2webhooksRetryPolicy'), require('./Notificationsubscriptionsv2webhooksSecurityPolicy'));
} else {
// Browser globals (root is window)
if (!root.CyberSource) {
root.CyberSource = {};
}
root.CyberSource.CreateWebhook = factory(root.CyberSource.ApiClient, root.CyberSource.Notificationsubscriptionsv2webhooksProducts1, root.CyberSource.Notificationsubscriptionsv2webhooksRetryPolicy, root.CyberSource.Notificationsubscriptionsv2webhooksSecurityPolicy);
}
}(this, function(ApiClient, Notificationsubscriptionsv2webhooksProducts1, Notificationsubscriptionsv2webhooksRetryPolicy, Notificationsubscriptionsv2webhooksSecurityPolicy) {
'use strict';
/**
* The CreateWebhook model module.
* @module model/CreateWebhook
* @version 0.0.1
*/
/**
* Constructs a new <code>CreateWebhook</code>.
* @alias module:model/CreateWebhook
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>CreateWebhook</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/CreateWebhook} obj Optional instance to populate.
* @return {module:model/CreateWebhook} The populated <code>CreateWebhook</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
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('organizationId')) {
obj['organizationId'] = ApiClient.convertToType(data['organizationId'], 'String');
}
if (data.hasOwnProperty('products')) {
obj['products'] = ApiClient.convertToType(data['products'], [Notificationsubscriptionsv2webhooksProducts1]);
}
if (data.hasOwnProperty('webhookUrl')) {
obj['webhookUrl'] = ApiClient.convertToType(data['webhookUrl'], 'String');
}
if (data.hasOwnProperty('healthCheckUrl')) {
obj['healthCheckUrl'] = ApiClient.convertToType(data['healthCheckUrl'], 'String');
}
if (data.hasOwnProperty('retryPolicy')) {
obj['retryPolicy'] = Notificationsubscriptionsv2webhooksRetryPolicy.constructFromObject(data['retryPolicy']);
}
if (data.hasOwnProperty('notificationScope')) {
obj['notificationScope'] = ApiClient.convertToType(data['notificationScope'], 'String');
}
if (data.hasOwnProperty('securityPolicy')) {
obj['securityPolicy'] = Notificationsubscriptionsv2webhooksSecurityPolicy.constructFromObject(data['securityPolicy']);
}
}
return obj;
}
/**
* Client friendly webhook name.
* @member {String} name
*/
exports.prototype['name'] = undefined;
/**
* Client friendly webhook description.
* @member {String} description
*/
exports.prototype['description'] = undefined;
/**
* Organization Identifier (OrgId) or Merchant Identifier (MID).
* @member {String} organizationId
*/
exports.prototype['organizationId'] = undefined;
/**
* To see the valid productId and eventTypes, call the \"Create and Manage Webhooks - Retrieve a list of event types\" endpoint.
* @member {Array.<module:model/Notificationsubscriptionsv2webhooksProducts1>} products
*/
exports.prototype['products'] = undefined;
/**
* The client's endpoint (URL) to receive webhooks.
* @member {String} webhookUrl
*/
exports.prototype['webhookUrl'] = undefined;
/**
* The client's health check endpoint (URL). If the user does not provide the health check URL, it is the user's responsibility to re-activate the webhook if it is deactivated by calling the test endpoint.
* @member {String} healthCheckUrl
*/
exports.prototype['healthCheckUrl'] = undefined;
/**
* @member {module:model/Notificationsubscriptionsv2webhooksRetryPolicy} retryPolicy
*/
exports.prototype['retryPolicy'] = undefined;
/**
* The webhook scope. 1. SELF The Webhook is used to deliver webhooks for only this Organization (or Merchant). 2. DESCENDANTS The Webhook is used to deliver webhooks for this Organization and its children. This field is optional. Possible values: - SELF - DESCENDANTS
* @member {String} notificationScope
* @default 'DESCENDANTS'
*/
exports.prototype['notificationScope'] = 'DESCENDANTS';
/**
* @member {module:model/Notificationsubscriptionsv2webhooksSecurityPolicy} securityPolicy
*/
exports.prototype['securityPolicy'] = undefined;
return exports;
}));