UNPKG

@gitchrisqueen/tdameritrade-api-js-client

Version:
179 lines (164 loc) 5.89 kB
/** * 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 * Do not edit the class manually. * */ import ApiClient from '../ApiClient'; import UserPrincipalAccounts from './UserPrincipalAccounts'; import UserPrincipalQuotes from './UserPrincipalQuotes'; import UserPrincipalStreamerInfo from './UserPrincipalStreamerInfo'; import UserPrincipalStreamerSubscriptionKeys from './UserPrincipalStreamerSubscriptionKeys'; /** * The UserPrincipal model module. * @module model/UserPrincipal * @version 0.1.4 */ export default class UserPrincipal { /** * Constructs a new <code>UserPrincipal</code>. * @alias module:model/UserPrincipal * @class */ constructor() { } /** * Constructs a <code>UserPrincipal</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/UserPrincipal} obj Optional instance to populate. * @return {module:model/UserPrincipal} The populated <code>UserPrincipal</code> instance. */ static constructFromObject(data, obj) { if (data) { obj = obj || new UserPrincipal(); if (data.hasOwnProperty('authToken')) { obj['authToken'] = ApiClient.convertToType(data['authToken'], 'String'); } if (data.hasOwnProperty('userId')) { obj['userId'] = ApiClient.convertToType(data['userId'], 'String'); } if (data.hasOwnProperty('userCdDomainId')) { obj['userCdDomainId'] = ApiClient.convertToType(data['userCdDomainId'], 'String'); } if (data.hasOwnProperty('primaryAccountId')) { obj['primaryAccountId'] = ApiClient.convertToType(data['primaryAccountId'], 'String'); } if (data.hasOwnProperty('lastLoginTime')) { obj['lastLoginTime'] = ApiClient.convertToType(data['lastLoginTime'], 'Date'); } if (data.hasOwnProperty('tokenExpirationTime')) { obj['tokenExpirationTime'] = ApiClient.convertToType(data['tokenExpirationTime'], 'Date'); } if (data.hasOwnProperty('loginTime')) { obj['loginTime'] = ApiClient.convertToType(data['loginTime'], 'Date'); } if (data.hasOwnProperty('accessLevel')) { obj['accessLevel'] = ApiClient.convertToType(data['accessLevel'], 'String'); } if (data.hasOwnProperty('stalePassword')) { obj['stalePassword'] = ApiClient.convertToType(data['stalePassword'], 'Boolean'); } if (data.hasOwnProperty('streamerInfo')) { obj['streamerInfo'] = UserPrincipalStreamerInfo.constructFromObject(data['streamerInfo']); } if (data.hasOwnProperty('professionalStatus')) { obj['professionalStatus'] = ApiClient.convertToType(data['professionalStatus'], 'String'); } if (data.hasOwnProperty('quotes')) { obj['quotes'] = UserPrincipalQuotes.constructFromObject(data['quotes']); } if (data.hasOwnProperty('streamerSubscriptionKeys')) { obj['streamerSubscriptionKeys'] = UserPrincipalStreamerSubscriptionKeys.constructFromObject(data['streamerSubscriptionKeys']); } if (data.hasOwnProperty('accounts')) { obj['accounts'] = ApiClient.convertToType(data['accounts'], [UserPrincipalAccounts]); } } return obj; } /** * @member {String} authToken */ 'authToken' = undefined; /** * @member {String} userId */ 'userId' = undefined; /** * @member {String} userCdDomainId */ 'userCdDomainId' = undefined; /** * @member {String} primaryAccountId */ 'primaryAccountId' = undefined; /** * @member {Date} lastLoginTime */ 'lastLoginTime' = undefined; /** * @member {Date} tokenExpirationTime */ 'tokenExpirationTime' = undefined; /** * @member {Date} loginTime */ 'loginTime' = undefined; /** * @member {String} accessLevel */ 'accessLevel' = undefined; /** * @member {Boolean} stalePassword * @default false */ 'stalePassword' = false; /** * @member {module:model/UserPrincipalStreamerInfo} streamerInfo */ 'streamerInfo' = undefined; /** * @member {module:model/UserPrincipal.ProfessionalStatusEnum} professionalStatus */ 'professionalStatus' = undefined; /** * @member {module:model/UserPrincipalQuotes} quotes */ 'quotes' = undefined; /** * @member {module:model/UserPrincipalStreamerSubscriptionKeys} streamerSubscriptionKeys */ 'streamerSubscriptionKeys' = undefined; /** * @member {Array.<module:model/UserPrincipalAccounts>} accounts */ 'accounts' = undefined; /** * Allowed values for the <code>professionalStatus</code> property. * @enum {String} * @readonly */ static ProfessionalStatusEnum = { /** * value: "PROFESSIONAL" * @const */ "PROFESSIONAL": "PROFESSIONAL", /** * value: "NON_PROFESSIONAL" * @const */ "NON_PROFESSIONAL": "NON_PROFESSIONAL", /** * value: "UNKNOWN_STATUS" * @const */ "UNKNOWN_STATUS": "UNKNOWN_STATUS" }; }