UNPKG

infusionsoft-nodejs

Version:

A NodeJS SDK automatically generated from Infusionsoft API Swagger definitions.

178 lines (145 loc) 5.44 kB
/** * 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 OpportunityContact from './OpportunityContact'; import SimpleOpportunityStage from './SimpleOpportunityStage'; import SimpleUser from './SimpleUser'; /** * The Opportunity model module. * @module model/Opportunity * @version V1.0 */ export default class Opportunity { /** * Constructs a new <code>Opportunity</code>. * @alias module:model/Opportunity * @class * @param contact {module:model/OpportunityContact} * @param opportunityTitle {String} * @param stage {module:model/SimpleOpportunityStage} */ constructor(contact, opportunityTitle, stage) { this['contact'] = contact;this['opportunity_title'] = opportunityTitle;this['stage'] = stage; } /** * Constructs a <code>Opportunity</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/Opportunity} obj Optional instance to populate. * @return {module:model/Opportunity} The populated <code>Opportunity</code> instance. */ static constructFromObject(data, obj) { if (data) { obj = obj || new Opportunity(); if (data.hasOwnProperty('contact')) { obj['contact'] = OpportunityContact.constructFromObject(data['contact']); } if (data.hasOwnProperty('date_created')) { obj['date_created'] = ApiClient.convertToType(data['date_created'], 'Date'); } if (data.hasOwnProperty('estimated_close_date')) { obj['estimated_close_date'] = ApiClient.convertToType(data['estimated_close_date'], 'Date'); } if (data.hasOwnProperty('id')) { obj['id'] = ApiClient.convertToType(data['id'], 'Number'); } if (data.hasOwnProperty('include_in_forecast')) { obj['include_in_forecast'] = ApiClient.convertToType(data['include_in_forecast'], 'Number'); } if (data.hasOwnProperty('last_updated')) { obj['last_updated'] = ApiClient.convertToType(data['last_updated'], 'Date'); } if (data.hasOwnProperty('next_action_date')) { obj['next_action_date'] = ApiClient.convertToType(data['next_action_date'], 'Date'); } if (data.hasOwnProperty('next_action_notes')) { obj['next_action_notes'] = ApiClient.convertToType(data['next_action_notes'], 'String'); } if (data.hasOwnProperty('opportunity_notes')) { obj['opportunity_notes'] = ApiClient.convertToType(data['opportunity_notes'], 'String'); } if (data.hasOwnProperty('opportunity_title')) { obj['opportunity_title'] = ApiClient.convertToType(data['opportunity_title'], 'String'); } if (data.hasOwnProperty('projected_revenue_high')) { obj['projected_revenue_high'] = ApiClient.convertToType(data['projected_revenue_high'], 'Number'); } if (data.hasOwnProperty('projected_revenue_low')) { obj['projected_revenue_low'] = ApiClient.convertToType(data['projected_revenue_low'], 'Number'); } if (data.hasOwnProperty('stage')) { obj['stage'] = SimpleOpportunityStage.constructFromObject(data['stage']); } if (data.hasOwnProperty('user')) { obj['user'] = SimpleUser.constructFromObject(data['user']); } } return obj; } /** * @member {module:model/OpportunityContact} contact */ contact = undefined; /** * @member {Date} date_created */ date_created = undefined; /** * @member {Date} estimated_close_date */ estimated_close_date = undefined; /** * @member {Number} id */ id = undefined; /** * @member {Number} include_in_forecast */ include_in_forecast = undefined; /** * @member {Date} last_updated */ last_updated = undefined; /** * @member {Date} next_action_date */ next_action_date = undefined; /** * @member {String} next_action_notes */ next_action_notes = undefined; /** * @member {String} opportunity_notes */ opportunity_notes = undefined; /** * @member {String} opportunity_title */ opportunity_title = undefined; /** * @member {Number} projected_revenue_high */ projected_revenue_high = undefined; /** * @member {Number} projected_revenue_low */ projected_revenue_low = undefined; /** * @member {module:model/SimpleOpportunityStage} stage */ stage = undefined; /** * @member {module:model/SimpleUser} user */ user = undefined; }