@gitchrisqueen/tdameritrade-api-js-client
Version:
TD Ameritrade API integration for node.js
117 lines (104 loc) • 3.93 kB
JavaScript
/*
* TD Ameritrade API - OAuth2
* This is replication of the TD Ameritrade API.
*
* OpenAPI spec version: 0.1.4
*
* 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.14
*
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.GitChrisQueen_TDA_JS) {
root.GitChrisQueen_TDA_JS = {};
}
root.GitChrisQueen_TDA_JS.PostAccessBody = factory(root.GitChrisQueen_TDA_JS.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The PostAccessBody model module.
* @module model/PostAccessBody
* @version 0.1.4
*/
/**
* Constructs a new <code>PostAccessBody</code>.
* Body Parmeers for the Post Access Token Endpoint
* @alias module:model/PostAccessBody
* @class
* @param client_id {Number} OAuth User ID of your application
* @param grant_type {String} The grant type of the oAuth scheme. Possible values are authorization_code, refresh_token
*/
var exports = function(client_id, grant_type) {
this.client_id = client_id;
this.grant_type = grant_type;
};
/**
* Constructs a <code>PostAccessBody</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/PostAccessBody} obj Optional instance to populate.
* @return {module:model/PostAccessBody} The populated <code>PostAccessBody</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('access_type'))
obj.access_type = ApiClient.convertToType(data['access_type'], 'String');
if (data.hasOwnProperty('client_id'))
obj.client_id = ApiClient.convertToType(data['client_id'], 'Number');
if (data.hasOwnProperty('code'))
obj.code = ApiClient.convertToType(data['code'], 'String');
if (data.hasOwnProperty('grant_type'))
obj.grant_type = ApiClient.convertToType(data['grant_type'], 'String');
if (data.hasOwnProperty('redirect_uri'))
obj.redirect_uri = ApiClient.convertToType(data['redirect_uri'], 'String');
if (data.hasOwnProperty('refresh_token'))
obj.refresh_token = ApiClient.convertToType(data['refresh_token'], 'String');
}
return obj;
}
/**
* Set to offline to receive a refresh token on an authorization_code grant type request. Do not set to offline on a refresh_token grant type request.
* @member {String} access_type
*/
exports.prototype.access_type = undefined;
/**
* OAuth User ID of your application
* @member {Number} client_id
*/
exports.prototype.client_id = undefined;
/**
* Required if trying to use authorization code grant
* @member {String} code
*/
exports.prototype.code = undefined;
/**
* The grant type of the oAuth scheme. Possible values are authorization_code, refresh_token
* @member {String} grant_type
*/
exports.prototype.grant_type = undefined;
/**
* Required if trying to use authorization code grant
* @member {String} redirect_uri
*/
exports.prototype.redirect_uri = undefined;
/**
* Required if using refresh token grant
* @member {String} refresh_token
*/
exports.prototype.refresh_token = undefined;
return exports;
}));