/
CompanyApi.js
818 lines (713 loc) · 32.2 KB
/
CompanyApi.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
/**
* Intrinio API
* Welcome to the Intrinio API! Through our Marketplace, we offer a wide selection of financial data feeds sourced by our own proprietary processes as well as from many data vendors. The primary application of the Intrinio API is for use in third-party applications and integrations or for end-users utilizing the Excel add-in and Google Sheets add-on. The Intrinio API uses HTTPS verbs and a RESTful endpoint structure, which makes it easy to request data from Intrinio. Responses are delivered in JSON format. If you need additional help in using the API, go to our home page (https://intrinio.com) and click on the chat icon in the lower right corner.
*
* OpenAPI spec version: 2.0.0
*
* 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
*
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Company', 'model/CompanyNews', 'model/CompanySummary', 'model/DataPointNumber', 'model/DataPointText', 'model/FilingSummary', 'model/Fundamental', 'model/HistoricalData'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('../model/Company'), require('../model/CompanyNews'), require('../model/CompanySummary'), require('../model/DataPointNumber'), require('../model/DataPointText'), require('../model/FilingSummary'), require('../model/Fundamental'), require('../model/HistoricalData'));
} else {
// Browser globals (root is window)
if (!root.intrinio) {
root.intrinio = {};
}
root.intrinio.CompanyApi = factory(root.intrinio.ApiClient, root.intrinio.Company, root.intrinio.CompanyNews, root.intrinio.CompanySummary, root.intrinio.DataPointNumber, root.intrinio.DataPointText, root.intrinio.FilingSummary, root.intrinio.Fundamental, root.intrinio.HistoricalData);
}
}(this, function(ApiClient, Company, CompanyNews, CompanySummary, DataPointNumber, DataPointText, FilingSummary, Fundamental, HistoricalData) {
'use strict';
/**
* Company service.
* @module api/CompanyApi
* @version 0.0.1
*/
/**
* Constructs a new CompanyApi.
* @alias module:api/CompanyApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
var exports = function(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
/**
* Filter Companies
* Returns Companies matching the specified filters
* @param {Object} opts Optional parameters
* @param {Date} opts.lastFilingDate Last filing date
* @param {String} opts.sic Standard Industrial Classification code
* @param {String} opts.template Template
* @param {String} opts.sector Industry sector
* @param {String} opts.industryCategory Industry category
* @param {String} opts.industryGroup Industry group
* @param {String} opts.nextPage Gets the next page of data from a previous API call
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/CompanySummary>} and HTTP response
*/
this.filterCompaniesWithHttpInfo = function(opts) {
opts = opts || {};
var postBody = null;
var pathParams = {
};
var queryParams = {
'last_filing_date': opts['lastFilingDate'],
'sic': opts['sic'],
'template': opts['template'],
'sector': opts['sector'],
'industry_category': opts['industryCategory'],
'industry_group': opts['industryGroup'],
'next_page': opts['nextPage'],
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['HttpHeaderApiKey'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = [CompanySummary];
return this.apiClient.callApi(
'/companies/filter', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
);
}
/**
* Filter Companies
* Returns Companies matching the specified filters
* @param {Object} opts Optional parameters
* @param {Date} opts.lastFilingDate Last filing date
* @param {String} opts.sic Standard Industrial Classification code
* @param {String} opts.template Template
* @param {String} opts.sector Industry sector
* @param {String} opts.industryCategory Industry category
* @param {String} opts.industryGroup Industry group
* @param {String} opts.nextPage Gets the next page of data from a previous API call
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/CompanySummary>}
*/
this.filterCompanies = function(opts) {
return this.filterCompaniesWithHttpInfo(opts)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Filter Fundamentals for a Company
* Returns Fundamentals for the Company with the given `identifier` and matching the specified filters
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @param {Object} opts Optional parameters
* @param {Date} opts.filedAfter Filed on or after this date
* @param {Date} opts.filedBefore Filed on or before this date
* @param {Boolean} opts.reportedOnly Only as-reported fundamentals
* @param {Number} opts.fiscalYear Only for the given fiscal year
* @param {module:model/String} opts.statementCode Only of the given statement code
* @param {module:model/String} opts.type Only of the given type
* @param {Date} opts.startDate Only on or after the given date
* @param {Date} opts.endDate Only on or after the given date
* @param {String} opts.nextPage Gets the next page of data from a previous API call
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/Fundamental>} and HTTP response
*/
this.filterCompanyFundamentalsWithHttpInfo = function(identifier, opts) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'identifier' is set
if (identifier === undefined || identifier === null) {
throw new Error("Missing the required parameter 'identifier' when calling filterCompanyFundamentals");
}
var pathParams = {
'identifier': identifier
};
var queryParams = {
'filed_after': opts['filedAfter'],
'filed_before': opts['filedBefore'],
'reported_only': opts['reportedOnly'],
'fiscal_year': opts['fiscalYear'],
'statement_code': opts['statementCode'],
'type': opts['type'],
'start_date': opts['startDate'],
'end_date': opts['endDate'],
'next_page': opts['nextPage'],
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['HttpHeaderApiKey'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = [Fundamental];
return this.apiClient.callApi(
'/companies/{identifier}/fundamentals/filter', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
);
}
/**
* Filter Fundamentals for a Company
* Returns Fundamentals for the Company with the given `identifier` and matching the specified filters
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @param {Object} opts Optional parameters
* @param {Date} opts.filedAfter Filed on or after this date
* @param {Date} opts.filedBefore Filed on or before this date
* @param {Boolean} opts.reportedOnly Only as-reported fundamentals
* @param {Number} opts.fiscalYear Only for the given fiscal year
* @param {module:model/String} opts.statementCode Only of the given statement code
* @param {module:model/String} opts.type Only of the given type
* @param {Date} opts.startDate Only on or after the given date
* @param {Date} opts.endDate Only on or after the given date
* @param {String} opts.nextPage Gets the next page of data from a previous API call
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/Fundamental>}
*/
this.filterCompanyFundamentals = function(identifier, opts) {
return this.filterCompanyFundamentalsWithHttpInfo(identifier, opts)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Get All Companies
* @param {Object} opts Optional parameters
* @param {String} opts.nextPage Gets the next page of data from a previous API call
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/CompanySummary>} and HTTP response
*/
this.getAllCompaniesWithHttpInfo = function(opts) {
opts = opts || {};
var postBody = null;
var pathParams = {
};
var queryParams = {
'next_page': opts['nextPage'],
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['HttpHeaderApiKey'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = [CompanySummary];
return this.apiClient.callApi(
'/companies', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
);
}
/**
* Get All Companies
* @param {Object} opts Optional parameters
* @param {String} opts.nextPage Gets the next page of data from a previous API call
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/CompanySummary>}
*/
this.getAllCompanies = function(opts) {
return this.getAllCompaniesWithHttpInfo(opts)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Filings
* Returns a complete list of SEC filings for the Company with the given `identifier`
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @param {Object} opts Optional parameters
* @param {String} opts.nextPage Gets the next page of data from a previous API call
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/FilingSummary>} and HTTP response
*/
this.getAllCompanyFilingsWithHttpInfo = function(identifier, opts) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'identifier' is set
if (identifier === undefined || identifier === null) {
throw new Error("Missing the required parameter 'identifier' when calling getAllCompanyFilings");
}
var pathParams = {
'identifier': identifier
};
var queryParams = {
'next_page': opts['nextPage'],
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['HttpHeaderApiKey'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = [FilingSummary];
return this.apiClient.callApi(
'/companies/{identifier}/filings', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
);
}
/**
* Filings
* Returns a complete list of SEC filings for the Company with the given `identifier`
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @param {Object} opts Optional parameters
* @param {String} opts.nextPage Gets the next page of data from a previous API call
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/FilingSummary>}
*/
this.getAllCompanyFilings = function(identifier, opts) {
return this.getAllCompanyFilingsWithHttpInfo(identifier, opts)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Get All Fundamentals for a Company
* Returns all Fundamentals for the Company with the given `identifier`
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @param {Object} opts Optional parameters
* @param {String} opts.nextPage Gets the next page of data from a previous API call
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/Fundamental>} and HTTP response
*/
this.getAllCompanyFundamentalsWithHttpInfo = function(identifier, opts) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'identifier' is set
if (identifier === undefined || identifier === null) {
throw new Error("Missing the required parameter 'identifier' when calling getAllCompanyFundamentals");
}
var pathParams = {
'identifier': identifier
};
var queryParams = {
'next_page': opts['nextPage'],
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['HttpHeaderApiKey'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = [Fundamental];
return this.apiClient.callApi(
'/companies/{identifier}/fundamentals', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
);
}
/**
* Get All Fundamentals for a Company
* Returns all Fundamentals for the Company with the given `identifier`
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @param {Object} opts Optional parameters
* @param {String} opts.nextPage Gets the next page of data from a previous API call
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/Fundamental>}
*/
this.getAllCompanyFundamentals = function(identifier, opts) {
return this.getAllCompanyFundamentalsWithHttpInfo(identifier, opts)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Get a Company by ID
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Company} and HTTP response
*/
this.getCompanyWithHttpInfo = function(identifier) {
var postBody = null;
// verify the required parameter 'identifier' is set
if (identifier === undefined || identifier === null) {
throw new Error("Missing the required parameter 'identifier' when calling getCompany");
}
var pathParams = {
'identifier': identifier
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['HttpHeaderApiKey'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = Company;
return this.apiClient.callApi(
'/companies/{identifier}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
);
}
/**
* Get a Company by ID
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Company}
*/
this.getCompany = function(identifier) {
return this.getCompanyWithHttpInfo(identifier)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Get Company Data Point (Number)
* Returns a numeric value for the given `item` for the Company with the given `identifier`
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @param {String} item An Intrinio data tag
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DataPointNumber} and HTTP response
*/
this.getCompanyDataPointNumberWithHttpInfo = function(identifier, item) {
var postBody = null;
// verify the required parameter 'identifier' is set
if (identifier === undefined || identifier === null) {
throw new Error("Missing the required parameter 'identifier' when calling getCompanyDataPointNumber");
}
// verify the required parameter 'item' is set
if (item === undefined || item === null) {
throw new Error("Missing the required parameter 'item' when calling getCompanyDataPointNumber");
}
var pathParams = {
'identifier': identifier,
'item': item
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['HttpHeaderApiKey'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = DataPointNumber;
return this.apiClient.callApi(
'/companies/{identifier}/data_point/{item}/number', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
);
}
/**
* Get Company Data Point (Number)
* Returns a numeric value for the given `item` for the Company with the given `identifier`
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @param {String} item An Intrinio data tag
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DataPointNumber}
*/
this.getCompanyDataPointNumber = function(identifier, item) {
return this.getCompanyDataPointNumberWithHttpInfo(identifier, item)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Get Company Data Point (Text)
* Returns a text value for the given `item` for the Company with the given `identifier`
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @param {String} item An Intrinio data tag
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DataPointText} and HTTP response
*/
this.getCompanyDataPointTextWithHttpInfo = function(identifier, item) {
var postBody = null;
// verify the required parameter 'identifier' is set
if (identifier === undefined || identifier === null) {
throw new Error("Missing the required parameter 'identifier' when calling getCompanyDataPointText");
}
// verify the required parameter 'item' is set
if (item === undefined || item === null) {
throw new Error("Missing the required parameter 'item' when calling getCompanyDataPointText");
}
var pathParams = {
'identifier': identifier,
'item': item
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['HttpHeaderApiKey'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = DataPointText;
return this.apiClient.callApi(
'/companies/{identifier}/data_point/{item}/text', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
);
}
/**
* Get Company Data Point (Text)
* Returns a text value for the given `item` for the Company with the given `identifier`
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @param {String} item An Intrinio data tag
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DataPointText}
*/
this.getCompanyDataPointText = function(identifier, item) {
return this.getCompanyDataPointTextWithHttpInfo(identifier, item)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Get Company Historical Data
* Returns historical values for the given `item` and the Company with the given `identifier`
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @param {String} item Item
* @param {Object} opts Optional parameters
* @param {String} opts.type Filter by type, when applicable
* @param {Date} opts.startDate Get historical data on or after this date
* @param {Date} opts.endDate Get historical data on or before this date
* @param {module:model/String} opts.sortOrder Sort by date `asc` or `desc` (default to desc)
* @param {String} opts.nextPage Gets the next page of data from a previous API call
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/HistoricalData>} and HTTP response
*/
this.getCompanyHistoricalDataWithHttpInfo = function(identifier, item, opts) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'identifier' is set
if (identifier === undefined || identifier === null) {
throw new Error("Missing the required parameter 'identifier' when calling getCompanyHistoricalData");
}
// verify the required parameter 'item' is set
if (item === undefined || item === null) {
throw new Error("Missing the required parameter 'item' when calling getCompanyHistoricalData");
}
var pathParams = {
'identifier': identifier,
'item': item
};
var queryParams = {
'type': opts['type'],
'start_date': opts['startDate'],
'end_date': opts['endDate'],
'sort_order': opts['sortOrder'],
'next_page': opts['nextPage'],
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['HttpHeaderApiKey'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = [HistoricalData];
return this.apiClient.callApi(
'/companies/{identifier}/historical_data/{item}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
);
}
/**
* Get Company Historical Data
* Returns historical values for the given `item` and the Company with the given `identifier`
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @param {String} item Item
* @param {Object} opts Optional parameters
* @param {String} opts.type Filter by type, when applicable
* @param {Date} opts.startDate Get historical data on or after this date
* @param {Date} opts.endDate Get historical data on or before this date
* @param {module:model/String} opts.sortOrder Sort by date `asc` or `desc` (default to desc)
* @param {String} opts.nextPage Gets the next page of data from a previous API call
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/HistoricalData>}
*/
this.getCompanyHistoricalData = function(identifier, item, opts) {
return this.getCompanyHistoricalDataWithHttpInfo(identifier, item, opts)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* News
* Returns news for the Company with the given `identifier`
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @param {Object} opts Optional parameters
* @param {String} opts.nextPage Gets the next page of data from a previous API call
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/CompanyNews>} and HTTP response
*/
this.getNewsWithHttpInfo = function(identifier, opts) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'identifier' is set
if (identifier === undefined || identifier === null) {
throw new Error("Missing the required parameter 'identifier' when calling getNews");
}
var pathParams = {
'identifier': identifier
};
var queryParams = {
'next_page': opts['nextPage'],
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['HttpHeaderApiKey'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = [CompanyNews];
return this.apiClient.callApi(
'/companies/{identifier}/news', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
);
}
/**
* News
* Returns news for the Company with the given `identifier`
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @param {Object} opts Optional parameters
* @param {String} opts.nextPage Gets the next page of data from a previous API call
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/CompanyNews>}
*/
this.getNews = function(identifier, opts) {
return this.getNewsWithHttpInfo(identifier, opts)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Lookup a Fundamental for a Company
* Returns the Fundamental for the Company with the given `identifier` and with the given parameters
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @param {module:model/String} statementCode The statement code
* @param {module:model/String} fiscalPeriod The fiscal period
* @param {Number} fiscalYear The fiscal year
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/Fundamental>} and HTTP response
*/
this.lookupCompanyFundamentalWithHttpInfo = function(identifier, statementCode, fiscalPeriod, fiscalYear) {
var postBody = null;
// verify the required parameter 'identifier' is set
if (identifier === undefined || identifier === null) {
throw new Error("Missing the required parameter 'identifier' when calling lookupCompanyFundamental");
}
// verify the required parameter 'statementCode' is set
if (statementCode === undefined || statementCode === null) {
throw new Error("Missing the required parameter 'statementCode' when calling lookupCompanyFundamental");
}
// verify the required parameter 'fiscalPeriod' is set
if (fiscalPeriod === undefined || fiscalPeriod === null) {
throw new Error("Missing the required parameter 'fiscalPeriod' when calling lookupCompanyFundamental");
}
// verify the required parameter 'fiscalYear' is set
if (fiscalYear === undefined || fiscalYear === null) {
throw new Error("Missing the required parameter 'fiscalYear' when calling lookupCompanyFundamental");
}
var pathParams = {
'identifier': identifier,
'statement_code': statementCode,
'fiscal_period': fiscalPeriod,
'fiscal_year': fiscalYear
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['HttpHeaderApiKey'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = [Fundamental];
return this.apiClient.callApi(
'/companies/{identifier}/fundamentals/lookup/{statement_code}/{fiscal_year}/{fiscal_period}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
);
}
/**
* Lookup a Fundamental for a Company
* Returns the Fundamental for the Company with the given `identifier` and with the given parameters
* @param {String} identifier A Company identifier (Ticker, CIK, LEI, Intrinio ID)
* @param {module:model/String} statementCode The statement code
* @param {module:model/String} fiscalPeriod The fiscal period
* @param {Number} fiscalYear The fiscal year
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/Fundamental>}
*/
this.lookupCompanyFundamental = function(identifier, statementCode, fiscalPeriod, fiscalYear) {
return this.lookupCompanyFundamentalWithHttpInfo(identifier, statementCode, fiscalPeriod, fiscalYear)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* Search Companies
* Searches for Companies matching the text `query`
* @param {String} query Search parameters
* @param {Object} opts Optional parameters
* @param {String} opts.nextPage Gets the next page of data from a previous API call
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/CompanySummary>} and HTTP response
*/
this.searchCompaniesWithHttpInfo = function(query, opts) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'query' is set
if (query === undefined || query === null) {
throw new Error("Missing the required parameter 'query' when calling searchCompanies");
}
var pathParams = {
};
var queryParams = {
'query': query,
'next_page': opts['nextPage'],
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['HttpHeaderApiKey'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = [CompanySummary];
return this.apiClient.callApi(
'/companies/search', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
);
}
/**
* Search Companies
* Searches for Companies matching the text `query`
* @param {String} query Search parameters
* @param {Object} opts Optional parameters
* @param {String} opts.nextPage Gets the next page of data from a previous API call
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/CompanySummary>}
*/
this.searchCompanies = function(query, opts) {
return this.searchCompaniesWithHttpInfo(query, opts)
.then(function(response_and_data) {
return response_and_data.data;
});
}
};
return exports;
}));