UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

98 lines (82 loc) 3.3 kB
/** * Square Connect API * Client library for accessing the Square Connect APIs * * OpenAPI spec version: 2.0 * Contact: developers@squareup.com * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * * Swagger Codegen version: 2.3.0-SNAPSHOT * */ var ApiClient = require('../ApiClient'); /** * The SubscriptionEvent model module. * Note: This model is in beta. * @module model/SubscriptionEvent */ /** * Constructs a new <code>SubscriptionEvent</code>. * Describes changes to subscription and billing states. * @alias module:model/SubscriptionEvent * @class * @param id {String} The ID of the subscription event. * @param subscriptionEventType {String} Type of the subscription event. See [SubscriptionEventSubscriptionEventType](#type-subscriptioneventsubscriptioneventtype) for possible values * @param effectiveDate {String} The date, in YYYY-MM-DD format (for example, 2013-01-15), when the subscription event went into effect. * @param planId {String} The ID of the subscription plan associated with the subscription. */ var exports = function(id, subscriptionEventType, effectiveDate, planId) { var _this = this; _this['id'] = id; _this['subscription_event_type'] = subscriptionEventType; _this['effective_date'] = effectiveDate; _this['plan_id'] = planId; }; /** * Constructs a <code>SubscriptionEvent</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/SubscriptionEvent} obj Optional instance to populate. * @return {module:model/SubscriptionEvent} The populated <code>SubscriptionEvent</code> 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('subscription_event_type')) { obj['subscription_event_type'] = ApiClient.convertToType(data['subscription_event_type'], 'String'); } if (data.hasOwnProperty('effective_date')) { obj['effective_date'] = ApiClient.convertToType(data['effective_date'], 'String'); } if (data.hasOwnProperty('plan_id')) { obj['plan_id'] = ApiClient.convertToType(data['plan_id'], 'String'); } } return obj; } /** * The ID of the subscription event. * @member {String} id */ exports.prototype['id'] = undefined; /** * Type of the subscription event. See [SubscriptionEventSubscriptionEventType](#type-subscriptioneventsubscriptioneventtype) for possible values * @member {String} subscription_event_type */ exports.prototype['subscription_event_type'] = undefined; /** * The date, in YYYY-MM-DD format (for example, 2013-01-15), when the subscription event went into effect. * @member {String} effective_date */ exports.prototype['effective_date'] = undefined; /** * The ID of the subscription plan associated with the subscription. * @member {String} plan_id */ exports.prototype['plan_id'] = undefined; module.exports = exports;