finance_dev 0.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- finance_dev/__init__.py +18 -0
- finance_dev/_hooks/__init__.py +7 -0
- finance_dev/_hooks/clientcredentials.py +319 -0
- finance_dev/_hooks/oauth2scopes.py +50 -0
- finance_dev/_hooks/registration.py +13 -0
- finance_dev/_hooks/sdkhooks.py +82 -0
- finance_dev/_hooks/types.py +125 -0
- finance_dev/_version.py +16 -0
- finance_dev/accounts.py +797 -0
- finance_dev/alternativedata.py +4830 -0
- finance_dev/analytics.py +3757 -0
- finance_dev/basesdk.py +393 -0
- finance_dev/calendar.py +1523 -0
- finance_dev/chart.py +1881 -0
- finance_dev/company.py +1105 -0
- finance_dev/corporateactions.py +1795 -0
- finance_dev/economy.py +1153 -0
- finance_dev/errors/__init__.py +94 -0
- finance_dev/errors/apierror.py +41 -0
- finance_dev/errors/authenticationerrorenvelope.py +43 -0
- finance_dev/errors/badrequest.py +34 -0
- finance_dev/errors/errorenvelope.py +42 -0
- finance_dev/errors/errorresponse.py +45 -0
- finance_dev/errors/financedevapierror.py +31 -0
- finance_dev/errors/forbidden.py +34 -0
- finance_dev/errors/internalservererror.py +35 -0
- finance_dev/errors/no_response_error.py +18 -0
- finance_dev/errors/notfound.py +34 -0
- finance_dev/errors/orderhistorybadrequest.py +35 -0
- finance_dev/errors/predorderserrorenvelope.py +42 -0
- finance_dev/errors/responsevalidationerror.py +28 -0
- finance_dev/errors/unauthorized.py +34 -0
- finance_dev/estimates.py +1906 -0
- finance_dev/etf.py +1108 -0
- finance_dev/filings.py +586 -0
- finance_dev/financials.py +4079 -0
- finance_dev/history.py +477 -0
- finance_dev/httpclient.py +126 -0
- finance_dev/indices.py +2308 -0
- finance_dev/logos.py +692 -0
- finance_dev/market.py +1825 -0
- finance_dev/markets.py +952 -0
- finance_dev/models/__init__.py +4568 -0
- finance_dev/models/accountbalancev2.py +340 -0
- finance_dev/models/accountitem.py +78 -0
- finance_dev/models/accountposition.py +147 -0
- finance_dev/models/aggregatetechnicalindicatorsresponse.py +192 -0
- finance_dev/models/analystinsightitem.py +161 -0
- finance_dev/models/analystinsightsresponse.py +39 -0
- finance_dev/models/apperror.py +123 -0
- finance_dev/models/authenticationerrordetail.py +58 -0
- finance_dev/models/bankbranchesresponse.py +96 -0
- finance_dev/models/basicfinancials.py +243 -0
- finance_dev/models/bullbearanalysisresponse.py +150 -0
- finance_dev/models/cancelorderop.py +40 -0
- finance_dev/models/cancelordrequest_union.py +287 -0
- finance_dev/models/cancelordresponse.py +115 -0
- finance_dev/models/cashflowstatement.py +290 -0
- finance_dev/models/cashflowstatementsresponse.py +61 -0
- finance_dev/models/chartbars.py +111 -0
- finance_dev/models/chartconfig.py +81 -0
- finance_dev/models/chartresolution.py +46 -0
- finance_dev/models/companyesgresponse.py +408 -0
- finance_dev/models/companyexecutive.py +70 -0
- finance_dev/models/companyexecutiveresponse.py +39 -0
- finance_dev/models/companypeersresponse.py +38 -0
- finance_dev/models/companypresentationresponse.py +96 -0
- finance_dev/models/companyprofile.py +255 -0
- finance_dev/models/conferencecallsresponse.py +169 -0
- finance_dev/models/congressionaltradingresponse.py +138 -0
- finance_dev/models/covid19uscasesresponse.py +79 -0
- finance_dev/models/createconfigwatchlistop.py +40 -0
- finance_dev/models/createwatchlistrequest.py +43 -0
- finance_dev/models/dailymarketsummaryresponse.py +73 -0
- finance_dev/models/deleteconfigwatchlistbyidop.py +53 -0
- finance_dev/models/dividenditem.py +125 -0
- finance_dev/models/dividendsresponse.py +61 -0
- finance_dev/models/earningrelease.py +291 -0
- finance_dev/models/earningscallliveresponse.py +103 -0
- finance_dev/models/earningsqualityscoreresponse.py +140 -0
- finance_dev/models/earningssurprisesresponse.py +125 -0
- finance_dev/models/ebitdaestimatesresponse.py +176 -0
- finance_dev/models/ebitestimatesresponse.py +176 -0
- finance_dev/models/economicscalendarevent.py +160 -0
- finance_dev/models/economicsindicator.py +87 -0
- finance_dev/models/epsestimatesresponse.py +176 -0
- finance_dev/models/equitydetailsdto.py +569 -0
- finance_dev/models/errorcode.py +48 -0
- finance_dev/models/etblistresponse.py +43 -0
- finance_dev/models/etbsearchrequest.py +21 -0
- finance_dev/models/etbsearchresponse.py +43 -0
- finance_dev/models/etfcountryallocationresponse.py +113 -0
- finance_dev/models/etfholdingsresponse.py +163 -0
- finance_dev/models/etfprofileresponse.py +234 -0
- finance_dev/models/etfsectorallocationresponse.py +113 -0
- finance_dev/models/exchangecode.py +90 -0
- finance_dev/models/fdaadvisorycommitteecalendarresponse.py +88 -0
- finance_dev/models/filingsimilarityrecord.py +115 -0
- finance_dev/models/filingssimilarityindexdatawrapper.py +52 -0
- finance_dev/models/filingssimilarityindexresponse.py +42 -0
- finance_dev/models/financialratiosresponse.py +252 -0
- finance_dev/models/financialsreporteddatawrapper.py +49 -0
- finance_dev/models/financialsreportedresponse.py +42 -0
- finance_dev/models/financialsrevenuebreakdowndatawrapper.py +49 -0
- finance_dev/models/financialsrevenuebreakdownresponse.py +42 -0
- finance_dev/models/financialsstatementsdatawrapper.py +44 -0
- finance_dev/models/financialsstatementsresponse.py +42 -0
- finance_dev/models/financialstatement.py +171 -0
- finance_dev/models/financialstatementtype.py +14 -0
- finance_dev/models/getaccountbalanceop.py +53 -0
- finance_dev/models/getaccountpositionsop.py +53 -0
- finance_dev/models/getaccountsresponse.py +22 -0
- finance_dev/models/getaggregatetechnicalindicatorsop.py +94 -0
- finance_dev/models/getanalystinsightsop.py +164 -0
- finance_dev/models/getbankbranchesop.py +53 -0
- finance_dev/models/getbaseeventop.py +87 -0
- finance_dev/models/getbullbearanalysisop.py +91 -0
- finance_dev/models/getcashflowstatementsop.py +564 -0
- finance_dev/models/getchartconfigop.py +40 -0
- finance_dev/models/getcharthistoryop.py +122 -0
- finance_dev/models/getcharttimeop.py +39 -0
- finance_dev/models/getcompanyesgop.py +53 -0
- finance_dev/models/getcompanyexecutivesop.py +56 -0
- finance_dev/models/getcompanymetricsop.py +68 -0
- finance_dev/models/getcompanypeersop.py +53 -0
- finance_dev/models/getcompanypresentationop.py +56 -0
- finance_dev/models/getcompanyprofileop.py +86 -0
- finance_dev/models/getconferencecallsop.py +111 -0
- finance_dev/models/getconfigwatchlistbyidop.py +53 -0
- finance_dev/models/getconfigwatchlistsop.py +40 -0
- finance_dev/models/getcongressionaltradingop.py +73 -0
- finance_dev/models/getcovid19uscasesop.py +43 -0
- finance_dev/models/getdailymarketsummaryop.py +92 -0
- finance_dev/models/getdividendsop.py +294 -0
- finance_dev/models/getearningscalendarop.py +87 -0
- finance_dev/models/getearningscallliveop.py +91 -0
- finance_dev/models/getearningsqualityscoreop.py +81 -0
- finance_dev/models/getearningssurprisesop.py +80 -0
- finance_dev/models/getebitdaestimatesop.py +91 -0
- finance_dev/models/getebitestimatesop.py +88 -0
- finance_dev/models/geteconomicscalendarop.py +92 -0
- finance_dev/models/geteconomicscalendarresponse.py +56 -0
- finance_dev/models/getepsestimatesop.py +88 -0
- finance_dev/models/getequitydetailsop.py +56 -0
- finance_dev/models/getequitydetailsresponse.py +45 -0
- finance_dev/models/getetblistop.py +40 -0
- finance_dev/models/getetfcountryallocationop.py +80 -0
- finance_dev/models/getetfholdingsop.py +96 -0
- finance_dev/models/getetfprofileop.py +77 -0
- finance_dev/models/getetfsectorallocationop.py +80 -0
- finance_dev/models/geteventcontractsop.py +87 -0
- finance_dev/models/getfdaadvisorycommitteecalendarop.py +47 -0
- finance_dev/models/getfilingssimilarityindexop.py +102 -0
- finance_dev/models/getfinancialratiosop.py +612 -0
- finance_dev/models/getfinancialstatementsop.py +117 -0
- finance_dev/models/getfundownershipop.py +77 -0
- finance_dev/models/gethistoricaldataop.py +61 -0
- finance_dev/models/gethistoricalesgop.py +53 -0
- finance_dev/models/gethistorybatchop.py +74 -0
- finance_dev/models/gethistoryop.py +123 -0
- finance_dev/models/getincomestatementsop.py +564 -0
- finance_dev/models/getindexbarop.py +140 -0
- finance_dev/models/getindexbarsop.py +149 -0
- finance_dev/models/getindexchartbarsop.py +178 -0
- finance_dev/models/getindexrealtimevaluesop.py +94 -0
- finance_dev/models/getinflationexpectationsop.py +157 -0
- finance_dev/models/getinflationop.py +154 -0
- finance_dev/models/getinsidertransactionsop.py +90 -0
- finance_dev/models/getinstitutionalownershipop.py +99 -0
- finance_dev/models/getinstitutionalportfolioop.py +75 -0
- finance_dev/models/getinvestmentthemeop.py +68 -0
- finance_dev/models/getipocalendarop.py +63 -0
- finance_dev/models/getlobbyingop.py +70 -0
- finance_dev/models/getmarketbreadthop.py +40 -0
- finance_dev/models/getmarketholidaysop.py +65 -0
- finance_dev/models/getmarketstatusop.py +65 -0
- finance_dev/models/getmergersandacquisitionsop.py +113 -0
- finance_dev/models/getnetinflowop.py +40 -0
- finance_dev/models/getnewsbyidop.py +73 -0
- finance_dev/models/getnewsop.py +98 -0
- finance_dev/models/getnewssentimentop.py +53 -0
- finance_dev/models/getoptionchainsnapshotop.py +244 -0
- finance_dev/models/getoptioncontractsnapshotop.py +69 -0
- finance_dev/models/getoptiondetailsop.py +56 -0
- finance_dev/models/getoptiondetailsresponse.py +45 -0
- finance_dev/models/getoptionlasttradeop.py +56 -0
- finance_dev/models/getoptionopencloseop.py +66 -0
- finance_dev/models/getoptionpreviousdayop.py +56 -0
- finance_dev/models/getoptionquotesop.py +177 -0
- finance_dev/models/getoptionsactivityop.py +111 -0
- finance_dev/models/getoptionsetfstopvolumeop.py +70 -0
- finance_dev/models/getoptionsstockstopgainersop.py +70 -0
- finance_dev/models/getoptionsstockstopvolumeop.py +70 -0
- finance_dev/models/getoptionsunusualactivityop.py +100 -0
- finance_dev/models/getoptiontradesop.py +177 -0
- finance_dev/models/getordersv2response.py +66 -0
- finance_dev/models/getownershipdataop.py +77 -0
- finance_dev/models/getpositionsresponse.py +39 -0
- finance_dev/models/getpredictionorderop.py +88 -0
- finance_dev/models/getpricetargetop.py +53 -0
- finance_dev/models/getquotesop.py +53 -0
- finance_dev/models/getratingsop.py +164 -0
- finance_dev/models/getratingsresponse.py +39 -0
- finance_dev/models/getreportedfinancialsop.py +127 -0
- finance_dev/models/getrevenuebreakdownop.py +85 -0
- finance_dev/models/getrevenueestimatesop.py +91 -0
- finance_dev/models/getsecfilingsop.py +113 -0
- finance_dev/models/getsectortickersop.py +124 -0
- finance_dev/models/getsectorwisechangeop.py +84 -0
- finance_dev/models/getshortinterestop.py +334 -0
- finance_dev/models/getshortvolumeop.py +333 -0
- finance_dev/models/getsocialsentimentop.py +90 -0
- finance_dev/models/getspinoffsop.py +112 -0
- finance_dev/models/getstockaggregatesop.py +174 -0
- finance_dev/models/getstocklastquoteop.py +56 -0
- finance_dev/models/getstocklasttradeop.py +56 -0
- finance_dev/models/getstockopencloseop.py +90 -0
- finance_dev/models/getstockpreviousdayop.py +80 -0
- finance_dev/models/getstockquotesop.py +177 -0
- finance_dev/models/getstocksnapshotsop.py +82 -0
- finance_dev/models/getstocksplitsop.py +243 -0
- finance_dev/models/getstocktradesop.py +177 -0
- finance_dev/models/getsupplychainop.py +53 -0
- finance_dev/models/getsupportresistancelevelsop.py +90 -0
- finance_dev/models/getsymbolinfoop.py +53 -0
- finance_dev/models/gettechnicalindicatorop.py +172 -0
- finance_dev/models/gettechnicalpatternsop.py +88 -0
- finance_dev/models/gettenderoffersop.py +112 -0
- finance_dev/models/gettickhistoryop.py +104 -0
- finance_dev/models/gettopgainersop.py +78 -0
- finance_dev/models/gettoplosersop.py +78 -0
- finance_dev/models/gettopmostactiveop.py +78 -0
- finance_dev/models/gettranscriptop.py +53 -0
- finance_dev/models/gettreasuryyieldsop.py +157 -0
- finance_dev/models/getunifiedsnapshotop.py +223 -0
- finance_dev/models/getupgradesdowngradesop.py +91 -0
- finance_dev/models/getusaspendingop.py +70 -0
- finance_dev/models/getuseraccountsop.py +40 -0
- finance_dev/models/getusptopatentsop.py +70 -0
- finance_dev/models/getvisaapplicationsop.py +73 -0
- finance_dev/models/historicalesgresponse.py +439 -0
- finance_dev/models/httpmetadata.py +24 -0
- finance_dev/models/incomestatement.py +296 -0
- finance_dev/models/incomestatementsresponse.py +61 -0
- finance_dev/models/indexbarresponse.py +194 -0
- finance_dev/models/indexbarsresponse.py +123 -0
- finance_dev/models/indexchartbarsresponse.py +213 -0
- finance_dev/models/indexgroupsresponse.py +78 -0
- finance_dev/models/indexlistresponse.py +95 -0
- finance_dev/models/indexsearchresponse.py +93 -0
- finance_dev/models/indicesbygroupresponse.py +93 -0
- finance_dev/models/indicesidentifiertype.py +28 -0
- finance_dev/models/indicesrealtimeindexinfo.py +67 -0
- finance_dev/models/indicesrealtimeindexvalue.py +157 -0
- finance_dev/models/indicesrealtimevaluesitem.py +80 -0
- finance_dev/models/indicesrealtimevaluesresponse.py +42 -0
- finance_dev/models/inflationexpectationsresponse.py +140 -0
- finance_dev/models/inflationresponse.py +132 -0
- finance_dev/models/insidertransaction.py +97 -0
- finance_dev/models/insidertransactionsresponse.py +39 -0
- finance_dev/models/institutionalholding.py +77 -0
- finance_dev/models/institutionalownershipresponse.py +39 -0
- finance_dev/models/institutionalportfolioresponse.py +39 -0
- finance_dev/models/investmentthemeid.py +35 -0
- finance_dev/models/investmentthemeresponse.py +80 -0
- finance_dev/models/ipocalendarresponse.py +39 -0
- finance_dev/models/ipoitem.py +93 -0
- finance_dev/models/listactiveordersop.py +87 -0
- finance_dev/models/listcategoriesop.py +79 -0
- finance_dev/models/listindexgroupsop.py +40 -0
- finance_dev/models/listindicesbygroupop.py +58 -0
- finance_dev/models/listindicesop.py +91 -0
- finance_dev/models/listoptioncontractsop.py +66 -0
- finance_dev/models/listoptionexpirydatesop.py +56 -0
- finance_dev/models/listorderhistoryop.py +139 -0
- finance_dev/models/listpredictionordersop.py +134 -0
- finance_dev/models/listtranscriptsop.py +53 -0
- finance_dev/models/lobbyingresponse.py +166 -0
- finance_dev/models/logosearchresponse.py +152 -0
- finance_dev/models/logosyncresponse.py +277 -0
- finance_dev/models/marketbreadth.py +97 -0
- finance_dev/models/marketbreadthresponse.py +44 -0
- finance_dev/models/marketholiday.py +56 -0
- finance_dev/models/marketholidayresponse.py +39 -0
- finance_dev/models/marketstatus.py +67 -0
- finance_dev/models/mergersandacquisitionsresponse.py +186 -0
- finance_dev/models/metricseriespoint.py +43 -0
- finance_dev/models/netinflow.py +81 -0
- finance_dev/models/netinflowresponse.py +44 -0
- finance_dev/models/newsitem.py +102 -0
- finance_dev/models/newslistresponse.py +128 -0
- finance_dev/models/newssentimentresponse.py +176 -0
- finance_dev/models/newstypeenum.py +16 -0
- finance_dev/models/optionchainsnapshotresponse.py +64 -0
- finance_dev/models/optioncontractsnapshotresponse.py +64 -0
- finance_dev/models/optioncontractsnapshotrow.py +164 -0
- finance_dev/models/optioncontractsresponse.py +131 -0
- finance_dev/models/optiondetailsdto.py +72 -0
- finance_dev/models/optionexpirydatesresponse.py +53 -0
- finance_dev/models/optionlasttraderesponse.py +169 -0
- finance_dev/models/optionopencloseresponse.py +97 -0
- finance_dev/models/optionpreviousdayresponse.py +89 -0
- finance_dev/models/optionquotesresponse.py +138 -0
- finance_dev/models/optionsactivityresponse.py +265 -0
- finance_dev/models/optionsnapshotcontractdetails.py +85 -0
- finance_dev/models/optionsnapshotdaybar.py +107 -0
- finance_dev/models/optionsnapshotgreeks.py +67 -0
- finance_dev/models/optionsnapshotlastquote.py +116 -0
- finance_dev/models/optionsnapshotlasttrade.py +102 -0
- finance_dev/models/optionsnapshotunderlying.py +86 -0
- finance_dev/models/optionsscreeneritem.py +151 -0
- finance_dev/models/optionsunusualactivityresponse.py +62 -0
- finance_dev/models/optionsunusualactivitytrade.py +103 -0
- finance_dev/models/optiontradesresponse.py +132 -0
- finance_dev/models/orderrequesttimeinforceenum.py +29 -0
- finance_dev/models/ordersideenum.py +20 -0
- finance_dev/models/ordertypeenum.py +20 -0
- finance_dev/models/ordleg.py +162 -0
- finance_dev/models/ordresponse.py +202 -0
- finance_dev/models/ownershipdataresponse.py +39 -0
- finance_dev/models/ownershiprecord.py +74 -0
- finance_dev/models/placeorderop.py +40 -0
- finance_dev/models/placeordrequest_union.py +335 -0
- finance_dev/models/placepredictionorderop.py +114 -0
- finance_dev/models/predmdbaseevent.py +62 -0
- finance_dev/models/predmdbaseeventhit.py +53 -0
- finance_dev/models/predmdbaseeventsearchresult.py +46 -0
- finance_dev/models/predmdbaseeventwithevents.py +32 -0
- finance_dev/models/predmdbatchhistoryrequest.py +16 -0
- finance_dev/models/predmdbatchhistoryresponse.py +16 -0
- finance_dev/models/predmdcategory.py +48 -0
- finance_dev/models/predmdcontract.py +177 -0
- finance_dev/models/predmdcontracthit.py +157 -0
- finance_dev/models/predmdcontractsearchresult.py +46 -0
- finance_dev/models/predmdevent.py +136 -0
- finance_dev/models/predmdeventhit.py +73 -0
- finance_dev/models/predmdeventsearchresult.py +46 -0
- finance_dev/models/predmdeventwithcontracts.py +22 -0
- finance_dev/models/predmdhistoryrequest.py +59 -0
- finance_dev/models/predmdhistoryresponse.py +53 -0
- finance_dev/models/predmdtick.py +53 -0
- finance_dev/models/predordersapperror.py +78 -0
- finance_dev/models/predordersorder.py +267 -0
- finance_dev/models/predordersorderdetail.py +26 -0
- finance_dev/models/predordersorderpage.py +45 -0
- finance_dev/models/predordersorderreport.py +88 -0
- finance_dev/models/predordersplaceorderrequest.py +159 -0
- finance_dev/models/previeworderop.py +40 -0
- finance_dev/models/previeworderresponse.py +127 -0
- finance_dev/models/pricetargetresponse.py +89 -0
- finance_dev/models/quotedata.py +49 -0
- finance_dev/models/quotesresponse.py +62 -0
- finance_dev/models/quotevalues.py +114 -0
- finance_dev/models/rating.py +193 -0
- finance_dev/models/ratingsaccuracy.py +242 -0
- finance_dev/models/replaceconfigwatchlistsop.py +40 -0
- finance_dev/models/replaceorderop.py +40 -0
- finance_dev/models/replaceordrequest_union.py +367 -0
- finance_dev/models/replaceordresponse.py +144 -0
- finance_dev/models/reportedbsitem.py +53 -0
- finance_dev/models/reportedfiling.py +110 -0
- finance_dev/models/reportedreport.py +39 -0
- finance_dev/models/reportingfrequency.py +16 -0
- finance_dev/models/revenuebreakdownaxis.py +52 -0
- finance_dev/models/revenuebreakdowndatapoint.py +58 -0
- finance_dev/models/revenuebreakdownentry.py +51 -0
- finance_dev/models/revenuebreakdowninner.py +75 -0
- finance_dev/models/revenueestimatesresponse.py +176 -0
- finance_dev/models/screenclause.py +70 -0
- finance_dev/models/screengroup.py +75 -0
- finance_dev/models/searchetbsymbolsop.py +40 -0
- finance_dev/models/searchindicesop.py +55 -0
- finance_dev/models/searchlogosop.py +158 -0
- finance_dev/models/searchmarketsymbolsop.py +80 -0
- finance_dev/models/searchop.py +232 -0
- finance_dev/models/searchsymbolitem.py +76 -0
- finance_dev/models/searchsymbolresponseitem.py +71 -0
- finance_dev/models/searchsymbolsop.py +77 -0
- finance_dev/models/secfiling.py +91 -0
- finance_dev/models/secfilingsresponse.py +39 -0
- finance_dev/models/sectoravgchange.py +50 -0
- finance_dev/models/security.py +59 -0
- finance_dev/models/securitytypeenum.py +16 -0
- finance_dev/models/shortinterestresponse.py +126 -0
- finance_dev/models/shortvolumeresponse.py +198 -0
- finance_dev/models/socialsentimentresponse.py +124 -0
- finance_dev/models/sortorderenum.py +13 -0
- finance_dev/models/spinoffsresponse.py +136 -0
- finance_dev/models/stockaggregatesresponse.py +92 -0
- finance_dev/models/stocklastquoteresponse.py +175 -0
- finance_dev/models/stocklasttraderesponse.py +169 -0
- finance_dev/models/stockohlcbar.py +85 -0
- finance_dev/models/stockopencloseresponse.py +109 -0
- finance_dev/models/stockpreviousdayresponse.py +86 -0
- finance_dev/models/stockquotesresponse.py +170 -0
- finance_dev/models/stockscreenerop.py +144 -0
- finance_dev/models/stockscreenerrequest.py +131 -0
- finance_dev/models/stockscreenerresponse.py +197 -0
- finance_dev/models/stocksnapshotsresponse.py +454 -0
- finance_dev/models/stocksplitsresponse.py +144 -0
- finance_dev/models/stocktradesresponse.py +164 -0
- finance_dev/models/supplychainresponse.py +158 -0
- finance_dev/models/supportresistancelevelsresponse.py +68 -0
- finance_dev/models/symboldetails.py +119 -0
- finance_dev/models/symbolerror.py +43 -0
- finance_dev/models/symbolinfo.py +183 -0
- finance_dev/models/synclogosop.py +146 -0
- finance_dev/models/technicalindicatorresponse.py +43 -0
- finance_dev/models/technicalindicatortype.py +21 -0
- finance_dev/models/technicalpatternsresponse.py +249 -0
- finance_dev/models/tenderofferidentifiertype.py +26 -0
- finance_dev/models/tenderoffersresponse.py +548 -0
- finance_dev/models/tickchartbars.py +104 -0
- finance_dev/models/tickresolution.py +20 -0
- finance_dev/models/timeinforceenum.py +26 -0
- finance_dev/models/tradeorderlegv2.py +164 -0
- finance_dev/models/tradeorderv2.py +434 -0
- finance_dev/models/transcriptresponse.py +162 -0
- finance_dev/models/transcriptsresponse.py +89 -0
- finance_dev/models/treasuryyieldsresponse.py +160 -0
- finance_dev/models/unifiedsnapshotresponse.py +308 -0
- finance_dev/models/updateconfigwatchlistbyidop.py +65 -0
- finance_dev/models/updatewatchlistrequest_union.py +134 -0
- finance_dev/models/upgradesdowngradesresponse.py +98 -0
- finance_dev/models/usaspendingresponse.py +222 -0
- finance_dev/models/usptopatentsresponse.py +134 -0
- finance_dev/models/visaapplicationsresponse.py +228 -0
- finance_dev/models/watchlist.py +68 -0
- finance_dev/models/watchlistrequest.py +43 -0
- finance_dev/models/watchlistresponse.py +44 -0
- finance_dev/news_sdk.py +829 -0
- finance_dev/options.py +3443 -0
- finance_dev/orders.py +1907 -0
- finance_dev/ownership.py +1386 -0
- finance_dev/predictions.py +29 -0
- finance_dev/predictions_orders.py +852 -0
- finance_dev/py.typed +1 -0
- finance_dev/sdk.py +347 -0
- finance_dev/sdkconfiguration.py +50 -0
- finance_dev/signals.py +338 -0
- finance_dev/stocks.py +3131 -0
- finance_dev/technicalanalysis_sdk.py +1137 -0
- finance_dev/types/__init__.py +25 -0
- finance_dev/types/base64fileinput.py +44 -0
- finance_dev/types/basemodel.py +78 -0
- finance_dev/utils/__init__.py +181 -0
- finance_dev/utils/annotations.py +80 -0
- finance_dev/utils/datetimes.py +42 -0
- finance_dev/utils/dynamic_imports.py +55 -0
- finance_dev/utils/enums.py +135 -0
- finance_dev/utils/eventstreaming.py +327 -0
- finance_dev/utils/forms.py +240 -0
- finance_dev/utils/headers.py +137 -0
- finance_dev/utils/logger.py +23 -0
- finance_dev/utils/metadata.py +120 -0
- finance_dev/utils/queryparams.py +218 -0
- finance_dev/utils/requestbodies.py +68 -0
- finance_dev/utils/retries.py +373 -0
- finance_dev/utils/security.py +199 -0
- finance_dev/utils/serializers.py +327 -0
- finance_dev/utils/unmarshal_json_response.py +39 -0
- finance_dev/utils/url.py +155 -0
- finance_dev/utils/values.py +143 -0
- finance_dev/watchlist_sdk.py +1583 -0
- finance_dev/websocket/__init__.py +57 -0
- finance_dev/websocket/account.py +5 -0
- finance_dev/websocket/auth.py +124 -0
- finance_dev/websocket/chart.py +5 -0
- finance_dev/websocket/codec.py +66 -0
- finance_dev/websocket/config.py +52 -0
- finance_dev/websocket/errors.py +54 -0
- finance_dev/websocket/market.py +5 -0
- finance_dev/websocket/models/__init__.py +52 -0
- finance_dev/websocket/models/account.py +60 -0
- finance_dev/websocket/models/chart.py +44 -0
- finance_dev/websocket/models/common.py +85 -0
- finance_dev/websocket/models/market.py +113 -0
- finance_dev/websocket/resources.py +327 -0
- finance_dev/websocket/sdk.py +13 -0
- finance_dev/websocket/transport/async_connection.py +493 -0
- finance_dev/websocket/transport/base.py +78 -0
- finance_dev/websocket/transport/sync_connection.py +470 -0
- finance_dev-0.9.0.dist-info/METADATA +913 -0
- finance_dev-0.9.0.dist-info/RECORD +486 -0
- finance_dev-0.9.0.dist-info/WHEEL +5 -0
- finance_dev-0.9.0.dist-info/top_level.txt +1 -0
finance_dev/analytics.py
ADDED
|
@@ -0,0 +1,3757 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
# @generated-id: 6db3756952aa
|
|
3
|
+
|
|
4
|
+
from .basesdk import BaseSDK
|
|
5
|
+
from datetime import date
|
|
6
|
+
from finance_dev import errors, models, utils
|
|
7
|
+
from finance_dev._hooks import HookContext
|
|
8
|
+
from finance_dev.types import OptionalNullable, UNSET
|
|
9
|
+
from finance_dev.utils.unmarshal_json_response import unmarshal_json_response
|
|
10
|
+
from jsonpath import JSONPath
|
|
11
|
+
from typing import Any, Dict, List, Mapping, Optional, Union
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Analytics(BaseSDK):
|
|
15
|
+
def get_analyst_insights(
|
|
16
|
+
self,
|
|
17
|
+
*,
|
|
18
|
+
page: Optional[int] = None,
|
|
19
|
+
page_size: Optional[int] = None,
|
|
20
|
+
symbols: Optional[str] = None,
|
|
21
|
+
analyst: Optional[str] = None,
|
|
22
|
+
rating_id: Optional[str] = None,
|
|
23
|
+
search_keys_type: Optional[models.GetAnalystInsightsSearchKeysType] = None,
|
|
24
|
+
search_keys: Optional[str] = None,
|
|
25
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
26
|
+
server_url: Optional[str] = None,
|
|
27
|
+
timeout_ms: Optional[int] = None,
|
|
28
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
29
|
+
) -> Optional[models.GetAnalystInsightsResponse]:
|
|
30
|
+
r"""Get Analyst Insights
|
|
31
|
+
|
|
32
|
+
Retrieve analyst insights and research data. All query parameters are optional. Supports pagination and filtering by symbols, analyst, ratingId, and firm.
|
|
33
|
+
|
|
34
|
+
If set, this operation will use `client_id` from the global security.
|
|
35
|
+
|
|
36
|
+
:param page: Zero-based page number. Enter 0 for the first page, 1 for the second page, and so on.
|
|
37
|
+
:param page_size: Number of results per page. Use this to control pagination size in list views. Use this to control page size; default is 10.
|
|
38
|
+
:param symbols: Comma-separated ticker symbols, such as AAPL,MSFT. Use this to request or filter multiple companies in one call. (e.g. AAPL,MSFT)
|
|
39
|
+
:param analyst: Comma-separated analyst IDs. Use this to limit insight results to specific analysts.
|
|
40
|
+
:param rating_id: Comma-separated rating IDs. Use this to limit insight results to specific rating records.
|
|
41
|
+
:param search_keys_type: Tells the API how to interpret the value you send in `searchKeys`. Allowed values:
|
|
42
|
+
- `firm_id` — the value is a firm/company internal ID.
|
|
43
|
+
- `firm` — the value is the firm/company name.
|
|
44
|
+
:param search_keys: Search key value (based on searchKeysType)
|
|
45
|
+
:param retries: Override the default retry configuration for this method
|
|
46
|
+
:param server_url: Override the default server URL for this method
|
|
47
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
48
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
49
|
+
"""
|
|
50
|
+
base_url = None
|
|
51
|
+
url_variables = None
|
|
52
|
+
if timeout_ms is None:
|
|
53
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
54
|
+
|
|
55
|
+
if timeout_ms is None:
|
|
56
|
+
timeout_ms = 30000
|
|
57
|
+
|
|
58
|
+
if server_url is not None:
|
|
59
|
+
base_url = server_url
|
|
60
|
+
else:
|
|
61
|
+
base_url = self._get_url(base_url, url_variables)
|
|
62
|
+
|
|
63
|
+
request = models.GetAnalystInsightsRequest(
|
|
64
|
+
page=page,
|
|
65
|
+
page_size=page_size,
|
|
66
|
+
symbols=symbols,
|
|
67
|
+
analyst=analyst,
|
|
68
|
+
rating_id=rating_id,
|
|
69
|
+
search_keys_type=search_keys_type,
|
|
70
|
+
search_keys=search_keys,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
req = self._build_request(
|
|
74
|
+
method="GET",
|
|
75
|
+
path="/v1/analytics/insights",
|
|
76
|
+
base_url=base_url,
|
|
77
|
+
url_variables=url_variables,
|
|
78
|
+
request=request,
|
|
79
|
+
request_body_required=False,
|
|
80
|
+
request_has_path_params=False,
|
|
81
|
+
request_has_query_params=True,
|
|
82
|
+
user_agent_header="user-agent",
|
|
83
|
+
accept_header_value="application/json",
|
|
84
|
+
http_headers=http_headers,
|
|
85
|
+
security=self.sdk_configuration.security,
|
|
86
|
+
allow_empty_value=None,
|
|
87
|
+
allowed_fields=["client_id"],
|
|
88
|
+
timeout_ms=timeout_ms,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
if retries == UNSET:
|
|
92
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
93
|
+
retries = self.sdk_configuration.retry_config
|
|
94
|
+
else:
|
|
95
|
+
retries = utils.RetryConfig(
|
|
96
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
retry_config = None
|
|
100
|
+
if isinstance(retries, utils.RetryConfig):
|
|
101
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
102
|
+
|
|
103
|
+
http_res = self.do_request(
|
|
104
|
+
hook_ctx=HookContext(
|
|
105
|
+
config=self.sdk_configuration,
|
|
106
|
+
base_url=base_url or "",
|
|
107
|
+
operation_id="getAnalystInsights",
|
|
108
|
+
oauth2_scopes=["analytics:information"],
|
|
109
|
+
security_source=self.sdk_configuration.security,
|
|
110
|
+
tags=["Analytics"],
|
|
111
|
+
extensions=None,
|
|
112
|
+
),
|
|
113
|
+
request=req,
|
|
114
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
115
|
+
retry_config=retry_config,
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
def next_func() -> Optional[models.GetAnalystInsightsResponse]:
|
|
119
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
120
|
+
page = request.page if isinstance(request.page, int) else 1
|
|
121
|
+
next_page = page + 1
|
|
122
|
+
|
|
123
|
+
if not http_res.text:
|
|
124
|
+
return None
|
|
125
|
+
results = JSONPath("$.insights").parse(body)
|
|
126
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
127
|
+
return None
|
|
128
|
+
limit_ = request.page_size if isinstance(request.page_size, int) else 0
|
|
129
|
+
if len(results[0]) < limit_:
|
|
130
|
+
return None
|
|
131
|
+
|
|
132
|
+
return self.get_analyst_insights(
|
|
133
|
+
page=next_page,
|
|
134
|
+
page_size=page_size,
|
|
135
|
+
symbols=symbols,
|
|
136
|
+
analyst=analyst,
|
|
137
|
+
rating_id=rating_id,
|
|
138
|
+
search_keys_type=search_keys_type,
|
|
139
|
+
search_keys=search_keys,
|
|
140
|
+
retries=retries,
|
|
141
|
+
server_url=server_url,
|
|
142
|
+
timeout_ms=timeout_ms,
|
|
143
|
+
http_headers=http_headers,
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
response_data: Any = None
|
|
147
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
148
|
+
return models.GetAnalystInsightsResponse(
|
|
149
|
+
analyst_insights_response=unmarshal_json_response(
|
|
150
|
+
Optional[models.AnalystInsightsResponse], http_res
|
|
151
|
+
),
|
|
152
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
153
|
+
next=next_func,
|
|
154
|
+
)
|
|
155
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
156
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
157
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
158
|
+
request=req, response=http_res
|
|
159
|
+
)
|
|
160
|
+
raise errors.BadRequest(response_data, http_res)
|
|
161
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
162
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
163
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
164
|
+
request=req, response=http_res
|
|
165
|
+
)
|
|
166
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
167
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
168
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
169
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
170
|
+
request=req, response=http_res
|
|
171
|
+
)
|
|
172
|
+
raise errors.Forbidden(response_data, http_res)
|
|
173
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
174
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
175
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
176
|
+
request=req, response=http_res
|
|
177
|
+
)
|
|
178
|
+
raise errors.NotFound(response_data, http_res)
|
|
179
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
180
|
+
response_data = unmarshal_json_response(
|
|
181
|
+
errors.InternalServerErrorUnion, http_res
|
|
182
|
+
)
|
|
183
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
184
|
+
request=req, response=http_res
|
|
185
|
+
)
|
|
186
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
187
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
188
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
189
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
190
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
191
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
192
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
193
|
+
|
|
194
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
195
|
+
|
|
196
|
+
async def get_analyst_insights_async(
|
|
197
|
+
self,
|
|
198
|
+
*,
|
|
199
|
+
page: Optional[int] = None,
|
|
200
|
+
page_size: Optional[int] = None,
|
|
201
|
+
symbols: Optional[str] = None,
|
|
202
|
+
analyst: Optional[str] = None,
|
|
203
|
+
rating_id: Optional[str] = None,
|
|
204
|
+
search_keys_type: Optional[models.GetAnalystInsightsSearchKeysType] = None,
|
|
205
|
+
search_keys: Optional[str] = None,
|
|
206
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
207
|
+
server_url: Optional[str] = None,
|
|
208
|
+
timeout_ms: Optional[int] = None,
|
|
209
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
210
|
+
) -> Optional[models.GetAnalystInsightsResponse]:
|
|
211
|
+
r"""Get Analyst Insights
|
|
212
|
+
|
|
213
|
+
Retrieve analyst insights and research data. All query parameters are optional. Supports pagination and filtering by symbols, analyst, ratingId, and firm.
|
|
214
|
+
|
|
215
|
+
If set, this operation will use `client_id` from the global security.
|
|
216
|
+
|
|
217
|
+
:param page: Zero-based page number. Enter 0 for the first page, 1 for the second page, and so on.
|
|
218
|
+
:param page_size: Number of results per page. Use this to control pagination size in list views. Use this to control page size; default is 10.
|
|
219
|
+
:param symbols: Comma-separated ticker symbols, such as AAPL,MSFT. Use this to request or filter multiple companies in one call. (e.g. AAPL,MSFT)
|
|
220
|
+
:param analyst: Comma-separated analyst IDs. Use this to limit insight results to specific analysts.
|
|
221
|
+
:param rating_id: Comma-separated rating IDs. Use this to limit insight results to specific rating records.
|
|
222
|
+
:param search_keys_type: Tells the API how to interpret the value you send in `searchKeys`. Allowed values:
|
|
223
|
+
- `firm_id` — the value is a firm/company internal ID.
|
|
224
|
+
- `firm` — the value is the firm/company name.
|
|
225
|
+
:param search_keys: Search key value (based on searchKeysType)
|
|
226
|
+
:param retries: Override the default retry configuration for this method
|
|
227
|
+
:param server_url: Override the default server URL for this method
|
|
228
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
229
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
230
|
+
"""
|
|
231
|
+
base_url = None
|
|
232
|
+
url_variables = None
|
|
233
|
+
if timeout_ms is None:
|
|
234
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
235
|
+
|
|
236
|
+
if timeout_ms is None:
|
|
237
|
+
timeout_ms = 30000
|
|
238
|
+
|
|
239
|
+
if server_url is not None:
|
|
240
|
+
base_url = server_url
|
|
241
|
+
else:
|
|
242
|
+
base_url = self._get_url(base_url, url_variables)
|
|
243
|
+
|
|
244
|
+
request = models.GetAnalystInsightsRequest(
|
|
245
|
+
page=page,
|
|
246
|
+
page_size=page_size,
|
|
247
|
+
symbols=symbols,
|
|
248
|
+
analyst=analyst,
|
|
249
|
+
rating_id=rating_id,
|
|
250
|
+
search_keys_type=search_keys_type,
|
|
251
|
+
search_keys=search_keys,
|
|
252
|
+
)
|
|
253
|
+
|
|
254
|
+
req = self._build_request_async(
|
|
255
|
+
method="GET",
|
|
256
|
+
path="/v1/analytics/insights",
|
|
257
|
+
base_url=base_url,
|
|
258
|
+
url_variables=url_variables,
|
|
259
|
+
request=request,
|
|
260
|
+
request_body_required=False,
|
|
261
|
+
request_has_path_params=False,
|
|
262
|
+
request_has_query_params=True,
|
|
263
|
+
user_agent_header="user-agent",
|
|
264
|
+
accept_header_value="application/json",
|
|
265
|
+
http_headers=http_headers,
|
|
266
|
+
security=self.sdk_configuration.security,
|
|
267
|
+
allow_empty_value=None,
|
|
268
|
+
allowed_fields=["client_id"],
|
|
269
|
+
timeout_ms=timeout_ms,
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
if retries == UNSET:
|
|
273
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
274
|
+
retries = self.sdk_configuration.retry_config
|
|
275
|
+
else:
|
|
276
|
+
retries = utils.RetryConfig(
|
|
277
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
retry_config = None
|
|
281
|
+
if isinstance(retries, utils.RetryConfig):
|
|
282
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
283
|
+
|
|
284
|
+
http_res = await self.do_request_async(
|
|
285
|
+
hook_ctx=HookContext(
|
|
286
|
+
config=self.sdk_configuration,
|
|
287
|
+
base_url=base_url or "",
|
|
288
|
+
operation_id="getAnalystInsights",
|
|
289
|
+
oauth2_scopes=["analytics:information"],
|
|
290
|
+
security_source=self.sdk_configuration.security,
|
|
291
|
+
tags=["Analytics"],
|
|
292
|
+
extensions=None,
|
|
293
|
+
),
|
|
294
|
+
request=req,
|
|
295
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
296
|
+
retry_config=retry_config,
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
def next_func() -> Optional[models.GetAnalystInsightsResponse]:
|
|
300
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
301
|
+
page = request.page if isinstance(request.page, int) else 1
|
|
302
|
+
next_page = page + 1
|
|
303
|
+
|
|
304
|
+
if not http_res.text:
|
|
305
|
+
return None
|
|
306
|
+
results = JSONPath("$.insights").parse(body)
|
|
307
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
308
|
+
return None
|
|
309
|
+
limit_ = request.page_size if isinstance(request.page_size, int) else 0
|
|
310
|
+
if len(results[0]) < limit_:
|
|
311
|
+
return None
|
|
312
|
+
|
|
313
|
+
return self.get_analyst_insights(
|
|
314
|
+
page=next_page,
|
|
315
|
+
page_size=page_size,
|
|
316
|
+
symbols=symbols,
|
|
317
|
+
analyst=analyst,
|
|
318
|
+
rating_id=rating_id,
|
|
319
|
+
search_keys_type=search_keys_type,
|
|
320
|
+
search_keys=search_keys,
|
|
321
|
+
retries=retries,
|
|
322
|
+
server_url=server_url,
|
|
323
|
+
timeout_ms=timeout_ms,
|
|
324
|
+
http_headers=http_headers,
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
response_data: Any = None
|
|
328
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
329
|
+
return models.GetAnalystInsightsResponse(
|
|
330
|
+
analyst_insights_response=unmarshal_json_response(
|
|
331
|
+
Optional[models.AnalystInsightsResponse], http_res
|
|
332
|
+
),
|
|
333
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
334
|
+
next=next_func,
|
|
335
|
+
)
|
|
336
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
337
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
338
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
339
|
+
request=req, response=http_res
|
|
340
|
+
)
|
|
341
|
+
raise errors.BadRequest(response_data, http_res)
|
|
342
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
343
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
344
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
345
|
+
request=req, response=http_res
|
|
346
|
+
)
|
|
347
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
348
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
349
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
350
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
351
|
+
request=req, response=http_res
|
|
352
|
+
)
|
|
353
|
+
raise errors.Forbidden(response_data, http_res)
|
|
354
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
355
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
356
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
357
|
+
request=req, response=http_res
|
|
358
|
+
)
|
|
359
|
+
raise errors.NotFound(response_data, http_res)
|
|
360
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
361
|
+
response_data = unmarshal_json_response(
|
|
362
|
+
errors.InternalServerErrorUnion, http_res
|
|
363
|
+
)
|
|
364
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
365
|
+
request=req, response=http_res
|
|
366
|
+
)
|
|
367
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
368
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
369
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
370
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
371
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
372
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
373
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
374
|
+
|
|
375
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
376
|
+
|
|
377
|
+
def get_market_breadth(
|
|
378
|
+
self,
|
|
379
|
+
*,
|
|
380
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
381
|
+
server_url: Optional[str] = None,
|
|
382
|
+
timeout_ms: Optional[int] = None,
|
|
383
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
384
|
+
) -> models.GetMarketBreadthResponse:
|
|
385
|
+
r"""Get Market Breadth
|
|
386
|
+
|
|
387
|
+
Retrieve market breadth data showing advancers vs decliners
|
|
388
|
+
|
|
389
|
+
If set, this operation will use `client_id` from the global security.
|
|
390
|
+
|
|
391
|
+
:param retries: Override the default retry configuration for this method
|
|
392
|
+
:param server_url: Override the default server URL for this method
|
|
393
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
394
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
395
|
+
"""
|
|
396
|
+
base_url = None
|
|
397
|
+
url_variables = None
|
|
398
|
+
if timeout_ms is None:
|
|
399
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
400
|
+
|
|
401
|
+
if timeout_ms is None:
|
|
402
|
+
timeout_ms = 30000
|
|
403
|
+
|
|
404
|
+
if server_url is not None:
|
|
405
|
+
base_url = server_url
|
|
406
|
+
else:
|
|
407
|
+
base_url = self._get_url(base_url, url_variables)
|
|
408
|
+
req = self._build_request(
|
|
409
|
+
method="GET",
|
|
410
|
+
path="/v1/analytics/market-breadth",
|
|
411
|
+
base_url=base_url,
|
|
412
|
+
url_variables=url_variables,
|
|
413
|
+
request=None,
|
|
414
|
+
request_body_required=False,
|
|
415
|
+
request_has_path_params=False,
|
|
416
|
+
request_has_query_params=True,
|
|
417
|
+
user_agent_header="user-agent",
|
|
418
|
+
accept_header_value="application/json",
|
|
419
|
+
http_headers=http_headers,
|
|
420
|
+
security=self.sdk_configuration.security,
|
|
421
|
+
allow_empty_value=None,
|
|
422
|
+
allowed_fields=["client_id"],
|
|
423
|
+
timeout_ms=timeout_ms,
|
|
424
|
+
)
|
|
425
|
+
|
|
426
|
+
if retries == UNSET:
|
|
427
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
428
|
+
retries = self.sdk_configuration.retry_config
|
|
429
|
+
else:
|
|
430
|
+
retries = utils.RetryConfig(
|
|
431
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
432
|
+
)
|
|
433
|
+
|
|
434
|
+
retry_config = None
|
|
435
|
+
if isinstance(retries, utils.RetryConfig):
|
|
436
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
437
|
+
|
|
438
|
+
http_res = self.do_request(
|
|
439
|
+
hook_ctx=HookContext(
|
|
440
|
+
config=self.sdk_configuration,
|
|
441
|
+
base_url=base_url or "",
|
|
442
|
+
operation_id="getMarketBreadth",
|
|
443
|
+
oauth2_scopes=["analytics:information"],
|
|
444
|
+
security_source=self.sdk_configuration.security,
|
|
445
|
+
tags=["Analytics"],
|
|
446
|
+
extensions=None,
|
|
447
|
+
),
|
|
448
|
+
request=req,
|
|
449
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
450
|
+
retry_config=retry_config,
|
|
451
|
+
)
|
|
452
|
+
|
|
453
|
+
response_data: Any = None
|
|
454
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
455
|
+
return models.GetMarketBreadthResponse(
|
|
456
|
+
market_breadth_response=unmarshal_json_response(
|
|
457
|
+
Optional[models.MarketBreadthResponse], http_res
|
|
458
|
+
),
|
|
459
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
460
|
+
)
|
|
461
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
462
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
463
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
464
|
+
request=req, response=http_res
|
|
465
|
+
)
|
|
466
|
+
raise errors.BadRequest(response_data, http_res)
|
|
467
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
468
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
469
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
470
|
+
request=req, response=http_res
|
|
471
|
+
)
|
|
472
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
473
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
474
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
475
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
476
|
+
request=req, response=http_res
|
|
477
|
+
)
|
|
478
|
+
raise errors.Forbidden(response_data, http_res)
|
|
479
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
480
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
481
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
482
|
+
request=req, response=http_res
|
|
483
|
+
)
|
|
484
|
+
raise errors.NotFound(response_data, http_res)
|
|
485
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
486
|
+
response_data = unmarshal_json_response(
|
|
487
|
+
errors.InternalServerErrorUnion, http_res
|
|
488
|
+
)
|
|
489
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
490
|
+
request=req, response=http_res
|
|
491
|
+
)
|
|
492
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
493
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
494
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
495
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
496
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
497
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
498
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
499
|
+
|
|
500
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
501
|
+
|
|
502
|
+
async def get_market_breadth_async(
|
|
503
|
+
self,
|
|
504
|
+
*,
|
|
505
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
506
|
+
server_url: Optional[str] = None,
|
|
507
|
+
timeout_ms: Optional[int] = None,
|
|
508
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
509
|
+
) -> models.GetMarketBreadthResponse:
|
|
510
|
+
r"""Get Market Breadth
|
|
511
|
+
|
|
512
|
+
Retrieve market breadth data showing advancers vs decliners
|
|
513
|
+
|
|
514
|
+
If set, this operation will use `client_id` from the global security.
|
|
515
|
+
|
|
516
|
+
:param retries: Override the default retry configuration for this method
|
|
517
|
+
:param server_url: Override the default server URL for this method
|
|
518
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
519
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
520
|
+
"""
|
|
521
|
+
base_url = None
|
|
522
|
+
url_variables = None
|
|
523
|
+
if timeout_ms is None:
|
|
524
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
525
|
+
|
|
526
|
+
if timeout_ms is None:
|
|
527
|
+
timeout_ms = 30000
|
|
528
|
+
|
|
529
|
+
if server_url is not None:
|
|
530
|
+
base_url = server_url
|
|
531
|
+
else:
|
|
532
|
+
base_url = self._get_url(base_url, url_variables)
|
|
533
|
+
req = self._build_request_async(
|
|
534
|
+
method="GET",
|
|
535
|
+
path="/v1/analytics/market-breadth",
|
|
536
|
+
base_url=base_url,
|
|
537
|
+
url_variables=url_variables,
|
|
538
|
+
request=None,
|
|
539
|
+
request_body_required=False,
|
|
540
|
+
request_has_path_params=False,
|
|
541
|
+
request_has_query_params=True,
|
|
542
|
+
user_agent_header="user-agent",
|
|
543
|
+
accept_header_value="application/json",
|
|
544
|
+
http_headers=http_headers,
|
|
545
|
+
security=self.sdk_configuration.security,
|
|
546
|
+
allow_empty_value=None,
|
|
547
|
+
allowed_fields=["client_id"],
|
|
548
|
+
timeout_ms=timeout_ms,
|
|
549
|
+
)
|
|
550
|
+
|
|
551
|
+
if retries == UNSET:
|
|
552
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
553
|
+
retries = self.sdk_configuration.retry_config
|
|
554
|
+
else:
|
|
555
|
+
retries = utils.RetryConfig(
|
|
556
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
557
|
+
)
|
|
558
|
+
|
|
559
|
+
retry_config = None
|
|
560
|
+
if isinstance(retries, utils.RetryConfig):
|
|
561
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
562
|
+
|
|
563
|
+
http_res = await self.do_request_async(
|
|
564
|
+
hook_ctx=HookContext(
|
|
565
|
+
config=self.sdk_configuration,
|
|
566
|
+
base_url=base_url or "",
|
|
567
|
+
operation_id="getMarketBreadth",
|
|
568
|
+
oauth2_scopes=["analytics:information"],
|
|
569
|
+
security_source=self.sdk_configuration.security,
|
|
570
|
+
tags=["Analytics"],
|
|
571
|
+
extensions=None,
|
|
572
|
+
),
|
|
573
|
+
request=req,
|
|
574
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
575
|
+
retry_config=retry_config,
|
|
576
|
+
)
|
|
577
|
+
|
|
578
|
+
response_data: Any = None
|
|
579
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
580
|
+
return models.GetMarketBreadthResponse(
|
|
581
|
+
market_breadth_response=unmarshal_json_response(
|
|
582
|
+
Optional[models.MarketBreadthResponse], http_res
|
|
583
|
+
),
|
|
584
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
585
|
+
)
|
|
586
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
587
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
588
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
589
|
+
request=req, response=http_res
|
|
590
|
+
)
|
|
591
|
+
raise errors.BadRequest(response_data, http_res)
|
|
592
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
593
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
594
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
595
|
+
request=req, response=http_res
|
|
596
|
+
)
|
|
597
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
598
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
599
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
600
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
601
|
+
request=req, response=http_res
|
|
602
|
+
)
|
|
603
|
+
raise errors.Forbidden(response_data, http_res)
|
|
604
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
605
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
606
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
607
|
+
request=req, response=http_res
|
|
608
|
+
)
|
|
609
|
+
raise errors.NotFound(response_data, http_res)
|
|
610
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
611
|
+
response_data = unmarshal_json_response(
|
|
612
|
+
errors.InternalServerErrorUnion, http_res
|
|
613
|
+
)
|
|
614
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
615
|
+
request=req, response=http_res
|
|
616
|
+
)
|
|
617
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
618
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
619
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
620
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
621
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
622
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
623
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
624
|
+
|
|
625
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
626
|
+
|
|
627
|
+
def get_net_inflow(
|
|
628
|
+
self,
|
|
629
|
+
*,
|
|
630
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
631
|
+
server_url: Optional[str] = None,
|
|
632
|
+
timeout_ms: Optional[int] = None,
|
|
633
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
634
|
+
) -> models.GetNetInflowResponse:
|
|
635
|
+
r"""Get Net Inflow
|
|
636
|
+
|
|
637
|
+
Retrieve net inflow data for NASDAQ and NYSE
|
|
638
|
+
|
|
639
|
+
If set, this operation will use `client_id` from the global security.
|
|
640
|
+
|
|
641
|
+
:param retries: Override the default retry configuration for this method
|
|
642
|
+
:param server_url: Override the default server URL for this method
|
|
643
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
644
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
645
|
+
"""
|
|
646
|
+
base_url = None
|
|
647
|
+
url_variables = None
|
|
648
|
+
if timeout_ms is None:
|
|
649
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
650
|
+
|
|
651
|
+
if timeout_ms is None:
|
|
652
|
+
timeout_ms = 30000
|
|
653
|
+
|
|
654
|
+
if server_url is not None:
|
|
655
|
+
base_url = server_url
|
|
656
|
+
else:
|
|
657
|
+
base_url = self._get_url(base_url, url_variables)
|
|
658
|
+
req = self._build_request(
|
|
659
|
+
method="GET",
|
|
660
|
+
path="/v1/analytics/net-inflow",
|
|
661
|
+
base_url=base_url,
|
|
662
|
+
url_variables=url_variables,
|
|
663
|
+
request=None,
|
|
664
|
+
request_body_required=False,
|
|
665
|
+
request_has_path_params=False,
|
|
666
|
+
request_has_query_params=True,
|
|
667
|
+
user_agent_header="user-agent",
|
|
668
|
+
accept_header_value="application/json",
|
|
669
|
+
http_headers=http_headers,
|
|
670
|
+
security=self.sdk_configuration.security,
|
|
671
|
+
allow_empty_value=None,
|
|
672
|
+
allowed_fields=["client_id"],
|
|
673
|
+
timeout_ms=timeout_ms,
|
|
674
|
+
)
|
|
675
|
+
|
|
676
|
+
if retries == UNSET:
|
|
677
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
678
|
+
retries = self.sdk_configuration.retry_config
|
|
679
|
+
else:
|
|
680
|
+
retries = utils.RetryConfig(
|
|
681
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
682
|
+
)
|
|
683
|
+
|
|
684
|
+
retry_config = None
|
|
685
|
+
if isinstance(retries, utils.RetryConfig):
|
|
686
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
687
|
+
|
|
688
|
+
http_res = self.do_request(
|
|
689
|
+
hook_ctx=HookContext(
|
|
690
|
+
config=self.sdk_configuration,
|
|
691
|
+
base_url=base_url or "",
|
|
692
|
+
operation_id="getNetInflow",
|
|
693
|
+
oauth2_scopes=["analytics:information"],
|
|
694
|
+
security_source=self.sdk_configuration.security,
|
|
695
|
+
tags=["Analytics"],
|
|
696
|
+
extensions=None,
|
|
697
|
+
),
|
|
698
|
+
request=req,
|
|
699
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
700
|
+
retry_config=retry_config,
|
|
701
|
+
)
|
|
702
|
+
|
|
703
|
+
response_data: Any = None
|
|
704
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
705
|
+
return models.GetNetInflowResponse(
|
|
706
|
+
net_inflow_response=unmarshal_json_response(
|
|
707
|
+
Optional[models.NetInflowResponse], http_res
|
|
708
|
+
),
|
|
709
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
710
|
+
)
|
|
711
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
712
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
713
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
714
|
+
request=req, response=http_res
|
|
715
|
+
)
|
|
716
|
+
raise errors.BadRequest(response_data, http_res)
|
|
717
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
718
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
719
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
720
|
+
request=req, response=http_res
|
|
721
|
+
)
|
|
722
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
723
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
724
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
725
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
726
|
+
request=req, response=http_res
|
|
727
|
+
)
|
|
728
|
+
raise errors.Forbidden(response_data, http_res)
|
|
729
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
730
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
731
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
732
|
+
request=req, response=http_res
|
|
733
|
+
)
|
|
734
|
+
raise errors.NotFound(response_data, http_res)
|
|
735
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
736
|
+
response_data = unmarshal_json_response(
|
|
737
|
+
errors.InternalServerErrorUnion, http_res
|
|
738
|
+
)
|
|
739
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
740
|
+
request=req, response=http_res
|
|
741
|
+
)
|
|
742
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
743
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
744
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
745
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
746
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
747
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
748
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
749
|
+
|
|
750
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
751
|
+
|
|
752
|
+
async def get_net_inflow_async(
|
|
753
|
+
self,
|
|
754
|
+
*,
|
|
755
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
756
|
+
server_url: Optional[str] = None,
|
|
757
|
+
timeout_ms: Optional[int] = None,
|
|
758
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
759
|
+
) -> models.GetNetInflowResponse:
|
|
760
|
+
r"""Get Net Inflow
|
|
761
|
+
|
|
762
|
+
Retrieve net inflow data for NASDAQ and NYSE
|
|
763
|
+
|
|
764
|
+
If set, this operation will use `client_id` from the global security.
|
|
765
|
+
|
|
766
|
+
:param retries: Override the default retry configuration for this method
|
|
767
|
+
:param server_url: Override the default server URL for this method
|
|
768
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
769
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
770
|
+
"""
|
|
771
|
+
base_url = None
|
|
772
|
+
url_variables = None
|
|
773
|
+
if timeout_ms is None:
|
|
774
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
775
|
+
|
|
776
|
+
if timeout_ms is None:
|
|
777
|
+
timeout_ms = 30000
|
|
778
|
+
|
|
779
|
+
if server_url is not None:
|
|
780
|
+
base_url = server_url
|
|
781
|
+
else:
|
|
782
|
+
base_url = self._get_url(base_url, url_variables)
|
|
783
|
+
req = self._build_request_async(
|
|
784
|
+
method="GET",
|
|
785
|
+
path="/v1/analytics/net-inflow",
|
|
786
|
+
base_url=base_url,
|
|
787
|
+
url_variables=url_variables,
|
|
788
|
+
request=None,
|
|
789
|
+
request_body_required=False,
|
|
790
|
+
request_has_path_params=False,
|
|
791
|
+
request_has_query_params=True,
|
|
792
|
+
user_agent_header="user-agent",
|
|
793
|
+
accept_header_value="application/json",
|
|
794
|
+
http_headers=http_headers,
|
|
795
|
+
security=self.sdk_configuration.security,
|
|
796
|
+
allow_empty_value=None,
|
|
797
|
+
allowed_fields=["client_id"],
|
|
798
|
+
timeout_ms=timeout_ms,
|
|
799
|
+
)
|
|
800
|
+
|
|
801
|
+
if retries == UNSET:
|
|
802
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
803
|
+
retries = self.sdk_configuration.retry_config
|
|
804
|
+
else:
|
|
805
|
+
retries = utils.RetryConfig(
|
|
806
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
807
|
+
)
|
|
808
|
+
|
|
809
|
+
retry_config = None
|
|
810
|
+
if isinstance(retries, utils.RetryConfig):
|
|
811
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
812
|
+
|
|
813
|
+
http_res = await self.do_request_async(
|
|
814
|
+
hook_ctx=HookContext(
|
|
815
|
+
config=self.sdk_configuration,
|
|
816
|
+
base_url=base_url or "",
|
|
817
|
+
operation_id="getNetInflow",
|
|
818
|
+
oauth2_scopes=["analytics:information"],
|
|
819
|
+
security_source=self.sdk_configuration.security,
|
|
820
|
+
tags=["Analytics"],
|
|
821
|
+
extensions=None,
|
|
822
|
+
),
|
|
823
|
+
request=req,
|
|
824
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
825
|
+
retry_config=retry_config,
|
|
826
|
+
)
|
|
827
|
+
|
|
828
|
+
response_data: Any = None
|
|
829
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
830
|
+
return models.GetNetInflowResponse(
|
|
831
|
+
net_inflow_response=unmarshal_json_response(
|
|
832
|
+
Optional[models.NetInflowResponse], http_res
|
|
833
|
+
),
|
|
834
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
835
|
+
)
|
|
836
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
837
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
838
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
839
|
+
request=req, response=http_res
|
|
840
|
+
)
|
|
841
|
+
raise errors.BadRequest(response_data, http_res)
|
|
842
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
843
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
844
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
845
|
+
request=req, response=http_res
|
|
846
|
+
)
|
|
847
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
848
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
849
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
850
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
851
|
+
request=req, response=http_res
|
|
852
|
+
)
|
|
853
|
+
raise errors.Forbidden(response_data, http_res)
|
|
854
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
855
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
856
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
857
|
+
request=req, response=http_res
|
|
858
|
+
)
|
|
859
|
+
raise errors.NotFound(response_data, http_res)
|
|
860
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
861
|
+
response_data = unmarshal_json_response(
|
|
862
|
+
errors.InternalServerErrorUnion, http_res
|
|
863
|
+
)
|
|
864
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
865
|
+
request=req, response=http_res
|
|
866
|
+
)
|
|
867
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
868
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
869
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
870
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
871
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
872
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
873
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
874
|
+
|
|
875
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
876
|
+
|
|
877
|
+
def get_ratings(
|
|
878
|
+
self,
|
|
879
|
+
*,
|
|
880
|
+
tickers: Optional[str] = None,
|
|
881
|
+
page: Optional[int] = None,
|
|
882
|
+
page_size: Optional[int] = None,
|
|
883
|
+
date_: Optional[date] = None,
|
|
884
|
+
date_from: Optional[date] = None,
|
|
885
|
+
date_to: Optional[date] = None,
|
|
886
|
+
importance: Optional[int] = None,
|
|
887
|
+
action: Optional[str] = None,
|
|
888
|
+
analyst_id: Optional[str] = None,
|
|
889
|
+
firm_id: Optional[str] = None,
|
|
890
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
891
|
+
server_url: Optional[str] = None,
|
|
892
|
+
timeout_ms: Optional[int] = None,
|
|
893
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
894
|
+
) -> Optional[models.GetRatingsResponseResponse]:
|
|
895
|
+
r"""Get Analyst Ratings
|
|
896
|
+
|
|
897
|
+
Retrieve analyst ratings for stocks. All query parameters are optional.
|
|
898
|
+
|
|
899
|
+
If set, this operation will use `client_id` from the global security.
|
|
900
|
+
|
|
901
|
+
:param tickers: Comma-separated list of ticker symbols to filter by
|
|
902
|
+
:param page: Page number for pagination (0-based)
|
|
903
|
+
:param page_size: Number of results per page. Use this to control pagination size in list views.
|
|
904
|
+
:param date_: Filter by specific date (YYYY-MM-DD)
|
|
905
|
+
:param date_from: Start date for date range (YYYY-MM-DD)
|
|
906
|
+
:param date_to: End date for date range (YYYY-MM-DD)
|
|
907
|
+
:param importance: Minimum importance level to include. Use higher values to filter for more market-moving events or ratings.
|
|
908
|
+
:param action: Rating action filter. Use it to return only upgrades, downgrades, initiations, or other supported action types.
|
|
909
|
+
:param analyst_id: Comma-separated analyst IDs. Use this to limit insight results to specific analysts. to filter by
|
|
910
|
+
:param firm_id: Comma-separated firm IDs to filter by
|
|
911
|
+
:param retries: Override the default retry configuration for this method
|
|
912
|
+
:param server_url: Override the default server URL for this method
|
|
913
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
914
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
915
|
+
"""
|
|
916
|
+
base_url = None
|
|
917
|
+
url_variables = None
|
|
918
|
+
if timeout_ms is None:
|
|
919
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
920
|
+
|
|
921
|
+
if timeout_ms is None:
|
|
922
|
+
timeout_ms = 30000
|
|
923
|
+
|
|
924
|
+
if server_url is not None:
|
|
925
|
+
base_url = server_url
|
|
926
|
+
else:
|
|
927
|
+
base_url = self._get_url(base_url, url_variables)
|
|
928
|
+
|
|
929
|
+
request = models.GetRatingsRequest(
|
|
930
|
+
tickers=tickers,
|
|
931
|
+
page=page,
|
|
932
|
+
page_size=page_size,
|
|
933
|
+
date_=date_,
|
|
934
|
+
date_from=date_from,
|
|
935
|
+
date_to=date_to,
|
|
936
|
+
importance=importance,
|
|
937
|
+
action=action,
|
|
938
|
+
analyst_id=analyst_id,
|
|
939
|
+
firm_id=firm_id,
|
|
940
|
+
)
|
|
941
|
+
|
|
942
|
+
req = self._build_request(
|
|
943
|
+
method="GET",
|
|
944
|
+
path="/v1/analytics/ratings",
|
|
945
|
+
base_url=base_url,
|
|
946
|
+
url_variables=url_variables,
|
|
947
|
+
request=request,
|
|
948
|
+
request_body_required=False,
|
|
949
|
+
request_has_path_params=False,
|
|
950
|
+
request_has_query_params=True,
|
|
951
|
+
user_agent_header="user-agent",
|
|
952
|
+
accept_header_value="application/json",
|
|
953
|
+
http_headers=http_headers,
|
|
954
|
+
security=self.sdk_configuration.security,
|
|
955
|
+
allow_empty_value=None,
|
|
956
|
+
allowed_fields=["client_id"],
|
|
957
|
+
timeout_ms=timeout_ms,
|
|
958
|
+
)
|
|
959
|
+
|
|
960
|
+
if retries == UNSET:
|
|
961
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
962
|
+
retries = self.sdk_configuration.retry_config
|
|
963
|
+
else:
|
|
964
|
+
retries = utils.RetryConfig(
|
|
965
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
966
|
+
)
|
|
967
|
+
|
|
968
|
+
retry_config = None
|
|
969
|
+
if isinstance(retries, utils.RetryConfig):
|
|
970
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
971
|
+
|
|
972
|
+
http_res = self.do_request(
|
|
973
|
+
hook_ctx=HookContext(
|
|
974
|
+
config=self.sdk_configuration,
|
|
975
|
+
base_url=base_url or "",
|
|
976
|
+
operation_id="getRatings",
|
|
977
|
+
oauth2_scopes=["analytics:information"],
|
|
978
|
+
security_source=self.sdk_configuration.security,
|
|
979
|
+
tags=["Analytics"],
|
|
980
|
+
extensions=None,
|
|
981
|
+
),
|
|
982
|
+
request=req,
|
|
983
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
984
|
+
retry_config=retry_config,
|
|
985
|
+
)
|
|
986
|
+
|
|
987
|
+
def next_func() -> Optional[models.GetRatingsResponseResponse]:
|
|
988
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
989
|
+
page = request.page if isinstance(request.page, int) else 1
|
|
990
|
+
next_page = page + 1
|
|
991
|
+
|
|
992
|
+
if not http_res.text:
|
|
993
|
+
return None
|
|
994
|
+
results = JSONPath("$.ratings").parse(body)
|
|
995
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
996
|
+
return None
|
|
997
|
+
limit_ = request.page_size if isinstance(request.page_size, int) else 0
|
|
998
|
+
if len(results[0]) < limit_:
|
|
999
|
+
return None
|
|
1000
|
+
|
|
1001
|
+
return self.get_ratings(
|
|
1002
|
+
tickers=tickers,
|
|
1003
|
+
page=next_page,
|
|
1004
|
+
page_size=page_size,
|
|
1005
|
+
date_=date_,
|
|
1006
|
+
date_from=date_from,
|
|
1007
|
+
date_to=date_to,
|
|
1008
|
+
importance=importance,
|
|
1009
|
+
action=action,
|
|
1010
|
+
analyst_id=analyst_id,
|
|
1011
|
+
firm_id=firm_id,
|
|
1012
|
+
retries=retries,
|
|
1013
|
+
server_url=server_url,
|
|
1014
|
+
timeout_ms=timeout_ms,
|
|
1015
|
+
http_headers=http_headers,
|
|
1016
|
+
)
|
|
1017
|
+
|
|
1018
|
+
response_data: Any = None
|
|
1019
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1020
|
+
return models.GetRatingsResponseResponse(
|
|
1021
|
+
get_ratings_response=unmarshal_json_response(
|
|
1022
|
+
Optional[models.GetRatingsResponse], http_res
|
|
1023
|
+
),
|
|
1024
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1025
|
+
next=next_func,
|
|
1026
|
+
)
|
|
1027
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1028
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1029
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1030
|
+
request=req, response=http_res
|
|
1031
|
+
)
|
|
1032
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1033
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1034
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1035
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1036
|
+
request=req, response=http_res
|
|
1037
|
+
)
|
|
1038
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1039
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1040
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1041
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1042
|
+
request=req, response=http_res
|
|
1043
|
+
)
|
|
1044
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1045
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1046
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1047
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1048
|
+
request=req, response=http_res
|
|
1049
|
+
)
|
|
1050
|
+
raise errors.NotFound(response_data, http_res)
|
|
1051
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1052
|
+
response_data = unmarshal_json_response(
|
|
1053
|
+
errors.InternalServerErrorUnion, http_res
|
|
1054
|
+
)
|
|
1055
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1056
|
+
request=req, response=http_res
|
|
1057
|
+
)
|
|
1058
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1059
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1060
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1061
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1062
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1063
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1064
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1065
|
+
|
|
1066
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1067
|
+
|
|
1068
|
+
async def get_ratings_async(
|
|
1069
|
+
self,
|
|
1070
|
+
*,
|
|
1071
|
+
tickers: Optional[str] = None,
|
|
1072
|
+
page: Optional[int] = None,
|
|
1073
|
+
page_size: Optional[int] = None,
|
|
1074
|
+
date_: Optional[date] = None,
|
|
1075
|
+
date_from: Optional[date] = None,
|
|
1076
|
+
date_to: Optional[date] = None,
|
|
1077
|
+
importance: Optional[int] = None,
|
|
1078
|
+
action: Optional[str] = None,
|
|
1079
|
+
analyst_id: Optional[str] = None,
|
|
1080
|
+
firm_id: Optional[str] = None,
|
|
1081
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1082
|
+
server_url: Optional[str] = None,
|
|
1083
|
+
timeout_ms: Optional[int] = None,
|
|
1084
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1085
|
+
) -> Optional[models.GetRatingsResponseResponse]:
|
|
1086
|
+
r"""Get Analyst Ratings
|
|
1087
|
+
|
|
1088
|
+
Retrieve analyst ratings for stocks. All query parameters are optional.
|
|
1089
|
+
|
|
1090
|
+
If set, this operation will use `client_id` from the global security.
|
|
1091
|
+
|
|
1092
|
+
:param tickers: Comma-separated list of ticker symbols to filter by
|
|
1093
|
+
:param page: Page number for pagination (0-based)
|
|
1094
|
+
:param page_size: Number of results per page. Use this to control pagination size in list views.
|
|
1095
|
+
:param date_: Filter by specific date (YYYY-MM-DD)
|
|
1096
|
+
:param date_from: Start date for date range (YYYY-MM-DD)
|
|
1097
|
+
:param date_to: End date for date range (YYYY-MM-DD)
|
|
1098
|
+
:param importance: Minimum importance level to include. Use higher values to filter for more market-moving events or ratings.
|
|
1099
|
+
:param action: Rating action filter. Use it to return only upgrades, downgrades, initiations, or other supported action types.
|
|
1100
|
+
:param analyst_id: Comma-separated analyst IDs. Use this to limit insight results to specific analysts. to filter by
|
|
1101
|
+
:param firm_id: Comma-separated firm IDs to filter by
|
|
1102
|
+
:param retries: Override the default retry configuration for this method
|
|
1103
|
+
:param server_url: Override the default server URL for this method
|
|
1104
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1105
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1106
|
+
"""
|
|
1107
|
+
base_url = None
|
|
1108
|
+
url_variables = None
|
|
1109
|
+
if timeout_ms is None:
|
|
1110
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1111
|
+
|
|
1112
|
+
if timeout_ms is None:
|
|
1113
|
+
timeout_ms = 30000
|
|
1114
|
+
|
|
1115
|
+
if server_url is not None:
|
|
1116
|
+
base_url = server_url
|
|
1117
|
+
else:
|
|
1118
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1119
|
+
|
|
1120
|
+
request = models.GetRatingsRequest(
|
|
1121
|
+
tickers=tickers,
|
|
1122
|
+
page=page,
|
|
1123
|
+
page_size=page_size,
|
|
1124
|
+
date_=date_,
|
|
1125
|
+
date_from=date_from,
|
|
1126
|
+
date_to=date_to,
|
|
1127
|
+
importance=importance,
|
|
1128
|
+
action=action,
|
|
1129
|
+
analyst_id=analyst_id,
|
|
1130
|
+
firm_id=firm_id,
|
|
1131
|
+
)
|
|
1132
|
+
|
|
1133
|
+
req = self._build_request_async(
|
|
1134
|
+
method="GET",
|
|
1135
|
+
path="/v1/analytics/ratings",
|
|
1136
|
+
base_url=base_url,
|
|
1137
|
+
url_variables=url_variables,
|
|
1138
|
+
request=request,
|
|
1139
|
+
request_body_required=False,
|
|
1140
|
+
request_has_path_params=False,
|
|
1141
|
+
request_has_query_params=True,
|
|
1142
|
+
user_agent_header="user-agent",
|
|
1143
|
+
accept_header_value="application/json",
|
|
1144
|
+
http_headers=http_headers,
|
|
1145
|
+
security=self.sdk_configuration.security,
|
|
1146
|
+
allow_empty_value=None,
|
|
1147
|
+
allowed_fields=["client_id"],
|
|
1148
|
+
timeout_ms=timeout_ms,
|
|
1149
|
+
)
|
|
1150
|
+
|
|
1151
|
+
if retries == UNSET:
|
|
1152
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1153
|
+
retries = self.sdk_configuration.retry_config
|
|
1154
|
+
else:
|
|
1155
|
+
retries = utils.RetryConfig(
|
|
1156
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1157
|
+
)
|
|
1158
|
+
|
|
1159
|
+
retry_config = None
|
|
1160
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1161
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1162
|
+
|
|
1163
|
+
http_res = await self.do_request_async(
|
|
1164
|
+
hook_ctx=HookContext(
|
|
1165
|
+
config=self.sdk_configuration,
|
|
1166
|
+
base_url=base_url or "",
|
|
1167
|
+
operation_id="getRatings",
|
|
1168
|
+
oauth2_scopes=["analytics:information"],
|
|
1169
|
+
security_source=self.sdk_configuration.security,
|
|
1170
|
+
tags=["Analytics"],
|
|
1171
|
+
extensions=None,
|
|
1172
|
+
),
|
|
1173
|
+
request=req,
|
|
1174
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1175
|
+
retry_config=retry_config,
|
|
1176
|
+
)
|
|
1177
|
+
|
|
1178
|
+
def next_func() -> Optional[models.GetRatingsResponseResponse]:
|
|
1179
|
+
body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
|
|
1180
|
+
page = request.page if isinstance(request.page, int) else 1
|
|
1181
|
+
next_page = page + 1
|
|
1182
|
+
|
|
1183
|
+
if not http_res.text:
|
|
1184
|
+
return None
|
|
1185
|
+
results = JSONPath("$.ratings").parse(body)
|
|
1186
|
+
if len(results) == 0 or len(results[0]) == 0:
|
|
1187
|
+
return None
|
|
1188
|
+
limit_ = request.page_size if isinstance(request.page_size, int) else 0
|
|
1189
|
+
if len(results[0]) < limit_:
|
|
1190
|
+
return None
|
|
1191
|
+
|
|
1192
|
+
return self.get_ratings(
|
|
1193
|
+
tickers=tickers,
|
|
1194
|
+
page=next_page,
|
|
1195
|
+
page_size=page_size,
|
|
1196
|
+
date_=date_,
|
|
1197
|
+
date_from=date_from,
|
|
1198
|
+
date_to=date_to,
|
|
1199
|
+
importance=importance,
|
|
1200
|
+
action=action,
|
|
1201
|
+
analyst_id=analyst_id,
|
|
1202
|
+
firm_id=firm_id,
|
|
1203
|
+
retries=retries,
|
|
1204
|
+
server_url=server_url,
|
|
1205
|
+
timeout_ms=timeout_ms,
|
|
1206
|
+
http_headers=http_headers,
|
|
1207
|
+
)
|
|
1208
|
+
|
|
1209
|
+
response_data: Any = None
|
|
1210
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1211
|
+
return models.GetRatingsResponseResponse(
|
|
1212
|
+
get_ratings_response=unmarshal_json_response(
|
|
1213
|
+
Optional[models.GetRatingsResponse], http_res
|
|
1214
|
+
),
|
|
1215
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1216
|
+
next=next_func,
|
|
1217
|
+
)
|
|
1218
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1219
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1220
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1221
|
+
request=req, response=http_res
|
|
1222
|
+
)
|
|
1223
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1224
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1225
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1226
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1227
|
+
request=req, response=http_res
|
|
1228
|
+
)
|
|
1229
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1230
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1231
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1232
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1233
|
+
request=req, response=http_res
|
|
1234
|
+
)
|
|
1235
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1236
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1237
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1238
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1239
|
+
request=req, response=http_res
|
|
1240
|
+
)
|
|
1241
|
+
raise errors.NotFound(response_data, http_res)
|
|
1242
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1243
|
+
response_data = unmarshal_json_response(
|
|
1244
|
+
errors.InternalServerErrorUnion, http_res
|
|
1245
|
+
)
|
|
1246
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1247
|
+
request=req, response=http_res
|
|
1248
|
+
)
|
|
1249
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1250
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1251
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1252
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1253
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1254
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1255
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1256
|
+
|
|
1257
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1258
|
+
|
|
1259
|
+
def get_sector_tickers(
|
|
1260
|
+
self,
|
|
1261
|
+
*,
|
|
1262
|
+
sector: models.Sector,
|
|
1263
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1264
|
+
server_url: Optional[str] = None,
|
|
1265
|
+
timeout_ms: Optional[int] = None,
|
|
1266
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1267
|
+
) -> models.GetSectorTickersResponse:
|
|
1268
|
+
r"""Get Sector Tickers
|
|
1269
|
+
|
|
1270
|
+
Retrieves all stock symbols within a specified sector, sorted by trading volume.
|
|
1271
|
+
|
|
1272
|
+
If set, this operation will use `client_id` from the global security.
|
|
1273
|
+
|
|
1274
|
+
:param sector: Which industry sector to list tickers for. Use the exact uppercase value (including spaces) — these match the values returned by [GET /v1/equity/sector-wise-change](/api-reference/analytics/equity-sector-wise-change).
|
|
1275
|
+
- `TECHNOLOGY` — software, hardware, semiconductors
|
|
1276
|
+
- `HEALTHCARE` — pharma, biotech, medical devices, providers
|
|
1277
|
+
- `FINANCIAL SERVICES` — banks, insurance, asset managers
|
|
1278
|
+
- `CONSUMER CYCLICAL` — discretionary spending (autos, retail, travel)
|
|
1279
|
+
- `CONSUMER DEFENSIVE` — staples (food, household goods, drugstores)
|
|
1280
|
+
- `INDUSTRIALS` — manufacturing, transport, defense, machinery
|
|
1281
|
+
- `ENERGY` — oil & gas, renewable energy
|
|
1282
|
+
- `UTILITIES` — power, water, gas distribution
|
|
1283
|
+
- `BASIC MATERIALS` — mining, chemicals, paper, metals
|
|
1284
|
+
- `COMMUNICATION SERVICES` — telecom, media, internet platforms
|
|
1285
|
+
- `REAL ESTATE` — REITs and real-estate operators
|
|
1286
|
+
- `OTHER` — uncategorized
|
|
1287
|
+
- `NONE` — no sector classification
|
|
1288
|
+
:param retries: Override the default retry configuration for this method
|
|
1289
|
+
:param server_url: Override the default server URL for this method
|
|
1290
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1291
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1292
|
+
"""
|
|
1293
|
+
base_url = None
|
|
1294
|
+
url_variables = None
|
|
1295
|
+
if timeout_ms is None:
|
|
1296
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1297
|
+
|
|
1298
|
+
if timeout_ms is None:
|
|
1299
|
+
timeout_ms = 30000
|
|
1300
|
+
|
|
1301
|
+
if server_url is not None:
|
|
1302
|
+
base_url = server_url
|
|
1303
|
+
else:
|
|
1304
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1305
|
+
|
|
1306
|
+
request = models.GetSectorTickersRequest(
|
|
1307
|
+
sector=sector,
|
|
1308
|
+
)
|
|
1309
|
+
|
|
1310
|
+
req = self._build_request(
|
|
1311
|
+
method="GET",
|
|
1312
|
+
path="/v1/equity/sector-tickers",
|
|
1313
|
+
base_url=base_url,
|
|
1314
|
+
url_variables=url_variables,
|
|
1315
|
+
request=request,
|
|
1316
|
+
request_body_required=False,
|
|
1317
|
+
request_has_path_params=False,
|
|
1318
|
+
request_has_query_params=True,
|
|
1319
|
+
user_agent_header="user-agent",
|
|
1320
|
+
accept_header_value="application/json",
|
|
1321
|
+
http_headers=http_headers,
|
|
1322
|
+
security=self.sdk_configuration.security,
|
|
1323
|
+
allow_empty_value=None,
|
|
1324
|
+
allowed_fields=["client_id"],
|
|
1325
|
+
timeout_ms=timeout_ms,
|
|
1326
|
+
)
|
|
1327
|
+
|
|
1328
|
+
if retries == UNSET:
|
|
1329
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1330
|
+
retries = self.sdk_configuration.retry_config
|
|
1331
|
+
else:
|
|
1332
|
+
retries = utils.RetryConfig(
|
|
1333
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1334
|
+
)
|
|
1335
|
+
|
|
1336
|
+
retry_config = None
|
|
1337
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1338
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1339
|
+
|
|
1340
|
+
http_res = self.do_request(
|
|
1341
|
+
hook_ctx=HookContext(
|
|
1342
|
+
config=self.sdk_configuration,
|
|
1343
|
+
base_url=base_url or "",
|
|
1344
|
+
operation_id="getSectorTickers",
|
|
1345
|
+
oauth2_scopes=["market:information"],
|
|
1346
|
+
security_source=self.sdk_configuration.security,
|
|
1347
|
+
tags=["Analytics"],
|
|
1348
|
+
extensions=None,
|
|
1349
|
+
),
|
|
1350
|
+
request=req,
|
|
1351
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1352
|
+
retry_config=retry_config,
|
|
1353
|
+
)
|
|
1354
|
+
|
|
1355
|
+
response_data: Any = None
|
|
1356
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1357
|
+
return models.GetSectorTickersResponse(
|
|
1358
|
+
symbol_details=unmarshal_json_response(
|
|
1359
|
+
Optional[List[models.SymbolDetails]], http_res
|
|
1360
|
+
),
|
|
1361
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1362
|
+
)
|
|
1363
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1364
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1365
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1366
|
+
request=req, response=http_res
|
|
1367
|
+
)
|
|
1368
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1369
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1370
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1371
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1372
|
+
request=req, response=http_res
|
|
1373
|
+
)
|
|
1374
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1375
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1376
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1377
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1378
|
+
request=req, response=http_res
|
|
1379
|
+
)
|
|
1380
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1381
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1382
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1383
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1384
|
+
request=req, response=http_res
|
|
1385
|
+
)
|
|
1386
|
+
raise errors.NotFound(response_data, http_res)
|
|
1387
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1388
|
+
response_data = unmarshal_json_response(
|
|
1389
|
+
errors.InternalServerErrorUnion, http_res
|
|
1390
|
+
)
|
|
1391
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1392
|
+
request=req, response=http_res
|
|
1393
|
+
)
|
|
1394
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1395
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1396
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1397
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1398
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1399
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1400
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1401
|
+
|
|
1402
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1403
|
+
|
|
1404
|
+
async def get_sector_tickers_async(
|
|
1405
|
+
self,
|
|
1406
|
+
*,
|
|
1407
|
+
sector: models.Sector,
|
|
1408
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1409
|
+
server_url: Optional[str] = None,
|
|
1410
|
+
timeout_ms: Optional[int] = None,
|
|
1411
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1412
|
+
) -> models.GetSectorTickersResponse:
|
|
1413
|
+
r"""Get Sector Tickers
|
|
1414
|
+
|
|
1415
|
+
Retrieves all stock symbols within a specified sector, sorted by trading volume.
|
|
1416
|
+
|
|
1417
|
+
If set, this operation will use `client_id` from the global security.
|
|
1418
|
+
|
|
1419
|
+
:param sector: Which industry sector to list tickers for. Use the exact uppercase value (including spaces) — these match the values returned by [GET /v1/equity/sector-wise-change](/api-reference/analytics/equity-sector-wise-change).
|
|
1420
|
+
- `TECHNOLOGY` — software, hardware, semiconductors
|
|
1421
|
+
- `HEALTHCARE` — pharma, biotech, medical devices, providers
|
|
1422
|
+
- `FINANCIAL SERVICES` — banks, insurance, asset managers
|
|
1423
|
+
- `CONSUMER CYCLICAL` — discretionary spending (autos, retail, travel)
|
|
1424
|
+
- `CONSUMER DEFENSIVE` — staples (food, household goods, drugstores)
|
|
1425
|
+
- `INDUSTRIALS` — manufacturing, transport, defense, machinery
|
|
1426
|
+
- `ENERGY` — oil & gas, renewable energy
|
|
1427
|
+
- `UTILITIES` — power, water, gas distribution
|
|
1428
|
+
- `BASIC MATERIALS` — mining, chemicals, paper, metals
|
|
1429
|
+
- `COMMUNICATION SERVICES` — telecom, media, internet platforms
|
|
1430
|
+
- `REAL ESTATE` — REITs and real-estate operators
|
|
1431
|
+
- `OTHER` — uncategorized
|
|
1432
|
+
- `NONE` — no sector classification
|
|
1433
|
+
:param retries: Override the default retry configuration for this method
|
|
1434
|
+
:param server_url: Override the default server URL for this method
|
|
1435
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1436
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1437
|
+
"""
|
|
1438
|
+
base_url = None
|
|
1439
|
+
url_variables = None
|
|
1440
|
+
if timeout_ms is None:
|
|
1441
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1442
|
+
|
|
1443
|
+
if timeout_ms is None:
|
|
1444
|
+
timeout_ms = 30000
|
|
1445
|
+
|
|
1446
|
+
if server_url is not None:
|
|
1447
|
+
base_url = server_url
|
|
1448
|
+
else:
|
|
1449
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1450
|
+
|
|
1451
|
+
request = models.GetSectorTickersRequest(
|
|
1452
|
+
sector=sector,
|
|
1453
|
+
)
|
|
1454
|
+
|
|
1455
|
+
req = self._build_request_async(
|
|
1456
|
+
method="GET",
|
|
1457
|
+
path="/v1/equity/sector-tickers",
|
|
1458
|
+
base_url=base_url,
|
|
1459
|
+
url_variables=url_variables,
|
|
1460
|
+
request=request,
|
|
1461
|
+
request_body_required=False,
|
|
1462
|
+
request_has_path_params=False,
|
|
1463
|
+
request_has_query_params=True,
|
|
1464
|
+
user_agent_header="user-agent",
|
|
1465
|
+
accept_header_value="application/json",
|
|
1466
|
+
http_headers=http_headers,
|
|
1467
|
+
security=self.sdk_configuration.security,
|
|
1468
|
+
allow_empty_value=None,
|
|
1469
|
+
allowed_fields=["client_id"],
|
|
1470
|
+
timeout_ms=timeout_ms,
|
|
1471
|
+
)
|
|
1472
|
+
|
|
1473
|
+
if retries == UNSET:
|
|
1474
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1475
|
+
retries = self.sdk_configuration.retry_config
|
|
1476
|
+
else:
|
|
1477
|
+
retries = utils.RetryConfig(
|
|
1478
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1479
|
+
)
|
|
1480
|
+
|
|
1481
|
+
retry_config = None
|
|
1482
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1483
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1484
|
+
|
|
1485
|
+
http_res = await self.do_request_async(
|
|
1486
|
+
hook_ctx=HookContext(
|
|
1487
|
+
config=self.sdk_configuration,
|
|
1488
|
+
base_url=base_url or "",
|
|
1489
|
+
operation_id="getSectorTickers",
|
|
1490
|
+
oauth2_scopes=["market:information"],
|
|
1491
|
+
security_source=self.sdk_configuration.security,
|
|
1492
|
+
tags=["Analytics"],
|
|
1493
|
+
extensions=None,
|
|
1494
|
+
),
|
|
1495
|
+
request=req,
|
|
1496
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1497
|
+
retry_config=retry_config,
|
|
1498
|
+
)
|
|
1499
|
+
|
|
1500
|
+
response_data: Any = None
|
|
1501
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1502
|
+
return models.GetSectorTickersResponse(
|
|
1503
|
+
symbol_details=unmarshal_json_response(
|
|
1504
|
+
Optional[List[models.SymbolDetails]], http_res
|
|
1505
|
+
),
|
|
1506
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1507
|
+
)
|
|
1508
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1509
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1510
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1511
|
+
request=req, response=http_res
|
|
1512
|
+
)
|
|
1513
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1514
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1515
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1516
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1517
|
+
request=req, response=http_res
|
|
1518
|
+
)
|
|
1519
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1520
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1521
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1522
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1523
|
+
request=req, response=http_res
|
|
1524
|
+
)
|
|
1525
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1526
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1527
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1528
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1529
|
+
request=req, response=http_res
|
|
1530
|
+
)
|
|
1531
|
+
raise errors.NotFound(response_data, http_res)
|
|
1532
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1533
|
+
response_data = unmarshal_json_response(
|
|
1534
|
+
errors.InternalServerErrorUnion, http_res
|
|
1535
|
+
)
|
|
1536
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1537
|
+
request=req, response=http_res
|
|
1538
|
+
)
|
|
1539
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1540
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1541
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1542
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1543
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1544
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1545
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1546
|
+
|
|
1547
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1548
|
+
|
|
1549
|
+
def get_sector_wise_change(
|
|
1550
|
+
self,
|
|
1551
|
+
*,
|
|
1552
|
+
limit: Optional[str] = None,
|
|
1553
|
+
size: Optional[str] = None,
|
|
1554
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1555
|
+
server_url: Optional[str] = None,
|
|
1556
|
+
timeout_ms: Optional[int] = None,
|
|
1557
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1558
|
+
) -> models.GetSectorWiseChangeResponse:
|
|
1559
|
+
r"""Get Sector-wise Change
|
|
1560
|
+
|
|
1561
|
+
Retrieves the average percentage change for all available sectors, sorted by change. Use limit=all to return all sectors.
|
|
1562
|
+
|
|
1563
|
+
If set, this operation will use `client_id` from the global security.
|
|
1564
|
+
|
|
1565
|
+
:param limit: Maximum number of sectors to return. Two formats are accepted:
|
|
1566
|
+
- An integer like `5`, `10`, `15` to cap the list (default `15`).
|
|
1567
|
+
- The literal string `all` to return every sector with no cap.
|
|
1568
|
+
:param size: Alias for limit. Ignored when limit is supplied.
|
|
1569
|
+
:param retries: Override the default retry configuration for this method
|
|
1570
|
+
:param server_url: Override the default server URL for this method
|
|
1571
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1572
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1573
|
+
"""
|
|
1574
|
+
base_url = None
|
|
1575
|
+
url_variables = None
|
|
1576
|
+
if timeout_ms is None:
|
|
1577
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1578
|
+
|
|
1579
|
+
if timeout_ms is None:
|
|
1580
|
+
timeout_ms = 30000
|
|
1581
|
+
|
|
1582
|
+
if server_url is not None:
|
|
1583
|
+
base_url = server_url
|
|
1584
|
+
else:
|
|
1585
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1586
|
+
|
|
1587
|
+
request = models.GetSectorWiseChangeRequest(
|
|
1588
|
+
limit=limit,
|
|
1589
|
+
size=size,
|
|
1590
|
+
)
|
|
1591
|
+
|
|
1592
|
+
req = self._build_request(
|
|
1593
|
+
method="GET",
|
|
1594
|
+
path="/v1/equity/sector-wise-change",
|
|
1595
|
+
base_url=base_url,
|
|
1596
|
+
url_variables=url_variables,
|
|
1597
|
+
request=request,
|
|
1598
|
+
request_body_required=False,
|
|
1599
|
+
request_has_path_params=False,
|
|
1600
|
+
request_has_query_params=True,
|
|
1601
|
+
user_agent_header="user-agent",
|
|
1602
|
+
accept_header_value="application/json",
|
|
1603
|
+
http_headers=http_headers,
|
|
1604
|
+
security=self.sdk_configuration.security,
|
|
1605
|
+
allow_empty_value=None,
|
|
1606
|
+
allowed_fields=["client_id"],
|
|
1607
|
+
timeout_ms=timeout_ms,
|
|
1608
|
+
)
|
|
1609
|
+
|
|
1610
|
+
if retries == UNSET:
|
|
1611
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1612
|
+
retries = self.sdk_configuration.retry_config
|
|
1613
|
+
else:
|
|
1614
|
+
retries = utils.RetryConfig(
|
|
1615
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1616
|
+
)
|
|
1617
|
+
|
|
1618
|
+
retry_config = None
|
|
1619
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1620
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1621
|
+
|
|
1622
|
+
http_res = self.do_request(
|
|
1623
|
+
hook_ctx=HookContext(
|
|
1624
|
+
config=self.sdk_configuration,
|
|
1625
|
+
base_url=base_url or "",
|
|
1626
|
+
operation_id="getSectorWiseChange",
|
|
1627
|
+
oauth2_scopes=["market:information"],
|
|
1628
|
+
security_source=self.sdk_configuration.security,
|
|
1629
|
+
tags=["Analytics"],
|
|
1630
|
+
extensions=None,
|
|
1631
|
+
),
|
|
1632
|
+
request=req,
|
|
1633
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1634
|
+
retry_config=retry_config,
|
|
1635
|
+
)
|
|
1636
|
+
|
|
1637
|
+
response_data: Any = None
|
|
1638
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1639
|
+
return models.GetSectorWiseChangeResponse(
|
|
1640
|
+
sector_avg_changes=unmarshal_json_response(
|
|
1641
|
+
Optional[List[models.SectorAvgChange]], http_res
|
|
1642
|
+
),
|
|
1643
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1644
|
+
)
|
|
1645
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1646
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1647
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1648
|
+
request=req, response=http_res
|
|
1649
|
+
)
|
|
1650
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1651
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1652
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1653
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1654
|
+
request=req, response=http_res
|
|
1655
|
+
)
|
|
1656
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1657
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1658
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1659
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1660
|
+
request=req, response=http_res
|
|
1661
|
+
)
|
|
1662
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1663
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1664
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1665
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1666
|
+
request=req, response=http_res
|
|
1667
|
+
)
|
|
1668
|
+
raise errors.NotFound(response_data, http_res)
|
|
1669
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1670
|
+
response_data = unmarshal_json_response(
|
|
1671
|
+
errors.InternalServerErrorUnion, http_res
|
|
1672
|
+
)
|
|
1673
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1674
|
+
request=req, response=http_res
|
|
1675
|
+
)
|
|
1676
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1677
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1678
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1679
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1680
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1681
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1682
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1683
|
+
|
|
1684
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1685
|
+
|
|
1686
|
+
async def get_sector_wise_change_async(
|
|
1687
|
+
self,
|
|
1688
|
+
*,
|
|
1689
|
+
limit: Optional[str] = None,
|
|
1690
|
+
size: Optional[str] = None,
|
|
1691
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1692
|
+
server_url: Optional[str] = None,
|
|
1693
|
+
timeout_ms: Optional[int] = None,
|
|
1694
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1695
|
+
) -> models.GetSectorWiseChangeResponse:
|
|
1696
|
+
r"""Get Sector-wise Change
|
|
1697
|
+
|
|
1698
|
+
Retrieves the average percentage change for all available sectors, sorted by change. Use limit=all to return all sectors.
|
|
1699
|
+
|
|
1700
|
+
If set, this operation will use `client_id` from the global security.
|
|
1701
|
+
|
|
1702
|
+
:param limit: Maximum number of sectors to return. Two formats are accepted:
|
|
1703
|
+
- An integer like `5`, `10`, `15` to cap the list (default `15`).
|
|
1704
|
+
- The literal string `all` to return every sector with no cap.
|
|
1705
|
+
:param size: Alias for limit. Ignored when limit is supplied.
|
|
1706
|
+
:param retries: Override the default retry configuration for this method
|
|
1707
|
+
:param server_url: Override the default server URL for this method
|
|
1708
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1709
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1710
|
+
"""
|
|
1711
|
+
base_url = None
|
|
1712
|
+
url_variables = None
|
|
1713
|
+
if timeout_ms is None:
|
|
1714
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1715
|
+
|
|
1716
|
+
if timeout_ms is None:
|
|
1717
|
+
timeout_ms = 30000
|
|
1718
|
+
|
|
1719
|
+
if server_url is not None:
|
|
1720
|
+
base_url = server_url
|
|
1721
|
+
else:
|
|
1722
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1723
|
+
|
|
1724
|
+
request = models.GetSectorWiseChangeRequest(
|
|
1725
|
+
limit=limit,
|
|
1726
|
+
size=size,
|
|
1727
|
+
)
|
|
1728
|
+
|
|
1729
|
+
req = self._build_request_async(
|
|
1730
|
+
method="GET",
|
|
1731
|
+
path="/v1/equity/sector-wise-change",
|
|
1732
|
+
base_url=base_url,
|
|
1733
|
+
url_variables=url_variables,
|
|
1734
|
+
request=request,
|
|
1735
|
+
request_body_required=False,
|
|
1736
|
+
request_has_path_params=False,
|
|
1737
|
+
request_has_query_params=True,
|
|
1738
|
+
user_agent_header="user-agent",
|
|
1739
|
+
accept_header_value="application/json",
|
|
1740
|
+
http_headers=http_headers,
|
|
1741
|
+
security=self.sdk_configuration.security,
|
|
1742
|
+
allow_empty_value=None,
|
|
1743
|
+
allowed_fields=["client_id"],
|
|
1744
|
+
timeout_ms=timeout_ms,
|
|
1745
|
+
)
|
|
1746
|
+
|
|
1747
|
+
if retries == UNSET:
|
|
1748
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1749
|
+
retries = self.sdk_configuration.retry_config
|
|
1750
|
+
else:
|
|
1751
|
+
retries = utils.RetryConfig(
|
|
1752
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1753
|
+
)
|
|
1754
|
+
|
|
1755
|
+
retry_config = None
|
|
1756
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1757
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1758
|
+
|
|
1759
|
+
http_res = await self.do_request_async(
|
|
1760
|
+
hook_ctx=HookContext(
|
|
1761
|
+
config=self.sdk_configuration,
|
|
1762
|
+
base_url=base_url or "",
|
|
1763
|
+
operation_id="getSectorWiseChange",
|
|
1764
|
+
oauth2_scopes=["market:information"],
|
|
1765
|
+
security_source=self.sdk_configuration.security,
|
|
1766
|
+
tags=["Analytics"],
|
|
1767
|
+
extensions=None,
|
|
1768
|
+
),
|
|
1769
|
+
request=req,
|
|
1770
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1771
|
+
retry_config=retry_config,
|
|
1772
|
+
)
|
|
1773
|
+
|
|
1774
|
+
response_data: Any = None
|
|
1775
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1776
|
+
return models.GetSectorWiseChangeResponse(
|
|
1777
|
+
sector_avg_changes=unmarshal_json_response(
|
|
1778
|
+
Optional[List[models.SectorAvgChange]], http_res
|
|
1779
|
+
),
|
|
1780
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1781
|
+
)
|
|
1782
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1783
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1784
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1785
|
+
request=req, response=http_res
|
|
1786
|
+
)
|
|
1787
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1788
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1789
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1790
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1791
|
+
request=req, response=http_res
|
|
1792
|
+
)
|
|
1793
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1794
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1795
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1796
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1797
|
+
request=req, response=http_res
|
|
1798
|
+
)
|
|
1799
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1800
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1801
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1802
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1803
|
+
request=req, response=http_res
|
|
1804
|
+
)
|
|
1805
|
+
raise errors.NotFound(response_data, http_res)
|
|
1806
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1807
|
+
response_data = unmarshal_json_response(
|
|
1808
|
+
errors.InternalServerErrorUnion, http_res
|
|
1809
|
+
)
|
|
1810
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1811
|
+
request=req, response=http_res
|
|
1812
|
+
)
|
|
1813
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1814
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1815
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1816
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1817
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1818
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1819
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1820
|
+
|
|
1821
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1822
|
+
|
|
1823
|
+
def get_top_gainers(
|
|
1824
|
+
self,
|
|
1825
|
+
*,
|
|
1826
|
+
limit: Optional[int] = 10,
|
|
1827
|
+
size: Optional[int] = 10,
|
|
1828
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1829
|
+
server_url: Optional[str] = None,
|
|
1830
|
+
timeout_ms: Optional[int] = None,
|
|
1831
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1832
|
+
) -> models.GetTopGainersResponse:
|
|
1833
|
+
r"""Get Top Gaining Stocks
|
|
1834
|
+
|
|
1835
|
+
Retrieves stocks with the highest positive percentage changes, sorted by change percentage in descending order.
|
|
1836
|
+
|
|
1837
|
+
If set, this operation will use `client_id` from the global security.
|
|
1838
|
+
|
|
1839
|
+
:param limit: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits. (optional, default 10)
|
|
1840
|
+
:param size: Alias for limit. Ignored when limit is supplied.
|
|
1841
|
+
:param retries: Override the default retry configuration for this method
|
|
1842
|
+
:param server_url: Override the default server URL for this method
|
|
1843
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1844
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1845
|
+
"""
|
|
1846
|
+
base_url = None
|
|
1847
|
+
url_variables = None
|
|
1848
|
+
if timeout_ms is None:
|
|
1849
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1850
|
+
|
|
1851
|
+
if timeout_ms is None:
|
|
1852
|
+
timeout_ms = 30000
|
|
1853
|
+
|
|
1854
|
+
if server_url is not None:
|
|
1855
|
+
base_url = server_url
|
|
1856
|
+
else:
|
|
1857
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1858
|
+
|
|
1859
|
+
request = models.GetTopGainersRequest(
|
|
1860
|
+
limit=limit,
|
|
1861
|
+
size=size,
|
|
1862
|
+
)
|
|
1863
|
+
|
|
1864
|
+
req = self._build_request(
|
|
1865
|
+
method="GET",
|
|
1866
|
+
path="/v1/equity/top-gainers",
|
|
1867
|
+
base_url=base_url,
|
|
1868
|
+
url_variables=url_variables,
|
|
1869
|
+
request=request,
|
|
1870
|
+
request_body_required=False,
|
|
1871
|
+
request_has_path_params=False,
|
|
1872
|
+
request_has_query_params=True,
|
|
1873
|
+
user_agent_header="user-agent",
|
|
1874
|
+
accept_header_value="application/json",
|
|
1875
|
+
http_headers=http_headers,
|
|
1876
|
+
security=self.sdk_configuration.security,
|
|
1877
|
+
allow_empty_value=None,
|
|
1878
|
+
allowed_fields=["client_id"],
|
|
1879
|
+
timeout_ms=timeout_ms,
|
|
1880
|
+
)
|
|
1881
|
+
|
|
1882
|
+
if retries == UNSET:
|
|
1883
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1884
|
+
retries = self.sdk_configuration.retry_config
|
|
1885
|
+
else:
|
|
1886
|
+
retries = utils.RetryConfig(
|
|
1887
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1888
|
+
)
|
|
1889
|
+
|
|
1890
|
+
retry_config = None
|
|
1891
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1892
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1893
|
+
|
|
1894
|
+
http_res = self.do_request(
|
|
1895
|
+
hook_ctx=HookContext(
|
|
1896
|
+
config=self.sdk_configuration,
|
|
1897
|
+
base_url=base_url or "",
|
|
1898
|
+
operation_id="getTopGainers",
|
|
1899
|
+
oauth2_scopes=["market:information"],
|
|
1900
|
+
security_source=self.sdk_configuration.security,
|
|
1901
|
+
tags=["Analytics"],
|
|
1902
|
+
extensions=None,
|
|
1903
|
+
),
|
|
1904
|
+
request=req,
|
|
1905
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1906
|
+
retry_config=retry_config,
|
|
1907
|
+
)
|
|
1908
|
+
|
|
1909
|
+
response_data: Any = None
|
|
1910
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1911
|
+
return models.GetTopGainersResponse(
|
|
1912
|
+
symbol_details=unmarshal_json_response(
|
|
1913
|
+
Optional[List[models.SymbolDetails]], http_res
|
|
1914
|
+
),
|
|
1915
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1916
|
+
)
|
|
1917
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1918
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1919
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1920
|
+
request=req, response=http_res
|
|
1921
|
+
)
|
|
1922
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1923
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1924
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1925
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1926
|
+
request=req, response=http_res
|
|
1927
|
+
)
|
|
1928
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1929
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1930
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1931
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1932
|
+
request=req, response=http_res
|
|
1933
|
+
)
|
|
1934
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1935
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1936
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1937
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1938
|
+
request=req, response=http_res
|
|
1939
|
+
)
|
|
1940
|
+
raise errors.NotFound(response_data, http_res)
|
|
1941
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1942
|
+
response_data = unmarshal_json_response(
|
|
1943
|
+
errors.InternalServerErrorUnion, http_res
|
|
1944
|
+
)
|
|
1945
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1946
|
+
request=req, response=http_res
|
|
1947
|
+
)
|
|
1948
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1949
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1950
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1951
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1952
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1953
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1954
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1955
|
+
|
|
1956
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1957
|
+
|
|
1958
|
+
async def get_top_gainers_async(
|
|
1959
|
+
self,
|
|
1960
|
+
*,
|
|
1961
|
+
limit: Optional[int] = 10,
|
|
1962
|
+
size: Optional[int] = 10,
|
|
1963
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1964
|
+
server_url: Optional[str] = None,
|
|
1965
|
+
timeout_ms: Optional[int] = None,
|
|
1966
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1967
|
+
) -> models.GetTopGainersResponse:
|
|
1968
|
+
r"""Get Top Gaining Stocks
|
|
1969
|
+
|
|
1970
|
+
Retrieves stocks with the highest positive percentage changes, sorted by change percentage in descending order.
|
|
1971
|
+
|
|
1972
|
+
If set, this operation will use `client_id` from the global security.
|
|
1973
|
+
|
|
1974
|
+
:param limit: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits. (optional, default 10)
|
|
1975
|
+
:param size: Alias for limit. Ignored when limit is supplied.
|
|
1976
|
+
:param retries: Override the default retry configuration for this method
|
|
1977
|
+
:param server_url: Override the default server URL for this method
|
|
1978
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1979
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1980
|
+
"""
|
|
1981
|
+
base_url = None
|
|
1982
|
+
url_variables = None
|
|
1983
|
+
if timeout_ms is None:
|
|
1984
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1985
|
+
|
|
1986
|
+
if timeout_ms is None:
|
|
1987
|
+
timeout_ms = 30000
|
|
1988
|
+
|
|
1989
|
+
if server_url is not None:
|
|
1990
|
+
base_url = server_url
|
|
1991
|
+
else:
|
|
1992
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1993
|
+
|
|
1994
|
+
request = models.GetTopGainersRequest(
|
|
1995
|
+
limit=limit,
|
|
1996
|
+
size=size,
|
|
1997
|
+
)
|
|
1998
|
+
|
|
1999
|
+
req = self._build_request_async(
|
|
2000
|
+
method="GET",
|
|
2001
|
+
path="/v1/equity/top-gainers",
|
|
2002
|
+
base_url=base_url,
|
|
2003
|
+
url_variables=url_variables,
|
|
2004
|
+
request=request,
|
|
2005
|
+
request_body_required=False,
|
|
2006
|
+
request_has_path_params=False,
|
|
2007
|
+
request_has_query_params=True,
|
|
2008
|
+
user_agent_header="user-agent",
|
|
2009
|
+
accept_header_value="application/json",
|
|
2010
|
+
http_headers=http_headers,
|
|
2011
|
+
security=self.sdk_configuration.security,
|
|
2012
|
+
allow_empty_value=None,
|
|
2013
|
+
allowed_fields=["client_id"],
|
|
2014
|
+
timeout_ms=timeout_ms,
|
|
2015
|
+
)
|
|
2016
|
+
|
|
2017
|
+
if retries == UNSET:
|
|
2018
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2019
|
+
retries = self.sdk_configuration.retry_config
|
|
2020
|
+
else:
|
|
2021
|
+
retries = utils.RetryConfig(
|
|
2022
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2023
|
+
)
|
|
2024
|
+
|
|
2025
|
+
retry_config = None
|
|
2026
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2027
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2028
|
+
|
|
2029
|
+
http_res = await self.do_request_async(
|
|
2030
|
+
hook_ctx=HookContext(
|
|
2031
|
+
config=self.sdk_configuration,
|
|
2032
|
+
base_url=base_url or "",
|
|
2033
|
+
operation_id="getTopGainers",
|
|
2034
|
+
oauth2_scopes=["market:information"],
|
|
2035
|
+
security_source=self.sdk_configuration.security,
|
|
2036
|
+
tags=["Analytics"],
|
|
2037
|
+
extensions=None,
|
|
2038
|
+
),
|
|
2039
|
+
request=req,
|
|
2040
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2041
|
+
retry_config=retry_config,
|
|
2042
|
+
)
|
|
2043
|
+
|
|
2044
|
+
response_data: Any = None
|
|
2045
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2046
|
+
return models.GetTopGainersResponse(
|
|
2047
|
+
symbol_details=unmarshal_json_response(
|
|
2048
|
+
Optional[List[models.SymbolDetails]], http_res
|
|
2049
|
+
),
|
|
2050
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2051
|
+
)
|
|
2052
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2053
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2054
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2055
|
+
request=req, response=http_res
|
|
2056
|
+
)
|
|
2057
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2058
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2059
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2060
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2061
|
+
request=req, response=http_res
|
|
2062
|
+
)
|
|
2063
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2064
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2065
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2066
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2067
|
+
request=req, response=http_res
|
|
2068
|
+
)
|
|
2069
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2070
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2071
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2072
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2073
|
+
request=req, response=http_res
|
|
2074
|
+
)
|
|
2075
|
+
raise errors.NotFound(response_data, http_res)
|
|
2076
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2077
|
+
response_data = unmarshal_json_response(
|
|
2078
|
+
errors.InternalServerErrorUnion, http_res
|
|
2079
|
+
)
|
|
2080
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2081
|
+
request=req, response=http_res
|
|
2082
|
+
)
|
|
2083
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2084
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2085
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2086
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2087
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2088
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2089
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2090
|
+
|
|
2091
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2092
|
+
|
|
2093
|
+
def get_top_losers(
|
|
2094
|
+
self,
|
|
2095
|
+
*,
|
|
2096
|
+
limit: Optional[int] = 10,
|
|
2097
|
+
size: Optional[int] = 10,
|
|
2098
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2099
|
+
server_url: Optional[str] = None,
|
|
2100
|
+
timeout_ms: Optional[int] = None,
|
|
2101
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2102
|
+
) -> models.GetTopLosersResponse:
|
|
2103
|
+
r"""Get Top Losing Stocks
|
|
2104
|
+
|
|
2105
|
+
Retrieves stocks with the largest negative percentage changes, sorted by change percentage in ascending order.
|
|
2106
|
+
|
|
2107
|
+
If set, this operation will use `client_id` from the global security.
|
|
2108
|
+
|
|
2109
|
+
:param limit: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits. (optional, default 10)
|
|
2110
|
+
:param size: Alias for limit. Ignored when limit is supplied.
|
|
2111
|
+
:param retries: Override the default retry configuration for this method
|
|
2112
|
+
:param server_url: Override the default server URL for this method
|
|
2113
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2114
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2115
|
+
"""
|
|
2116
|
+
base_url = None
|
|
2117
|
+
url_variables = None
|
|
2118
|
+
if timeout_ms is None:
|
|
2119
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2120
|
+
|
|
2121
|
+
if timeout_ms is None:
|
|
2122
|
+
timeout_ms = 30000
|
|
2123
|
+
|
|
2124
|
+
if server_url is not None:
|
|
2125
|
+
base_url = server_url
|
|
2126
|
+
else:
|
|
2127
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2128
|
+
|
|
2129
|
+
request = models.GetTopLosersRequest(
|
|
2130
|
+
limit=limit,
|
|
2131
|
+
size=size,
|
|
2132
|
+
)
|
|
2133
|
+
|
|
2134
|
+
req = self._build_request(
|
|
2135
|
+
method="GET",
|
|
2136
|
+
path="/v1/equity/top-losers",
|
|
2137
|
+
base_url=base_url,
|
|
2138
|
+
url_variables=url_variables,
|
|
2139
|
+
request=request,
|
|
2140
|
+
request_body_required=False,
|
|
2141
|
+
request_has_path_params=False,
|
|
2142
|
+
request_has_query_params=True,
|
|
2143
|
+
user_agent_header="user-agent",
|
|
2144
|
+
accept_header_value="application/json",
|
|
2145
|
+
http_headers=http_headers,
|
|
2146
|
+
security=self.sdk_configuration.security,
|
|
2147
|
+
allow_empty_value=None,
|
|
2148
|
+
allowed_fields=["client_id"],
|
|
2149
|
+
timeout_ms=timeout_ms,
|
|
2150
|
+
)
|
|
2151
|
+
|
|
2152
|
+
if retries == UNSET:
|
|
2153
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2154
|
+
retries = self.sdk_configuration.retry_config
|
|
2155
|
+
else:
|
|
2156
|
+
retries = utils.RetryConfig(
|
|
2157
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2158
|
+
)
|
|
2159
|
+
|
|
2160
|
+
retry_config = None
|
|
2161
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2162
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2163
|
+
|
|
2164
|
+
http_res = self.do_request(
|
|
2165
|
+
hook_ctx=HookContext(
|
|
2166
|
+
config=self.sdk_configuration,
|
|
2167
|
+
base_url=base_url or "",
|
|
2168
|
+
operation_id="getTopLosers",
|
|
2169
|
+
oauth2_scopes=["market:information"],
|
|
2170
|
+
security_source=self.sdk_configuration.security,
|
|
2171
|
+
tags=["Analytics"],
|
|
2172
|
+
extensions=None,
|
|
2173
|
+
),
|
|
2174
|
+
request=req,
|
|
2175
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2176
|
+
retry_config=retry_config,
|
|
2177
|
+
)
|
|
2178
|
+
|
|
2179
|
+
response_data: Any = None
|
|
2180
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2181
|
+
return models.GetTopLosersResponse(
|
|
2182
|
+
symbol_details=unmarshal_json_response(
|
|
2183
|
+
Optional[List[models.SymbolDetails]], http_res
|
|
2184
|
+
),
|
|
2185
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2186
|
+
)
|
|
2187
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2188
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2189
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2190
|
+
request=req, response=http_res
|
|
2191
|
+
)
|
|
2192
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2193
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2194
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2195
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2196
|
+
request=req, response=http_res
|
|
2197
|
+
)
|
|
2198
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2199
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2200
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2201
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2202
|
+
request=req, response=http_res
|
|
2203
|
+
)
|
|
2204
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2205
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2206
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2207
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2208
|
+
request=req, response=http_res
|
|
2209
|
+
)
|
|
2210
|
+
raise errors.NotFound(response_data, http_res)
|
|
2211
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2212
|
+
response_data = unmarshal_json_response(
|
|
2213
|
+
errors.InternalServerErrorUnion, http_res
|
|
2214
|
+
)
|
|
2215
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2216
|
+
request=req, response=http_res
|
|
2217
|
+
)
|
|
2218
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2219
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2220
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2221
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2222
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2223
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2224
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2225
|
+
|
|
2226
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2227
|
+
|
|
2228
|
+
async def get_top_losers_async(
|
|
2229
|
+
self,
|
|
2230
|
+
*,
|
|
2231
|
+
limit: Optional[int] = 10,
|
|
2232
|
+
size: Optional[int] = 10,
|
|
2233
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2234
|
+
server_url: Optional[str] = None,
|
|
2235
|
+
timeout_ms: Optional[int] = None,
|
|
2236
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2237
|
+
) -> models.GetTopLosersResponse:
|
|
2238
|
+
r"""Get Top Losing Stocks
|
|
2239
|
+
|
|
2240
|
+
Retrieves stocks with the largest negative percentage changes, sorted by change percentage in ascending order.
|
|
2241
|
+
|
|
2242
|
+
If set, this operation will use `client_id` from the global security.
|
|
2243
|
+
|
|
2244
|
+
:param limit: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits. (optional, default 10)
|
|
2245
|
+
:param size: Alias for limit. Ignored when limit is supplied.
|
|
2246
|
+
:param retries: Override the default retry configuration for this method
|
|
2247
|
+
:param server_url: Override the default server URL for this method
|
|
2248
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2249
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2250
|
+
"""
|
|
2251
|
+
base_url = None
|
|
2252
|
+
url_variables = None
|
|
2253
|
+
if timeout_ms is None:
|
|
2254
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2255
|
+
|
|
2256
|
+
if timeout_ms is None:
|
|
2257
|
+
timeout_ms = 30000
|
|
2258
|
+
|
|
2259
|
+
if server_url is not None:
|
|
2260
|
+
base_url = server_url
|
|
2261
|
+
else:
|
|
2262
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2263
|
+
|
|
2264
|
+
request = models.GetTopLosersRequest(
|
|
2265
|
+
limit=limit,
|
|
2266
|
+
size=size,
|
|
2267
|
+
)
|
|
2268
|
+
|
|
2269
|
+
req = self._build_request_async(
|
|
2270
|
+
method="GET",
|
|
2271
|
+
path="/v1/equity/top-losers",
|
|
2272
|
+
base_url=base_url,
|
|
2273
|
+
url_variables=url_variables,
|
|
2274
|
+
request=request,
|
|
2275
|
+
request_body_required=False,
|
|
2276
|
+
request_has_path_params=False,
|
|
2277
|
+
request_has_query_params=True,
|
|
2278
|
+
user_agent_header="user-agent",
|
|
2279
|
+
accept_header_value="application/json",
|
|
2280
|
+
http_headers=http_headers,
|
|
2281
|
+
security=self.sdk_configuration.security,
|
|
2282
|
+
allow_empty_value=None,
|
|
2283
|
+
allowed_fields=["client_id"],
|
|
2284
|
+
timeout_ms=timeout_ms,
|
|
2285
|
+
)
|
|
2286
|
+
|
|
2287
|
+
if retries == UNSET:
|
|
2288
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2289
|
+
retries = self.sdk_configuration.retry_config
|
|
2290
|
+
else:
|
|
2291
|
+
retries = utils.RetryConfig(
|
|
2292
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2293
|
+
)
|
|
2294
|
+
|
|
2295
|
+
retry_config = None
|
|
2296
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2297
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2298
|
+
|
|
2299
|
+
http_res = await self.do_request_async(
|
|
2300
|
+
hook_ctx=HookContext(
|
|
2301
|
+
config=self.sdk_configuration,
|
|
2302
|
+
base_url=base_url or "",
|
|
2303
|
+
operation_id="getTopLosers",
|
|
2304
|
+
oauth2_scopes=["market:information"],
|
|
2305
|
+
security_source=self.sdk_configuration.security,
|
|
2306
|
+
tags=["Analytics"],
|
|
2307
|
+
extensions=None,
|
|
2308
|
+
),
|
|
2309
|
+
request=req,
|
|
2310
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2311
|
+
retry_config=retry_config,
|
|
2312
|
+
)
|
|
2313
|
+
|
|
2314
|
+
response_data: Any = None
|
|
2315
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2316
|
+
return models.GetTopLosersResponse(
|
|
2317
|
+
symbol_details=unmarshal_json_response(
|
|
2318
|
+
Optional[List[models.SymbolDetails]], http_res
|
|
2319
|
+
),
|
|
2320
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2321
|
+
)
|
|
2322
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2323
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2324
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2325
|
+
request=req, response=http_res
|
|
2326
|
+
)
|
|
2327
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2328
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2329
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2330
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2331
|
+
request=req, response=http_res
|
|
2332
|
+
)
|
|
2333
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2334
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2335
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2336
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2337
|
+
request=req, response=http_res
|
|
2338
|
+
)
|
|
2339
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2340
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2341
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2342
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2343
|
+
request=req, response=http_res
|
|
2344
|
+
)
|
|
2345
|
+
raise errors.NotFound(response_data, http_res)
|
|
2346
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2347
|
+
response_data = unmarshal_json_response(
|
|
2348
|
+
errors.InternalServerErrorUnion, http_res
|
|
2349
|
+
)
|
|
2350
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2351
|
+
request=req, response=http_res
|
|
2352
|
+
)
|
|
2353
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2354
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2355
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2356
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2357
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2358
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2359
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2360
|
+
|
|
2361
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2362
|
+
|
|
2363
|
+
def get_top_most_active(
|
|
2364
|
+
self,
|
|
2365
|
+
*,
|
|
2366
|
+
limit: Optional[int] = 10,
|
|
2367
|
+
size: Optional[int] = 10,
|
|
2368
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2369
|
+
server_url: Optional[str] = None,
|
|
2370
|
+
timeout_ms: Optional[int] = None,
|
|
2371
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2372
|
+
) -> models.GetTopMostActiveResponse:
|
|
2373
|
+
r"""Get Most Active Stocks
|
|
2374
|
+
|
|
2375
|
+
Retrieves stocks sorted by trading volume in descending order.
|
|
2376
|
+
|
|
2377
|
+
If set, this operation will use `client_id` from the global security.
|
|
2378
|
+
|
|
2379
|
+
:param limit: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits. (optional, default 10)
|
|
2380
|
+
:param size: Alias for limit. Ignored when limit is supplied.
|
|
2381
|
+
:param retries: Override the default retry configuration for this method
|
|
2382
|
+
:param server_url: Override the default server URL for this method
|
|
2383
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2384
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2385
|
+
"""
|
|
2386
|
+
base_url = None
|
|
2387
|
+
url_variables = None
|
|
2388
|
+
if timeout_ms is None:
|
|
2389
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2390
|
+
|
|
2391
|
+
if timeout_ms is None:
|
|
2392
|
+
timeout_ms = 30000
|
|
2393
|
+
|
|
2394
|
+
if server_url is not None:
|
|
2395
|
+
base_url = server_url
|
|
2396
|
+
else:
|
|
2397
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2398
|
+
|
|
2399
|
+
request = models.GetTopMostActiveRequest(
|
|
2400
|
+
limit=limit,
|
|
2401
|
+
size=size,
|
|
2402
|
+
)
|
|
2403
|
+
|
|
2404
|
+
req = self._build_request(
|
|
2405
|
+
method="GET",
|
|
2406
|
+
path="/v1/equity/top-most-active",
|
|
2407
|
+
base_url=base_url,
|
|
2408
|
+
url_variables=url_variables,
|
|
2409
|
+
request=request,
|
|
2410
|
+
request_body_required=False,
|
|
2411
|
+
request_has_path_params=False,
|
|
2412
|
+
request_has_query_params=True,
|
|
2413
|
+
user_agent_header="user-agent",
|
|
2414
|
+
accept_header_value="application/json",
|
|
2415
|
+
http_headers=http_headers,
|
|
2416
|
+
security=self.sdk_configuration.security,
|
|
2417
|
+
allow_empty_value=None,
|
|
2418
|
+
allowed_fields=["client_id"],
|
|
2419
|
+
timeout_ms=timeout_ms,
|
|
2420
|
+
)
|
|
2421
|
+
|
|
2422
|
+
if retries == UNSET:
|
|
2423
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2424
|
+
retries = self.sdk_configuration.retry_config
|
|
2425
|
+
else:
|
|
2426
|
+
retries = utils.RetryConfig(
|
|
2427
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2428
|
+
)
|
|
2429
|
+
|
|
2430
|
+
retry_config = None
|
|
2431
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2432
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2433
|
+
|
|
2434
|
+
http_res = self.do_request(
|
|
2435
|
+
hook_ctx=HookContext(
|
|
2436
|
+
config=self.sdk_configuration,
|
|
2437
|
+
base_url=base_url or "",
|
|
2438
|
+
operation_id="getTopMostActive",
|
|
2439
|
+
oauth2_scopes=["market:information"],
|
|
2440
|
+
security_source=self.sdk_configuration.security,
|
|
2441
|
+
tags=["Analytics"],
|
|
2442
|
+
extensions=None,
|
|
2443
|
+
),
|
|
2444
|
+
request=req,
|
|
2445
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2446
|
+
retry_config=retry_config,
|
|
2447
|
+
)
|
|
2448
|
+
|
|
2449
|
+
response_data: Any = None
|
|
2450
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2451
|
+
return models.GetTopMostActiveResponse(
|
|
2452
|
+
symbol_details=unmarshal_json_response(
|
|
2453
|
+
Optional[List[models.SymbolDetails]], http_res
|
|
2454
|
+
),
|
|
2455
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2456
|
+
)
|
|
2457
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2458
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2459
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2460
|
+
request=req, response=http_res
|
|
2461
|
+
)
|
|
2462
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2463
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2464
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2465
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2466
|
+
request=req, response=http_res
|
|
2467
|
+
)
|
|
2468
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2469
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2470
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2471
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2472
|
+
request=req, response=http_res
|
|
2473
|
+
)
|
|
2474
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2475
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2476
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2477
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2478
|
+
request=req, response=http_res
|
|
2479
|
+
)
|
|
2480
|
+
raise errors.NotFound(response_data, http_res)
|
|
2481
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2482
|
+
response_data = unmarshal_json_response(
|
|
2483
|
+
errors.InternalServerErrorUnion, http_res
|
|
2484
|
+
)
|
|
2485
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2486
|
+
request=req, response=http_res
|
|
2487
|
+
)
|
|
2488
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2489
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2490
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2491
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2492
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2493
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2494
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2495
|
+
|
|
2496
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2497
|
+
|
|
2498
|
+
async def get_top_most_active_async(
|
|
2499
|
+
self,
|
|
2500
|
+
*,
|
|
2501
|
+
limit: Optional[int] = 10,
|
|
2502
|
+
size: Optional[int] = 10,
|
|
2503
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2504
|
+
server_url: Optional[str] = None,
|
|
2505
|
+
timeout_ms: Optional[int] = None,
|
|
2506
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2507
|
+
) -> models.GetTopMostActiveResponse:
|
|
2508
|
+
r"""Get Most Active Stocks
|
|
2509
|
+
|
|
2510
|
+
Retrieves stocks sorted by trading volume in descending order.
|
|
2511
|
+
|
|
2512
|
+
If set, this operation will use `client_id` from the global security.
|
|
2513
|
+
|
|
2514
|
+
:param limit: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits. (optional, default 10)
|
|
2515
|
+
:param size: Alias for limit. Ignored when limit is supplied.
|
|
2516
|
+
:param retries: Override the default retry configuration for this method
|
|
2517
|
+
:param server_url: Override the default server URL for this method
|
|
2518
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2519
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2520
|
+
"""
|
|
2521
|
+
base_url = None
|
|
2522
|
+
url_variables = None
|
|
2523
|
+
if timeout_ms is None:
|
|
2524
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2525
|
+
|
|
2526
|
+
if timeout_ms is None:
|
|
2527
|
+
timeout_ms = 30000
|
|
2528
|
+
|
|
2529
|
+
if server_url is not None:
|
|
2530
|
+
base_url = server_url
|
|
2531
|
+
else:
|
|
2532
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2533
|
+
|
|
2534
|
+
request = models.GetTopMostActiveRequest(
|
|
2535
|
+
limit=limit,
|
|
2536
|
+
size=size,
|
|
2537
|
+
)
|
|
2538
|
+
|
|
2539
|
+
req = self._build_request_async(
|
|
2540
|
+
method="GET",
|
|
2541
|
+
path="/v1/equity/top-most-active",
|
|
2542
|
+
base_url=base_url,
|
|
2543
|
+
url_variables=url_variables,
|
|
2544
|
+
request=request,
|
|
2545
|
+
request_body_required=False,
|
|
2546
|
+
request_has_path_params=False,
|
|
2547
|
+
request_has_query_params=True,
|
|
2548
|
+
user_agent_header="user-agent",
|
|
2549
|
+
accept_header_value="application/json",
|
|
2550
|
+
http_headers=http_headers,
|
|
2551
|
+
security=self.sdk_configuration.security,
|
|
2552
|
+
allow_empty_value=None,
|
|
2553
|
+
allowed_fields=["client_id"],
|
|
2554
|
+
timeout_ms=timeout_ms,
|
|
2555
|
+
)
|
|
2556
|
+
|
|
2557
|
+
if retries == UNSET:
|
|
2558
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2559
|
+
retries = self.sdk_configuration.retry_config
|
|
2560
|
+
else:
|
|
2561
|
+
retries = utils.RetryConfig(
|
|
2562
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2563
|
+
)
|
|
2564
|
+
|
|
2565
|
+
retry_config = None
|
|
2566
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2567
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2568
|
+
|
|
2569
|
+
http_res = await self.do_request_async(
|
|
2570
|
+
hook_ctx=HookContext(
|
|
2571
|
+
config=self.sdk_configuration,
|
|
2572
|
+
base_url=base_url or "",
|
|
2573
|
+
operation_id="getTopMostActive",
|
|
2574
|
+
oauth2_scopes=["market:information"],
|
|
2575
|
+
security_source=self.sdk_configuration.security,
|
|
2576
|
+
tags=["Analytics"],
|
|
2577
|
+
extensions=None,
|
|
2578
|
+
),
|
|
2579
|
+
request=req,
|
|
2580
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2581
|
+
retry_config=retry_config,
|
|
2582
|
+
)
|
|
2583
|
+
|
|
2584
|
+
response_data: Any = None
|
|
2585
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2586
|
+
return models.GetTopMostActiveResponse(
|
|
2587
|
+
symbol_details=unmarshal_json_response(
|
|
2588
|
+
Optional[List[models.SymbolDetails]], http_res
|
|
2589
|
+
),
|
|
2590
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2591
|
+
)
|
|
2592
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2593
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2594
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2595
|
+
request=req, response=http_res
|
|
2596
|
+
)
|
|
2597
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2598
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2599
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2600
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2601
|
+
request=req, response=http_res
|
|
2602
|
+
)
|
|
2603
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2604
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2605
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2606
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2607
|
+
request=req, response=http_res
|
|
2608
|
+
)
|
|
2609
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2610
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2611
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2612
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2613
|
+
request=req, response=http_res
|
|
2614
|
+
)
|
|
2615
|
+
raise errors.NotFound(response_data, http_res)
|
|
2616
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2617
|
+
response_data = unmarshal_json_response(
|
|
2618
|
+
errors.InternalServerErrorUnion, http_res
|
|
2619
|
+
)
|
|
2620
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2621
|
+
request=req, response=http_res
|
|
2622
|
+
)
|
|
2623
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2624
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2625
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2626
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2627
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2628
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2629
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2630
|
+
|
|
2631
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2632
|
+
|
|
2633
|
+
def get_options_et_fs_top_volume(
|
|
2634
|
+
self,
|
|
2635
|
+
*,
|
|
2636
|
+
size: Optional[int] = 10,
|
|
2637
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2638
|
+
server_url: Optional[str] = None,
|
|
2639
|
+
timeout_ms: Optional[int] = None,
|
|
2640
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2641
|
+
) -> models.GetOptionsETFsTopVolumeResponse:
|
|
2642
|
+
r"""Get Top ETF Options by Volume
|
|
2643
|
+
|
|
2644
|
+
Retrieve ETF options with the highest trading volume showing the most actively traded contracts across all ETFs.
|
|
2645
|
+
|
|
2646
|
+
If set, this operation will use `client_id` from the global security.
|
|
2647
|
+
|
|
2648
|
+
:param size: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits. (optional, default 10)
|
|
2649
|
+
:param retries: Override the default retry configuration for this method
|
|
2650
|
+
:param server_url: Override the default server URL for this method
|
|
2651
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2652
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2653
|
+
"""
|
|
2654
|
+
base_url = None
|
|
2655
|
+
url_variables = None
|
|
2656
|
+
if timeout_ms is None:
|
|
2657
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2658
|
+
|
|
2659
|
+
if timeout_ms is None:
|
|
2660
|
+
timeout_ms = 30000
|
|
2661
|
+
|
|
2662
|
+
if server_url is not None:
|
|
2663
|
+
base_url = server_url
|
|
2664
|
+
else:
|
|
2665
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2666
|
+
|
|
2667
|
+
request = models.GetOptionsETFsTopVolumeRequest(
|
|
2668
|
+
size=size,
|
|
2669
|
+
)
|
|
2670
|
+
|
|
2671
|
+
req = self._build_request(
|
|
2672
|
+
method="GET",
|
|
2673
|
+
path="/v1/options/etfs/top-volume",
|
|
2674
|
+
base_url=base_url,
|
|
2675
|
+
url_variables=url_variables,
|
|
2676
|
+
request=request,
|
|
2677
|
+
request_body_required=False,
|
|
2678
|
+
request_has_path_params=False,
|
|
2679
|
+
request_has_query_params=True,
|
|
2680
|
+
user_agent_header="user-agent",
|
|
2681
|
+
accept_header_value="application/json",
|
|
2682
|
+
http_headers=http_headers,
|
|
2683
|
+
security=self.sdk_configuration.security,
|
|
2684
|
+
allow_empty_value=None,
|
|
2685
|
+
allowed_fields=["client_id"],
|
|
2686
|
+
timeout_ms=timeout_ms,
|
|
2687
|
+
)
|
|
2688
|
+
|
|
2689
|
+
if retries == UNSET:
|
|
2690
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2691
|
+
retries = self.sdk_configuration.retry_config
|
|
2692
|
+
else:
|
|
2693
|
+
retries = utils.RetryConfig(
|
|
2694
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2695
|
+
)
|
|
2696
|
+
|
|
2697
|
+
retry_config = None
|
|
2698
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2699
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2700
|
+
|
|
2701
|
+
http_res = self.do_request(
|
|
2702
|
+
hook_ctx=HookContext(
|
|
2703
|
+
config=self.sdk_configuration,
|
|
2704
|
+
base_url=base_url or "",
|
|
2705
|
+
operation_id="getOptionsETFsTopVolume",
|
|
2706
|
+
oauth2_scopes=["options:information"],
|
|
2707
|
+
security_source=self.sdk_configuration.security,
|
|
2708
|
+
tags=["Analytics"],
|
|
2709
|
+
extensions=None,
|
|
2710
|
+
),
|
|
2711
|
+
request=req,
|
|
2712
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2713
|
+
retry_config=retry_config,
|
|
2714
|
+
)
|
|
2715
|
+
|
|
2716
|
+
response_data: Any = None
|
|
2717
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2718
|
+
return models.GetOptionsETFsTopVolumeResponse(
|
|
2719
|
+
options_screener_items=unmarshal_json_response(
|
|
2720
|
+
Optional[List[models.OptionsScreenerItem]], http_res
|
|
2721
|
+
),
|
|
2722
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2723
|
+
)
|
|
2724
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2725
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2726
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2727
|
+
request=req, response=http_res
|
|
2728
|
+
)
|
|
2729
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2730
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2731
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2732
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2733
|
+
request=req, response=http_res
|
|
2734
|
+
)
|
|
2735
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2736
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2737
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2738
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2739
|
+
request=req, response=http_res
|
|
2740
|
+
)
|
|
2741
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2742
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2743
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2744
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2745
|
+
request=req, response=http_res
|
|
2746
|
+
)
|
|
2747
|
+
raise errors.NotFound(response_data, http_res)
|
|
2748
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2749
|
+
response_data = unmarshal_json_response(
|
|
2750
|
+
errors.InternalServerErrorUnion, http_res
|
|
2751
|
+
)
|
|
2752
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2753
|
+
request=req, response=http_res
|
|
2754
|
+
)
|
|
2755
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2756
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2757
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2758
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2759
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2760
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2761
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2762
|
+
|
|
2763
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2764
|
+
|
|
2765
|
+
async def get_options_et_fs_top_volume_async(
|
|
2766
|
+
self,
|
|
2767
|
+
*,
|
|
2768
|
+
size: Optional[int] = 10,
|
|
2769
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2770
|
+
server_url: Optional[str] = None,
|
|
2771
|
+
timeout_ms: Optional[int] = None,
|
|
2772
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2773
|
+
) -> models.GetOptionsETFsTopVolumeResponse:
|
|
2774
|
+
r"""Get Top ETF Options by Volume
|
|
2775
|
+
|
|
2776
|
+
Retrieve ETF options with the highest trading volume showing the most actively traded contracts across all ETFs.
|
|
2777
|
+
|
|
2778
|
+
If set, this operation will use `client_id` from the global security.
|
|
2779
|
+
|
|
2780
|
+
:param size: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits. (optional, default 10)
|
|
2781
|
+
:param retries: Override the default retry configuration for this method
|
|
2782
|
+
:param server_url: Override the default server URL for this method
|
|
2783
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2784
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2785
|
+
"""
|
|
2786
|
+
base_url = None
|
|
2787
|
+
url_variables = None
|
|
2788
|
+
if timeout_ms is None:
|
|
2789
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2790
|
+
|
|
2791
|
+
if timeout_ms is None:
|
|
2792
|
+
timeout_ms = 30000
|
|
2793
|
+
|
|
2794
|
+
if server_url is not None:
|
|
2795
|
+
base_url = server_url
|
|
2796
|
+
else:
|
|
2797
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2798
|
+
|
|
2799
|
+
request = models.GetOptionsETFsTopVolumeRequest(
|
|
2800
|
+
size=size,
|
|
2801
|
+
)
|
|
2802
|
+
|
|
2803
|
+
req = self._build_request_async(
|
|
2804
|
+
method="GET",
|
|
2805
|
+
path="/v1/options/etfs/top-volume",
|
|
2806
|
+
base_url=base_url,
|
|
2807
|
+
url_variables=url_variables,
|
|
2808
|
+
request=request,
|
|
2809
|
+
request_body_required=False,
|
|
2810
|
+
request_has_path_params=False,
|
|
2811
|
+
request_has_query_params=True,
|
|
2812
|
+
user_agent_header="user-agent",
|
|
2813
|
+
accept_header_value="application/json",
|
|
2814
|
+
http_headers=http_headers,
|
|
2815
|
+
security=self.sdk_configuration.security,
|
|
2816
|
+
allow_empty_value=None,
|
|
2817
|
+
allowed_fields=["client_id"],
|
|
2818
|
+
timeout_ms=timeout_ms,
|
|
2819
|
+
)
|
|
2820
|
+
|
|
2821
|
+
if retries == UNSET:
|
|
2822
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2823
|
+
retries = self.sdk_configuration.retry_config
|
|
2824
|
+
else:
|
|
2825
|
+
retries = utils.RetryConfig(
|
|
2826
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2827
|
+
)
|
|
2828
|
+
|
|
2829
|
+
retry_config = None
|
|
2830
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2831
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2832
|
+
|
|
2833
|
+
http_res = await self.do_request_async(
|
|
2834
|
+
hook_ctx=HookContext(
|
|
2835
|
+
config=self.sdk_configuration,
|
|
2836
|
+
base_url=base_url or "",
|
|
2837
|
+
operation_id="getOptionsETFsTopVolume",
|
|
2838
|
+
oauth2_scopes=["options:information"],
|
|
2839
|
+
security_source=self.sdk_configuration.security,
|
|
2840
|
+
tags=["Analytics"],
|
|
2841
|
+
extensions=None,
|
|
2842
|
+
),
|
|
2843
|
+
request=req,
|
|
2844
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2845
|
+
retry_config=retry_config,
|
|
2846
|
+
)
|
|
2847
|
+
|
|
2848
|
+
response_data: Any = None
|
|
2849
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2850
|
+
return models.GetOptionsETFsTopVolumeResponse(
|
|
2851
|
+
options_screener_items=unmarshal_json_response(
|
|
2852
|
+
Optional[List[models.OptionsScreenerItem]], http_res
|
|
2853
|
+
),
|
|
2854
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2855
|
+
)
|
|
2856
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2857
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2858
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2859
|
+
request=req, response=http_res
|
|
2860
|
+
)
|
|
2861
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2862
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2863
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2864
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2865
|
+
request=req, response=http_res
|
|
2866
|
+
)
|
|
2867
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2868
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2869
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2870
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2871
|
+
request=req, response=http_res
|
|
2872
|
+
)
|
|
2873
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2874
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2875
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2876
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2877
|
+
request=req, response=http_res
|
|
2878
|
+
)
|
|
2879
|
+
raise errors.NotFound(response_data, http_res)
|
|
2880
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2881
|
+
response_data = unmarshal_json_response(
|
|
2882
|
+
errors.InternalServerErrorUnion, http_res
|
|
2883
|
+
)
|
|
2884
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2885
|
+
request=req, response=http_res
|
|
2886
|
+
)
|
|
2887
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2888
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2889
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2890
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2891
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2892
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2893
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2894
|
+
|
|
2895
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2896
|
+
|
|
2897
|
+
def get_options_stocks_top_gainers(
|
|
2898
|
+
self,
|
|
2899
|
+
*,
|
|
2900
|
+
size: Optional[int] = 10,
|
|
2901
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2902
|
+
server_url: Optional[str] = None,
|
|
2903
|
+
timeout_ms: Optional[int] = None,
|
|
2904
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2905
|
+
) -> models.GetOptionsStocksTopGainersResponse:
|
|
2906
|
+
r"""Get Top Stock Options by Gains
|
|
2907
|
+
|
|
2908
|
+
Retrieve stock options with the largest percentage gains showing the best performing options contracts.
|
|
2909
|
+
|
|
2910
|
+
If set, this operation will use `client_id` from the global security.
|
|
2911
|
+
|
|
2912
|
+
:param size: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits. (optional, default 10)
|
|
2913
|
+
:param retries: Override the default retry configuration for this method
|
|
2914
|
+
:param server_url: Override the default server URL for this method
|
|
2915
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2916
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2917
|
+
"""
|
|
2918
|
+
base_url = None
|
|
2919
|
+
url_variables = None
|
|
2920
|
+
if timeout_ms is None:
|
|
2921
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2922
|
+
|
|
2923
|
+
if timeout_ms is None:
|
|
2924
|
+
timeout_ms = 30000
|
|
2925
|
+
|
|
2926
|
+
if server_url is not None:
|
|
2927
|
+
base_url = server_url
|
|
2928
|
+
else:
|
|
2929
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2930
|
+
|
|
2931
|
+
request = models.GetOptionsStocksTopGainersRequest(
|
|
2932
|
+
size=size,
|
|
2933
|
+
)
|
|
2934
|
+
|
|
2935
|
+
req = self._build_request(
|
|
2936
|
+
method="GET",
|
|
2937
|
+
path="/v1/options/stocks/top-gainers",
|
|
2938
|
+
base_url=base_url,
|
|
2939
|
+
url_variables=url_variables,
|
|
2940
|
+
request=request,
|
|
2941
|
+
request_body_required=False,
|
|
2942
|
+
request_has_path_params=False,
|
|
2943
|
+
request_has_query_params=True,
|
|
2944
|
+
user_agent_header="user-agent",
|
|
2945
|
+
accept_header_value="application/json",
|
|
2946
|
+
http_headers=http_headers,
|
|
2947
|
+
security=self.sdk_configuration.security,
|
|
2948
|
+
allow_empty_value=None,
|
|
2949
|
+
allowed_fields=["client_id"],
|
|
2950
|
+
timeout_ms=timeout_ms,
|
|
2951
|
+
)
|
|
2952
|
+
|
|
2953
|
+
if retries == UNSET:
|
|
2954
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2955
|
+
retries = self.sdk_configuration.retry_config
|
|
2956
|
+
else:
|
|
2957
|
+
retries = utils.RetryConfig(
|
|
2958
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2959
|
+
)
|
|
2960
|
+
|
|
2961
|
+
retry_config = None
|
|
2962
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2963
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2964
|
+
|
|
2965
|
+
http_res = self.do_request(
|
|
2966
|
+
hook_ctx=HookContext(
|
|
2967
|
+
config=self.sdk_configuration,
|
|
2968
|
+
base_url=base_url or "",
|
|
2969
|
+
operation_id="getOptionsStocksTopGainers",
|
|
2970
|
+
oauth2_scopes=["options:information"],
|
|
2971
|
+
security_source=self.sdk_configuration.security,
|
|
2972
|
+
tags=["Analytics"],
|
|
2973
|
+
extensions=None,
|
|
2974
|
+
),
|
|
2975
|
+
request=req,
|
|
2976
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2977
|
+
retry_config=retry_config,
|
|
2978
|
+
)
|
|
2979
|
+
|
|
2980
|
+
response_data: Any = None
|
|
2981
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2982
|
+
return models.GetOptionsStocksTopGainersResponse(
|
|
2983
|
+
options_screener_items=unmarshal_json_response(
|
|
2984
|
+
Optional[List[models.OptionsScreenerItem]], http_res
|
|
2985
|
+
),
|
|
2986
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2987
|
+
)
|
|
2988
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2989
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2990
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2991
|
+
request=req, response=http_res
|
|
2992
|
+
)
|
|
2993
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2994
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2995
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2996
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2997
|
+
request=req, response=http_res
|
|
2998
|
+
)
|
|
2999
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3000
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3001
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3002
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3003
|
+
request=req, response=http_res
|
|
3004
|
+
)
|
|
3005
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3006
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3007
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3008
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3009
|
+
request=req, response=http_res
|
|
3010
|
+
)
|
|
3011
|
+
raise errors.NotFound(response_data, http_res)
|
|
3012
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3013
|
+
response_data = unmarshal_json_response(
|
|
3014
|
+
errors.InternalServerErrorUnion, http_res
|
|
3015
|
+
)
|
|
3016
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3017
|
+
request=req, response=http_res
|
|
3018
|
+
)
|
|
3019
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3020
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3021
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3022
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3023
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3024
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3025
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3026
|
+
|
|
3027
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
3028
|
+
|
|
3029
|
+
async def get_options_stocks_top_gainers_async(
|
|
3030
|
+
self,
|
|
3031
|
+
*,
|
|
3032
|
+
size: Optional[int] = 10,
|
|
3033
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
3034
|
+
server_url: Optional[str] = None,
|
|
3035
|
+
timeout_ms: Optional[int] = None,
|
|
3036
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
3037
|
+
) -> models.GetOptionsStocksTopGainersResponse:
|
|
3038
|
+
r"""Get Top Stock Options by Gains
|
|
3039
|
+
|
|
3040
|
+
Retrieve stock options with the largest percentage gains showing the best performing options contracts.
|
|
3041
|
+
|
|
3042
|
+
If set, this operation will use `client_id` from the global security.
|
|
3043
|
+
|
|
3044
|
+
:param size: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits. (optional, default 10)
|
|
3045
|
+
:param retries: Override the default retry configuration for this method
|
|
3046
|
+
:param server_url: Override the default server URL for this method
|
|
3047
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
3048
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
3049
|
+
"""
|
|
3050
|
+
base_url = None
|
|
3051
|
+
url_variables = None
|
|
3052
|
+
if timeout_ms is None:
|
|
3053
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
3054
|
+
|
|
3055
|
+
if timeout_ms is None:
|
|
3056
|
+
timeout_ms = 30000
|
|
3057
|
+
|
|
3058
|
+
if server_url is not None:
|
|
3059
|
+
base_url = server_url
|
|
3060
|
+
else:
|
|
3061
|
+
base_url = self._get_url(base_url, url_variables)
|
|
3062
|
+
|
|
3063
|
+
request = models.GetOptionsStocksTopGainersRequest(
|
|
3064
|
+
size=size,
|
|
3065
|
+
)
|
|
3066
|
+
|
|
3067
|
+
req = self._build_request_async(
|
|
3068
|
+
method="GET",
|
|
3069
|
+
path="/v1/options/stocks/top-gainers",
|
|
3070
|
+
base_url=base_url,
|
|
3071
|
+
url_variables=url_variables,
|
|
3072
|
+
request=request,
|
|
3073
|
+
request_body_required=False,
|
|
3074
|
+
request_has_path_params=False,
|
|
3075
|
+
request_has_query_params=True,
|
|
3076
|
+
user_agent_header="user-agent",
|
|
3077
|
+
accept_header_value="application/json",
|
|
3078
|
+
http_headers=http_headers,
|
|
3079
|
+
security=self.sdk_configuration.security,
|
|
3080
|
+
allow_empty_value=None,
|
|
3081
|
+
allowed_fields=["client_id"],
|
|
3082
|
+
timeout_ms=timeout_ms,
|
|
3083
|
+
)
|
|
3084
|
+
|
|
3085
|
+
if retries == UNSET:
|
|
3086
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
3087
|
+
retries = self.sdk_configuration.retry_config
|
|
3088
|
+
else:
|
|
3089
|
+
retries = utils.RetryConfig(
|
|
3090
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
3091
|
+
)
|
|
3092
|
+
|
|
3093
|
+
retry_config = None
|
|
3094
|
+
if isinstance(retries, utils.RetryConfig):
|
|
3095
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
3096
|
+
|
|
3097
|
+
http_res = await self.do_request_async(
|
|
3098
|
+
hook_ctx=HookContext(
|
|
3099
|
+
config=self.sdk_configuration,
|
|
3100
|
+
base_url=base_url or "",
|
|
3101
|
+
operation_id="getOptionsStocksTopGainers",
|
|
3102
|
+
oauth2_scopes=["options:information"],
|
|
3103
|
+
security_source=self.sdk_configuration.security,
|
|
3104
|
+
tags=["Analytics"],
|
|
3105
|
+
extensions=None,
|
|
3106
|
+
),
|
|
3107
|
+
request=req,
|
|
3108
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
3109
|
+
retry_config=retry_config,
|
|
3110
|
+
)
|
|
3111
|
+
|
|
3112
|
+
response_data: Any = None
|
|
3113
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
3114
|
+
return models.GetOptionsStocksTopGainersResponse(
|
|
3115
|
+
options_screener_items=unmarshal_json_response(
|
|
3116
|
+
Optional[List[models.OptionsScreenerItem]], http_res
|
|
3117
|
+
),
|
|
3118
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
3119
|
+
)
|
|
3120
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
3121
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
3122
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3123
|
+
request=req, response=http_res
|
|
3124
|
+
)
|
|
3125
|
+
raise errors.BadRequest(response_data, http_res)
|
|
3126
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
3127
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
3128
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3129
|
+
request=req, response=http_res
|
|
3130
|
+
)
|
|
3131
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3132
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3133
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3134
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3135
|
+
request=req, response=http_res
|
|
3136
|
+
)
|
|
3137
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3138
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3139
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3140
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3141
|
+
request=req, response=http_res
|
|
3142
|
+
)
|
|
3143
|
+
raise errors.NotFound(response_data, http_res)
|
|
3144
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3145
|
+
response_data = unmarshal_json_response(
|
|
3146
|
+
errors.InternalServerErrorUnion, http_res
|
|
3147
|
+
)
|
|
3148
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3149
|
+
request=req, response=http_res
|
|
3150
|
+
)
|
|
3151
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3152
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3153
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3154
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3155
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3156
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3157
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3158
|
+
|
|
3159
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
3160
|
+
|
|
3161
|
+
def get_options_stocks_top_volume(
|
|
3162
|
+
self,
|
|
3163
|
+
*,
|
|
3164
|
+
size: Optional[int] = 10,
|
|
3165
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
3166
|
+
server_url: Optional[str] = None,
|
|
3167
|
+
timeout_ms: Optional[int] = None,
|
|
3168
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
3169
|
+
) -> models.GetOptionsStocksTopVolumeResponse:
|
|
3170
|
+
r"""Get Top Stock Options by Volume
|
|
3171
|
+
|
|
3172
|
+
Retrieve stock options with the highest trading volume identifying the most actively traded equity options contracts.
|
|
3173
|
+
|
|
3174
|
+
If set, this operation will use `client_id` from the global security.
|
|
3175
|
+
|
|
3176
|
+
:param size: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits. (optional, default 10)
|
|
3177
|
+
:param retries: Override the default retry configuration for this method
|
|
3178
|
+
:param server_url: Override the default server URL for this method
|
|
3179
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
3180
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
3181
|
+
"""
|
|
3182
|
+
base_url = None
|
|
3183
|
+
url_variables = None
|
|
3184
|
+
if timeout_ms is None:
|
|
3185
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
3186
|
+
|
|
3187
|
+
if timeout_ms is None:
|
|
3188
|
+
timeout_ms = 30000
|
|
3189
|
+
|
|
3190
|
+
if server_url is not None:
|
|
3191
|
+
base_url = server_url
|
|
3192
|
+
else:
|
|
3193
|
+
base_url = self._get_url(base_url, url_variables)
|
|
3194
|
+
|
|
3195
|
+
request = models.GetOptionsStocksTopVolumeRequest(
|
|
3196
|
+
size=size,
|
|
3197
|
+
)
|
|
3198
|
+
|
|
3199
|
+
req = self._build_request(
|
|
3200
|
+
method="GET",
|
|
3201
|
+
path="/v1/options/stocks/top-volume",
|
|
3202
|
+
base_url=base_url,
|
|
3203
|
+
url_variables=url_variables,
|
|
3204
|
+
request=request,
|
|
3205
|
+
request_body_required=False,
|
|
3206
|
+
request_has_path_params=False,
|
|
3207
|
+
request_has_query_params=True,
|
|
3208
|
+
user_agent_header="user-agent",
|
|
3209
|
+
accept_header_value="application/json",
|
|
3210
|
+
http_headers=http_headers,
|
|
3211
|
+
security=self.sdk_configuration.security,
|
|
3212
|
+
allow_empty_value=None,
|
|
3213
|
+
allowed_fields=["client_id"],
|
|
3214
|
+
timeout_ms=timeout_ms,
|
|
3215
|
+
)
|
|
3216
|
+
|
|
3217
|
+
if retries == UNSET:
|
|
3218
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
3219
|
+
retries = self.sdk_configuration.retry_config
|
|
3220
|
+
else:
|
|
3221
|
+
retries = utils.RetryConfig(
|
|
3222
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
3223
|
+
)
|
|
3224
|
+
|
|
3225
|
+
retry_config = None
|
|
3226
|
+
if isinstance(retries, utils.RetryConfig):
|
|
3227
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
3228
|
+
|
|
3229
|
+
http_res = self.do_request(
|
|
3230
|
+
hook_ctx=HookContext(
|
|
3231
|
+
config=self.sdk_configuration,
|
|
3232
|
+
base_url=base_url or "",
|
|
3233
|
+
operation_id="getOptionsStocksTopVolume",
|
|
3234
|
+
oauth2_scopes=["options:information"],
|
|
3235
|
+
security_source=self.sdk_configuration.security,
|
|
3236
|
+
tags=["Analytics"],
|
|
3237
|
+
extensions=None,
|
|
3238
|
+
),
|
|
3239
|
+
request=req,
|
|
3240
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
3241
|
+
retry_config=retry_config,
|
|
3242
|
+
)
|
|
3243
|
+
|
|
3244
|
+
response_data: Any = None
|
|
3245
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
3246
|
+
return models.GetOptionsStocksTopVolumeResponse(
|
|
3247
|
+
options_screener_items=unmarshal_json_response(
|
|
3248
|
+
Optional[List[models.OptionsScreenerItem]], http_res
|
|
3249
|
+
),
|
|
3250
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
3251
|
+
)
|
|
3252
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
3253
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
3254
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3255
|
+
request=req, response=http_res
|
|
3256
|
+
)
|
|
3257
|
+
raise errors.BadRequest(response_data, http_res)
|
|
3258
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
3259
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
3260
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3261
|
+
request=req, response=http_res
|
|
3262
|
+
)
|
|
3263
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3264
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3265
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3266
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3267
|
+
request=req, response=http_res
|
|
3268
|
+
)
|
|
3269
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3270
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3271
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3272
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3273
|
+
request=req, response=http_res
|
|
3274
|
+
)
|
|
3275
|
+
raise errors.NotFound(response_data, http_res)
|
|
3276
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3277
|
+
response_data = unmarshal_json_response(
|
|
3278
|
+
errors.InternalServerErrorUnion, http_res
|
|
3279
|
+
)
|
|
3280
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3281
|
+
request=req, response=http_res
|
|
3282
|
+
)
|
|
3283
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3284
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3285
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3286
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3287
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3288
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3289
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3290
|
+
|
|
3291
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
3292
|
+
|
|
3293
|
+
async def get_options_stocks_top_volume_async(
|
|
3294
|
+
self,
|
|
3295
|
+
*,
|
|
3296
|
+
size: Optional[int] = 10,
|
|
3297
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
3298
|
+
server_url: Optional[str] = None,
|
|
3299
|
+
timeout_ms: Optional[int] = None,
|
|
3300
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
3301
|
+
) -> models.GetOptionsStocksTopVolumeResponse:
|
|
3302
|
+
r"""Get Top Stock Options by Volume
|
|
3303
|
+
|
|
3304
|
+
Retrieve stock options with the highest trading volume identifying the most actively traded equity options contracts.
|
|
3305
|
+
|
|
3306
|
+
If set, this operation will use `client_id` from the global security.
|
|
3307
|
+
|
|
3308
|
+
:param size: Maximum number of results to return. Use smaller values for UI pages and larger values for exports within API limits. (optional, default 10)
|
|
3309
|
+
:param retries: Override the default retry configuration for this method
|
|
3310
|
+
:param server_url: Override the default server URL for this method
|
|
3311
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
3312
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
3313
|
+
"""
|
|
3314
|
+
base_url = None
|
|
3315
|
+
url_variables = None
|
|
3316
|
+
if timeout_ms is None:
|
|
3317
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
3318
|
+
|
|
3319
|
+
if timeout_ms is None:
|
|
3320
|
+
timeout_ms = 30000
|
|
3321
|
+
|
|
3322
|
+
if server_url is not None:
|
|
3323
|
+
base_url = server_url
|
|
3324
|
+
else:
|
|
3325
|
+
base_url = self._get_url(base_url, url_variables)
|
|
3326
|
+
|
|
3327
|
+
request = models.GetOptionsStocksTopVolumeRequest(
|
|
3328
|
+
size=size,
|
|
3329
|
+
)
|
|
3330
|
+
|
|
3331
|
+
req = self._build_request_async(
|
|
3332
|
+
method="GET",
|
|
3333
|
+
path="/v1/options/stocks/top-volume",
|
|
3334
|
+
base_url=base_url,
|
|
3335
|
+
url_variables=url_variables,
|
|
3336
|
+
request=request,
|
|
3337
|
+
request_body_required=False,
|
|
3338
|
+
request_has_path_params=False,
|
|
3339
|
+
request_has_query_params=True,
|
|
3340
|
+
user_agent_header="user-agent",
|
|
3341
|
+
accept_header_value="application/json",
|
|
3342
|
+
http_headers=http_headers,
|
|
3343
|
+
security=self.sdk_configuration.security,
|
|
3344
|
+
allow_empty_value=None,
|
|
3345
|
+
allowed_fields=["client_id"],
|
|
3346
|
+
timeout_ms=timeout_ms,
|
|
3347
|
+
)
|
|
3348
|
+
|
|
3349
|
+
if retries == UNSET:
|
|
3350
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
3351
|
+
retries = self.sdk_configuration.retry_config
|
|
3352
|
+
else:
|
|
3353
|
+
retries = utils.RetryConfig(
|
|
3354
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
3355
|
+
)
|
|
3356
|
+
|
|
3357
|
+
retry_config = None
|
|
3358
|
+
if isinstance(retries, utils.RetryConfig):
|
|
3359
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
3360
|
+
|
|
3361
|
+
http_res = await self.do_request_async(
|
|
3362
|
+
hook_ctx=HookContext(
|
|
3363
|
+
config=self.sdk_configuration,
|
|
3364
|
+
base_url=base_url or "",
|
|
3365
|
+
operation_id="getOptionsStocksTopVolume",
|
|
3366
|
+
oauth2_scopes=["options:information"],
|
|
3367
|
+
security_source=self.sdk_configuration.security,
|
|
3368
|
+
tags=["Analytics"],
|
|
3369
|
+
extensions=None,
|
|
3370
|
+
),
|
|
3371
|
+
request=req,
|
|
3372
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
3373
|
+
retry_config=retry_config,
|
|
3374
|
+
)
|
|
3375
|
+
|
|
3376
|
+
response_data: Any = None
|
|
3377
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
3378
|
+
return models.GetOptionsStocksTopVolumeResponse(
|
|
3379
|
+
options_screener_items=unmarshal_json_response(
|
|
3380
|
+
Optional[List[models.OptionsScreenerItem]], http_res
|
|
3381
|
+
),
|
|
3382
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
3383
|
+
)
|
|
3384
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
3385
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
3386
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3387
|
+
request=req, response=http_res
|
|
3388
|
+
)
|
|
3389
|
+
raise errors.BadRequest(response_data, http_res)
|
|
3390
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
3391
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
3392
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3393
|
+
request=req, response=http_res
|
|
3394
|
+
)
|
|
3395
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3396
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3397
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3398
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3399
|
+
request=req, response=http_res
|
|
3400
|
+
)
|
|
3401
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3402
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3403
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3404
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3405
|
+
request=req, response=http_res
|
|
3406
|
+
)
|
|
3407
|
+
raise errors.NotFound(response_data, http_res)
|
|
3408
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3409
|
+
response_data = unmarshal_json_response(
|
|
3410
|
+
errors.InternalServerErrorUnion, http_res
|
|
3411
|
+
)
|
|
3412
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3413
|
+
request=req, response=http_res
|
|
3414
|
+
)
|
|
3415
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3416
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3417
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3418
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3419
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3420
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3421
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3422
|
+
|
|
3423
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
3424
|
+
|
|
3425
|
+
def stock_screener(
|
|
3426
|
+
self,
|
|
3427
|
+
*,
|
|
3428
|
+
stock_screener_request: Union[
|
|
3429
|
+
models.StockScreenerRequest, models.StockScreenerRequestTypedDict
|
|
3430
|
+
],
|
|
3431
|
+
page_size: Optional[int] = None,
|
|
3432
|
+
order_column: Optional[str] = None,
|
|
3433
|
+
order_direction: Optional[models.SortOrderEnum] = None,
|
|
3434
|
+
primary_only: Optional[str] = None,
|
|
3435
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
3436
|
+
server_url: Optional[str] = None,
|
|
3437
|
+
timeout_ms: Optional[int] = None,
|
|
3438
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
3439
|
+
) -> models.StockScreenerResponseResponse:
|
|
3440
|
+
r"""Stock Screener
|
|
3441
|
+
|
|
3442
|
+
Screen securities by sending a JSON body with operator and clauses (and optional groups). At least one clause or group is required. Query params: page_size, order_column, order_direction, primary_only. **Required scope:** analytics:information
|
|
3443
|
+
|
|
3444
|
+
If set, this operation will use `client_id` from the global security.
|
|
3445
|
+
|
|
3446
|
+
:param stock_screener_request: Screener request with operator (AND, OR, or NOT), clauses (field, operator, value), and optional groups.
|
|
3447
|
+
:param page_size: Number of results to return per page. Use smaller values (10–50) for UI screens, larger (100–500) for batch exports. Defaults to the upstream provider's default.
|
|
3448
|
+
:param order_column: Which data column to sort the screened results by. Accepts any column the upstream screener exposes — not a fixed enum on our side. Common columns:
|
|
3449
|
+
- `marketcap` — market capitalization.
|
|
3450
|
+
- `pricetoearnings` — trailing P/E ratio.
|
|
3451
|
+
- `pricetobook` — price-to-book ratio.
|
|
3452
|
+
- `roe` — return on equity.
|
|
3453
|
+
- `volume` — average daily volume.
|
|
3454
|
+
- `open_price` / `close_price` — most recent open / close.
|
|
3455
|
+
- `dilutedeps` — diluted earnings per share (TTM).
|
|
3456
|
+
- `cashandequivalents` — cash + cash equivalents on the balance sheet.
|
|
3457
|
+
|
|
3458
|
+
Pair with `order_direction` (`asc` / `desc`).
|
|
3459
|
+
:param order_direction: Direction to sort `order_column` in:
|
|
3460
|
+
- `asc` — ascending (smallest first).
|
|
3461
|
+
- `desc` — descending (largest first).
|
|
3462
|
+
:param primary_only: When `true`, return only the primary listing for each company (e.g. NYSE for a U.S. dual-listed stock) instead of every listing. Defaults to `false`.
|
|
3463
|
+
:param retries: Override the default retry configuration for this method
|
|
3464
|
+
:param server_url: Override the default server URL for this method
|
|
3465
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
3466
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
3467
|
+
"""
|
|
3468
|
+
base_url = None
|
|
3469
|
+
url_variables = None
|
|
3470
|
+
if timeout_ms is None:
|
|
3471
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
3472
|
+
|
|
3473
|
+
if timeout_ms is None:
|
|
3474
|
+
timeout_ms = 30000
|
|
3475
|
+
|
|
3476
|
+
if server_url is not None:
|
|
3477
|
+
base_url = server_url
|
|
3478
|
+
else:
|
|
3479
|
+
base_url = self._get_url(base_url, url_variables)
|
|
3480
|
+
|
|
3481
|
+
request = models.StockScreenerRequestRequest(
|
|
3482
|
+
page_size=page_size,
|
|
3483
|
+
order_column=order_column,
|
|
3484
|
+
order_direction=order_direction,
|
|
3485
|
+
primary_only=primary_only,
|
|
3486
|
+
stock_screener_request=utils.get_pydantic_model(
|
|
3487
|
+
stock_screener_request, models.StockScreenerRequest
|
|
3488
|
+
),
|
|
3489
|
+
)
|
|
3490
|
+
|
|
3491
|
+
req = self._build_request(
|
|
3492
|
+
method="POST",
|
|
3493
|
+
path="/v1/stock/screener",
|
|
3494
|
+
base_url=base_url,
|
|
3495
|
+
url_variables=url_variables,
|
|
3496
|
+
request=request,
|
|
3497
|
+
request_body_required=True,
|
|
3498
|
+
request_has_path_params=False,
|
|
3499
|
+
request_has_query_params=True,
|
|
3500
|
+
user_agent_header="user-agent",
|
|
3501
|
+
accept_header_value="application/json",
|
|
3502
|
+
http_headers=http_headers,
|
|
3503
|
+
security=self.sdk_configuration.security,
|
|
3504
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
3505
|
+
request.stock_screener_request,
|
|
3506
|
+
False,
|
|
3507
|
+
False,
|
|
3508
|
+
"json",
|
|
3509
|
+
models.StockScreenerRequest,
|
|
3510
|
+
),
|
|
3511
|
+
allow_empty_value=None,
|
|
3512
|
+
allowed_fields=["client_id"],
|
|
3513
|
+
timeout_ms=timeout_ms,
|
|
3514
|
+
)
|
|
3515
|
+
|
|
3516
|
+
if retries == UNSET:
|
|
3517
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
3518
|
+
retries = self.sdk_configuration.retry_config
|
|
3519
|
+
else:
|
|
3520
|
+
retries = utils.RetryConfig(
|
|
3521
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
3522
|
+
)
|
|
3523
|
+
|
|
3524
|
+
retry_config = None
|
|
3525
|
+
if isinstance(retries, utils.RetryConfig):
|
|
3526
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
3527
|
+
|
|
3528
|
+
http_res = self.do_request(
|
|
3529
|
+
hook_ctx=HookContext(
|
|
3530
|
+
config=self.sdk_configuration,
|
|
3531
|
+
base_url=base_url or "",
|
|
3532
|
+
operation_id="stockScreener",
|
|
3533
|
+
oauth2_scopes=["market:supplemental"],
|
|
3534
|
+
security_source=self.sdk_configuration.security,
|
|
3535
|
+
tags=["Analytics"],
|
|
3536
|
+
extensions=None,
|
|
3537
|
+
),
|
|
3538
|
+
request=req,
|
|
3539
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
3540
|
+
retry_config=retry_config,
|
|
3541
|
+
)
|
|
3542
|
+
|
|
3543
|
+
response_data: Any = None
|
|
3544
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
3545
|
+
return models.StockScreenerResponseResponse(
|
|
3546
|
+
stock_screener_response=unmarshal_json_response(
|
|
3547
|
+
Optional[List[models.StockScreenerResponse]], http_res
|
|
3548
|
+
),
|
|
3549
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
3550
|
+
)
|
|
3551
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
3552
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
3553
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3554
|
+
request=req, response=http_res
|
|
3555
|
+
)
|
|
3556
|
+
raise errors.BadRequest(response_data, http_res)
|
|
3557
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
3558
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
3559
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3560
|
+
request=req, response=http_res
|
|
3561
|
+
)
|
|
3562
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3563
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3564
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3565
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3566
|
+
request=req, response=http_res
|
|
3567
|
+
)
|
|
3568
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3569
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3570
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3571
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3572
|
+
request=req, response=http_res
|
|
3573
|
+
)
|
|
3574
|
+
raise errors.NotFound(response_data, http_res)
|
|
3575
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3576
|
+
response_data = unmarshal_json_response(
|
|
3577
|
+
errors.InternalServerErrorUnion, http_res
|
|
3578
|
+
)
|
|
3579
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3580
|
+
request=req, response=http_res
|
|
3581
|
+
)
|
|
3582
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3583
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3584
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3585
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3586
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3587
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3588
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3589
|
+
|
|
3590
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
3591
|
+
|
|
3592
|
+
async def stock_screener_async(
|
|
3593
|
+
self,
|
|
3594
|
+
*,
|
|
3595
|
+
stock_screener_request: Union[
|
|
3596
|
+
models.StockScreenerRequest, models.StockScreenerRequestTypedDict
|
|
3597
|
+
],
|
|
3598
|
+
page_size: Optional[int] = None,
|
|
3599
|
+
order_column: Optional[str] = None,
|
|
3600
|
+
order_direction: Optional[models.SortOrderEnum] = None,
|
|
3601
|
+
primary_only: Optional[str] = None,
|
|
3602
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
3603
|
+
server_url: Optional[str] = None,
|
|
3604
|
+
timeout_ms: Optional[int] = None,
|
|
3605
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
3606
|
+
) -> models.StockScreenerResponseResponse:
|
|
3607
|
+
r"""Stock Screener
|
|
3608
|
+
|
|
3609
|
+
Screen securities by sending a JSON body with operator and clauses (and optional groups). At least one clause or group is required. Query params: page_size, order_column, order_direction, primary_only. **Required scope:** analytics:information
|
|
3610
|
+
|
|
3611
|
+
If set, this operation will use `client_id` from the global security.
|
|
3612
|
+
|
|
3613
|
+
:param stock_screener_request: Screener request with operator (AND, OR, or NOT), clauses (field, operator, value), and optional groups.
|
|
3614
|
+
:param page_size: Number of results to return per page. Use smaller values (10–50) for UI screens, larger (100–500) for batch exports. Defaults to the upstream provider's default.
|
|
3615
|
+
:param order_column: Which data column to sort the screened results by. Accepts any column the upstream screener exposes — not a fixed enum on our side. Common columns:
|
|
3616
|
+
- `marketcap` — market capitalization.
|
|
3617
|
+
- `pricetoearnings` — trailing P/E ratio.
|
|
3618
|
+
- `pricetobook` — price-to-book ratio.
|
|
3619
|
+
- `roe` — return on equity.
|
|
3620
|
+
- `volume` — average daily volume.
|
|
3621
|
+
- `open_price` / `close_price` — most recent open / close.
|
|
3622
|
+
- `dilutedeps` — diluted earnings per share (TTM).
|
|
3623
|
+
- `cashandequivalents` — cash + cash equivalents on the balance sheet.
|
|
3624
|
+
|
|
3625
|
+
Pair with `order_direction` (`asc` / `desc`).
|
|
3626
|
+
:param order_direction: Direction to sort `order_column` in:
|
|
3627
|
+
- `asc` — ascending (smallest first).
|
|
3628
|
+
- `desc` — descending (largest first).
|
|
3629
|
+
:param primary_only: When `true`, return only the primary listing for each company (e.g. NYSE for a U.S. dual-listed stock) instead of every listing. Defaults to `false`.
|
|
3630
|
+
:param retries: Override the default retry configuration for this method
|
|
3631
|
+
:param server_url: Override the default server URL for this method
|
|
3632
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
3633
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
3634
|
+
"""
|
|
3635
|
+
base_url = None
|
|
3636
|
+
url_variables = None
|
|
3637
|
+
if timeout_ms is None:
|
|
3638
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
3639
|
+
|
|
3640
|
+
if timeout_ms is None:
|
|
3641
|
+
timeout_ms = 30000
|
|
3642
|
+
|
|
3643
|
+
if server_url is not None:
|
|
3644
|
+
base_url = server_url
|
|
3645
|
+
else:
|
|
3646
|
+
base_url = self._get_url(base_url, url_variables)
|
|
3647
|
+
|
|
3648
|
+
request = models.StockScreenerRequestRequest(
|
|
3649
|
+
page_size=page_size,
|
|
3650
|
+
order_column=order_column,
|
|
3651
|
+
order_direction=order_direction,
|
|
3652
|
+
primary_only=primary_only,
|
|
3653
|
+
stock_screener_request=utils.get_pydantic_model(
|
|
3654
|
+
stock_screener_request, models.StockScreenerRequest
|
|
3655
|
+
),
|
|
3656
|
+
)
|
|
3657
|
+
|
|
3658
|
+
req = self._build_request_async(
|
|
3659
|
+
method="POST",
|
|
3660
|
+
path="/v1/stock/screener",
|
|
3661
|
+
base_url=base_url,
|
|
3662
|
+
url_variables=url_variables,
|
|
3663
|
+
request=request,
|
|
3664
|
+
request_body_required=True,
|
|
3665
|
+
request_has_path_params=False,
|
|
3666
|
+
request_has_query_params=True,
|
|
3667
|
+
user_agent_header="user-agent",
|
|
3668
|
+
accept_header_value="application/json",
|
|
3669
|
+
http_headers=http_headers,
|
|
3670
|
+
security=self.sdk_configuration.security,
|
|
3671
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
3672
|
+
request.stock_screener_request,
|
|
3673
|
+
False,
|
|
3674
|
+
False,
|
|
3675
|
+
"json",
|
|
3676
|
+
models.StockScreenerRequest,
|
|
3677
|
+
),
|
|
3678
|
+
allow_empty_value=None,
|
|
3679
|
+
allowed_fields=["client_id"],
|
|
3680
|
+
timeout_ms=timeout_ms,
|
|
3681
|
+
)
|
|
3682
|
+
|
|
3683
|
+
if retries == UNSET:
|
|
3684
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
3685
|
+
retries = self.sdk_configuration.retry_config
|
|
3686
|
+
else:
|
|
3687
|
+
retries = utils.RetryConfig(
|
|
3688
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
3689
|
+
)
|
|
3690
|
+
|
|
3691
|
+
retry_config = None
|
|
3692
|
+
if isinstance(retries, utils.RetryConfig):
|
|
3693
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
3694
|
+
|
|
3695
|
+
http_res = await self.do_request_async(
|
|
3696
|
+
hook_ctx=HookContext(
|
|
3697
|
+
config=self.sdk_configuration,
|
|
3698
|
+
base_url=base_url or "",
|
|
3699
|
+
operation_id="stockScreener",
|
|
3700
|
+
oauth2_scopes=["market:supplemental"],
|
|
3701
|
+
security_source=self.sdk_configuration.security,
|
|
3702
|
+
tags=["Analytics"],
|
|
3703
|
+
extensions=None,
|
|
3704
|
+
),
|
|
3705
|
+
request=req,
|
|
3706
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
3707
|
+
retry_config=retry_config,
|
|
3708
|
+
)
|
|
3709
|
+
|
|
3710
|
+
response_data: Any = None
|
|
3711
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
3712
|
+
return models.StockScreenerResponseResponse(
|
|
3713
|
+
stock_screener_response=unmarshal_json_response(
|
|
3714
|
+
Optional[List[models.StockScreenerResponse]], http_res
|
|
3715
|
+
),
|
|
3716
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
3717
|
+
)
|
|
3718
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
3719
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
3720
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3721
|
+
request=req, response=http_res
|
|
3722
|
+
)
|
|
3723
|
+
raise errors.BadRequest(response_data, http_res)
|
|
3724
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
3725
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
3726
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3727
|
+
request=req, response=http_res
|
|
3728
|
+
)
|
|
3729
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3730
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3731
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3732
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3733
|
+
request=req, response=http_res
|
|
3734
|
+
)
|
|
3735
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3736
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3737
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3738
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3739
|
+
request=req, response=http_res
|
|
3740
|
+
)
|
|
3741
|
+
raise errors.NotFound(response_data, http_res)
|
|
3742
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3743
|
+
response_data = unmarshal_json_response(
|
|
3744
|
+
errors.InternalServerErrorUnion, http_res
|
|
3745
|
+
)
|
|
3746
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3747
|
+
request=req, response=http_res
|
|
3748
|
+
)
|
|
3749
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3750
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3751
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3752
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3753
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3754
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3755
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3756
|
+
|
|
3757
|
+
raise errors.APIError("Unexpected response received", http_res)
|