infusionsoft-nodejs
Version:
A NodeJS SDK automatically generated from Infusionsoft API Swagger definitions.
173 lines (139 loc) • 4.64 kB
JavaScript
/**
* Infusionsoft REST API
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: V1.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
import Order from './Order';
/**
* The Transaction model module.
* @module model/Transaction
* @version V1.0
*/
export default class Transaction {
/**
* Constructs a new <code>Transaction</code>.
* @alias module:model/Transaction
* @class
*/
constructor() {
}
/**
* Constructs a <code>Transaction</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/Transaction} obj Optional instance to populate.
* @return {module:model/Transaction} The populated <code>Transaction</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new Transaction();
if (data.hasOwnProperty('amount')) {
obj['amount'] = ApiClient.convertToType(data['amount'], 'Number');
}
if (data.hasOwnProperty('collection_method')) {
obj['collection_method'] = ApiClient.convertToType(data['collection_method'], 'String');
}
if (data.hasOwnProperty('contact_id')) {
obj['contact_id'] = ApiClient.convertToType(data['contact_id'], 'Number');
}
if (data.hasOwnProperty('currency')) {
obj['currency'] = ApiClient.convertToType(data['currency'], 'String');
}
if (data.hasOwnProperty('errors')) {
obj['errors'] = ApiClient.convertToType(data['errors'], 'String');
}
if (data.hasOwnProperty('gateway')) {
obj['gateway'] = ApiClient.convertToType(data['gateway'], 'String');
}
if (data.hasOwnProperty('gateway_account_name')) {
obj['gateway_account_name'] = ApiClient.convertToType(data['gateway_account_name'], 'String');
}
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('order_ids')) {
obj['order_ids'] = ApiClient.convertToType(data['order_ids'], 'String');
}
if (data.hasOwnProperty('orders')) {
obj['orders'] = ApiClient.convertToType(data['orders'], [Order]);
}
if (data.hasOwnProperty('status')) {
obj['status'] = ApiClient.convertToType(data['status'], 'String');
}
if (data.hasOwnProperty('test')) {
obj['test'] = ApiClient.convertToType(data['test'], 'Boolean');
}
if (data.hasOwnProperty('transaction_date')) {
obj['transaction_date'] = ApiClient.convertToType(data['transaction_date'], 'String');
}
if (data.hasOwnProperty('type')) {
obj['type'] = ApiClient.convertToType(data['type'], 'String');
}
}
return obj;
}
/**
* @member {Number} amount
*/
amount = undefined;
/**
* @member {String} collection_method
*/
collection_method = undefined;
/**
* @member {Number} contact_id
*/
contact_id = undefined;
/**
* @member {String} currency
*/
currency = undefined;
/**
* @member {String} errors
*/
errors = undefined;
/**
* @member {String} gateway
*/
gateway = undefined;
/**
* @member {String} gateway_account_name
*/
gateway_account_name = undefined;
/**
* @member {Number} id
*/
id = undefined;
/**
* @member {String} order_ids
*/
order_ids = undefined;
/**
* @member {Array.<module:model/Order>} orders
*/
orders = undefined;
/**
* @member {String} status
*/
status = undefined;
/**
* @member {Boolean} test
*/
test = undefined;
/**
* @member {String} transaction_date
*/
transaction_date = undefined;
/**
* @member {String} type
*/
type = undefined;
}