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
|
@@ -0,0 +1,4830 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
# @generated-id: 2dc2f7b5f484
|
|
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 typing import Any, Mapping, Optional
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AlternativeData(BaseSDK):
|
|
14
|
+
def get_bank_branches(
|
|
15
|
+
self,
|
|
16
|
+
*,
|
|
17
|
+
symbol: str,
|
|
18
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
19
|
+
server_url: Optional[str] = None,
|
|
20
|
+
timeout_ms: Optional[int] = None,
|
|
21
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
22
|
+
) -> models.GetBankBranchesResponse:
|
|
23
|
+
r"""Get Bank Branch
|
|
24
|
+
|
|
25
|
+
Retrieve bank branch data for a symbol.
|
|
26
|
+
|
|
27
|
+
If set, this operation will use `client_id` from the global security.
|
|
28
|
+
|
|
29
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
30
|
+
:param retries: Override the default retry configuration for this method
|
|
31
|
+
:param server_url: Override the default server URL for this method
|
|
32
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
33
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
34
|
+
"""
|
|
35
|
+
base_url = None
|
|
36
|
+
url_variables = None
|
|
37
|
+
if timeout_ms is None:
|
|
38
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
39
|
+
|
|
40
|
+
if timeout_ms is None:
|
|
41
|
+
timeout_ms = 30000
|
|
42
|
+
|
|
43
|
+
if server_url is not None:
|
|
44
|
+
base_url = server_url
|
|
45
|
+
else:
|
|
46
|
+
base_url = self._get_url(base_url, url_variables)
|
|
47
|
+
|
|
48
|
+
request = models.GetBankBranchesRequest(
|
|
49
|
+
symbol=symbol,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
req = self._build_request(
|
|
53
|
+
method="GET",
|
|
54
|
+
path="/v1/stock/bank-branch",
|
|
55
|
+
base_url=base_url,
|
|
56
|
+
url_variables=url_variables,
|
|
57
|
+
request=request,
|
|
58
|
+
request_body_required=False,
|
|
59
|
+
request_has_path_params=False,
|
|
60
|
+
request_has_query_params=True,
|
|
61
|
+
user_agent_header="user-agent",
|
|
62
|
+
accept_header_value="application/json",
|
|
63
|
+
http_headers=http_headers,
|
|
64
|
+
security=self.sdk_configuration.security,
|
|
65
|
+
allow_empty_value=None,
|
|
66
|
+
allowed_fields=["client_id"],
|
|
67
|
+
timeout_ms=timeout_ms,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
if retries == UNSET:
|
|
71
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
72
|
+
retries = self.sdk_configuration.retry_config
|
|
73
|
+
else:
|
|
74
|
+
retries = utils.RetryConfig(
|
|
75
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
retry_config = None
|
|
79
|
+
if isinstance(retries, utils.RetryConfig):
|
|
80
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
81
|
+
|
|
82
|
+
http_res = self.do_request(
|
|
83
|
+
hook_ctx=HookContext(
|
|
84
|
+
config=self.sdk_configuration,
|
|
85
|
+
base_url=base_url or "",
|
|
86
|
+
operation_id="getBankBranches",
|
|
87
|
+
oauth2_scopes=["market:supplemental"],
|
|
88
|
+
security_source=self.sdk_configuration.security,
|
|
89
|
+
tags=["Stock Alternative"],
|
|
90
|
+
extensions=None,
|
|
91
|
+
),
|
|
92
|
+
request=req,
|
|
93
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
94
|
+
retry_config=retry_config,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
response_data: Any = None
|
|
98
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
99
|
+
return models.GetBankBranchesResponse(
|
|
100
|
+
bank_branches_response=unmarshal_json_response(
|
|
101
|
+
Optional[models.BankBranchesResponse], http_res
|
|
102
|
+
),
|
|
103
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
104
|
+
)
|
|
105
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
106
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
107
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
108
|
+
request=req, response=http_res
|
|
109
|
+
)
|
|
110
|
+
raise errors.BadRequest(response_data, http_res)
|
|
111
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
112
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
113
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
114
|
+
request=req, response=http_res
|
|
115
|
+
)
|
|
116
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
117
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
118
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
119
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
120
|
+
request=req, response=http_res
|
|
121
|
+
)
|
|
122
|
+
raise errors.Forbidden(response_data, http_res)
|
|
123
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
124
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
125
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
126
|
+
request=req, response=http_res
|
|
127
|
+
)
|
|
128
|
+
raise errors.NotFound(response_data, http_res)
|
|
129
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
130
|
+
response_data = unmarshal_json_response(
|
|
131
|
+
errors.InternalServerErrorUnion, http_res
|
|
132
|
+
)
|
|
133
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
134
|
+
request=req, response=http_res
|
|
135
|
+
)
|
|
136
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
137
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
138
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
139
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
140
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
141
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
142
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
143
|
+
|
|
144
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
145
|
+
|
|
146
|
+
async def get_bank_branches_async(
|
|
147
|
+
self,
|
|
148
|
+
*,
|
|
149
|
+
symbol: str,
|
|
150
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
151
|
+
server_url: Optional[str] = None,
|
|
152
|
+
timeout_ms: Optional[int] = None,
|
|
153
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
154
|
+
) -> models.GetBankBranchesResponse:
|
|
155
|
+
r"""Get Bank Branch
|
|
156
|
+
|
|
157
|
+
Retrieve bank branch data for a symbol.
|
|
158
|
+
|
|
159
|
+
If set, this operation will use `client_id` from the global security.
|
|
160
|
+
|
|
161
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
162
|
+
:param retries: Override the default retry configuration for this method
|
|
163
|
+
:param server_url: Override the default server URL for this method
|
|
164
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
165
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
166
|
+
"""
|
|
167
|
+
base_url = None
|
|
168
|
+
url_variables = None
|
|
169
|
+
if timeout_ms is None:
|
|
170
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
171
|
+
|
|
172
|
+
if timeout_ms is None:
|
|
173
|
+
timeout_ms = 30000
|
|
174
|
+
|
|
175
|
+
if server_url is not None:
|
|
176
|
+
base_url = server_url
|
|
177
|
+
else:
|
|
178
|
+
base_url = self._get_url(base_url, url_variables)
|
|
179
|
+
|
|
180
|
+
request = models.GetBankBranchesRequest(
|
|
181
|
+
symbol=symbol,
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
req = self._build_request_async(
|
|
185
|
+
method="GET",
|
|
186
|
+
path="/v1/stock/bank-branch",
|
|
187
|
+
base_url=base_url,
|
|
188
|
+
url_variables=url_variables,
|
|
189
|
+
request=request,
|
|
190
|
+
request_body_required=False,
|
|
191
|
+
request_has_path_params=False,
|
|
192
|
+
request_has_query_params=True,
|
|
193
|
+
user_agent_header="user-agent",
|
|
194
|
+
accept_header_value="application/json",
|
|
195
|
+
http_headers=http_headers,
|
|
196
|
+
security=self.sdk_configuration.security,
|
|
197
|
+
allow_empty_value=None,
|
|
198
|
+
allowed_fields=["client_id"],
|
|
199
|
+
timeout_ms=timeout_ms,
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
if retries == UNSET:
|
|
203
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
204
|
+
retries = self.sdk_configuration.retry_config
|
|
205
|
+
else:
|
|
206
|
+
retries = utils.RetryConfig(
|
|
207
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
retry_config = None
|
|
211
|
+
if isinstance(retries, utils.RetryConfig):
|
|
212
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
213
|
+
|
|
214
|
+
http_res = await self.do_request_async(
|
|
215
|
+
hook_ctx=HookContext(
|
|
216
|
+
config=self.sdk_configuration,
|
|
217
|
+
base_url=base_url or "",
|
|
218
|
+
operation_id="getBankBranches",
|
|
219
|
+
oauth2_scopes=["market:supplemental"],
|
|
220
|
+
security_source=self.sdk_configuration.security,
|
|
221
|
+
tags=["Stock Alternative"],
|
|
222
|
+
extensions=None,
|
|
223
|
+
),
|
|
224
|
+
request=req,
|
|
225
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
226
|
+
retry_config=retry_config,
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
response_data: Any = None
|
|
230
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
231
|
+
return models.GetBankBranchesResponse(
|
|
232
|
+
bank_branches_response=unmarshal_json_response(
|
|
233
|
+
Optional[models.BankBranchesResponse], http_res
|
|
234
|
+
),
|
|
235
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
236
|
+
)
|
|
237
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
238
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
239
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
240
|
+
request=req, response=http_res
|
|
241
|
+
)
|
|
242
|
+
raise errors.BadRequest(response_data, http_res)
|
|
243
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
244
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
245
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
246
|
+
request=req, response=http_res
|
|
247
|
+
)
|
|
248
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
249
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
250
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
251
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
252
|
+
request=req, response=http_res
|
|
253
|
+
)
|
|
254
|
+
raise errors.Forbidden(response_data, http_res)
|
|
255
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
256
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
257
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
258
|
+
request=req, response=http_res
|
|
259
|
+
)
|
|
260
|
+
raise errors.NotFound(response_data, http_res)
|
|
261
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
262
|
+
response_data = unmarshal_json_response(
|
|
263
|
+
errors.InternalServerErrorUnion, http_res
|
|
264
|
+
)
|
|
265
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
266
|
+
request=req, response=http_res
|
|
267
|
+
)
|
|
268
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
269
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
270
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
271
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
272
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
273
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
274
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
275
|
+
|
|
276
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
277
|
+
|
|
278
|
+
def get_congressional_trading(
|
|
279
|
+
self,
|
|
280
|
+
*,
|
|
281
|
+
symbol: str,
|
|
282
|
+
from_: date,
|
|
283
|
+
to: date,
|
|
284
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
285
|
+
server_url: Optional[str] = None,
|
|
286
|
+
timeout_ms: Optional[int] = None,
|
|
287
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
288
|
+
) -> models.GetCongressionalTradingResponse:
|
|
289
|
+
r"""Get Congressional Trading
|
|
290
|
+
|
|
291
|
+
Retrieve congressional trading data for a symbol within a date range.
|
|
292
|
+
|
|
293
|
+
If set, this operation will use `client_id` from the global security.
|
|
294
|
+
|
|
295
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
296
|
+
:param from_: Start of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-01-01`).
|
|
297
|
+
:param to: End of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-12-31`).
|
|
298
|
+
:param retries: Override the default retry configuration for this method
|
|
299
|
+
:param server_url: Override the default server URL for this method
|
|
300
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
301
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
302
|
+
"""
|
|
303
|
+
base_url = None
|
|
304
|
+
url_variables = None
|
|
305
|
+
if timeout_ms is None:
|
|
306
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
307
|
+
|
|
308
|
+
if timeout_ms is None:
|
|
309
|
+
timeout_ms = 30000
|
|
310
|
+
|
|
311
|
+
if server_url is not None:
|
|
312
|
+
base_url = server_url
|
|
313
|
+
else:
|
|
314
|
+
base_url = self._get_url(base_url, url_variables)
|
|
315
|
+
|
|
316
|
+
request = models.GetCongressionalTradingRequest(
|
|
317
|
+
symbol=symbol,
|
|
318
|
+
from_=from_,
|
|
319
|
+
to=to,
|
|
320
|
+
)
|
|
321
|
+
|
|
322
|
+
req = self._build_request(
|
|
323
|
+
method="GET",
|
|
324
|
+
path="/v1/stock/congressional-trading",
|
|
325
|
+
base_url=base_url,
|
|
326
|
+
url_variables=url_variables,
|
|
327
|
+
request=request,
|
|
328
|
+
request_body_required=False,
|
|
329
|
+
request_has_path_params=False,
|
|
330
|
+
request_has_query_params=True,
|
|
331
|
+
user_agent_header="user-agent",
|
|
332
|
+
accept_header_value="application/json",
|
|
333
|
+
http_headers=http_headers,
|
|
334
|
+
security=self.sdk_configuration.security,
|
|
335
|
+
allow_empty_value=None,
|
|
336
|
+
allowed_fields=["client_id"],
|
|
337
|
+
timeout_ms=timeout_ms,
|
|
338
|
+
)
|
|
339
|
+
|
|
340
|
+
if retries == UNSET:
|
|
341
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
342
|
+
retries = self.sdk_configuration.retry_config
|
|
343
|
+
else:
|
|
344
|
+
retries = utils.RetryConfig(
|
|
345
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
346
|
+
)
|
|
347
|
+
|
|
348
|
+
retry_config = None
|
|
349
|
+
if isinstance(retries, utils.RetryConfig):
|
|
350
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
351
|
+
|
|
352
|
+
http_res = self.do_request(
|
|
353
|
+
hook_ctx=HookContext(
|
|
354
|
+
config=self.sdk_configuration,
|
|
355
|
+
base_url=base_url or "",
|
|
356
|
+
operation_id="getCongressionalTrading",
|
|
357
|
+
oauth2_scopes=["market:supplemental"],
|
|
358
|
+
security_source=self.sdk_configuration.security,
|
|
359
|
+
tags=["Stock Alternative"],
|
|
360
|
+
extensions=None,
|
|
361
|
+
),
|
|
362
|
+
request=req,
|
|
363
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
364
|
+
retry_config=retry_config,
|
|
365
|
+
)
|
|
366
|
+
|
|
367
|
+
response_data: Any = None
|
|
368
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
369
|
+
return models.GetCongressionalTradingResponse(
|
|
370
|
+
congressional_trading_response=unmarshal_json_response(
|
|
371
|
+
Optional[models.CongressionalTradingResponse], http_res
|
|
372
|
+
),
|
|
373
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
374
|
+
)
|
|
375
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
376
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
377
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
378
|
+
request=req, response=http_res
|
|
379
|
+
)
|
|
380
|
+
raise errors.BadRequest(response_data, http_res)
|
|
381
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
382
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
383
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
384
|
+
request=req, response=http_res
|
|
385
|
+
)
|
|
386
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
387
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
388
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
389
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
390
|
+
request=req, response=http_res
|
|
391
|
+
)
|
|
392
|
+
raise errors.Forbidden(response_data, http_res)
|
|
393
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
394
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
395
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
396
|
+
request=req, response=http_res
|
|
397
|
+
)
|
|
398
|
+
raise errors.NotFound(response_data, http_res)
|
|
399
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
400
|
+
response_data = unmarshal_json_response(
|
|
401
|
+
errors.InternalServerErrorUnion, http_res
|
|
402
|
+
)
|
|
403
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
404
|
+
request=req, response=http_res
|
|
405
|
+
)
|
|
406
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
407
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
408
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
409
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
410
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
411
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
412
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
413
|
+
|
|
414
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
415
|
+
|
|
416
|
+
async def get_congressional_trading_async(
|
|
417
|
+
self,
|
|
418
|
+
*,
|
|
419
|
+
symbol: str,
|
|
420
|
+
from_: date,
|
|
421
|
+
to: date,
|
|
422
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
423
|
+
server_url: Optional[str] = None,
|
|
424
|
+
timeout_ms: Optional[int] = None,
|
|
425
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
426
|
+
) -> models.GetCongressionalTradingResponse:
|
|
427
|
+
r"""Get Congressional Trading
|
|
428
|
+
|
|
429
|
+
Retrieve congressional trading data for a symbol within a date range.
|
|
430
|
+
|
|
431
|
+
If set, this operation will use `client_id` from the global security.
|
|
432
|
+
|
|
433
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
434
|
+
:param from_: Start of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-01-01`).
|
|
435
|
+
:param to: End of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-12-31`).
|
|
436
|
+
:param retries: Override the default retry configuration for this method
|
|
437
|
+
:param server_url: Override the default server URL for this method
|
|
438
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
439
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
440
|
+
"""
|
|
441
|
+
base_url = None
|
|
442
|
+
url_variables = None
|
|
443
|
+
if timeout_ms is None:
|
|
444
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
445
|
+
|
|
446
|
+
if timeout_ms is None:
|
|
447
|
+
timeout_ms = 30000
|
|
448
|
+
|
|
449
|
+
if server_url is not None:
|
|
450
|
+
base_url = server_url
|
|
451
|
+
else:
|
|
452
|
+
base_url = self._get_url(base_url, url_variables)
|
|
453
|
+
|
|
454
|
+
request = models.GetCongressionalTradingRequest(
|
|
455
|
+
symbol=symbol,
|
|
456
|
+
from_=from_,
|
|
457
|
+
to=to,
|
|
458
|
+
)
|
|
459
|
+
|
|
460
|
+
req = self._build_request_async(
|
|
461
|
+
method="GET",
|
|
462
|
+
path="/v1/stock/congressional-trading",
|
|
463
|
+
base_url=base_url,
|
|
464
|
+
url_variables=url_variables,
|
|
465
|
+
request=request,
|
|
466
|
+
request_body_required=False,
|
|
467
|
+
request_has_path_params=False,
|
|
468
|
+
request_has_query_params=True,
|
|
469
|
+
user_agent_header="user-agent",
|
|
470
|
+
accept_header_value="application/json",
|
|
471
|
+
http_headers=http_headers,
|
|
472
|
+
security=self.sdk_configuration.security,
|
|
473
|
+
allow_empty_value=None,
|
|
474
|
+
allowed_fields=["client_id"],
|
|
475
|
+
timeout_ms=timeout_ms,
|
|
476
|
+
)
|
|
477
|
+
|
|
478
|
+
if retries == UNSET:
|
|
479
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
480
|
+
retries = self.sdk_configuration.retry_config
|
|
481
|
+
else:
|
|
482
|
+
retries = utils.RetryConfig(
|
|
483
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
484
|
+
)
|
|
485
|
+
|
|
486
|
+
retry_config = None
|
|
487
|
+
if isinstance(retries, utils.RetryConfig):
|
|
488
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
489
|
+
|
|
490
|
+
http_res = await self.do_request_async(
|
|
491
|
+
hook_ctx=HookContext(
|
|
492
|
+
config=self.sdk_configuration,
|
|
493
|
+
base_url=base_url or "",
|
|
494
|
+
operation_id="getCongressionalTrading",
|
|
495
|
+
oauth2_scopes=["market:supplemental"],
|
|
496
|
+
security_source=self.sdk_configuration.security,
|
|
497
|
+
tags=["Stock Alternative"],
|
|
498
|
+
extensions=None,
|
|
499
|
+
),
|
|
500
|
+
request=req,
|
|
501
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
502
|
+
retry_config=retry_config,
|
|
503
|
+
)
|
|
504
|
+
|
|
505
|
+
response_data: Any = None
|
|
506
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
507
|
+
return models.GetCongressionalTradingResponse(
|
|
508
|
+
congressional_trading_response=unmarshal_json_response(
|
|
509
|
+
Optional[models.CongressionalTradingResponse], http_res
|
|
510
|
+
),
|
|
511
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
512
|
+
)
|
|
513
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
514
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
515
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
516
|
+
request=req, response=http_res
|
|
517
|
+
)
|
|
518
|
+
raise errors.BadRequest(response_data, http_res)
|
|
519
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
520
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
521
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
522
|
+
request=req, response=http_res
|
|
523
|
+
)
|
|
524
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
525
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
526
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
527
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
528
|
+
request=req, response=http_res
|
|
529
|
+
)
|
|
530
|
+
raise errors.Forbidden(response_data, http_res)
|
|
531
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
532
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
533
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
534
|
+
request=req, response=http_res
|
|
535
|
+
)
|
|
536
|
+
raise errors.NotFound(response_data, http_res)
|
|
537
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
538
|
+
response_data = unmarshal_json_response(
|
|
539
|
+
errors.InternalServerErrorUnion, http_res
|
|
540
|
+
)
|
|
541
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
542
|
+
request=req, response=http_res
|
|
543
|
+
)
|
|
544
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
545
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
546
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
547
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
548
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
549
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
550
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
551
|
+
|
|
552
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
553
|
+
|
|
554
|
+
def get_covid19_us_cases(
|
|
555
|
+
self,
|
|
556
|
+
*,
|
|
557
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
558
|
+
server_url: Optional[str] = None,
|
|
559
|
+
timeout_ms: Optional[int] = None,
|
|
560
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
561
|
+
) -> models.GetCovid19UsCasesResponse:
|
|
562
|
+
r"""Get COVID-19 US
|
|
563
|
+
|
|
564
|
+
Retrieve COVID-19 US data.
|
|
565
|
+
|
|
566
|
+
If set, this operation will use `client_id` from the global security.
|
|
567
|
+
|
|
568
|
+
:param retries: Override the default retry configuration for this method
|
|
569
|
+
:param server_url: Override the default server URL for this method
|
|
570
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
571
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
572
|
+
"""
|
|
573
|
+
base_url = None
|
|
574
|
+
url_variables = None
|
|
575
|
+
if timeout_ms is None:
|
|
576
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
577
|
+
|
|
578
|
+
if timeout_ms is None:
|
|
579
|
+
timeout_ms = 30000
|
|
580
|
+
|
|
581
|
+
if server_url is not None:
|
|
582
|
+
base_url = server_url
|
|
583
|
+
else:
|
|
584
|
+
base_url = self._get_url(base_url, url_variables)
|
|
585
|
+
req = self._build_request(
|
|
586
|
+
method="GET",
|
|
587
|
+
path="/v1/stock/covid19/us",
|
|
588
|
+
base_url=base_url,
|
|
589
|
+
url_variables=url_variables,
|
|
590
|
+
request=None,
|
|
591
|
+
request_body_required=False,
|
|
592
|
+
request_has_path_params=False,
|
|
593
|
+
request_has_query_params=True,
|
|
594
|
+
user_agent_header="user-agent",
|
|
595
|
+
accept_header_value="application/json",
|
|
596
|
+
http_headers=http_headers,
|
|
597
|
+
security=self.sdk_configuration.security,
|
|
598
|
+
allow_empty_value=None,
|
|
599
|
+
allowed_fields=["client_id"],
|
|
600
|
+
timeout_ms=timeout_ms,
|
|
601
|
+
)
|
|
602
|
+
|
|
603
|
+
if retries == UNSET:
|
|
604
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
605
|
+
retries = self.sdk_configuration.retry_config
|
|
606
|
+
else:
|
|
607
|
+
retries = utils.RetryConfig(
|
|
608
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
609
|
+
)
|
|
610
|
+
|
|
611
|
+
retry_config = None
|
|
612
|
+
if isinstance(retries, utils.RetryConfig):
|
|
613
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
614
|
+
|
|
615
|
+
http_res = self.do_request(
|
|
616
|
+
hook_ctx=HookContext(
|
|
617
|
+
config=self.sdk_configuration,
|
|
618
|
+
base_url=base_url or "",
|
|
619
|
+
operation_id="getCovid19UsCases",
|
|
620
|
+
oauth2_scopes=["market:supplemental"],
|
|
621
|
+
security_source=self.sdk_configuration.security,
|
|
622
|
+
tags=["Stock Alternative"],
|
|
623
|
+
extensions=None,
|
|
624
|
+
),
|
|
625
|
+
request=req,
|
|
626
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
627
|
+
retry_config=retry_config,
|
|
628
|
+
)
|
|
629
|
+
|
|
630
|
+
response_data: Any = None
|
|
631
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
632
|
+
return models.GetCovid19UsCasesResponse(
|
|
633
|
+
covid19_us_cases_response=unmarshal_json_response(
|
|
634
|
+
Optional[models.Covid19UsCasesResponse], http_res
|
|
635
|
+
),
|
|
636
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
637
|
+
)
|
|
638
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
639
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
640
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
641
|
+
request=req, response=http_res
|
|
642
|
+
)
|
|
643
|
+
raise errors.BadRequest(response_data, http_res)
|
|
644
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
645
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
646
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
647
|
+
request=req, response=http_res
|
|
648
|
+
)
|
|
649
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
650
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
651
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
652
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
653
|
+
request=req, response=http_res
|
|
654
|
+
)
|
|
655
|
+
raise errors.Forbidden(response_data, http_res)
|
|
656
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
657
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
658
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
659
|
+
request=req, response=http_res
|
|
660
|
+
)
|
|
661
|
+
raise errors.NotFound(response_data, http_res)
|
|
662
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
663
|
+
response_data = unmarshal_json_response(
|
|
664
|
+
errors.InternalServerErrorUnion, http_res
|
|
665
|
+
)
|
|
666
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
667
|
+
request=req, response=http_res
|
|
668
|
+
)
|
|
669
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
670
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
671
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
672
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
673
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
674
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
675
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
676
|
+
|
|
677
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
678
|
+
|
|
679
|
+
async def get_covid19_us_cases_async(
|
|
680
|
+
self,
|
|
681
|
+
*,
|
|
682
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
683
|
+
server_url: Optional[str] = None,
|
|
684
|
+
timeout_ms: Optional[int] = None,
|
|
685
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
686
|
+
) -> models.GetCovid19UsCasesResponse:
|
|
687
|
+
r"""Get COVID-19 US
|
|
688
|
+
|
|
689
|
+
Retrieve COVID-19 US data.
|
|
690
|
+
|
|
691
|
+
If set, this operation will use `client_id` from the global security.
|
|
692
|
+
|
|
693
|
+
:param retries: Override the default retry configuration for this method
|
|
694
|
+
:param server_url: Override the default server URL for this method
|
|
695
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
696
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
697
|
+
"""
|
|
698
|
+
base_url = None
|
|
699
|
+
url_variables = None
|
|
700
|
+
if timeout_ms is None:
|
|
701
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
702
|
+
|
|
703
|
+
if timeout_ms is None:
|
|
704
|
+
timeout_ms = 30000
|
|
705
|
+
|
|
706
|
+
if server_url is not None:
|
|
707
|
+
base_url = server_url
|
|
708
|
+
else:
|
|
709
|
+
base_url = self._get_url(base_url, url_variables)
|
|
710
|
+
req = self._build_request_async(
|
|
711
|
+
method="GET",
|
|
712
|
+
path="/v1/stock/covid19/us",
|
|
713
|
+
base_url=base_url,
|
|
714
|
+
url_variables=url_variables,
|
|
715
|
+
request=None,
|
|
716
|
+
request_body_required=False,
|
|
717
|
+
request_has_path_params=False,
|
|
718
|
+
request_has_query_params=True,
|
|
719
|
+
user_agent_header="user-agent",
|
|
720
|
+
accept_header_value="application/json",
|
|
721
|
+
http_headers=http_headers,
|
|
722
|
+
security=self.sdk_configuration.security,
|
|
723
|
+
allow_empty_value=None,
|
|
724
|
+
allowed_fields=["client_id"],
|
|
725
|
+
timeout_ms=timeout_ms,
|
|
726
|
+
)
|
|
727
|
+
|
|
728
|
+
if retries == UNSET:
|
|
729
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
730
|
+
retries = self.sdk_configuration.retry_config
|
|
731
|
+
else:
|
|
732
|
+
retries = utils.RetryConfig(
|
|
733
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
734
|
+
)
|
|
735
|
+
|
|
736
|
+
retry_config = None
|
|
737
|
+
if isinstance(retries, utils.RetryConfig):
|
|
738
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
739
|
+
|
|
740
|
+
http_res = await self.do_request_async(
|
|
741
|
+
hook_ctx=HookContext(
|
|
742
|
+
config=self.sdk_configuration,
|
|
743
|
+
base_url=base_url or "",
|
|
744
|
+
operation_id="getCovid19UsCases",
|
|
745
|
+
oauth2_scopes=["market:supplemental"],
|
|
746
|
+
security_source=self.sdk_configuration.security,
|
|
747
|
+
tags=["Stock Alternative"],
|
|
748
|
+
extensions=None,
|
|
749
|
+
),
|
|
750
|
+
request=req,
|
|
751
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
752
|
+
retry_config=retry_config,
|
|
753
|
+
)
|
|
754
|
+
|
|
755
|
+
response_data: Any = None
|
|
756
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
757
|
+
return models.GetCovid19UsCasesResponse(
|
|
758
|
+
covid19_us_cases_response=unmarshal_json_response(
|
|
759
|
+
Optional[models.Covid19UsCasesResponse], http_res
|
|
760
|
+
),
|
|
761
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
762
|
+
)
|
|
763
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
764
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
765
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
766
|
+
request=req, response=http_res
|
|
767
|
+
)
|
|
768
|
+
raise errors.BadRequest(response_data, http_res)
|
|
769
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
770
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
771
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
772
|
+
request=req, response=http_res
|
|
773
|
+
)
|
|
774
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
775
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
776
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
777
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
778
|
+
request=req, response=http_res
|
|
779
|
+
)
|
|
780
|
+
raise errors.Forbidden(response_data, http_res)
|
|
781
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
782
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
783
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
784
|
+
request=req, response=http_res
|
|
785
|
+
)
|
|
786
|
+
raise errors.NotFound(response_data, http_res)
|
|
787
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
788
|
+
response_data = unmarshal_json_response(
|
|
789
|
+
errors.InternalServerErrorUnion, http_res
|
|
790
|
+
)
|
|
791
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
792
|
+
request=req, response=http_res
|
|
793
|
+
)
|
|
794
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
795
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
796
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
797
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
798
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
799
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
800
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
801
|
+
|
|
802
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
803
|
+
|
|
804
|
+
def get_earnings_call_live(
|
|
805
|
+
self,
|
|
806
|
+
*,
|
|
807
|
+
from_: Optional[date] = None,
|
|
808
|
+
to: Optional[date] = None,
|
|
809
|
+
symbol: Optional[str] = None,
|
|
810
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
811
|
+
server_url: Optional[str] = None,
|
|
812
|
+
timeout_ms: Optional[int] = None,
|
|
813
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
814
|
+
) -> models.GetEarningsCallLiveResponse:
|
|
815
|
+
r"""Get Earnings Call Live
|
|
816
|
+
|
|
817
|
+
Retrieve live or upcoming earnings call information.
|
|
818
|
+
|
|
819
|
+
If set, this operation will use `client_id` from the global security.
|
|
820
|
+
|
|
821
|
+
:param from_: Start of the date window, inclusive. Format: `YYYY-MM-DD`.
|
|
822
|
+
:param to: End of the date window, inclusive. Format: `YYYY-MM-DD`.
|
|
823
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol, e.g. `AAPL`.
|
|
824
|
+
:param retries: Override the default retry configuration for this method
|
|
825
|
+
:param server_url: Override the default server URL for this method
|
|
826
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
827
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
828
|
+
"""
|
|
829
|
+
base_url = None
|
|
830
|
+
url_variables = None
|
|
831
|
+
if timeout_ms is None:
|
|
832
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
833
|
+
|
|
834
|
+
if timeout_ms is None:
|
|
835
|
+
timeout_ms = 30000
|
|
836
|
+
|
|
837
|
+
if server_url is not None:
|
|
838
|
+
base_url = server_url
|
|
839
|
+
else:
|
|
840
|
+
base_url = self._get_url(base_url, url_variables)
|
|
841
|
+
|
|
842
|
+
request = models.GetEarningsCallLiveRequest(
|
|
843
|
+
from_=from_,
|
|
844
|
+
to=to,
|
|
845
|
+
symbol=symbol,
|
|
846
|
+
)
|
|
847
|
+
|
|
848
|
+
req = self._build_request(
|
|
849
|
+
method="GET",
|
|
850
|
+
path="/v1/stock/earnings-call-live",
|
|
851
|
+
base_url=base_url,
|
|
852
|
+
url_variables=url_variables,
|
|
853
|
+
request=request,
|
|
854
|
+
request_body_required=False,
|
|
855
|
+
request_has_path_params=False,
|
|
856
|
+
request_has_query_params=True,
|
|
857
|
+
user_agent_header="user-agent",
|
|
858
|
+
accept_header_value="application/json",
|
|
859
|
+
http_headers=http_headers,
|
|
860
|
+
security=self.sdk_configuration.security,
|
|
861
|
+
allow_empty_value=None,
|
|
862
|
+
allowed_fields=["client_id"],
|
|
863
|
+
timeout_ms=timeout_ms,
|
|
864
|
+
)
|
|
865
|
+
|
|
866
|
+
if retries == UNSET:
|
|
867
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
868
|
+
retries = self.sdk_configuration.retry_config
|
|
869
|
+
else:
|
|
870
|
+
retries = utils.RetryConfig(
|
|
871
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
872
|
+
)
|
|
873
|
+
|
|
874
|
+
retry_config = None
|
|
875
|
+
if isinstance(retries, utils.RetryConfig):
|
|
876
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
877
|
+
|
|
878
|
+
http_res = self.do_request(
|
|
879
|
+
hook_ctx=HookContext(
|
|
880
|
+
config=self.sdk_configuration,
|
|
881
|
+
base_url=base_url or "",
|
|
882
|
+
operation_id="getEarningsCallLive",
|
|
883
|
+
oauth2_scopes=["market:supplemental"],
|
|
884
|
+
security_source=self.sdk_configuration.security,
|
|
885
|
+
tags=["Stock Alternative"],
|
|
886
|
+
extensions=None,
|
|
887
|
+
),
|
|
888
|
+
request=req,
|
|
889
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
890
|
+
retry_config=retry_config,
|
|
891
|
+
)
|
|
892
|
+
|
|
893
|
+
response_data: Any = None
|
|
894
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
895
|
+
return models.GetEarningsCallLiveResponse(
|
|
896
|
+
earnings_call_live_response=unmarshal_json_response(
|
|
897
|
+
Optional[models.EarningsCallLiveResponse], http_res
|
|
898
|
+
),
|
|
899
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
900
|
+
)
|
|
901
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
902
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
903
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
904
|
+
request=req, response=http_res
|
|
905
|
+
)
|
|
906
|
+
raise errors.BadRequest(response_data, http_res)
|
|
907
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
908
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
909
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
910
|
+
request=req, response=http_res
|
|
911
|
+
)
|
|
912
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
913
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
914
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
915
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
916
|
+
request=req, response=http_res
|
|
917
|
+
)
|
|
918
|
+
raise errors.Forbidden(response_data, http_res)
|
|
919
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
920
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
921
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
922
|
+
request=req, response=http_res
|
|
923
|
+
)
|
|
924
|
+
raise errors.NotFound(response_data, http_res)
|
|
925
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
926
|
+
response_data = unmarshal_json_response(
|
|
927
|
+
errors.InternalServerErrorUnion, http_res
|
|
928
|
+
)
|
|
929
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
930
|
+
request=req, response=http_res
|
|
931
|
+
)
|
|
932
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
933
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
934
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
935
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
936
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
937
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
938
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
939
|
+
|
|
940
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
941
|
+
|
|
942
|
+
async def get_earnings_call_live_async(
|
|
943
|
+
self,
|
|
944
|
+
*,
|
|
945
|
+
from_: Optional[date] = None,
|
|
946
|
+
to: Optional[date] = None,
|
|
947
|
+
symbol: Optional[str] = None,
|
|
948
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
949
|
+
server_url: Optional[str] = None,
|
|
950
|
+
timeout_ms: Optional[int] = None,
|
|
951
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
952
|
+
) -> models.GetEarningsCallLiveResponse:
|
|
953
|
+
r"""Get Earnings Call Live
|
|
954
|
+
|
|
955
|
+
Retrieve live or upcoming earnings call information.
|
|
956
|
+
|
|
957
|
+
If set, this operation will use `client_id` from the global security.
|
|
958
|
+
|
|
959
|
+
:param from_: Start of the date window, inclusive. Format: `YYYY-MM-DD`.
|
|
960
|
+
:param to: End of the date window, inclusive. Format: `YYYY-MM-DD`.
|
|
961
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol, e.g. `AAPL`.
|
|
962
|
+
:param retries: Override the default retry configuration for this method
|
|
963
|
+
:param server_url: Override the default server URL for this method
|
|
964
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
965
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
966
|
+
"""
|
|
967
|
+
base_url = None
|
|
968
|
+
url_variables = None
|
|
969
|
+
if timeout_ms is None:
|
|
970
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
971
|
+
|
|
972
|
+
if timeout_ms is None:
|
|
973
|
+
timeout_ms = 30000
|
|
974
|
+
|
|
975
|
+
if server_url is not None:
|
|
976
|
+
base_url = server_url
|
|
977
|
+
else:
|
|
978
|
+
base_url = self._get_url(base_url, url_variables)
|
|
979
|
+
|
|
980
|
+
request = models.GetEarningsCallLiveRequest(
|
|
981
|
+
from_=from_,
|
|
982
|
+
to=to,
|
|
983
|
+
symbol=symbol,
|
|
984
|
+
)
|
|
985
|
+
|
|
986
|
+
req = self._build_request_async(
|
|
987
|
+
method="GET",
|
|
988
|
+
path="/v1/stock/earnings-call-live",
|
|
989
|
+
base_url=base_url,
|
|
990
|
+
url_variables=url_variables,
|
|
991
|
+
request=request,
|
|
992
|
+
request_body_required=False,
|
|
993
|
+
request_has_path_params=False,
|
|
994
|
+
request_has_query_params=True,
|
|
995
|
+
user_agent_header="user-agent",
|
|
996
|
+
accept_header_value="application/json",
|
|
997
|
+
http_headers=http_headers,
|
|
998
|
+
security=self.sdk_configuration.security,
|
|
999
|
+
allow_empty_value=None,
|
|
1000
|
+
allowed_fields=["client_id"],
|
|
1001
|
+
timeout_ms=timeout_ms,
|
|
1002
|
+
)
|
|
1003
|
+
|
|
1004
|
+
if retries == UNSET:
|
|
1005
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1006
|
+
retries = self.sdk_configuration.retry_config
|
|
1007
|
+
else:
|
|
1008
|
+
retries = utils.RetryConfig(
|
|
1009
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1010
|
+
)
|
|
1011
|
+
|
|
1012
|
+
retry_config = None
|
|
1013
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1014
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1015
|
+
|
|
1016
|
+
http_res = await self.do_request_async(
|
|
1017
|
+
hook_ctx=HookContext(
|
|
1018
|
+
config=self.sdk_configuration,
|
|
1019
|
+
base_url=base_url or "",
|
|
1020
|
+
operation_id="getEarningsCallLive",
|
|
1021
|
+
oauth2_scopes=["market:supplemental"],
|
|
1022
|
+
security_source=self.sdk_configuration.security,
|
|
1023
|
+
tags=["Stock Alternative"],
|
|
1024
|
+
extensions=None,
|
|
1025
|
+
),
|
|
1026
|
+
request=req,
|
|
1027
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1028
|
+
retry_config=retry_config,
|
|
1029
|
+
)
|
|
1030
|
+
|
|
1031
|
+
response_data: Any = None
|
|
1032
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1033
|
+
return models.GetEarningsCallLiveResponse(
|
|
1034
|
+
earnings_call_live_response=unmarshal_json_response(
|
|
1035
|
+
Optional[models.EarningsCallLiveResponse], http_res
|
|
1036
|
+
),
|
|
1037
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1038
|
+
)
|
|
1039
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1040
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1041
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1042
|
+
request=req, response=http_res
|
|
1043
|
+
)
|
|
1044
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1045
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1046
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1047
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1048
|
+
request=req, response=http_res
|
|
1049
|
+
)
|
|
1050
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1051
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1052
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1053
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1054
|
+
request=req, response=http_res
|
|
1055
|
+
)
|
|
1056
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1057
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1058
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1059
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1060
|
+
request=req, response=http_res
|
|
1061
|
+
)
|
|
1062
|
+
raise errors.NotFound(response_data, http_res)
|
|
1063
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1064
|
+
response_data = unmarshal_json_response(
|
|
1065
|
+
errors.InternalServerErrorUnion, http_res
|
|
1066
|
+
)
|
|
1067
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1068
|
+
request=req, response=http_res
|
|
1069
|
+
)
|
|
1070
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1071
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1072
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1073
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1074
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1075
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1076
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1077
|
+
|
|
1078
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1079
|
+
|
|
1080
|
+
def get_earnings_quality_score(
|
|
1081
|
+
self,
|
|
1082
|
+
*,
|
|
1083
|
+
symbol: str,
|
|
1084
|
+
freq: models.ReportingFrequency,
|
|
1085
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1086
|
+
server_url: Optional[str] = None,
|
|
1087
|
+
timeout_ms: Optional[int] = None,
|
|
1088
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1089
|
+
) -> models.GetEarningsQualityScoreResponse:
|
|
1090
|
+
r"""Get Earnings Quality Score
|
|
1091
|
+
|
|
1092
|
+
Retrieve earnings quality score metrics for a company (annual or quarterly).
|
|
1093
|
+
|
|
1094
|
+
If set, this operation will use `client_id` from the global security.
|
|
1095
|
+
|
|
1096
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
1097
|
+
:param freq: How often the score is computed. Allowed values:
|
|
1098
|
+
- `annual` — one score per fiscal year (broad trends).
|
|
1099
|
+
- `quarterly` — one score per quarter (closer to recent reporting).
|
|
1100
|
+
:param retries: Override the default retry configuration for this method
|
|
1101
|
+
:param server_url: Override the default server URL for this method
|
|
1102
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1103
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1104
|
+
"""
|
|
1105
|
+
base_url = None
|
|
1106
|
+
url_variables = None
|
|
1107
|
+
if timeout_ms is None:
|
|
1108
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1109
|
+
|
|
1110
|
+
if timeout_ms is None:
|
|
1111
|
+
timeout_ms = 30000
|
|
1112
|
+
|
|
1113
|
+
if server_url is not None:
|
|
1114
|
+
base_url = server_url
|
|
1115
|
+
else:
|
|
1116
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1117
|
+
|
|
1118
|
+
request = models.GetEarningsQualityScoreRequest(
|
|
1119
|
+
symbol=symbol,
|
|
1120
|
+
freq=freq,
|
|
1121
|
+
)
|
|
1122
|
+
|
|
1123
|
+
req = self._build_request(
|
|
1124
|
+
method="GET",
|
|
1125
|
+
path="/v1/stock/earnings-quality-score",
|
|
1126
|
+
base_url=base_url,
|
|
1127
|
+
url_variables=url_variables,
|
|
1128
|
+
request=request,
|
|
1129
|
+
request_body_required=False,
|
|
1130
|
+
request_has_path_params=False,
|
|
1131
|
+
request_has_query_params=True,
|
|
1132
|
+
user_agent_header="user-agent",
|
|
1133
|
+
accept_header_value="application/json",
|
|
1134
|
+
http_headers=http_headers,
|
|
1135
|
+
security=self.sdk_configuration.security,
|
|
1136
|
+
allow_empty_value=None,
|
|
1137
|
+
allowed_fields=["client_id"],
|
|
1138
|
+
timeout_ms=timeout_ms,
|
|
1139
|
+
)
|
|
1140
|
+
|
|
1141
|
+
if retries == UNSET:
|
|
1142
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1143
|
+
retries = self.sdk_configuration.retry_config
|
|
1144
|
+
else:
|
|
1145
|
+
retries = utils.RetryConfig(
|
|
1146
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1147
|
+
)
|
|
1148
|
+
|
|
1149
|
+
retry_config = None
|
|
1150
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1151
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1152
|
+
|
|
1153
|
+
http_res = self.do_request(
|
|
1154
|
+
hook_ctx=HookContext(
|
|
1155
|
+
config=self.sdk_configuration,
|
|
1156
|
+
base_url=base_url or "",
|
|
1157
|
+
operation_id="getEarningsQualityScore",
|
|
1158
|
+
oauth2_scopes=["market:supplemental"],
|
|
1159
|
+
security_source=self.sdk_configuration.security,
|
|
1160
|
+
tags=["Stock Alternative"],
|
|
1161
|
+
extensions=None,
|
|
1162
|
+
),
|
|
1163
|
+
request=req,
|
|
1164
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1165
|
+
retry_config=retry_config,
|
|
1166
|
+
)
|
|
1167
|
+
|
|
1168
|
+
response_data: Any = None
|
|
1169
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1170
|
+
return models.GetEarningsQualityScoreResponse(
|
|
1171
|
+
earnings_quality_score_response=unmarshal_json_response(
|
|
1172
|
+
Optional[models.EarningsQualityScoreResponse], http_res
|
|
1173
|
+
),
|
|
1174
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1175
|
+
)
|
|
1176
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1177
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1178
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1179
|
+
request=req, response=http_res
|
|
1180
|
+
)
|
|
1181
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1182
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1183
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1184
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1185
|
+
request=req, response=http_res
|
|
1186
|
+
)
|
|
1187
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1188
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1189
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1190
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1191
|
+
request=req, response=http_res
|
|
1192
|
+
)
|
|
1193
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1194
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1195
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1196
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1197
|
+
request=req, response=http_res
|
|
1198
|
+
)
|
|
1199
|
+
raise errors.NotFound(response_data, http_res)
|
|
1200
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1201
|
+
response_data = unmarshal_json_response(
|
|
1202
|
+
errors.InternalServerErrorUnion, http_res
|
|
1203
|
+
)
|
|
1204
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1205
|
+
request=req, response=http_res
|
|
1206
|
+
)
|
|
1207
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1208
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1209
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1210
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1211
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1212
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1213
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1214
|
+
|
|
1215
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1216
|
+
|
|
1217
|
+
async def get_earnings_quality_score_async(
|
|
1218
|
+
self,
|
|
1219
|
+
*,
|
|
1220
|
+
symbol: str,
|
|
1221
|
+
freq: models.ReportingFrequency,
|
|
1222
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1223
|
+
server_url: Optional[str] = None,
|
|
1224
|
+
timeout_ms: Optional[int] = None,
|
|
1225
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1226
|
+
) -> models.GetEarningsQualityScoreResponse:
|
|
1227
|
+
r"""Get Earnings Quality Score
|
|
1228
|
+
|
|
1229
|
+
Retrieve earnings quality score metrics for a company (annual or quarterly).
|
|
1230
|
+
|
|
1231
|
+
If set, this operation will use `client_id` from the global security.
|
|
1232
|
+
|
|
1233
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
1234
|
+
:param freq: How often the score is computed. Allowed values:
|
|
1235
|
+
- `annual` — one score per fiscal year (broad trends).
|
|
1236
|
+
- `quarterly` — one score per quarter (closer to recent reporting).
|
|
1237
|
+
:param retries: Override the default retry configuration for this method
|
|
1238
|
+
:param server_url: Override the default server URL for this method
|
|
1239
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1240
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1241
|
+
"""
|
|
1242
|
+
base_url = None
|
|
1243
|
+
url_variables = None
|
|
1244
|
+
if timeout_ms is None:
|
|
1245
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1246
|
+
|
|
1247
|
+
if timeout_ms is None:
|
|
1248
|
+
timeout_ms = 30000
|
|
1249
|
+
|
|
1250
|
+
if server_url is not None:
|
|
1251
|
+
base_url = server_url
|
|
1252
|
+
else:
|
|
1253
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1254
|
+
|
|
1255
|
+
request = models.GetEarningsQualityScoreRequest(
|
|
1256
|
+
symbol=symbol,
|
|
1257
|
+
freq=freq,
|
|
1258
|
+
)
|
|
1259
|
+
|
|
1260
|
+
req = self._build_request_async(
|
|
1261
|
+
method="GET",
|
|
1262
|
+
path="/v1/stock/earnings-quality-score",
|
|
1263
|
+
base_url=base_url,
|
|
1264
|
+
url_variables=url_variables,
|
|
1265
|
+
request=request,
|
|
1266
|
+
request_body_required=False,
|
|
1267
|
+
request_has_path_params=False,
|
|
1268
|
+
request_has_query_params=True,
|
|
1269
|
+
user_agent_header="user-agent",
|
|
1270
|
+
accept_header_value="application/json",
|
|
1271
|
+
http_headers=http_headers,
|
|
1272
|
+
security=self.sdk_configuration.security,
|
|
1273
|
+
allow_empty_value=None,
|
|
1274
|
+
allowed_fields=["client_id"],
|
|
1275
|
+
timeout_ms=timeout_ms,
|
|
1276
|
+
)
|
|
1277
|
+
|
|
1278
|
+
if retries == UNSET:
|
|
1279
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1280
|
+
retries = self.sdk_configuration.retry_config
|
|
1281
|
+
else:
|
|
1282
|
+
retries = utils.RetryConfig(
|
|
1283
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1284
|
+
)
|
|
1285
|
+
|
|
1286
|
+
retry_config = None
|
|
1287
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1288
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1289
|
+
|
|
1290
|
+
http_res = await self.do_request_async(
|
|
1291
|
+
hook_ctx=HookContext(
|
|
1292
|
+
config=self.sdk_configuration,
|
|
1293
|
+
base_url=base_url or "",
|
|
1294
|
+
operation_id="getEarningsQualityScore",
|
|
1295
|
+
oauth2_scopes=["market:supplemental"],
|
|
1296
|
+
security_source=self.sdk_configuration.security,
|
|
1297
|
+
tags=["Stock Alternative"],
|
|
1298
|
+
extensions=None,
|
|
1299
|
+
),
|
|
1300
|
+
request=req,
|
|
1301
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1302
|
+
retry_config=retry_config,
|
|
1303
|
+
)
|
|
1304
|
+
|
|
1305
|
+
response_data: Any = None
|
|
1306
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1307
|
+
return models.GetEarningsQualityScoreResponse(
|
|
1308
|
+
earnings_quality_score_response=unmarshal_json_response(
|
|
1309
|
+
Optional[models.EarningsQualityScoreResponse], http_res
|
|
1310
|
+
),
|
|
1311
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1312
|
+
)
|
|
1313
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1314
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1315
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1316
|
+
request=req, response=http_res
|
|
1317
|
+
)
|
|
1318
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1319
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1320
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1321
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1322
|
+
request=req, response=http_res
|
|
1323
|
+
)
|
|
1324
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1325
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1326
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1327
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1328
|
+
request=req, response=http_res
|
|
1329
|
+
)
|
|
1330
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1331
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1332
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1333
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1334
|
+
request=req, response=http_res
|
|
1335
|
+
)
|
|
1336
|
+
raise errors.NotFound(response_data, http_res)
|
|
1337
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1338
|
+
response_data = unmarshal_json_response(
|
|
1339
|
+
errors.InternalServerErrorUnion, http_res
|
|
1340
|
+
)
|
|
1341
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1342
|
+
request=req, response=http_res
|
|
1343
|
+
)
|
|
1344
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1345
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1346
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1347
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1348
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1349
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1350
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1351
|
+
|
|
1352
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1353
|
+
|
|
1354
|
+
def get_company_esg(
|
|
1355
|
+
self,
|
|
1356
|
+
*,
|
|
1357
|
+
symbol: str,
|
|
1358
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1359
|
+
server_url: Optional[str] = None,
|
|
1360
|
+
timeout_ms: Optional[int] = None,
|
|
1361
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1362
|
+
) -> models.GetCompanyEsgResponse:
|
|
1363
|
+
r"""Get Company ESG
|
|
1364
|
+
|
|
1365
|
+
Retrieve environmental, social, and governance (ESG) data for a company.
|
|
1366
|
+
|
|
1367
|
+
If set, this operation will use `client_id` from the global security.
|
|
1368
|
+
|
|
1369
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
1370
|
+
:param retries: Override the default retry configuration for this method
|
|
1371
|
+
:param server_url: Override the default server URL for this method
|
|
1372
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1373
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1374
|
+
"""
|
|
1375
|
+
base_url = None
|
|
1376
|
+
url_variables = None
|
|
1377
|
+
if timeout_ms is None:
|
|
1378
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1379
|
+
|
|
1380
|
+
if timeout_ms is None:
|
|
1381
|
+
timeout_ms = 30000
|
|
1382
|
+
|
|
1383
|
+
if server_url is not None:
|
|
1384
|
+
base_url = server_url
|
|
1385
|
+
else:
|
|
1386
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1387
|
+
|
|
1388
|
+
request = models.GetCompanyEsgRequest(
|
|
1389
|
+
symbol=symbol,
|
|
1390
|
+
)
|
|
1391
|
+
|
|
1392
|
+
req = self._build_request(
|
|
1393
|
+
method="GET",
|
|
1394
|
+
path="/v1/stock/esg",
|
|
1395
|
+
base_url=base_url,
|
|
1396
|
+
url_variables=url_variables,
|
|
1397
|
+
request=request,
|
|
1398
|
+
request_body_required=False,
|
|
1399
|
+
request_has_path_params=False,
|
|
1400
|
+
request_has_query_params=True,
|
|
1401
|
+
user_agent_header="user-agent",
|
|
1402
|
+
accept_header_value="application/json",
|
|
1403
|
+
http_headers=http_headers,
|
|
1404
|
+
security=self.sdk_configuration.security,
|
|
1405
|
+
allow_empty_value=None,
|
|
1406
|
+
allowed_fields=["client_id"],
|
|
1407
|
+
timeout_ms=timeout_ms,
|
|
1408
|
+
)
|
|
1409
|
+
|
|
1410
|
+
if retries == UNSET:
|
|
1411
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1412
|
+
retries = self.sdk_configuration.retry_config
|
|
1413
|
+
else:
|
|
1414
|
+
retries = utils.RetryConfig(
|
|
1415
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1416
|
+
)
|
|
1417
|
+
|
|
1418
|
+
retry_config = None
|
|
1419
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1420
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1421
|
+
|
|
1422
|
+
http_res = self.do_request(
|
|
1423
|
+
hook_ctx=HookContext(
|
|
1424
|
+
config=self.sdk_configuration,
|
|
1425
|
+
base_url=base_url or "",
|
|
1426
|
+
operation_id="getCompanyEsg",
|
|
1427
|
+
oauth2_scopes=["market:supplemental"],
|
|
1428
|
+
security_source=self.sdk_configuration.security,
|
|
1429
|
+
tags=["Stock Alternative"],
|
|
1430
|
+
extensions=None,
|
|
1431
|
+
),
|
|
1432
|
+
request=req,
|
|
1433
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1434
|
+
retry_config=retry_config,
|
|
1435
|
+
)
|
|
1436
|
+
|
|
1437
|
+
response_data: Any = None
|
|
1438
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1439
|
+
return models.GetCompanyEsgResponse(
|
|
1440
|
+
company_esg_response=unmarshal_json_response(
|
|
1441
|
+
Optional[models.CompanyEsgResponse], http_res
|
|
1442
|
+
),
|
|
1443
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1444
|
+
)
|
|
1445
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1446
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1447
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1448
|
+
request=req, response=http_res
|
|
1449
|
+
)
|
|
1450
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1451
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1452
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1453
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1454
|
+
request=req, response=http_res
|
|
1455
|
+
)
|
|
1456
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1457
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1458
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1459
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1460
|
+
request=req, response=http_res
|
|
1461
|
+
)
|
|
1462
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1463
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1464
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1465
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1466
|
+
request=req, response=http_res
|
|
1467
|
+
)
|
|
1468
|
+
raise errors.NotFound(response_data, http_res)
|
|
1469
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1470
|
+
response_data = unmarshal_json_response(
|
|
1471
|
+
errors.InternalServerErrorUnion, http_res
|
|
1472
|
+
)
|
|
1473
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1474
|
+
request=req, response=http_res
|
|
1475
|
+
)
|
|
1476
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1477
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1478
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1479
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1480
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1481
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1482
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1483
|
+
|
|
1484
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1485
|
+
|
|
1486
|
+
async def get_company_esg_async(
|
|
1487
|
+
self,
|
|
1488
|
+
*,
|
|
1489
|
+
symbol: str,
|
|
1490
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1491
|
+
server_url: Optional[str] = None,
|
|
1492
|
+
timeout_ms: Optional[int] = None,
|
|
1493
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1494
|
+
) -> models.GetCompanyEsgResponse:
|
|
1495
|
+
r"""Get Company ESG
|
|
1496
|
+
|
|
1497
|
+
Retrieve environmental, social, and governance (ESG) data for a company.
|
|
1498
|
+
|
|
1499
|
+
If set, this operation will use `client_id` from the global security.
|
|
1500
|
+
|
|
1501
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
1502
|
+
:param retries: Override the default retry configuration for this method
|
|
1503
|
+
:param server_url: Override the default server URL for this method
|
|
1504
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1505
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1506
|
+
"""
|
|
1507
|
+
base_url = None
|
|
1508
|
+
url_variables = None
|
|
1509
|
+
if timeout_ms is None:
|
|
1510
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1511
|
+
|
|
1512
|
+
if timeout_ms is None:
|
|
1513
|
+
timeout_ms = 30000
|
|
1514
|
+
|
|
1515
|
+
if server_url is not None:
|
|
1516
|
+
base_url = server_url
|
|
1517
|
+
else:
|
|
1518
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1519
|
+
|
|
1520
|
+
request = models.GetCompanyEsgRequest(
|
|
1521
|
+
symbol=symbol,
|
|
1522
|
+
)
|
|
1523
|
+
|
|
1524
|
+
req = self._build_request_async(
|
|
1525
|
+
method="GET",
|
|
1526
|
+
path="/v1/stock/esg",
|
|
1527
|
+
base_url=base_url,
|
|
1528
|
+
url_variables=url_variables,
|
|
1529
|
+
request=request,
|
|
1530
|
+
request_body_required=False,
|
|
1531
|
+
request_has_path_params=False,
|
|
1532
|
+
request_has_query_params=True,
|
|
1533
|
+
user_agent_header="user-agent",
|
|
1534
|
+
accept_header_value="application/json",
|
|
1535
|
+
http_headers=http_headers,
|
|
1536
|
+
security=self.sdk_configuration.security,
|
|
1537
|
+
allow_empty_value=None,
|
|
1538
|
+
allowed_fields=["client_id"],
|
|
1539
|
+
timeout_ms=timeout_ms,
|
|
1540
|
+
)
|
|
1541
|
+
|
|
1542
|
+
if retries == UNSET:
|
|
1543
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1544
|
+
retries = self.sdk_configuration.retry_config
|
|
1545
|
+
else:
|
|
1546
|
+
retries = utils.RetryConfig(
|
|
1547
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1548
|
+
)
|
|
1549
|
+
|
|
1550
|
+
retry_config = None
|
|
1551
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1552
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1553
|
+
|
|
1554
|
+
http_res = await self.do_request_async(
|
|
1555
|
+
hook_ctx=HookContext(
|
|
1556
|
+
config=self.sdk_configuration,
|
|
1557
|
+
base_url=base_url or "",
|
|
1558
|
+
operation_id="getCompanyEsg",
|
|
1559
|
+
oauth2_scopes=["market:supplemental"],
|
|
1560
|
+
security_source=self.sdk_configuration.security,
|
|
1561
|
+
tags=["Stock Alternative"],
|
|
1562
|
+
extensions=None,
|
|
1563
|
+
),
|
|
1564
|
+
request=req,
|
|
1565
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1566
|
+
retry_config=retry_config,
|
|
1567
|
+
)
|
|
1568
|
+
|
|
1569
|
+
response_data: Any = None
|
|
1570
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1571
|
+
return models.GetCompanyEsgResponse(
|
|
1572
|
+
company_esg_response=unmarshal_json_response(
|
|
1573
|
+
Optional[models.CompanyEsgResponse], http_res
|
|
1574
|
+
),
|
|
1575
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1576
|
+
)
|
|
1577
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1578
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1579
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1580
|
+
request=req, response=http_res
|
|
1581
|
+
)
|
|
1582
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1583
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1584
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1585
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1586
|
+
request=req, response=http_res
|
|
1587
|
+
)
|
|
1588
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1589
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1590
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1591
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1592
|
+
request=req, response=http_res
|
|
1593
|
+
)
|
|
1594
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1595
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1596
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1597
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1598
|
+
request=req, response=http_res
|
|
1599
|
+
)
|
|
1600
|
+
raise errors.NotFound(response_data, http_res)
|
|
1601
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1602
|
+
response_data = unmarshal_json_response(
|
|
1603
|
+
errors.InternalServerErrorUnion, http_res
|
|
1604
|
+
)
|
|
1605
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1606
|
+
request=req, response=http_res
|
|
1607
|
+
)
|
|
1608
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1609
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1610
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1611
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1612
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1613
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1614
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1615
|
+
|
|
1616
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1617
|
+
|
|
1618
|
+
def get_fda_advisory_committee_calendar(
|
|
1619
|
+
self,
|
|
1620
|
+
*,
|
|
1621
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1622
|
+
server_url: Optional[str] = None,
|
|
1623
|
+
timeout_ms: Optional[int] = None,
|
|
1624
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1625
|
+
) -> models.GetFdaAdvisoryCommitteeCalendarResponse:
|
|
1626
|
+
r"""Get FDA Advisory Committee Calendar
|
|
1627
|
+
|
|
1628
|
+
Retrieve FDA advisory committee meeting calendar.
|
|
1629
|
+
|
|
1630
|
+
If set, this operation will use `client_id` from the global security.
|
|
1631
|
+
|
|
1632
|
+
:param retries: Override the default retry configuration for this method
|
|
1633
|
+
:param server_url: Override the default server URL for this method
|
|
1634
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1635
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1636
|
+
"""
|
|
1637
|
+
base_url = None
|
|
1638
|
+
url_variables = None
|
|
1639
|
+
if timeout_ms is None:
|
|
1640
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1641
|
+
|
|
1642
|
+
if timeout_ms is None:
|
|
1643
|
+
timeout_ms = 30000
|
|
1644
|
+
|
|
1645
|
+
if server_url is not None:
|
|
1646
|
+
base_url = server_url
|
|
1647
|
+
else:
|
|
1648
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1649
|
+
req = self._build_request(
|
|
1650
|
+
method="GET",
|
|
1651
|
+
path="/v1/stock/fda-advisory-committee-calendar",
|
|
1652
|
+
base_url=base_url,
|
|
1653
|
+
url_variables=url_variables,
|
|
1654
|
+
request=None,
|
|
1655
|
+
request_body_required=False,
|
|
1656
|
+
request_has_path_params=False,
|
|
1657
|
+
request_has_query_params=True,
|
|
1658
|
+
user_agent_header="user-agent",
|
|
1659
|
+
accept_header_value="application/json",
|
|
1660
|
+
http_headers=http_headers,
|
|
1661
|
+
security=self.sdk_configuration.security,
|
|
1662
|
+
allow_empty_value=None,
|
|
1663
|
+
allowed_fields=["client_id"],
|
|
1664
|
+
timeout_ms=timeout_ms,
|
|
1665
|
+
)
|
|
1666
|
+
|
|
1667
|
+
if retries == UNSET:
|
|
1668
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1669
|
+
retries = self.sdk_configuration.retry_config
|
|
1670
|
+
else:
|
|
1671
|
+
retries = utils.RetryConfig(
|
|
1672
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1673
|
+
)
|
|
1674
|
+
|
|
1675
|
+
retry_config = None
|
|
1676
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1677
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1678
|
+
|
|
1679
|
+
http_res = self.do_request(
|
|
1680
|
+
hook_ctx=HookContext(
|
|
1681
|
+
config=self.sdk_configuration,
|
|
1682
|
+
base_url=base_url or "",
|
|
1683
|
+
operation_id="getFdaAdvisoryCommitteeCalendar",
|
|
1684
|
+
oauth2_scopes=["market:supplemental"],
|
|
1685
|
+
security_source=self.sdk_configuration.security,
|
|
1686
|
+
tags=["Stock Alternative"],
|
|
1687
|
+
extensions=None,
|
|
1688
|
+
),
|
|
1689
|
+
request=req,
|
|
1690
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1691
|
+
retry_config=retry_config,
|
|
1692
|
+
)
|
|
1693
|
+
|
|
1694
|
+
response_data: Any = None
|
|
1695
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1696
|
+
return models.GetFdaAdvisoryCommitteeCalendarResponse(
|
|
1697
|
+
fda_advisory_committee_calendar_response=unmarshal_json_response(
|
|
1698
|
+
Optional[models.FdaAdvisoryCommitteeCalendarResponse], http_res
|
|
1699
|
+
),
|
|
1700
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1701
|
+
)
|
|
1702
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1703
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1704
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1705
|
+
request=req, response=http_res
|
|
1706
|
+
)
|
|
1707
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1708
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1709
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1710
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1711
|
+
request=req, response=http_res
|
|
1712
|
+
)
|
|
1713
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1714
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1715
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1716
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1717
|
+
request=req, response=http_res
|
|
1718
|
+
)
|
|
1719
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1720
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1721
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1722
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1723
|
+
request=req, response=http_res
|
|
1724
|
+
)
|
|
1725
|
+
raise errors.NotFound(response_data, http_res)
|
|
1726
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1727
|
+
response_data = unmarshal_json_response(
|
|
1728
|
+
errors.InternalServerErrorUnion, http_res
|
|
1729
|
+
)
|
|
1730
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1731
|
+
request=req, response=http_res
|
|
1732
|
+
)
|
|
1733
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1734
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1735
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1736
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1737
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1738
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1739
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1740
|
+
|
|
1741
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1742
|
+
|
|
1743
|
+
async def get_fda_advisory_committee_calendar_async(
|
|
1744
|
+
self,
|
|
1745
|
+
*,
|
|
1746
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1747
|
+
server_url: Optional[str] = None,
|
|
1748
|
+
timeout_ms: Optional[int] = None,
|
|
1749
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1750
|
+
) -> models.GetFdaAdvisoryCommitteeCalendarResponse:
|
|
1751
|
+
r"""Get FDA Advisory Committee Calendar
|
|
1752
|
+
|
|
1753
|
+
Retrieve FDA advisory committee meeting calendar.
|
|
1754
|
+
|
|
1755
|
+
If set, this operation will use `client_id` from the global security.
|
|
1756
|
+
|
|
1757
|
+
:param retries: Override the default retry configuration for this method
|
|
1758
|
+
:param server_url: Override the default server URL for this method
|
|
1759
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1760
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1761
|
+
"""
|
|
1762
|
+
base_url = None
|
|
1763
|
+
url_variables = None
|
|
1764
|
+
if timeout_ms is None:
|
|
1765
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1766
|
+
|
|
1767
|
+
if timeout_ms is None:
|
|
1768
|
+
timeout_ms = 30000
|
|
1769
|
+
|
|
1770
|
+
if server_url is not None:
|
|
1771
|
+
base_url = server_url
|
|
1772
|
+
else:
|
|
1773
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1774
|
+
req = self._build_request_async(
|
|
1775
|
+
method="GET",
|
|
1776
|
+
path="/v1/stock/fda-advisory-committee-calendar",
|
|
1777
|
+
base_url=base_url,
|
|
1778
|
+
url_variables=url_variables,
|
|
1779
|
+
request=None,
|
|
1780
|
+
request_body_required=False,
|
|
1781
|
+
request_has_path_params=False,
|
|
1782
|
+
request_has_query_params=True,
|
|
1783
|
+
user_agent_header="user-agent",
|
|
1784
|
+
accept_header_value="application/json",
|
|
1785
|
+
http_headers=http_headers,
|
|
1786
|
+
security=self.sdk_configuration.security,
|
|
1787
|
+
allow_empty_value=None,
|
|
1788
|
+
allowed_fields=["client_id"],
|
|
1789
|
+
timeout_ms=timeout_ms,
|
|
1790
|
+
)
|
|
1791
|
+
|
|
1792
|
+
if retries == UNSET:
|
|
1793
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1794
|
+
retries = self.sdk_configuration.retry_config
|
|
1795
|
+
else:
|
|
1796
|
+
retries = utils.RetryConfig(
|
|
1797
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1798
|
+
)
|
|
1799
|
+
|
|
1800
|
+
retry_config = None
|
|
1801
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1802
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1803
|
+
|
|
1804
|
+
http_res = await self.do_request_async(
|
|
1805
|
+
hook_ctx=HookContext(
|
|
1806
|
+
config=self.sdk_configuration,
|
|
1807
|
+
base_url=base_url or "",
|
|
1808
|
+
operation_id="getFdaAdvisoryCommitteeCalendar",
|
|
1809
|
+
oauth2_scopes=["market:supplemental"],
|
|
1810
|
+
security_source=self.sdk_configuration.security,
|
|
1811
|
+
tags=["Stock Alternative"],
|
|
1812
|
+
extensions=None,
|
|
1813
|
+
),
|
|
1814
|
+
request=req,
|
|
1815
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1816
|
+
retry_config=retry_config,
|
|
1817
|
+
)
|
|
1818
|
+
|
|
1819
|
+
response_data: Any = None
|
|
1820
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1821
|
+
return models.GetFdaAdvisoryCommitteeCalendarResponse(
|
|
1822
|
+
fda_advisory_committee_calendar_response=unmarshal_json_response(
|
|
1823
|
+
Optional[models.FdaAdvisoryCommitteeCalendarResponse], http_res
|
|
1824
|
+
),
|
|
1825
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1826
|
+
)
|
|
1827
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1828
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1829
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1830
|
+
request=req, response=http_res
|
|
1831
|
+
)
|
|
1832
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1833
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1834
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1835
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1836
|
+
request=req, response=http_res
|
|
1837
|
+
)
|
|
1838
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1839
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1840
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1841
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1842
|
+
request=req, response=http_res
|
|
1843
|
+
)
|
|
1844
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1845
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1846
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1847
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1848
|
+
request=req, response=http_res
|
|
1849
|
+
)
|
|
1850
|
+
raise errors.NotFound(response_data, http_res)
|
|
1851
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1852
|
+
response_data = unmarshal_json_response(
|
|
1853
|
+
errors.InternalServerErrorUnion, http_res
|
|
1854
|
+
)
|
|
1855
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1856
|
+
request=req, response=http_res
|
|
1857
|
+
)
|
|
1858
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1859
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1860
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1861
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1862
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1863
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1864
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1865
|
+
|
|
1866
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1867
|
+
|
|
1868
|
+
def get_historical_esg(
|
|
1869
|
+
self,
|
|
1870
|
+
*,
|
|
1871
|
+
symbol: str,
|
|
1872
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1873
|
+
server_url: Optional[str] = None,
|
|
1874
|
+
timeout_ms: Optional[int] = None,
|
|
1875
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1876
|
+
) -> models.GetHistoricalEsgResponse:
|
|
1877
|
+
r"""Get Historical ESG
|
|
1878
|
+
|
|
1879
|
+
Retrieve historical environmental, social, and governance (ESG) data for a company over time.
|
|
1880
|
+
|
|
1881
|
+
If set, this operation will use `client_id` from the global security.
|
|
1882
|
+
|
|
1883
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
1884
|
+
:param retries: Override the default retry configuration for this method
|
|
1885
|
+
:param server_url: Override the default server URL for this method
|
|
1886
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1887
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1888
|
+
"""
|
|
1889
|
+
base_url = None
|
|
1890
|
+
url_variables = None
|
|
1891
|
+
if timeout_ms is None:
|
|
1892
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1893
|
+
|
|
1894
|
+
if timeout_ms is None:
|
|
1895
|
+
timeout_ms = 30000
|
|
1896
|
+
|
|
1897
|
+
if server_url is not None:
|
|
1898
|
+
base_url = server_url
|
|
1899
|
+
else:
|
|
1900
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1901
|
+
|
|
1902
|
+
request = models.GetHistoricalEsgRequest(
|
|
1903
|
+
symbol=symbol,
|
|
1904
|
+
)
|
|
1905
|
+
|
|
1906
|
+
req = self._build_request(
|
|
1907
|
+
method="GET",
|
|
1908
|
+
path="/v1/stock/historical-esg",
|
|
1909
|
+
base_url=base_url,
|
|
1910
|
+
url_variables=url_variables,
|
|
1911
|
+
request=request,
|
|
1912
|
+
request_body_required=False,
|
|
1913
|
+
request_has_path_params=False,
|
|
1914
|
+
request_has_query_params=True,
|
|
1915
|
+
user_agent_header="user-agent",
|
|
1916
|
+
accept_header_value="application/json",
|
|
1917
|
+
http_headers=http_headers,
|
|
1918
|
+
security=self.sdk_configuration.security,
|
|
1919
|
+
allow_empty_value=None,
|
|
1920
|
+
allowed_fields=["client_id"],
|
|
1921
|
+
timeout_ms=timeout_ms,
|
|
1922
|
+
)
|
|
1923
|
+
|
|
1924
|
+
if retries == UNSET:
|
|
1925
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1926
|
+
retries = self.sdk_configuration.retry_config
|
|
1927
|
+
else:
|
|
1928
|
+
retries = utils.RetryConfig(
|
|
1929
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
1930
|
+
)
|
|
1931
|
+
|
|
1932
|
+
retry_config = None
|
|
1933
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1934
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1935
|
+
|
|
1936
|
+
http_res = self.do_request(
|
|
1937
|
+
hook_ctx=HookContext(
|
|
1938
|
+
config=self.sdk_configuration,
|
|
1939
|
+
base_url=base_url or "",
|
|
1940
|
+
operation_id="getHistoricalEsg",
|
|
1941
|
+
oauth2_scopes=["market:supplemental"],
|
|
1942
|
+
security_source=self.sdk_configuration.security,
|
|
1943
|
+
tags=["Stock Alternative"],
|
|
1944
|
+
extensions=None,
|
|
1945
|
+
),
|
|
1946
|
+
request=req,
|
|
1947
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
1948
|
+
retry_config=retry_config,
|
|
1949
|
+
)
|
|
1950
|
+
|
|
1951
|
+
response_data: Any = None
|
|
1952
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1953
|
+
return models.GetHistoricalEsgResponse(
|
|
1954
|
+
historical_esg_response=unmarshal_json_response(
|
|
1955
|
+
Optional[models.HistoricalEsgResponse], http_res
|
|
1956
|
+
),
|
|
1957
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
1958
|
+
)
|
|
1959
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
1960
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
1961
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1962
|
+
request=req, response=http_res
|
|
1963
|
+
)
|
|
1964
|
+
raise errors.BadRequest(response_data, http_res)
|
|
1965
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
1966
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
1967
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1968
|
+
request=req, response=http_res
|
|
1969
|
+
)
|
|
1970
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
1971
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
1972
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
1973
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1974
|
+
request=req, response=http_res
|
|
1975
|
+
)
|
|
1976
|
+
raise errors.Forbidden(response_data, http_res)
|
|
1977
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
1978
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
1979
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1980
|
+
request=req, response=http_res
|
|
1981
|
+
)
|
|
1982
|
+
raise errors.NotFound(response_data, http_res)
|
|
1983
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
1984
|
+
response_data = unmarshal_json_response(
|
|
1985
|
+
errors.InternalServerErrorUnion, http_res
|
|
1986
|
+
)
|
|
1987
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
1988
|
+
request=req, response=http_res
|
|
1989
|
+
)
|
|
1990
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
1991
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1992
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1993
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1994
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1995
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1996
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1997
|
+
|
|
1998
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1999
|
+
|
|
2000
|
+
async def get_historical_esg_async(
|
|
2001
|
+
self,
|
|
2002
|
+
*,
|
|
2003
|
+
symbol: str,
|
|
2004
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2005
|
+
server_url: Optional[str] = None,
|
|
2006
|
+
timeout_ms: Optional[int] = None,
|
|
2007
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2008
|
+
) -> models.GetHistoricalEsgResponse:
|
|
2009
|
+
r"""Get Historical ESG
|
|
2010
|
+
|
|
2011
|
+
Retrieve historical environmental, social, and governance (ESG) data for a company over time.
|
|
2012
|
+
|
|
2013
|
+
If set, this operation will use `client_id` from the global security.
|
|
2014
|
+
|
|
2015
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
2016
|
+
:param retries: Override the default retry configuration for this method
|
|
2017
|
+
:param server_url: Override the default server URL for this method
|
|
2018
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2019
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2020
|
+
"""
|
|
2021
|
+
base_url = None
|
|
2022
|
+
url_variables = None
|
|
2023
|
+
if timeout_ms is None:
|
|
2024
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2025
|
+
|
|
2026
|
+
if timeout_ms is None:
|
|
2027
|
+
timeout_ms = 30000
|
|
2028
|
+
|
|
2029
|
+
if server_url is not None:
|
|
2030
|
+
base_url = server_url
|
|
2031
|
+
else:
|
|
2032
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2033
|
+
|
|
2034
|
+
request = models.GetHistoricalEsgRequest(
|
|
2035
|
+
symbol=symbol,
|
|
2036
|
+
)
|
|
2037
|
+
|
|
2038
|
+
req = self._build_request_async(
|
|
2039
|
+
method="GET",
|
|
2040
|
+
path="/v1/stock/historical-esg",
|
|
2041
|
+
base_url=base_url,
|
|
2042
|
+
url_variables=url_variables,
|
|
2043
|
+
request=request,
|
|
2044
|
+
request_body_required=False,
|
|
2045
|
+
request_has_path_params=False,
|
|
2046
|
+
request_has_query_params=True,
|
|
2047
|
+
user_agent_header="user-agent",
|
|
2048
|
+
accept_header_value="application/json",
|
|
2049
|
+
http_headers=http_headers,
|
|
2050
|
+
security=self.sdk_configuration.security,
|
|
2051
|
+
allow_empty_value=None,
|
|
2052
|
+
allowed_fields=["client_id"],
|
|
2053
|
+
timeout_ms=timeout_ms,
|
|
2054
|
+
)
|
|
2055
|
+
|
|
2056
|
+
if retries == UNSET:
|
|
2057
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2058
|
+
retries = self.sdk_configuration.retry_config
|
|
2059
|
+
else:
|
|
2060
|
+
retries = utils.RetryConfig(
|
|
2061
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2062
|
+
)
|
|
2063
|
+
|
|
2064
|
+
retry_config = None
|
|
2065
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2066
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2067
|
+
|
|
2068
|
+
http_res = await self.do_request_async(
|
|
2069
|
+
hook_ctx=HookContext(
|
|
2070
|
+
config=self.sdk_configuration,
|
|
2071
|
+
base_url=base_url or "",
|
|
2072
|
+
operation_id="getHistoricalEsg",
|
|
2073
|
+
oauth2_scopes=["market:supplemental"],
|
|
2074
|
+
security_source=self.sdk_configuration.security,
|
|
2075
|
+
tags=["Stock Alternative"],
|
|
2076
|
+
extensions=None,
|
|
2077
|
+
),
|
|
2078
|
+
request=req,
|
|
2079
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2080
|
+
retry_config=retry_config,
|
|
2081
|
+
)
|
|
2082
|
+
|
|
2083
|
+
response_data: Any = None
|
|
2084
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2085
|
+
return models.GetHistoricalEsgResponse(
|
|
2086
|
+
historical_esg_response=unmarshal_json_response(
|
|
2087
|
+
Optional[models.HistoricalEsgResponse], http_res
|
|
2088
|
+
),
|
|
2089
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2090
|
+
)
|
|
2091
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2092
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2093
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2094
|
+
request=req, response=http_res
|
|
2095
|
+
)
|
|
2096
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2097
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2098
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2099
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2100
|
+
request=req, response=http_res
|
|
2101
|
+
)
|
|
2102
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2103
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2104
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2105
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2106
|
+
request=req, response=http_res
|
|
2107
|
+
)
|
|
2108
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2109
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2110
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2111
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2112
|
+
request=req, response=http_res
|
|
2113
|
+
)
|
|
2114
|
+
raise errors.NotFound(response_data, http_res)
|
|
2115
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2116
|
+
response_data = unmarshal_json_response(
|
|
2117
|
+
errors.InternalServerErrorUnion, http_res
|
|
2118
|
+
)
|
|
2119
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2120
|
+
request=req, response=http_res
|
|
2121
|
+
)
|
|
2122
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2123
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2124
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2125
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2126
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2127
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2128
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2129
|
+
|
|
2130
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2131
|
+
|
|
2132
|
+
def get_investment_theme(
|
|
2133
|
+
self,
|
|
2134
|
+
*,
|
|
2135
|
+
theme: models.InvestmentThemeID,
|
|
2136
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2137
|
+
server_url: Optional[str] = None,
|
|
2138
|
+
timeout_ms: Optional[int] = None,
|
|
2139
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2140
|
+
) -> models.GetInvestmentThemeResponse:
|
|
2141
|
+
r"""Get Investment Theme
|
|
2142
|
+
|
|
2143
|
+
Retrieve investment theme data by theme name.
|
|
2144
|
+
|
|
2145
|
+
If set, this operation will use `client_id` from the global security.
|
|
2146
|
+
|
|
2147
|
+
:param theme: investment theme identifier. Use the Try it dropdown or the supported values list on the reference page.
|
|
2148
|
+
:param retries: Override the default retry configuration for this method
|
|
2149
|
+
:param server_url: Override the default server URL for this method
|
|
2150
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2151
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2152
|
+
"""
|
|
2153
|
+
base_url = None
|
|
2154
|
+
url_variables = None
|
|
2155
|
+
if timeout_ms is None:
|
|
2156
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2157
|
+
|
|
2158
|
+
if timeout_ms is None:
|
|
2159
|
+
timeout_ms = 30000
|
|
2160
|
+
|
|
2161
|
+
if server_url is not None:
|
|
2162
|
+
base_url = server_url
|
|
2163
|
+
else:
|
|
2164
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2165
|
+
|
|
2166
|
+
request = models.GetInvestmentThemeRequest(
|
|
2167
|
+
theme=theme,
|
|
2168
|
+
)
|
|
2169
|
+
|
|
2170
|
+
req = self._build_request(
|
|
2171
|
+
method="GET",
|
|
2172
|
+
path="/v1/stock/investment-theme",
|
|
2173
|
+
base_url=base_url,
|
|
2174
|
+
url_variables=url_variables,
|
|
2175
|
+
request=request,
|
|
2176
|
+
request_body_required=False,
|
|
2177
|
+
request_has_path_params=False,
|
|
2178
|
+
request_has_query_params=True,
|
|
2179
|
+
user_agent_header="user-agent",
|
|
2180
|
+
accept_header_value="application/json",
|
|
2181
|
+
http_headers=http_headers,
|
|
2182
|
+
security=self.sdk_configuration.security,
|
|
2183
|
+
allow_empty_value=None,
|
|
2184
|
+
allowed_fields=["client_id"],
|
|
2185
|
+
timeout_ms=timeout_ms,
|
|
2186
|
+
)
|
|
2187
|
+
|
|
2188
|
+
if retries == UNSET:
|
|
2189
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2190
|
+
retries = self.sdk_configuration.retry_config
|
|
2191
|
+
else:
|
|
2192
|
+
retries = utils.RetryConfig(
|
|
2193
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2194
|
+
)
|
|
2195
|
+
|
|
2196
|
+
retry_config = None
|
|
2197
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2198
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2199
|
+
|
|
2200
|
+
http_res = self.do_request(
|
|
2201
|
+
hook_ctx=HookContext(
|
|
2202
|
+
config=self.sdk_configuration,
|
|
2203
|
+
base_url=base_url or "",
|
|
2204
|
+
operation_id="getInvestmentTheme",
|
|
2205
|
+
oauth2_scopes=["market:supplemental"],
|
|
2206
|
+
security_source=self.sdk_configuration.security,
|
|
2207
|
+
tags=["Stock Alternative"],
|
|
2208
|
+
extensions=None,
|
|
2209
|
+
),
|
|
2210
|
+
request=req,
|
|
2211
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2212
|
+
retry_config=retry_config,
|
|
2213
|
+
)
|
|
2214
|
+
|
|
2215
|
+
response_data: Any = None
|
|
2216
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2217
|
+
return models.GetInvestmentThemeResponse(
|
|
2218
|
+
investment_theme_response=unmarshal_json_response(
|
|
2219
|
+
Optional[models.InvestmentThemeResponse], http_res
|
|
2220
|
+
),
|
|
2221
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2222
|
+
)
|
|
2223
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2224
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2225
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2226
|
+
request=req, response=http_res
|
|
2227
|
+
)
|
|
2228
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2229
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2230
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2231
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2232
|
+
request=req, response=http_res
|
|
2233
|
+
)
|
|
2234
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2235
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2236
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2237
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2238
|
+
request=req, response=http_res
|
|
2239
|
+
)
|
|
2240
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2241
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2242
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2243
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2244
|
+
request=req, response=http_res
|
|
2245
|
+
)
|
|
2246
|
+
raise errors.NotFound(response_data, http_res)
|
|
2247
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2248
|
+
response_data = unmarshal_json_response(
|
|
2249
|
+
errors.InternalServerErrorUnion, http_res
|
|
2250
|
+
)
|
|
2251
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2252
|
+
request=req, response=http_res
|
|
2253
|
+
)
|
|
2254
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2255
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2256
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2257
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2258
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2259
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2260
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2261
|
+
|
|
2262
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2263
|
+
|
|
2264
|
+
async def get_investment_theme_async(
|
|
2265
|
+
self,
|
|
2266
|
+
*,
|
|
2267
|
+
theme: models.InvestmentThemeID,
|
|
2268
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2269
|
+
server_url: Optional[str] = None,
|
|
2270
|
+
timeout_ms: Optional[int] = None,
|
|
2271
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2272
|
+
) -> models.GetInvestmentThemeResponse:
|
|
2273
|
+
r"""Get Investment Theme
|
|
2274
|
+
|
|
2275
|
+
Retrieve investment theme data by theme name.
|
|
2276
|
+
|
|
2277
|
+
If set, this operation will use `client_id` from the global security.
|
|
2278
|
+
|
|
2279
|
+
:param theme: investment theme identifier. Use the Try it dropdown or the supported values list on the reference page.
|
|
2280
|
+
:param retries: Override the default retry configuration for this method
|
|
2281
|
+
:param server_url: Override the default server URL for this method
|
|
2282
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2283
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2284
|
+
"""
|
|
2285
|
+
base_url = None
|
|
2286
|
+
url_variables = None
|
|
2287
|
+
if timeout_ms is None:
|
|
2288
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2289
|
+
|
|
2290
|
+
if timeout_ms is None:
|
|
2291
|
+
timeout_ms = 30000
|
|
2292
|
+
|
|
2293
|
+
if server_url is not None:
|
|
2294
|
+
base_url = server_url
|
|
2295
|
+
else:
|
|
2296
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2297
|
+
|
|
2298
|
+
request = models.GetInvestmentThemeRequest(
|
|
2299
|
+
theme=theme,
|
|
2300
|
+
)
|
|
2301
|
+
|
|
2302
|
+
req = self._build_request_async(
|
|
2303
|
+
method="GET",
|
|
2304
|
+
path="/v1/stock/investment-theme",
|
|
2305
|
+
base_url=base_url,
|
|
2306
|
+
url_variables=url_variables,
|
|
2307
|
+
request=request,
|
|
2308
|
+
request_body_required=False,
|
|
2309
|
+
request_has_path_params=False,
|
|
2310
|
+
request_has_query_params=True,
|
|
2311
|
+
user_agent_header="user-agent",
|
|
2312
|
+
accept_header_value="application/json",
|
|
2313
|
+
http_headers=http_headers,
|
|
2314
|
+
security=self.sdk_configuration.security,
|
|
2315
|
+
allow_empty_value=None,
|
|
2316
|
+
allowed_fields=["client_id"],
|
|
2317
|
+
timeout_ms=timeout_ms,
|
|
2318
|
+
)
|
|
2319
|
+
|
|
2320
|
+
if retries == UNSET:
|
|
2321
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2322
|
+
retries = self.sdk_configuration.retry_config
|
|
2323
|
+
else:
|
|
2324
|
+
retries = utils.RetryConfig(
|
|
2325
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2326
|
+
)
|
|
2327
|
+
|
|
2328
|
+
retry_config = None
|
|
2329
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2330
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2331
|
+
|
|
2332
|
+
http_res = await self.do_request_async(
|
|
2333
|
+
hook_ctx=HookContext(
|
|
2334
|
+
config=self.sdk_configuration,
|
|
2335
|
+
base_url=base_url or "",
|
|
2336
|
+
operation_id="getInvestmentTheme",
|
|
2337
|
+
oauth2_scopes=["market:supplemental"],
|
|
2338
|
+
security_source=self.sdk_configuration.security,
|
|
2339
|
+
tags=["Stock Alternative"],
|
|
2340
|
+
extensions=None,
|
|
2341
|
+
),
|
|
2342
|
+
request=req,
|
|
2343
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2344
|
+
retry_config=retry_config,
|
|
2345
|
+
)
|
|
2346
|
+
|
|
2347
|
+
response_data: Any = None
|
|
2348
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2349
|
+
return models.GetInvestmentThemeResponse(
|
|
2350
|
+
investment_theme_response=unmarshal_json_response(
|
|
2351
|
+
Optional[models.InvestmentThemeResponse], http_res
|
|
2352
|
+
),
|
|
2353
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2354
|
+
)
|
|
2355
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2356
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2357
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2358
|
+
request=req, response=http_res
|
|
2359
|
+
)
|
|
2360
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2361
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2362
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2363
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2364
|
+
request=req, response=http_res
|
|
2365
|
+
)
|
|
2366
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2367
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2368
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2369
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2370
|
+
request=req, response=http_res
|
|
2371
|
+
)
|
|
2372
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2373
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2374
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2375
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2376
|
+
request=req, response=http_res
|
|
2377
|
+
)
|
|
2378
|
+
raise errors.NotFound(response_data, http_res)
|
|
2379
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2380
|
+
response_data = unmarshal_json_response(
|
|
2381
|
+
errors.InternalServerErrorUnion, http_res
|
|
2382
|
+
)
|
|
2383
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2384
|
+
request=req, response=http_res
|
|
2385
|
+
)
|
|
2386
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2387
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2388
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2389
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2390
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2391
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2392
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2393
|
+
|
|
2394
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2395
|
+
|
|
2396
|
+
def get_lobbying(
|
|
2397
|
+
self,
|
|
2398
|
+
*,
|
|
2399
|
+
symbol: str,
|
|
2400
|
+
from_: date,
|
|
2401
|
+
to: date,
|
|
2402
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2403
|
+
server_url: Optional[str] = None,
|
|
2404
|
+
timeout_ms: Optional[int] = None,
|
|
2405
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2406
|
+
) -> models.GetLobbyingResponse:
|
|
2407
|
+
r"""Get Lobbying
|
|
2408
|
+
|
|
2409
|
+
Retrieve lobbying data for a symbol within a date range.
|
|
2410
|
+
|
|
2411
|
+
If set, this operation will use `client_id` from the global security.
|
|
2412
|
+
|
|
2413
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
2414
|
+
:param from_: Start of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-01-01`).
|
|
2415
|
+
:param to: End of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-12-31`).
|
|
2416
|
+
:param retries: Override the default retry configuration for this method
|
|
2417
|
+
:param server_url: Override the default server URL for this method
|
|
2418
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2419
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2420
|
+
"""
|
|
2421
|
+
base_url = None
|
|
2422
|
+
url_variables = None
|
|
2423
|
+
if timeout_ms is None:
|
|
2424
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2425
|
+
|
|
2426
|
+
if timeout_ms is None:
|
|
2427
|
+
timeout_ms = 30000
|
|
2428
|
+
|
|
2429
|
+
if server_url is not None:
|
|
2430
|
+
base_url = server_url
|
|
2431
|
+
else:
|
|
2432
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2433
|
+
|
|
2434
|
+
request = models.GetLobbyingRequest(
|
|
2435
|
+
symbol=symbol,
|
|
2436
|
+
from_=from_,
|
|
2437
|
+
to=to,
|
|
2438
|
+
)
|
|
2439
|
+
|
|
2440
|
+
req = self._build_request(
|
|
2441
|
+
method="GET",
|
|
2442
|
+
path="/v1/stock/lobbying",
|
|
2443
|
+
base_url=base_url,
|
|
2444
|
+
url_variables=url_variables,
|
|
2445
|
+
request=request,
|
|
2446
|
+
request_body_required=False,
|
|
2447
|
+
request_has_path_params=False,
|
|
2448
|
+
request_has_query_params=True,
|
|
2449
|
+
user_agent_header="user-agent",
|
|
2450
|
+
accept_header_value="application/json",
|
|
2451
|
+
http_headers=http_headers,
|
|
2452
|
+
security=self.sdk_configuration.security,
|
|
2453
|
+
allow_empty_value=None,
|
|
2454
|
+
allowed_fields=["client_id"],
|
|
2455
|
+
timeout_ms=timeout_ms,
|
|
2456
|
+
)
|
|
2457
|
+
|
|
2458
|
+
if retries == UNSET:
|
|
2459
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2460
|
+
retries = self.sdk_configuration.retry_config
|
|
2461
|
+
else:
|
|
2462
|
+
retries = utils.RetryConfig(
|
|
2463
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2464
|
+
)
|
|
2465
|
+
|
|
2466
|
+
retry_config = None
|
|
2467
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2468
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2469
|
+
|
|
2470
|
+
http_res = self.do_request(
|
|
2471
|
+
hook_ctx=HookContext(
|
|
2472
|
+
config=self.sdk_configuration,
|
|
2473
|
+
base_url=base_url or "",
|
|
2474
|
+
operation_id="getLobbying",
|
|
2475
|
+
oauth2_scopes=["market:supplemental"],
|
|
2476
|
+
security_source=self.sdk_configuration.security,
|
|
2477
|
+
tags=["Stock Alternative"],
|
|
2478
|
+
extensions=None,
|
|
2479
|
+
),
|
|
2480
|
+
request=req,
|
|
2481
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2482
|
+
retry_config=retry_config,
|
|
2483
|
+
)
|
|
2484
|
+
|
|
2485
|
+
response_data: Any = None
|
|
2486
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2487
|
+
return models.GetLobbyingResponse(
|
|
2488
|
+
lobbying_response=unmarshal_json_response(
|
|
2489
|
+
Optional[models.LobbyingResponse], http_res
|
|
2490
|
+
),
|
|
2491
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2492
|
+
)
|
|
2493
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2494
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2495
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2496
|
+
request=req, response=http_res
|
|
2497
|
+
)
|
|
2498
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2499
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2500
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2501
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2502
|
+
request=req, response=http_res
|
|
2503
|
+
)
|
|
2504
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2505
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2506
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2507
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2508
|
+
request=req, response=http_res
|
|
2509
|
+
)
|
|
2510
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2511
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2512
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2513
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2514
|
+
request=req, response=http_res
|
|
2515
|
+
)
|
|
2516
|
+
raise errors.NotFound(response_data, http_res)
|
|
2517
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2518
|
+
response_data = unmarshal_json_response(
|
|
2519
|
+
errors.InternalServerErrorUnion, http_res
|
|
2520
|
+
)
|
|
2521
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2522
|
+
request=req, response=http_res
|
|
2523
|
+
)
|
|
2524
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2525
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2526
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2527
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2528
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2529
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2530
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2531
|
+
|
|
2532
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2533
|
+
|
|
2534
|
+
async def get_lobbying_async(
|
|
2535
|
+
self,
|
|
2536
|
+
*,
|
|
2537
|
+
symbol: str,
|
|
2538
|
+
from_: date,
|
|
2539
|
+
to: date,
|
|
2540
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2541
|
+
server_url: Optional[str] = None,
|
|
2542
|
+
timeout_ms: Optional[int] = None,
|
|
2543
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2544
|
+
) -> models.GetLobbyingResponse:
|
|
2545
|
+
r"""Get Lobbying
|
|
2546
|
+
|
|
2547
|
+
Retrieve lobbying data for a symbol within a date range.
|
|
2548
|
+
|
|
2549
|
+
If set, this operation will use `client_id` from the global security.
|
|
2550
|
+
|
|
2551
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
2552
|
+
:param from_: Start of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-01-01`).
|
|
2553
|
+
:param to: End of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-12-31`).
|
|
2554
|
+
:param retries: Override the default retry configuration for this method
|
|
2555
|
+
:param server_url: Override the default server URL for this method
|
|
2556
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2557
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2558
|
+
"""
|
|
2559
|
+
base_url = None
|
|
2560
|
+
url_variables = None
|
|
2561
|
+
if timeout_ms is None:
|
|
2562
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2563
|
+
|
|
2564
|
+
if timeout_ms is None:
|
|
2565
|
+
timeout_ms = 30000
|
|
2566
|
+
|
|
2567
|
+
if server_url is not None:
|
|
2568
|
+
base_url = server_url
|
|
2569
|
+
else:
|
|
2570
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2571
|
+
|
|
2572
|
+
request = models.GetLobbyingRequest(
|
|
2573
|
+
symbol=symbol,
|
|
2574
|
+
from_=from_,
|
|
2575
|
+
to=to,
|
|
2576
|
+
)
|
|
2577
|
+
|
|
2578
|
+
req = self._build_request_async(
|
|
2579
|
+
method="GET",
|
|
2580
|
+
path="/v1/stock/lobbying",
|
|
2581
|
+
base_url=base_url,
|
|
2582
|
+
url_variables=url_variables,
|
|
2583
|
+
request=request,
|
|
2584
|
+
request_body_required=False,
|
|
2585
|
+
request_has_path_params=False,
|
|
2586
|
+
request_has_query_params=True,
|
|
2587
|
+
user_agent_header="user-agent",
|
|
2588
|
+
accept_header_value="application/json",
|
|
2589
|
+
http_headers=http_headers,
|
|
2590
|
+
security=self.sdk_configuration.security,
|
|
2591
|
+
allow_empty_value=None,
|
|
2592
|
+
allowed_fields=["client_id"],
|
|
2593
|
+
timeout_ms=timeout_ms,
|
|
2594
|
+
)
|
|
2595
|
+
|
|
2596
|
+
if retries == UNSET:
|
|
2597
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2598
|
+
retries = self.sdk_configuration.retry_config
|
|
2599
|
+
else:
|
|
2600
|
+
retries = utils.RetryConfig(
|
|
2601
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2602
|
+
)
|
|
2603
|
+
|
|
2604
|
+
retry_config = None
|
|
2605
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2606
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2607
|
+
|
|
2608
|
+
http_res = await self.do_request_async(
|
|
2609
|
+
hook_ctx=HookContext(
|
|
2610
|
+
config=self.sdk_configuration,
|
|
2611
|
+
base_url=base_url or "",
|
|
2612
|
+
operation_id="getLobbying",
|
|
2613
|
+
oauth2_scopes=["market:supplemental"],
|
|
2614
|
+
security_source=self.sdk_configuration.security,
|
|
2615
|
+
tags=["Stock Alternative"],
|
|
2616
|
+
extensions=None,
|
|
2617
|
+
),
|
|
2618
|
+
request=req,
|
|
2619
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2620
|
+
retry_config=retry_config,
|
|
2621
|
+
)
|
|
2622
|
+
|
|
2623
|
+
response_data: Any = None
|
|
2624
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2625
|
+
return models.GetLobbyingResponse(
|
|
2626
|
+
lobbying_response=unmarshal_json_response(
|
|
2627
|
+
Optional[models.LobbyingResponse], http_res
|
|
2628
|
+
),
|
|
2629
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2630
|
+
)
|
|
2631
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2632
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2633
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2634
|
+
request=req, response=http_res
|
|
2635
|
+
)
|
|
2636
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2637
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2638
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2639
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2640
|
+
request=req, response=http_res
|
|
2641
|
+
)
|
|
2642
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2643
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2644
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2645
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2646
|
+
request=req, response=http_res
|
|
2647
|
+
)
|
|
2648
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2649
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2650
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2651
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2652
|
+
request=req, response=http_res
|
|
2653
|
+
)
|
|
2654
|
+
raise errors.NotFound(response_data, http_res)
|
|
2655
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2656
|
+
response_data = unmarshal_json_response(
|
|
2657
|
+
errors.InternalServerErrorUnion, http_res
|
|
2658
|
+
)
|
|
2659
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2660
|
+
request=req, response=http_res
|
|
2661
|
+
)
|
|
2662
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2663
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2664
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2665
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2666
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2667
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2668
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2669
|
+
|
|
2670
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2671
|
+
|
|
2672
|
+
def get_company_presentation(
|
|
2673
|
+
self,
|
|
2674
|
+
*,
|
|
2675
|
+
symbol: str,
|
|
2676
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2677
|
+
server_url: Optional[str] = None,
|
|
2678
|
+
timeout_ms: Optional[int] = None,
|
|
2679
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2680
|
+
) -> models.GetCompanyPresentationResponse:
|
|
2681
|
+
r"""Get Company Presentation
|
|
2682
|
+
|
|
2683
|
+
Retrieve company presentation materials for a symbol.
|
|
2684
|
+
|
|
2685
|
+
If set, this operation will use `client_id` from the global security.
|
|
2686
|
+
|
|
2687
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
2688
|
+
:param retries: Override the default retry configuration for this method
|
|
2689
|
+
:param server_url: Override the default server URL for this method
|
|
2690
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2691
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2692
|
+
"""
|
|
2693
|
+
base_url = None
|
|
2694
|
+
url_variables = None
|
|
2695
|
+
if timeout_ms is None:
|
|
2696
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2697
|
+
|
|
2698
|
+
if timeout_ms is None:
|
|
2699
|
+
timeout_ms = 30000
|
|
2700
|
+
|
|
2701
|
+
if server_url is not None:
|
|
2702
|
+
base_url = server_url
|
|
2703
|
+
else:
|
|
2704
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2705
|
+
|
|
2706
|
+
request = models.GetCompanyPresentationRequest(
|
|
2707
|
+
symbol=symbol,
|
|
2708
|
+
)
|
|
2709
|
+
|
|
2710
|
+
req = self._build_request(
|
|
2711
|
+
method="GET",
|
|
2712
|
+
path="/v1/stock/presentation",
|
|
2713
|
+
base_url=base_url,
|
|
2714
|
+
url_variables=url_variables,
|
|
2715
|
+
request=request,
|
|
2716
|
+
request_body_required=False,
|
|
2717
|
+
request_has_path_params=False,
|
|
2718
|
+
request_has_query_params=True,
|
|
2719
|
+
user_agent_header="user-agent",
|
|
2720
|
+
accept_header_value="application/json",
|
|
2721
|
+
http_headers=http_headers,
|
|
2722
|
+
security=self.sdk_configuration.security,
|
|
2723
|
+
allow_empty_value=None,
|
|
2724
|
+
allowed_fields=["client_id"],
|
|
2725
|
+
timeout_ms=timeout_ms,
|
|
2726
|
+
)
|
|
2727
|
+
|
|
2728
|
+
if retries == UNSET:
|
|
2729
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2730
|
+
retries = self.sdk_configuration.retry_config
|
|
2731
|
+
else:
|
|
2732
|
+
retries = utils.RetryConfig(
|
|
2733
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2734
|
+
)
|
|
2735
|
+
|
|
2736
|
+
retry_config = None
|
|
2737
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2738
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2739
|
+
|
|
2740
|
+
http_res = self.do_request(
|
|
2741
|
+
hook_ctx=HookContext(
|
|
2742
|
+
config=self.sdk_configuration,
|
|
2743
|
+
base_url=base_url or "",
|
|
2744
|
+
operation_id="getCompanyPresentation",
|
|
2745
|
+
oauth2_scopes=["market:supplemental"],
|
|
2746
|
+
security_source=self.sdk_configuration.security,
|
|
2747
|
+
tags=["Stock Alternative"],
|
|
2748
|
+
extensions=None,
|
|
2749
|
+
),
|
|
2750
|
+
request=req,
|
|
2751
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2752
|
+
retry_config=retry_config,
|
|
2753
|
+
)
|
|
2754
|
+
|
|
2755
|
+
response_data: Any = None
|
|
2756
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2757
|
+
return models.GetCompanyPresentationResponse(
|
|
2758
|
+
company_presentation_response=unmarshal_json_response(
|
|
2759
|
+
Optional[models.CompanyPresentationResponse], http_res
|
|
2760
|
+
),
|
|
2761
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2762
|
+
)
|
|
2763
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2764
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2765
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2766
|
+
request=req, response=http_res
|
|
2767
|
+
)
|
|
2768
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2769
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2770
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2771
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2772
|
+
request=req, response=http_res
|
|
2773
|
+
)
|
|
2774
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2775
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2776
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2777
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2778
|
+
request=req, response=http_res
|
|
2779
|
+
)
|
|
2780
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2781
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2782
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2783
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2784
|
+
request=req, response=http_res
|
|
2785
|
+
)
|
|
2786
|
+
raise errors.NotFound(response_data, http_res)
|
|
2787
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2788
|
+
response_data = unmarshal_json_response(
|
|
2789
|
+
errors.InternalServerErrorUnion, http_res
|
|
2790
|
+
)
|
|
2791
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2792
|
+
request=req, response=http_res
|
|
2793
|
+
)
|
|
2794
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2795
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2796
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2797
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2798
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2799
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
2800
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2801
|
+
|
|
2802
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2803
|
+
|
|
2804
|
+
async def get_company_presentation_async(
|
|
2805
|
+
self,
|
|
2806
|
+
*,
|
|
2807
|
+
symbol: str,
|
|
2808
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2809
|
+
server_url: Optional[str] = None,
|
|
2810
|
+
timeout_ms: Optional[int] = None,
|
|
2811
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2812
|
+
) -> models.GetCompanyPresentationResponse:
|
|
2813
|
+
r"""Get Company Presentation
|
|
2814
|
+
|
|
2815
|
+
Retrieve company presentation materials for a symbol.
|
|
2816
|
+
|
|
2817
|
+
If set, this operation will use `client_id` from the global security.
|
|
2818
|
+
|
|
2819
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
2820
|
+
:param retries: Override the default retry configuration for this method
|
|
2821
|
+
:param server_url: Override the default server URL for this method
|
|
2822
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2823
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2824
|
+
"""
|
|
2825
|
+
base_url = None
|
|
2826
|
+
url_variables = None
|
|
2827
|
+
if timeout_ms is None:
|
|
2828
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2829
|
+
|
|
2830
|
+
if timeout_ms is None:
|
|
2831
|
+
timeout_ms = 30000
|
|
2832
|
+
|
|
2833
|
+
if server_url is not None:
|
|
2834
|
+
base_url = server_url
|
|
2835
|
+
else:
|
|
2836
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2837
|
+
|
|
2838
|
+
request = models.GetCompanyPresentationRequest(
|
|
2839
|
+
symbol=symbol,
|
|
2840
|
+
)
|
|
2841
|
+
|
|
2842
|
+
req = self._build_request_async(
|
|
2843
|
+
method="GET",
|
|
2844
|
+
path="/v1/stock/presentation",
|
|
2845
|
+
base_url=base_url,
|
|
2846
|
+
url_variables=url_variables,
|
|
2847
|
+
request=request,
|
|
2848
|
+
request_body_required=False,
|
|
2849
|
+
request_has_path_params=False,
|
|
2850
|
+
request_has_query_params=True,
|
|
2851
|
+
user_agent_header="user-agent",
|
|
2852
|
+
accept_header_value="application/json",
|
|
2853
|
+
http_headers=http_headers,
|
|
2854
|
+
security=self.sdk_configuration.security,
|
|
2855
|
+
allow_empty_value=None,
|
|
2856
|
+
allowed_fields=["client_id"],
|
|
2857
|
+
timeout_ms=timeout_ms,
|
|
2858
|
+
)
|
|
2859
|
+
|
|
2860
|
+
if retries == UNSET:
|
|
2861
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2862
|
+
retries = self.sdk_configuration.retry_config
|
|
2863
|
+
else:
|
|
2864
|
+
retries = utils.RetryConfig(
|
|
2865
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
2866
|
+
)
|
|
2867
|
+
|
|
2868
|
+
retry_config = None
|
|
2869
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2870
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2871
|
+
|
|
2872
|
+
http_res = await self.do_request_async(
|
|
2873
|
+
hook_ctx=HookContext(
|
|
2874
|
+
config=self.sdk_configuration,
|
|
2875
|
+
base_url=base_url or "",
|
|
2876
|
+
operation_id="getCompanyPresentation",
|
|
2877
|
+
oauth2_scopes=["market:supplemental"],
|
|
2878
|
+
security_source=self.sdk_configuration.security,
|
|
2879
|
+
tags=["Stock Alternative"],
|
|
2880
|
+
extensions=None,
|
|
2881
|
+
),
|
|
2882
|
+
request=req,
|
|
2883
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
2884
|
+
retry_config=retry_config,
|
|
2885
|
+
)
|
|
2886
|
+
|
|
2887
|
+
response_data: Any = None
|
|
2888
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2889
|
+
return models.GetCompanyPresentationResponse(
|
|
2890
|
+
company_presentation_response=unmarshal_json_response(
|
|
2891
|
+
Optional[models.CompanyPresentationResponse], http_res
|
|
2892
|
+
),
|
|
2893
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
2894
|
+
)
|
|
2895
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
2896
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
2897
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2898
|
+
request=req, response=http_res
|
|
2899
|
+
)
|
|
2900
|
+
raise errors.BadRequest(response_data, http_res)
|
|
2901
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
2902
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
2903
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2904
|
+
request=req, response=http_res
|
|
2905
|
+
)
|
|
2906
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
2907
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
2908
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
2909
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2910
|
+
request=req, response=http_res
|
|
2911
|
+
)
|
|
2912
|
+
raise errors.Forbidden(response_data, http_res)
|
|
2913
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
2914
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
2915
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2916
|
+
request=req, response=http_res
|
|
2917
|
+
)
|
|
2918
|
+
raise errors.NotFound(response_data, http_res)
|
|
2919
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
2920
|
+
response_data = unmarshal_json_response(
|
|
2921
|
+
errors.InternalServerErrorUnion, http_res
|
|
2922
|
+
)
|
|
2923
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
2924
|
+
request=req, response=http_res
|
|
2925
|
+
)
|
|
2926
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
2927
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2928
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2929
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2930
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2931
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2932
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2933
|
+
|
|
2934
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2935
|
+
|
|
2936
|
+
def get_social_sentiment(
|
|
2937
|
+
self,
|
|
2938
|
+
*,
|
|
2939
|
+
symbol: str,
|
|
2940
|
+
from_: Optional[date] = None,
|
|
2941
|
+
to: Optional[date] = None,
|
|
2942
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2943
|
+
server_url: Optional[str] = None,
|
|
2944
|
+
timeout_ms: Optional[int] = None,
|
|
2945
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2946
|
+
) -> models.GetSocialSentimentResponse:
|
|
2947
|
+
r"""Get Social Sentiment
|
|
2948
|
+
|
|
2949
|
+
Retrieve social media sentiment metrics for a symbol.
|
|
2950
|
+
|
|
2951
|
+
If set, this operation will use `client_id` from the global security.
|
|
2952
|
+
|
|
2953
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
2954
|
+
:param from_: Start of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-01-01`).
|
|
2955
|
+
:param to: End of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-12-31`).
|
|
2956
|
+
:param retries: Override the default retry configuration for this method
|
|
2957
|
+
:param server_url: Override the default server URL for this method
|
|
2958
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2959
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2960
|
+
"""
|
|
2961
|
+
base_url = None
|
|
2962
|
+
url_variables = None
|
|
2963
|
+
if timeout_ms is None:
|
|
2964
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2965
|
+
|
|
2966
|
+
if timeout_ms is None:
|
|
2967
|
+
timeout_ms = 30000
|
|
2968
|
+
|
|
2969
|
+
if server_url is not None:
|
|
2970
|
+
base_url = server_url
|
|
2971
|
+
else:
|
|
2972
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2973
|
+
|
|
2974
|
+
request = models.GetSocialSentimentRequest(
|
|
2975
|
+
symbol=symbol,
|
|
2976
|
+
from_=from_,
|
|
2977
|
+
to=to,
|
|
2978
|
+
)
|
|
2979
|
+
|
|
2980
|
+
req = self._build_request(
|
|
2981
|
+
method="GET",
|
|
2982
|
+
path="/v1/stock/social-sentiment",
|
|
2983
|
+
base_url=base_url,
|
|
2984
|
+
url_variables=url_variables,
|
|
2985
|
+
request=request,
|
|
2986
|
+
request_body_required=False,
|
|
2987
|
+
request_has_path_params=False,
|
|
2988
|
+
request_has_query_params=True,
|
|
2989
|
+
user_agent_header="user-agent",
|
|
2990
|
+
accept_header_value="application/json",
|
|
2991
|
+
http_headers=http_headers,
|
|
2992
|
+
security=self.sdk_configuration.security,
|
|
2993
|
+
allow_empty_value=None,
|
|
2994
|
+
allowed_fields=["client_id"],
|
|
2995
|
+
timeout_ms=timeout_ms,
|
|
2996
|
+
)
|
|
2997
|
+
|
|
2998
|
+
if retries == UNSET:
|
|
2999
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
3000
|
+
retries = self.sdk_configuration.retry_config
|
|
3001
|
+
else:
|
|
3002
|
+
retries = utils.RetryConfig(
|
|
3003
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
3004
|
+
)
|
|
3005
|
+
|
|
3006
|
+
retry_config = None
|
|
3007
|
+
if isinstance(retries, utils.RetryConfig):
|
|
3008
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
3009
|
+
|
|
3010
|
+
http_res = self.do_request(
|
|
3011
|
+
hook_ctx=HookContext(
|
|
3012
|
+
config=self.sdk_configuration,
|
|
3013
|
+
base_url=base_url or "",
|
|
3014
|
+
operation_id="getSocialSentiment",
|
|
3015
|
+
oauth2_scopes=["market:supplemental"],
|
|
3016
|
+
security_source=self.sdk_configuration.security,
|
|
3017
|
+
tags=["Stock Alternative"],
|
|
3018
|
+
extensions=None,
|
|
3019
|
+
),
|
|
3020
|
+
request=req,
|
|
3021
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
3022
|
+
retry_config=retry_config,
|
|
3023
|
+
)
|
|
3024
|
+
|
|
3025
|
+
response_data: Any = None
|
|
3026
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
3027
|
+
return models.GetSocialSentimentResponse(
|
|
3028
|
+
social_sentiment_response=unmarshal_json_response(
|
|
3029
|
+
Optional[models.SocialSentimentResponse], http_res
|
|
3030
|
+
),
|
|
3031
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
3032
|
+
)
|
|
3033
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
3034
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
3035
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3036
|
+
request=req, response=http_res
|
|
3037
|
+
)
|
|
3038
|
+
raise errors.BadRequest(response_data, http_res)
|
|
3039
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
3040
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
3041
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3042
|
+
request=req, response=http_res
|
|
3043
|
+
)
|
|
3044
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3045
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3046
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3047
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3048
|
+
request=req, response=http_res
|
|
3049
|
+
)
|
|
3050
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3051
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3052
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3053
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3054
|
+
request=req, response=http_res
|
|
3055
|
+
)
|
|
3056
|
+
raise errors.NotFound(response_data, http_res)
|
|
3057
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3058
|
+
response_data = unmarshal_json_response(
|
|
3059
|
+
errors.InternalServerErrorUnion, http_res
|
|
3060
|
+
)
|
|
3061
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3062
|
+
request=req, response=http_res
|
|
3063
|
+
)
|
|
3064
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3065
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3066
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3067
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3068
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3069
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3070
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3071
|
+
|
|
3072
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
3073
|
+
|
|
3074
|
+
async def get_social_sentiment_async(
|
|
3075
|
+
self,
|
|
3076
|
+
*,
|
|
3077
|
+
symbol: str,
|
|
3078
|
+
from_: Optional[date] = None,
|
|
3079
|
+
to: Optional[date] = None,
|
|
3080
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
3081
|
+
server_url: Optional[str] = None,
|
|
3082
|
+
timeout_ms: Optional[int] = None,
|
|
3083
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
3084
|
+
) -> models.GetSocialSentimentResponse:
|
|
3085
|
+
r"""Get Social Sentiment
|
|
3086
|
+
|
|
3087
|
+
Retrieve social media sentiment metrics for a symbol.
|
|
3088
|
+
|
|
3089
|
+
If set, this operation will use `client_id` from the global security.
|
|
3090
|
+
|
|
3091
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
3092
|
+
:param from_: Start of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-01-01`).
|
|
3093
|
+
:param to: End of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-12-31`).
|
|
3094
|
+
:param retries: Override the default retry configuration for this method
|
|
3095
|
+
:param server_url: Override the default server URL for this method
|
|
3096
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
3097
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
3098
|
+
"""
|
|
3099
|
+
base_url = None
|
|
3100
|
+
url_variables = None
|
|
3101
|
+
if timeout_ms is None:
|
|
3102
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
3103
|
+
|
|
3104
|
+
if timeout_ms is None:
|
|
3105
|
+
timeout_ms = 30000
|
|
3106
|
+
|
|
3107
|
+
if server_url is not None:
|
|
3108
|
+
base_url = server_url
|
|
3109
|
+
else:
|
|
3110
|
+
base_url = self._get_url(base_url, url_variables)
|
|
3111
|
+
|
|
3112
|
+
request = models.GetSocialSentimentRequest(
|
|
3113
|
+
symbol=symbol,
|
|
3114
|
+
from_=from_,
|
|
3115
|
+
to=to,
|
|
3116
|
+
)
|
|
3117
|
+
|
|
3118
|
+
req = self._build_request_async(
|
|
3119
|
+
method="GET",
|
|
3120
|
+
path="/v1/stock/social-sentiment",
|
|
3121
|
+
base_url=base_url,
|
|
3122
|
+
url_variables=url_variables,
|
|
3123
|
+
request=request,
|
|
3124
|
+
request_body_required=False,
|
|
3125
|
+
request_has_path_params=False,
|
|
3126
|
+
request_has_query_params=True,
|
|
3127
|
+
user_agent_header="user-agent",
|
|
3128
|
+
accept_header_value="application/json",
|
|
3129
|
+
http_headers=http_headers,
|
|
3130
|
+
security=self.sdk_configuration.security,
|
|
3131
|
+
allow_empty_value=None,
|
|
3132
|
+
allowed_fields=["client_id"],
|
|
3133
|
+
timeout_ms=timeout_ms,
|
|
3134
|
+
)
|
|
3135
|
+
|
|
3136
|
+
if retries == UNSET:
|
|
3137
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
3138
|
+
retries = self.sdk_configuration.retry_config
|
|
3139
|
+
else:
|
|
3140
|
+
retries = utils.RetryConfig(
|
|
3141
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
3142
|
+
)
|
|
3143
|
+
|
|
3144
|
+
retry_config = None
|
|
3145
|
+
if isinstance(retries, utils.RetryConfig):
|
|
3146
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
3147
|
+
|
|
3148
|
+
http_res = await self.do_request_async(
|
|
3149
|
+
hook_ctx=HookContext(
|
|
3150
|
+
config=self.sdk_configuration,
|
|
3151
|
+
base_url=base_url or "",
|
|
3152
|
+
operation_id="getSocialSentiment",
|
|
3153
|
+
oauth2_scopes=["market:supplemental"],
|
|
3154
|
+
security_source=self.sdk_configuration.security,
|
|
3155
|
+
tags=["Stock Alternative"],
|
|
3156
|
+
extensions=None,
|
|
3157
|
+
),
|
|
3158
|
+
request=req,
|
|
3159
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
3160
|
+
retry_config=retry_config,
|
|
3161
|
+
)
|
|
3162
|
+
|
|
3163
|
+
response_data: Any = None
|
|
3164
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
3165
|
+
return models.GetSocialSentimentResponse(
|
|
3166
|
+
social_sentiment_response=unmarshal_json_response(
|
|
3167
|
+
Optional[models.SocialSentimentResponse], http_res
|
|
3168
|
+
),
|
|
3169
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
3170
|
+
)
|
|
3171
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
3172
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
3173
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3174
|
+
request=req, response=http_res
|
|
3175
|
+
)
|
|
3176
|
+
raise errors.BadRequest(response_data, http_res)
|
|
3177
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
3178
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
3179
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3180
|
+
request=req, response=http_res
|
|
3181
|
+
)
|
|
3182
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3183
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3184
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3185
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3186
|
+
request=req, response=http_res
|
|
3187
|
+
)
|
|
3188
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3189
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3190
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3191
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3192
|
+
request=req, response=http_res
|
|
3193
|
+
)
|
|
3194
|
+
raise errors.NotFound(response_data, http_res)
|
|
3195
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3196
|
+
response_data = unmarshal_json_response(
|
|
3197
|
+
errors.InternalServerErrorUnion, http_res
|
|
3198
|
+
)
|
|
3199
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3200
|
+
request=req, response=http_res
|
|
3201
|
+
)
|
|
3202
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3203
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3204
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3205
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3206
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3207
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3208
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3209
|
+
|
|
3210
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
3211
|
+
|
|
3212
|
+
def get_supply_chain(
|
|
3213
|
+
self,
|
|
3214
|
+
*,
|
|
3215
|
+
symbol: str,
|
|
3216
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
3217
|
+
server_url: Optional[str] = None,
|
|
3218
|
+
timeout_ms: Optional[int] = None,
|
|
3219
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
3220
|
+
) -> models.GetSupplyChainResponse:
|
|
3221
|
+
r"""Get Supply Chain
|
|
3222
|
+
|
|
3223
|
+
Retrieve supply chain data for a symbol.
|
|
3224
|
+
|
|
3225
|
+
If set, this operation will use `client_id` from the global security.
|
|
3226
|
+
|
|
3227
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
3228
|
+
:param retries: Override the default retry configuration for this method
|
|
3229
|
+
:param server_url: Override the default server URL for this method
|
|
3230
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
3231
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
3232
|
+
"""
|
|
3233
|
+
base_url = None
|
|
3234
|
+
url_variables = None
|
|
3235
|
+
if timeout_ms is None:
|
|
3236
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
3237
|
+
|
|
3238
|
+
if timeout_ms is None:
|
|
3239
|
+
timeout_ms = 30000
|
|
3240
|
+
|
|
3241
|
+
if server_url is not None:
|
|
3242
|
+
base_url = server_url
|
|
3243
|
+
else:
|
|
3244
|
+
base_url = self._get_url(base_url, url_variables)
|
|
3245
|
+
|
|
3246
|
+
request = models.GetSupplyChainRequest(
|
|
3247
|
+
symbol=symbol,
|
|
3248
|
+
)
|
|
3249
|
+
|
|
3250
|
+
req = self._build_request(
|
|
3251
|
+
method="GET",
|
|
3252
|
+
path="/v1/stock/supply-chain",
|
|
3253
|
+
base_url=base_url,
|
|
3254
|
+
url_variables=url_variables,
|
|
3255
|
+
request=request,
|
|
3256
|
+
request_body_required=False,
|
|
3257
|
+
request_has_path_params=False,
|
|
3258
|
+
request_has_query_params=True,
|
|
3259
|
+
user_agent_header="user-agent",
|
|
3260
|
+
accept_header_value="application/json",
|
|
3261
|
+
http_headers=http_headers,
|
|
3262
|
+
security=self.sdk_configuration.security,
|
|
3263
|
+
allow_empty_value=None,
|
|
3264
|
+
allowed_fields=["client_id"],
|
|
3265
|
+
timeout_ms=timeout_ms,
|
|
3266
|
+
)
|
|
3267
|
+
|
|
3268
|
+
if retries == UNSET:
|
|
3269
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
3270
|
+
retries = self.sdk_configuration.retry_config
|
|
3271
|
+
else:
|
|
3272
|
+
retries = utils.RetryConfig(
|
|
3273
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
3274
|
+
)
|
|
3275
|
+
|
|
3276
|
+
retry_config = None
|
|
3277
|
+
if isinstance(retries, utils.RetryConfig):
|
|
3278
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
3279
|
+
|
|
3280
|
+
http_res = self.do_request(
|
|
3281
|
+
hook_ctx=HookContext(
|
|
3282
|
+
config=self.sdk_configuration,
|
|
3283
|
+
base_url=base_url or "",
|
|
3284
|
+
operation_id="getSupplyChain",
|
|
3285
|
+
oauth2_scopes=["market:supplemental"],
|
|
3286
|
+
security_source=self.sdk_configuration.security,
|
|
3287
|
+
tags=["Stock Alternative"],
|
|
3288
|
+
extensions=None,
|
|
3289
|
+
),
|
|
3290
|
+
request=req,
|
|
3291
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
3292
|
+
retry_config=retry_config,
|
|
3293
|
+
)
|
|
3294
|
+
|
|
3295
|
+
response_data: Any = None
|
|
3296
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
3297
|
+
return models.GetSupplyChainResponse(
|
|
3298
|
+
supply_chain_response=unmarshal_json_response(
|
|
3299
|
+
Optional[models.SupplyChainResponse], http_res
|
|
3300
|
+
),
|
|
3301
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
3302
|
+
)
|
|
3303
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
3304
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
3305
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3306
|
+
request=req, response=http_res
|
|
3307
|
+
)
|
|
3308
|
+
raise errors.BadRequest(response_data, http_res)
|
|
3309
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
3310
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
3311
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3312
|
+
request=req, response=http_res
|
|
3313
|
+
)
|
|
3314
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3315
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3316
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3317
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3318
|
+
request=req, response=http_res
|
|
3319
|
+
)
|
|
3320
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3321
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3322
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3323
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3324
|
+
request=req, response=http_res
|
|
3325
|
+
)
|
|
3326
|
+
raise errors.NotFound(response_data, http_res)
|
|
3327
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3328
|
+
response_data = unmarshal_json_response(
|
|
3329
|
+
errors.InternalServerErrorUnion, http_res
|
|
3330
|
+
)
|
|
3331
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3332
|
+
request=req, response=http_res
|
|
3333
|
+
)
|
|
3334
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3335
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3336
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3337
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3338
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3339
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3340
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3341
|
+
|
|
3342
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
3343
|
+
|
|
3344
|
+
async def get_supply_chain_async(
|
|
3345
|
+
self,
|
|
3346
|
+
*,
|
|
3347
|
+
symbol: str,
|
|
3348
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
3349
|
+
server_url: Optional[str] = None,
|
|
3350
|
+
timeout_ms: Optional[int] = None,
|
|
3351
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
3352
|
+
) -> models.GetSupplyChainResponse:
|
|
3353
|
+
r"""Get Supply Chain
|
|
3354
|
+
|
|
3355
|
+
Retrieve supply chain data for a symbol.
|
|
3356
|
+
|
|
3357
|
+
If set, this operation will use `client_id` from the global security.
|
|
3358
|
+
|
|
3359
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
3360
|
+
:param retries: Override the default retry configuration for this method
|
|
3361
|
+
:param server_url: Override the default server URL for this method
|
|
3362
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
3363
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
3364
|
+
"""
|
|
3365
|
+
base_url = None
|
|
3366
|
+
url_variables = None
|
|
3367
|
+
if timeout_ms is None:
|
|
3368
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
3369
|
+
|
|
3370
|
+
if timeout_ms is None:
|
|
3371
|
+
timeout_ms = 30000
|
|
3372
|
+
|
|
3373
|
+
if server_url is not None:
|
|
3374
|
+
base_url = server_url
|
|
3375
|
+
else:
|
|
3376
|
+
base_url = self._get_url(base_url, url_variables)
|
|
3377
|
+
|
|
3378
|
+
request = models.GetSupplyChainRequest(
|
|
3379
|
+
symbol=symbol,
|
|
3380
|
+
)
|
|
3381
|
+
|
|
3382
|
+
req = self._build_request_async(
|
|
3383
|
+
method="GET",
|
|
3384
|
+
path="/v1/stock/supply-chain",
|
|
3385
|
+
base_url=base_url,
|
|
3386
|
+
url_variables=url_variables,
|
|
3387
|
+
request=request,
|
|
3388
|
+
request_body_required=False,
|
|
3389
|
+
request_has_path_params=False,
|
|
3390
|
+
request_has_query_params=True,
|
|
3391
|
+
user_agent_header="user-agent",
|
|
3392
|
+
accept_header_value="application/json",
|
|
3393
|
+
http_headers=http_headers,
|
|
3394
|
+
security=self.sdk_configuration.security,
|
|
3395
|
+
allow_empty_value=None,
|
|
3396
|
+
allowed_fields=["client_id"],
|
|
3397
|
+
timeout_ms=timeout_ms,
|
|
3398
|
+
)
|
|
3399
|
+
|
|
3400
|
+
if retries == UNSET:
|
|
3401
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
3402
|
+
retries = self.sdk_configuration.retry_config
|
|
3403
|
+
else:
|
|
3404
|
+
retries = utils.RetryConfig(
|
|
3405
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
3406
|
+
)
|
|
3407
|
+
|
|
3408
|
+
retry_config = None
|
|
3409
|
+
if isinstance(retries, utils.RetryConfig):
|
|
3410
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
3411
|
+
|
|
3412
|
+
http_res = await self.do_request_async(
|
|
3413
|
+
hook_ctx=HookContext(
|
|
3414
|
+
config=self.sdk_configuration,
|
|
3415
|
+
base_url=base_url or "",
|
|
3416
|
+
operation_id="getSupplyChain",
|
|
3417
|
+
oauth2_scopes=["market:supplemental"],
|
|
3418
|
+
security_source=self.sdk_configuration.security,
|
|
3419
|
+
tags=["Stock Alternative"],
|
|
3420
|
+
extensions=None,
|
|
3421
|
+
),
|
|
3422
|
+
request=req,
|
|
3423
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
3424
|
+
retry_config=retry_config,
|
|
3425
|
+
)
|
|
3426
|
+
|
|
3427
|
+
response_data: Any = None
|
|
3428
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
3429
|
+
return models.GetSupplyChainResponse(
|
|
3430
|
+
supply_chain_response=unmarshal_json_response(
|
|
3431
|
+
Optional[models.SupplyChainResponse], http_res
|
|
3432
|
+
),
|
|
3433
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
3434
|
+
)
|
|
3435
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
3436
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
3437
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3438
|
+
request=req, response=http_res
|
|
3439
|
+
)
|
|
3440
|
+
raise errors.BadRequest(response_data, http_res)
|
|
3441
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
3442
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
3443
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3444
|
+
request=req, response=http_res
|
|
3445
|
+
)
|
|
3446
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3447
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3448
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3449
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3450
|
+
request=req, response=http_res
|
|
3451
|
+
)
|
|
3452
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3453
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3454
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3455
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3456
|
+
request=req, response=http_res
|
|
3457
|
+
)
|
|
3458
|
+
raise errors.NotFound(response_data, http_res)
|
|
3459
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3460
|
+
response_data = unmarshal_json_response(
|
|
3461
|
+
errors.InternalServerErrorUnion, http_res
|
|
3462
|
+
)
|
|
3463
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3464
|
+
request=req, response=http_res
|
|
3465
|
+
)
|
|
3466
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3467
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3468
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3469
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3470
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3471
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3472
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3473
|
+
|
|
3474
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
3475
|
+
|
|
3476
|
+
def get_transcript(
|
|
3477
|
+
self,
|
|
3478
|
+
*,
|
|
3479
|
+
id: str,
|
|
3480
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
3481
|
+
server_url: Optional[str] = None,
|
|
3482
|
+
timeout_ms: Optional[int] = None,
|
|
3483
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
3484
|
+
) -> models.GetTranscriptResponse:
|
|
3485
|
+
r"""Get Transcript by ID
|
|
3486
|
+
|
|
3487
|
+
Retrieve a single earnings call transcript by ID.
|
|
3488
|
+
|
|
3489
|
+
If set, this operation will use `client_id` from the global security.
|
|
3490
|
+
|
|
3491
|
+
:param id: Unique identifier for an earnings-call transcript. Obtain it from `/v1/stock/transcripts/list` for the symbol you want.
|
|
3492
|
+
:param retries: Override the default retry configuration for this method
|
|
3493
|
+
:param server_url: Override the default server URL for this method
|
|
3494
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
3495
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
3496
|
+
"""
|
|
3497
|
+
base_url = None
|
|
3498
|
+
url_variables = None
|
|
3499
|
+
if timeout_ms is None:
|
|
3500
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
3501
|
+
|
|
3502
|
+
if timeout_ms is None:
|
|
3503
|
+
timeout_ms = 30000
|
|
3504
|
+
|
|
3505
|
+
if server_url is not None:
|
|
3506
|
+
base_url = server_url
|
|
3507
|
+
else:
|
|
3508
|
+
base_url = self._get_url(base_url, url_variables)
|
|
3509
|
+
|
|
3510
|
+
request = models.GetTranscriptRequest(
|
|
3511
|
+
id=id,
|
|
3512
|
+
)
|
|
3513
|
+
|
|
3514
|
+
req = self._build_request(
|
|
3515
|
+
method="GET",
|
|
3516
|
+
path="/v1/stock/transcripts",
|
|
3517
|
+
base_url=base_url,
|
|
3518
|
+
url_variables=url_variables,
|
|
3519
|
+
request=request,
|
|
3520
|
+
request_body_required=False,
|
|
3521
|
+
request_has_path_params=False,
|
|
3522
|
+
request_has_query_params=True,
|
|
3523
|
+
user_agent_header="user-agent",
|
|
3524
|
+
accept_header_value="application/json",
|
|
3525
|
+
http_headers=http_headers,
|
|
3526
|
+
security=self.sdk_configuration.security,
|
|
3527
|
+
allow_empty_value=None,
|
|
3528
|
+
allowed_fields=["client_id"],
|
|
3529
|
+
timeout_ms=timeout_ms,
|
|
3530
|
+
)
|
|
3531
|
+
|
|
3532
|
+
if retries == UNSET:
|
|
3533
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
3534
|
+
retries = self.sdk_configuration.retry_config
|
|
3535
|
+
else:
|
|
3536
|
+
retries = utils.RetryConfig(
|
|
3537
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
3538
|
+
)
|
|
3539
|
+
|
|
3540
|
+
retry_config = None
|
|
3541
|
+
if isinstance(retries, utils.RetryConfig):
|
|
3542
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
3543
|
+
|
|
3544
|
+
http_res = self.do_request(
|
|
3545
|
+
hook_ctx=HookContext(
|
|
3546
|
+
config=self.sdk_configuration,
|
|
3547
|
+
base_url=base_url or "",
|
|
3548
|
+
operation_id="getTranscript",
|
|
3549
|
+
oauth2_scopes=["market:supplemental"],
|
|
3550
|
+
security_source=self.sdk_configuration.security,
|
|
3551
|
+
tags=["Stock Alternative"],
|
|
3552
|
+
extensions=None,
|
|
3553
|
+
),
|
|
3554
|
+
request=req,
|
|
3555
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
3556
|
+
retry_config=retry_config,
|
|
3557
|
+
)
|
|
3558
|
+
|
|
3559
|
+
response_data: Any = None
|
|
3560
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
3561
|
+
return models.GetTranscriptResponse(
|
|
3562
|
+
transcript_response=unmarshal_json_response(
|
|
3563
|
+
Optional[models.TranscriptResponse], http_res
|
|
3564
|
+
),
|
|
3565
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
3566
|
+
)
|
|
3567
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
3568
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
3569
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3570
|
+
request=req, response=http_res
|
|
3571
|
+
)
|
|
3572
|
+
raise errors.BadRequest(response_data, http_res)
|
|
3573
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
3574
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
3575
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3576
|
+
request=req, response=http_res
|
|
3577
|
+
)
|
|
3578
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3579
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3580
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3581
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3582
|
+
request=req, response=http_res
|
|
3583
|
+
)
|
|
3584
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3585
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3586
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3587
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3588
|
+
request=req, response=http_res
|
|
3589
|
+
)
|
|
3590
|
+
raise errors.NotFound(response_data, http_res)
|
|
3591
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3592
|
+
response_data = unmarshal_json_response(
|
|
3593
|
+
errors.InternalServerErrorUnion, http_res
|
|
3594
|
+
)
|
|
3595
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3596
|
+
request=req, response=http_res
|
|
3597
|
+
)
|
|
3598
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3599
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3600
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3601
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3602
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3603
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3604
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3605
|
+
|
|
3606
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
3607
|
+
|
|
3608
|
+
async def get_transcript_async(
|
|
3609
|
+
self,
|
|
3610
|
+
*,
|
|
3611
|
+
id: str,
|
|
3612
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
3613
|
+
server_url: Optional[str] = None,
|
|
3614
|
+
timeout_ms: Optional[int] = None,
|
|
3615
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
3616
|
+
) -> models.GetTranscriptResponse:
|
|
3617
|
+
r"""Get Transcript by ID
|
|
3618
|
+
|
|
3619
|
+
Retrieve a single earnings call transcript by ID.
|
|
3620
|
+
|
|
3621
|
+
If set, this operation will use `client_id` from the global security.
|
|
3622
|
+
|
|
3623
|
+
:param id: Unique identifier for an earnings-call transcript. Obtain it from `/v1/stock/transcripts/list` for the symbol you want.
|
|
3624
|
+
:param retries: Override the default retry configuration for this method
|
|
3625
|
+
:param server_url: Override the default server URL for this method
|
|
3626
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
3627
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
3628
|
+
"""
|
|
3629
|
+
base_url = None
|
|
3630
|
+
url_variables = None
|
|
3631
|
+
if timeout_ms is None:
|
|
3632
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
3633
|
+
|
|
3634
|
+
if timeout_ms is None:
|
|
3635
|
+
timeout_ms = 30000
|
|
3636
|
+
|
|
3637
|
+
if server_url is not None:
|
|
3638
|
+
base_url = server_url
|
|
3639
|
+
else:
|
|
3640
|
+
base_url = self._get_url(base_url, url_variables)
|
|
3641
|
+
|
|
3642
|
+
request = models.GetTranscriptRequest(
|
|
3643
|
+
id=id,
|
|
3644
|
+
)
|
|
3645
|
+
|
|
3646
|
+
req = self._build_request_async(
|
|
3647
|
+
method="GET",
|
|
3648
|
+
path="/v1/stock/transcripts",
|
|
3649
|
+
base_url=base_url,
|
|
3650
|
+
url_variables=url_variables,
|
|
3651
|
+
request=request,
|
|
3652
|
+
request_body_required=False,
|
|
3653
|
+
request_has_path_params=False,
|
|
3654
|
+
request_has_query_params=True,
|
|
3655
|
+
user_agent_header="user-agent",
|
|
3656
|
+
accept_header_value="application/json",
|
|
3657
|
+
http_headers=http_headers,
|
|
3658
|
+
security=self.sdk_configuration.security,
|
|
3659
|
+
allow_empty_value=None,
|
|
3660
|
+
allowed_fields=["client_id"],
|
|
3661
|
+
timeout_ms=timeout_ms,
|
|
3662
|
+
)
|
|
3663
|
+
|
|
3664
|
+
if retries == UNSET:
|
|
3665
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
3666
|
+
retries = self.sdk_configuration.retry_config
|
|
3667
|
+
else:
|
|
3668
|
+
retries = utils.RetryConfig(
|
|
3669
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
3670
|
+
)
|
|
3671
|
+
|
|
3672
|
+
retry_config = None
|
|
3673
|
+
if isinstance(retries, utils.RetryConfig):
|
|
3674
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
3675
|
+
|
|
3676
|
+
http_res = await self.do_request_async(
|
|
3677
|
+
hook_ctx=HookContext(
|
|
3678
|
+
config=self.sdk_configuration,
|
|
3679
|
+
base_url=base_url or "",
|
|
3680
|
+
operation_id="getTranscript",
|
|
3681
|
+
oauth2_scopes=["market:supplemental"],
|
|
3682
|
+
security_source=self.sdk_configuration.security,
|
|
3683
|
+
tags=["Stock Alternative"],
|
|
3684
|
+
extensions=None,
|
|
3685
|
+
),
|
|
3686
|
+
request=req,
|
|
3687
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
3688
|
+
retry_config=retry_config,
|
|
3689
|
+
)
|
|
3690
|
+
|
|
3691
|
+
response_data: Any = None
|
|
3692
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
3693
|
+
return models.GetTranscriptResponse(
|
|
3694
|
+
transcript_response=unmarshal_json_response(
|
|
3695
|
+
Optional[models.TranscriptResponse], http_res
|
|
3696
|
+
),
|
|
3697
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
3698
|
+
)
|
|
3699
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
3700
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
3701
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3702
|
+
request=req, response=http_res
|
|
3703
|
+
)
|
|
3704
|
+
raise errors.BadRequest(response_data, http_res)
|
|
3705
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
3706
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
3707
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3708
|
+
request=req, response=http_res
|
|
3709
|
+
)
|
|
3710
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3711
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3712
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3713
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3714
|
+
request=req, response=http_res
|
|
3715
|
+
)
|
|
3716
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3717
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3718
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3719
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3720
|
+
request=req, response=http_res
|
|
3721
|
+
)
|
|
3722
|
+
raise errors.NotFound(response_data, http_res)
|
|
3723
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3724
|
+
response_data = unmarshal_json_response(
|
|
3725
|
+
errors.InternalServerErrorUnion, http_res
|
|
3726
|
+
)
|
|
3727
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3728
|
+
request=req, response=http_res
|
|
3729
|
+
)
|
|
3730
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3731
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3732
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3733
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3734
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3735
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3736
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3737
|
+
|
|
3738
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
3739
|
+
|
|
3740
|
+
def list_transcripts(
|
|
3741
|
+
self,
|
|
3742
|
+
*,
|
|
3743
|
+
symbol: str,
|
|
3744
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
3745
|
+
server_url: Optional[str] = None,
|
|
3746
|
+
timeout_ms: Optional[int] = None,
|
|
3747
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
3748
|
+
) -> models.ListTranscriptsResponse:
|
|
3749
|
+
r"""Get Transcripts List
|
|
3750
|
+
|
|
3751
|
+
Retrieve a list of available earnings call transcripts for a symbol.
|
|
3752
|
+
|
|
3753
|
+
If set, this operation will use `client_id` from the global security.
|
|
3754
|
+
|
|
3755
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
3756
|
+
:param retries: Override the default retry configuration for this method
|
|
3757
|
+
:param server_url: Override the default server URL for this method
|
|
3758
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
3759
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
3760
|
+
"""
|
|
3761
|
+
base_url = None
|
|
3762
|
+
url_variables = None
|
|
3763
|
+
if timeout_ms is None:
|
|
3764
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
3765
|
+
|
|
3766
|
+
if timeout_ms is None:
|
|
3767
|
+
timeout_ms = 30000
|
|
3768
|
+
|
|
3769
|
+
if server_url is not None:
|
|
3770
|
+
base_url = server_url
|
|
3771
|
+
else:
|
|
3772
|
+
base_url = self._get_url(base_url, url_variables)
|
|
3773
|
+
|
|
3774
|
+
request = models.ListTranscriptsRequest(
|
|
3775
|
+
symbol=symbol,
|
|
3776
|
+
)
|
|
3777
|
+
|
|
3778
|
+
req = self._build_request(
|
|
3779
|
+
method="GET",
|
|
3780
|
+
path="/v1/stock/transcripts/list",
|
|
3781
|
+
base_url=base_url,
|
|
3782
|
+
url_variables=url_variables,
|
|
3783
|
+
request=request,
|
|
3784
|
+
request_body_required=False,
|
|
3785
|
+
request_has_path_params=False,
|
|
3786
|
+
request_has_query_params=True,
|
|
3787
|
+
user_agent_header="user-agent",
|
|
3788
|
+
accept_header_value="application/json",
|
|
3789
|
+
http_headers=http_headers,
|
|
3790
|
+
security=self.sdk_configuration.security,
|
|
3791
|
+
allow_empty_value=None,
|
|
3792
|
+
allowed_fields=["client_id"],
|
|
3793
|
+
timeout_ms=timeout_ms,
|
|
3794
|
+
)
|
|
3795
|
+
|
|
3796
|
+
if retries == UNSET:
|
|
3797
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
3798
|
+
retries = self.sdk_configuration.retry_config
|
|
3799
|
+
else:
|
|
3800
|
+
retries = utils.RetryConfig(
|
|
3801
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
3802
|
+
)
|
|
3803
|
+
|
|
3804
|
+
retry_config = None
|
|
3805
|
+
if isinstance(retries, utils.RetryConfig):
|
|
3806
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
3807
|
+
|
|
3808
|
+
http_res = self.do_request(
|
|
3809
|
+
hook_ctx=HookContext(
|
|
3810
|
+
config=self.sdk_configuration,
|
|
3811
|
+
base_url=base_url or "",
|
|
3812
|
+
operation_id="listTranscripts",
|
|
3813
|
+
oauth2_scopes=["market:supplemental"],
|
|
3814
|
+
security_source=self.sdk_configuration.security,
|
|
3815
|
+
tags=["Stock Alternative"],
|
|
3816
|
+
extensions=None,
|
|
3817
|
+
),
|
|
3818
|
+
request=req,
|
|
3819
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
3820
|
+
retry_config=retry_config,
|
|
3821
|
+
)
|
|
3822
|
+
|
|
3823
|
+
response_data: Any = None
|
|
3824
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
3825
|
+
return models.ListTranscriptsResponse(
|
|
3826
|
+
transcripts_response=unmarshal_json_response(
|
|
3827
|
+
Optional[models.TranscriptsResponse], http_res
|
|
3828
|
+
),
|
|
3829
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
3830
|
+
)
|
|
3831
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
3832
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
3833
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3834
|
+
request=req, response=http_res
|
|
3835
|
+
)
|
|
3836
|
+
raise errors.BadRequest(response_data, http_res)
|
|
3837
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
3838
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
3839
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3840
|
+
request=req, response=http_res
|
|
3841
|
+
)
|
|
3842
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3843
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3844
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3845
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3846
|
+
request=req, response=http_res
|
|
3847
|
+
)
|
|
3848
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3849
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3850
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3851
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3852
|
+
request=req, response=http_res
|
|
3853
|
+
)
|
|
3854
|
+
raise errors.NotFound(response_data, http_res)
|
|
3855
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3856
|
+
response_data = unmarshal_json_response(
|
|
3857
|
+
errors.InternalServerErrorUnion, http_res
|
|
3858
|
+
)
|
|
3859
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3860
|
+
request=req, response=http_res
|
|
3861
|
+
)
|
|
3862
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3863
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3864
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3865
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3866
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3867
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
3868
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3869
|
+
|
|
3870
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
3871
|
+
|
|
3872
|
+
async def list_transcripts_async(
|
|
3873
|
+
self,
|
|
3874
|
+
*,
|
|
3875
|
+
symbol: str,
|
|
3876
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
3877
|
+
server_url: Optional[str] = None,
|
|
3878
|
+
timeout_ms: Optional[int] = None,
|
|
3879
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
3880
|
+
) -> models.ListTranscriptsResponse:
|
|
3881
|
+
r"""Get Transcripts List
|
|
3882
|
+
|
|
3883
|
+
Retrieve a list of available earnings call transcripts for a symbol.
|
|
3884
|
+
|
|
3885
|
+
If set, this operation will use `client_id` from the global security.
|
|
3886
|
+
|
|
3887
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
3888
|
+
:param retries: Override the default retry configuration for this method
|
|
3889
|
+
:param server_url: Override the default server URL for this method
|
|
3890
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
3891
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
3892
|
+
"""
|
|
3893
|
+
base_url = None
|
|
3894
|
+
url_variables = None
|
|
3895
|
+
if timeout_ms is None:
|
|
3896
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
3897
|
+
|
|
3898
|
+
if timeout_ms is None:
|
|
3899
|
+
timeout_ms = 30000
|
|
3900
|
+
|
|
3901
|
+
if server_url is not None:
|
|
3902
|
+
base_url = server_url
|
|
3903
|
+
else:
|
|
3904
|
+
base_url = self._get_url(base_url, url_variables)
|
|
3905
|
+
|
|
3906
|
+
request = models.ListTranscriptsRequest(
|
|
3907
|
+
symbol=symbol,
|
|
3908
|
+
)
|
|
3909
|
+
|
|
3910
|
+
req = self._build_request_async(
|
|
3911
|
+
method="GET",
|
|
3912
|
+
path="/v1/stock/transcripts/list",
|
|
3913
|
+
base_url=base_url,
|
|
3914
|
+
url_variables=url_variables,
|
|
3915
|
+
request=request,
|
|
3916
|
+
request_body_required=False,
|
|
3917
|
+
request_has_path_params=False,
|
|
3918
|
+
request_has_query_params=True,
|
|
3919
|
+
user_agent_header="user-agent",
|
|
3920
|
+
accept_header_value="application/json",
|
|
3921
|
+
http_headers=http_headers,
|
|
3922
|
+
security=self.sdk_configuration.security,
|
|
3923
|
+
allow_empty_value=None,
|
|
3924
|
+
allowed_fields=["client_id"],
|
|
3925
|
+
timeout_ms=timeout_ms,
|
|
3926
|
+
)
|
|
3927
|
+
|
|
3928
|
+
if retries == UNSET:
|
|
3929
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
3930
|
+
retries = self.sdk_configuration.retry_config
|
|
3931
|
+
else:
|
|
3932
|
+
retries = utils.RetryConfig(
|
|
3933
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
3934
|
+
)
|
|
3935
|
+
|
|
3936
|
+
retry_config = None
|
|
3937
|
+
if isinstance(retries, utils.RetryConfig):
|
|
3938
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
3939
|
+
|
|
3940
|
+
http_res = await self.do_request_async(
|
|
3941
|
+
hook_ctx=HookContext(
|
|
3942
|
+
config=self.sdk_configuration,
|
|
3943
|
+
base_url=base_url or "",
|
|
3944
|
+
operation_id="listTranscripts",
|
|
3945
|
+
oauth2_scopes=["market:supplemental"],
|
|
3946
|
+
security_source=self.sdk_configuration.security,
|
|
3947
|
+
tags=["Stock Alternative"],
|
|
3948
|
+
extensions=None,
|
|
3949
|
+
),
|
|
3950
|
+
request=req,
|
|
3951
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
3952
|
+
retry_config=retry_config,
|
|
3953
|
+
)
|
|
3954
|
+
|
|
3955
|
+
response_data: Any = None
|
|
3956
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
3957
|
+
return models.ListTranscriptsResponse(
|
|
3958
|
+
transcripts_response=unmarshal_json_response(
|
|
3959
|
+
Optional[models.TranscriptsResponse], http_res
|
|
3960
|
+
),
|
|
3961
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
3962
|
+
)
|
|
3963
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
3964
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
3965
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3966
|
+
request=req, response=http_res
|
|
3967
|
+
)
|
|
3968
|
+
raise errors.BadRequest(response_data, http_res)
|
|
3969
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
3970
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
3971
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3972
|
+
request=req, response=http_res
|
|
3973
|
+
)
|
|
3974
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
3975
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
3976
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
3977
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3978
|
+
request=req, response=http_res
|
|
3979
|
+
)
|
|
3980
|
+
raise errors.Forbidden(response_data, http_res)
|
|
3981
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
3982
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
3983
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3984
|
+
request=req, response=http_res
|
|
3985
|
+
)
|
|
3986
|
+
raise errors.NotFound(response_data, http_res)
|
|
3987
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
3988
|
+
response_data = unmarshal_json_response(
|
|
3989
|
+
errors.InternalServerErrorUnion, http_res
|
|
3990
|
+
)
|
|
3991
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
3992
|
+
request=req, response=http_res
|
|
3993
|
+
)
|
|
3994
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
3995
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
3996
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
3997
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
3998
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
3999
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
4000
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
4001
|
+
|
|
4002
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
4003
|
+
|
|
4004
|
+
def get_usa_spending(
|
|
4005
|
+
self,
|
|
4006
|
+
*,
|
|
4007
|
+
symbol: str,
|
|
4008
|
+
from_: date,
|
|
4009
|
+
to: date,
|
|
4010
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
4011
|
+
server_url: Optional[str] = None,
|
|
4012
|
+
timeout_ms: Optional[int] = None,
|
|
4013
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
4014
|
+
) -> models.GetUsaSpendingResponse:
|
|
4015
|
+
r"""Get USA Spending
|
|
4016
|
+
|
|
4017
|
+
Retrieve USA spending data for a symbol within a date range.
|
|
4018
|
+
|
|
4019
|
+
If set, this operation will use `client_id` from the global security.
|
|
4020
|
+
|
|
4021
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
4022
|
+
:param from_: Start of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-01-01`).
|
|
4023
|
+
:param to: End of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-12-31`).
|
|
4024
|
+
:param retries: Override the default retry configuration for this method
|
|
4025
|
+
:param server_url: Override the default server URL for this method
|
|
4026
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
4027
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
4028
|
+
"""
|
|
4029
|
+
base_url = None
|
|
4030
|
+
url_variables = None
|
|
4031
|
+
if timeout_ms is None:
|
|
4032
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
4033
|
+
|
|
4034
|
+
if timeout_ms is None:
|
|
4035
|
+
timeout_ms = 30000
|
|
4036
|
+
|
|
4037
|
+
if server_url is not None:
|
|
4038
|
+
base_url = server_url
|
|
4039
|
+
else:
|
|
4040
|
+
base_url = self._get_url(base_url, url_variables)
|
|
4041
|
+
|
|
4042
|
+
request = models.GetUsaSpendingRequest(
|
|
4043
|
+
symbol=symbol,
|
|
4044
|
+
from_=from_,
|
|
4045
|
+
to=to,
|
|
4046
|
+
)
|
|
4047
|
+
|
|
4048
|
+
req = self._build_request(
|
|
4049
|
+
method="GET",
|
|
4050
|
+
path="/v1/stock/usa-spending",
|
|
4051
|
+
base_url=base_url,
|
|
4052
|
+
url_variables=url_variables,
|
|
4053
|
+
request=request,
|
|
4054
|
+
request_body_required=False,
|
|
4055
|
+
request_has_path_params=False,
|
|
4056
|
+
request_has_query_params=True,
|
|
4057
|
+
user_agent_header="user-agent",
|
|
4058
|
+
accept_header_value="application/json",
|
|
4059
|
+
http_headers=http_headers,
|
|
4060
|
+
security=self.sdk_configuration.security,
|
|
4061
|
+
allow_empty_value=None,
|
|
4062
|
+
allowed_fields=["client_id"],
|
|
4063
|
+
timeout_ms=timeout_ms,
|
|
4064
|
+
)
|
|
4065
|
+
|
|
4066
|
+
if retries == UNSET:
|
|
4067
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
4068
|
+
retries = self.sdk_configuration.retry_config
|
|
4069
|
+
else:
|
|
4070
|
+
retries = utils.RetryConfig(
|
|
4071
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
4072
|
+
)
|
|
4073
|
+
|
|
4074
|
+
retry_config = None
|
|
4075
|
+
if isinstance(retries, utils.RetryConfig):
|
|
4076
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
4077
|
+
|
|
4078
|
+
http_res = self.do_request(
|
|
4079
|
+
hook_ctx=HookContext(
|
|
4080
|
+
config=self.sdk_configuration,
|
|
4081
|
+
base_url=base_url or "",
|
|
4082
|
+
operation_id="getUsaSpending",
|
|
4083
|
+
oauth2_scopes=["market:supplemental"],
|
|
4084
|
+
security_source=self.sdk_configuration.security,
|
|
4085
|
+
tags=["Stock Alternative"],
|
|
4086
|
+
extensions=None,
|
|
4087
|
+
),
|
|
4088
|
+
request=req,
|
|
4089
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
4090
|
+
retry_config=retry_config,
|
|
4091
|
+
)
|
|
4092
|
+
|
|
4093
|
+
response_data: Any = None
|
|
4094
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
4095
|
+
return models.GetUsaSpendingResponse(
|
|
4096
|
+
usa_spending_response=unmarshal_json_response(
|
|
4097
|
+
Optional[models.UsaSpendingResponse], http_res
|
|
4098
|
+
),
|
|
4099
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
4100
|
+
)
|
|
4101
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
4102
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
4103
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4104
|
+
request=req, response=http_res
|
|
4105
|
+
)
|
|
4106
|
+
raise errors.BadRequest(response_data, http_res)
|
|
4107
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
4108
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
4109
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4110
|
+
request=req, response=http_res
|
|
4111
|
+
)
|
|
4112
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
4113
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
4114
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
4115
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4116
|
+
request=req, response=http_res
|
|
4117
|
+
)
|
|
4118
|
+
raise errors.Forbidden(response_data, http_res)
|
|
4119
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
4120
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
4121
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4122
|
+
request=req, response=http_res
|
|
4123
|
+
)
|
|
4124
|
+
raise errors.NotFound(response_data, http_res)
|
|
4125
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
4126
|
+
response_data = unmarshal_json_response(
|
|
4127
|
+
errors.InternalServerErrorUnion, http_res
|
|
4128
|
+
)
|
|
4129
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4130
|
+
request=req, response=http_res
|
|
4131
|
+
)
|
|
4132
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
4133
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
4134
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
4135
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
4136
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
4137
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
4138
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
4139
|
+
|
|
4140
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
4141
|
+
|
|
4142
|
+
async def get_usa_spending_async(
|
|
4143
|
+
self,
|
|
4144
|
+
*,
|
|
4145
|
+
symbol: str,
|
|
4146
|
+
from_: date,
|
|
4147
|
+
to: date,
|
|
4148
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
4149
|
+
server_url: Optional[str] = None,
|
|
4150
|
+
timeout_ms: Optional[int] = None,
|
|
4151
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
4152
|
+
) -> models.GetUsaSpendingResponse:
|
|
4153
|
+
r"""Get USA Spending
|
|
4154
|
+
|
|
4155
|
+
Retrieve USA spending data for a symbol within a date range.
|
|
4156
|
+
|
|
4157
|
+
If set, this operation will use `client_id` from the global security.
|
|
4158
|
+
|
|
4159
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
4160
|
+
:param from_: Start of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-01-01`).
|
|
4161
|
+
:param to: End of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-12-31`).
|
|
4162
|
+
:param retries: Override the default retry configuration for this method
|
|
4163
|
+
:param server_url: Override the default server URL for this method
|
|
4164
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
4165
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
4166
|
+
"""
|
|
4167
|
+
base_url = None
|
|
4168
|
+
url_variables = None
|
|
4169
|
+
if timeout_ms is None:
|
|
4170
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
4171
|
+
|
|
4172
|
+
if timeout_ms is None:
|
|
4173
|
+
timeout_ms = 30000
|
|
4174
|
+
|
|
4175
|
+
if server_url is not None:
|
|
4176
|
+
base_url = server_url
|
|
4177
|
+
else:
|
|
4178
|
+
base_url = self._get_url(base_url, url_variables)
|
|
4179
|
+
|
|
4180
|
+
request = models.GetUsaSpendingRequest(
|
|
4181
|
+
symbol=symbol,
|
|
4182
|
+
from_=from_,
|
|
4183
|
+
to=to,
|
|
4184
|
+
)
|
|
4185
|
+
|
|
4186
|
+
req = self._build_request_async(
|
|
4187
|
+
method="GET",
|
|
4188
|
+
path="/v1/stock/usa-spending",
|
|
4189
|
+
base_url=base_url,
|
|
4190
|
+
url_variables=url_variables,
|
|
4191
|
+
request=request,
|
|
4192
|
+
request_body_required=False,
|
|
4193
|
+
request_has_path_params=False,
|
|
4194
|
+
request_has_query_params=True,
|
|
4195
|
+
user_agent_header="user-agent",
|
|
4196
|
+
accept_header_value="application/json",
|
|
4197
|
+
http_headers=http_headers,
|
|
4198
|
+
security=self.sdk_configuration.security,
|
|
4199
|
+
allow_empty_value=None,
|
|
4200
|
+
allowed_fields=["client_id"],
|
|
4201
|
+
timeout_ms=timeout_ms,
|
|
4202
|
+
)
|
|
4203
|
+
|
|
4204
|
+
if retries == UNSET:
|
|
4205
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
4206
|
+
retries = self.sdk_configuration.retry_config
|
|
4207
|
+
else:
|
|
4208
|
+
retries = utils.RetryConfig(
|
|
4209
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
4210
|
+
)
|
|
4211
|
+
|
|
4212
|
+
retry_config = None
|
|
4213
|
+
if isinstance(retries, utils.RetryConfig):
|
|
4214
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
4215
|
+
|
|
4216
|
+
http_res = await self.do_request_async(
|
|
4217
|
+
hook_ctx=HookContext(
|
|
4218
|
+
config=self.sdk_configuration,
|
|
4219
|
+
base_url=base_url or "",
|
|
4220
|
+
operation_id="getUsaSpending",
|
|
4221
|
+
oauth2_scopes=["market:supplemental"],
|
|
4222
|
+
security_source=self.sdk_configuration.security,
|
|
4223
|
+
tags=["Stock Alternative"],
|
|
4224
|
+
extensions=None,
|
|
4225
|
+
),
|
|
4226
|
+
request=req,
|
|
4227
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
4228
|
+
retry_config=retry_config,
|
|
4229
|
+
)
|
|
4230
|
+
|
|
4231
|
+
response_data: Any = None
|
|
4232
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
4233
|
+
return models.GetUsaSpendingResponse(
|
|
4234
|
+
usa_spending_response=unmarshal_json_response(
|
|
4235
|
+
Optional[models.UsaSpendingResponse], http_res
|
|
4236
|
+
),
|
|
4237
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
4238
|
+
)
|
|
4239
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
4240
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
4241
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4242
|
+
request=req, response=http_res
|
|
4243
|
+
)
|
|
4244
|
+
raise errors.BadRequest(response_data, http_res)
|
|
4245
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
4246
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
4247
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4248
|
+
request=req, response=http_res
|
|
4249
|
+
)
|
|
4250
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
4251
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
4252
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
4253
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4254
|
+
request=req, response=http_res
|
|
4255
|
+
)
|
|
4256
|
+
raise errors.Forbidden(response_data, http_res)
|
|
4257
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
4258
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
4259
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4260
|
+
request=req, response=http_res
|
|
4261
|
+
)
|
|
4262
|
+
raise errors.NotFound(response_data, http_res)
|
|
4263
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
4264
|
+
response_data = unmarshal_json_response(
|
|
4265
|
+
errors.InternalServerErrorUnion, http_res
|
|
4266
|
+
)
|
|
4267
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4268
|
+
request=req, response=http_res
|
|
4269
|
+
)
|
|
4270
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
4271
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
4272
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
4273
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
4274
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
4275
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
4276
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
4277
|
+
|
|
4278
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
4279
|
+
|
|
4280
|
+
def get_uspto_patents(
|
|
4281
|
+
self,
|
|
4282
|
+
*,
|
|
4283
|
+
symbol: str,
|
|
4284
|
+
from_: date,
|
|
4285
|
+
to: date,
|
|
4286
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
4287
|
+
server_url: Optional[str] = None,
|
|
4288
|
+
timeout_ms: Optional[int] = None,
|
|
4289
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
4290
|
+
) -> models.GetUsptoPatentsResponse:
|
|
4291
|
+
r"""Get USPTO Patent
|
|
4292
|
+
|
|
4293
|
+
Retrieve USPTO patent data for a symbol within a date range.
|
|
4294
|
+
|
|
4295
|
+
If set, this operation will use `client_id` from the global security.
|
|
4296
|
+
|
|
4297
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
4298
|
+
:param from_: Start of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-01-01`).
|
|
4299
|
+
:param to: End of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-12-31`).
|
|
4300
|
+
:param retries: Override the default retry configuration for this method
|
|
4301
|
+
:param server_url: Override the default server URL for this method
|
|
4302
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
4303
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
4304
|
+
"""
|
|
4305
|
+
base_url = None
|
|
4306
|
+
url_variables = None
|
|
4307
|
+
if timeout_ms is None:
|
|
4308
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
4309
|
+
|
|
4310
|
+
if timeout_ms is None:
|
|
4311
|
+
timeout_ms = 30000
|
|
4312
|
+
|
|
4313
|
+
if server_url is not None:
|
|
4314
|
+
base_url = server_url
|
|
4315
|
+
else:
|
|
4316
|
+
base_url = self._get_url(base_url, url_variables)
|
|
4317
|
+
|
|
4318
|
+
request = models.GetUsptoPatentsRequest(
|
|
4319
|
+
symbol=symbol,
|
|
4320
|
+
from_=from_,
|
|
4321
|
+
to=to,
|
|
4322
|
+
)
|
|
4323
|
+
|
|
4324
|
+
req = self._build_request(
|
|
4325
|
+
method="GET",
|
|
4326
|
+
path="/v1/stock/uspto-patent",
|
|
4327
|
+
base_url=base_url,
|
|
4328
|
+
url_variables=url_variables,
|
|
4329
|
+
request=request,
|
|
4330
|
+
request_body_required=False,
|
|
4331
|
+
request_has_path_params=False,
|
|
4332
|
+
request_has_query_params=True,
|
|
4333
|
+
user_agent_header="user-agent",
|
|
4334
|
+
accept_header_value="application/json",
|
|
4335
|
+
http_headers=http_headers,
|
|
4336
|
+
security=self.sdk_configuration.security,
|
|
4337
|
+
allow_empty_value=None,
|
|
4338
|
+
allowed_fields=["client_id"],
|
|
4339
|
+
timeout_ms=timeout_ms,
|
|
4340
|
+
)
|
|
4341
|
+
|
|
4342
|
+
if retries == UNSET:
|
|
4343
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
4344
|
+
retries = self.sdk_configuration.retry_config
|
|
4345
|
+
else:
|
|
4346
|
+
retries = utils.RetryConfig(
|
|
4347
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
4348
|
+
)
|
|
4349
|
+
|
|
4350
|
+
retry_config = None
|
|
4351
|
+
if isinstance(retries, utils.RetryConfig):
|
|
4352
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
4353
|
+
|
|
4354
|
+
http_res = self.do_request(
|
|
4355
|
+
hook_ctx=HookContext(
|
|
4356
|
+
config=self.sdk_configuration,
|
|
4357
|
+
base_url=base_url or "",
|
|
4358
|
+
operation_id="getUsptoPatents",
|
|
4359
|
+
oauth2_scopes=["market:supplemental"],
|
|
4360
|
+
security_source=self.sdk_configuration.security,
|
|
4361
|
+
tags=["Stock Alternative"],
|
|
4362
|
+
extensions=None,
|
|
4363
|
+
),
|
|
4364
|
+
request=req,
|
|
4365
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
4366
|
+
retry_config=retry_config,
|
|
4367
|
+
)
|
|
4368
|
+
|
|
4369
|
+
response_data: Any = None
|
|
4370
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
4371
|
+
return models.GetUsptoPatentsResponse(
|
|
4372
|
+
uspto_patents_response=unmarshal_json_response(
|
|
4373
|
+
Optional[models.UsptoPatentsResponse], http_res
|
|
4374
|
+
),
|
|
4375
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
4376
|
+
)
|
|
4377
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
4378
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
4379
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4380
|
+
request=req, response=http_res
|
|
4381
|
+
)
|
|
4382
|
+
raise errors.BadRequest(response_data, http_res)
|
|
4383
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
4384
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
4385
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4386
|
+
request=req, response=http_res
|
|
4387
|
+
)
|
|
4388
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
4389
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
4390
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
4391
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4392
|
+
request=req, response=http_res
|
|
4393
|
+
)
|
|
4394
|
+
raise errors.Forbidden(response_data, http_res)
|
|
4395
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
4396
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
4397
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4398
|
+
request=req, response=http_res
|
|
4399
|
+
)
|
|
4400
|
+
raise errors.NotFound(response_data, http_res)
|
|
4401
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
4402
|
+
response_data = unmarshal_json_response(
|
|
4403
|
+
errors.InternalServerErrorUnion, http_res
|
|
4404
|
+
)
|
|
4405
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4406
|
+
request=req, response=http_res
|
|
4407
|
+
)
|
|
4408
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
4409
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
4410
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
4411
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
4412
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
4413
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
4414
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
4415
|
+
|
|
4416
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
4417
|
+
|
|
4418
|
+
async def get_uspto_patents_async(
|
|
4419
|
+
self,
|
|
4420
|
+
*,
|
|
4421
|
+
symbol: str,
|
|
4422
|
+
from_: date,
|
|
4423
|
+
to: date,
|
|
4424
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
4425
|
+
server_url: Optional[str] = None,
|
|
4426
|
+
timeout_ms: Optional[int] = None,
|
|
4427
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
4428
|
+
) -> models.GetUsptoPatentsResponse:
|
|
4429
|
+
r"""Get USPTO Patent
|
|
4430
|
+
|
|
4431
|
+
Retrieve USPTO patent data for a symbol within a date range.
|
|
4432
|
+
|
|
4433
|
+
If set, this operation will use `client_id` from the global security.
|
|
4434
|
+
|
|
4435
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
4436
|
+
:param from_: Start of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-01-01`).
|
|
4437
|
+
:param to: End of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-12-31`).
|
|
4438
|
+
:param retries: Override the default retry configuration for this method
|
|
4439
|
+
:param server_url: Override the default server URL for this method
|
|
4440
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
4441
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
4442
|
+
"""
|
|
4443
|
+
base_url = None
|
|
4444
|
+
url_variables = None
|
|
4445
|
+
if timeout_ms is None:
|
|
4446
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
4447
|
+
|
|
4448
|
+
if timeout_ms is None:
|
|
4449
|
+
timeout_ms = 30000
|
|
4450
|
+
|
|
4451
|
+
if server_url is not None:
|
|
4452
|
+
base_url = server_url
|
|
4453
|
+
else:
|
|
4454
|
+
base_url = self._get_url(base_url, url_variables)
|
|
4455
|
+
|
|
4456
|
+
request = models.GetUsptoPatentsRequest(
|
|
4457
|
+
symbol=symbol,
|
|
4458
|
+
from_=from_,
|
|
4459
|
+
to=to,
|
|
4460
|
+
)
|
|
4461
|
+
|
|
4462
|
+
req = self._build_request_async(
|
|
4463
|
+
method="GET",
|
|
4464
|
+
path="/v1/stock/uspto-patent",
|
|
4465
|
+
base_url=base_url,
|
|
4466
|
+
url_variables=url_variables,
|
|
4467
|
+
request=request,
|
|
4468
|
+
request_body_required=False,
|
|
4469
|
+
request_has_path_params=False,
|
|
4470
|
+
request_has_query_params=True,
|
|
4471
|
+
user_agent_header="user-agent",
|
|
4472
|
+
accept_header_value="application/json",
|
|
4473
|
+
http_headers=http_headers,
|
|
4474
|
+
security=self.sdk_configuration.security,
|
|
4475
|
+
allow_empty_value=None,
|
|
4476
|
+
allowed_fields=["client_id"],
|
|
4477
|
+
timeout_ms=timeout_ms,
|
|
4478
|
+
)
|
|
4479
|
+
|
|
4480
|
+
if retries == UNSET:
|
|
4481
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
4482
|
+
retries = self.sdk_configuration.retry_config
|
|
4483
|
+
else:
|
|
4484
|
+
retries = utils.RetryConfig(
|
|
4485
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
4486
|
+
)
|
|
4487
|
+
|
|
4488
|
+
retry_config = None
|
|
4489
|
+
if isinstance(retries, utils.RetryConfig):
|
|
4490
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
4491
|
+
|
|
4492
|
+
http_res = await self.do_request_async(
|
|
4493
|
+
hook_ctx=HookContext(
|
|
4494
|
+
config=self.sdk_configuration,
|
|
4495
|
+
base_url=base_url or "",
|
|
4496
|
+
operation_id="getUsptoPatents",
|
|
4497
|
+
oauth2_scopes=["market:supplemental"],
|
|
4498
|
+
security_source=self.sdk_configuration.security,
|
|
4499
|
+
tags=["Stock Alternative"],
|
|
4500
|
+
extensions=None,
|
|
4501
|
+
),
|
|
4502
|
+
request=req,
|
|
4503
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
4504
|
+
retry_config=retry_config,
|
|
4505
|
+
)
|
|
4506
|
+
|
|
4507
|
+
response_data: Any = None
|
|
4508
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
4509
|
+
return models.GetUsptoPatentsResponse(
|
|
4510
|
+
uspto_patents_response=unmarshal_json_response(
|
|
4511
|
+
Optional[models.UsptoPatentsResponse], http_res
|
|
4512
|
+
),
|
|
4513
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
4514
|
+
)
|
|
4515
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
4516
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
4517
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4518
|
+
request=req, response=http_res
|
|
4519
|
+
)
|
|
4520
|
+
raise errors.BadRequest(response_data, http_res)
|
|
4521
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
4522
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
4523
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4524
|
+
request=req, response=http_res
|
|
4525
|
+
)
|
|
4526
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
4527
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
4528
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
4529
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4530
|
+
request=req, response=http_res
|
|
4531
|
+
)
|
|
4532
|
+
raise errors.Forbidden(response_data, http_res)
|
|
4533
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
4534
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
4535
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4536
|
+
request=req, response=http_res
|
|
4537
|
+
)
|
|
4538
|
+
raise errors.NotFound(response_data, http_res)
|
|
4539
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
4540
|
+
response_data = unmarshal_json_response(
|
|
4541
|
+
errors.InternalServerErrorUnion, http_res
|
|
4542
|
+
)
|
|
4543
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4544
|
+
request=req, response=http_res
|
|
4545
|
+
)
|
|
4546
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
4547
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
4548
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
4549
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
4550
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
4551
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
4552
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
4553
|
+
|
|
4554
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
4555
|
+
|
|
4556
|
+
def get_visa_applications(
|
|
4557
|
+
self,
|
|
4558
|
+
*,
|
|
4559
|
+
symbol: str,
|
|
4560
|
+
from_: date,
|
|
4561
|
+
to: date,
|
|
4562
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
4563
|
+
server_url: Optional[str] = None,
|
|
4564
|
+
timeout_ms: Optional[int] = None,
|
|
4565
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
4566
|
+
) -> models.GetVisaApplicationsResponse:
|
|
4567
|
+
r"""Get Visa Application (H1-B)
|
|
4568
|
+
|
|
4569
|
+
Retrieve H1-B visa application data for a symbol within a date range.
|
|
4570
|
+
|
|
4571
|
+
If set, this operation will use `client_id` from the global security.
|
|
4572
|
+
|
|
4573
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
4574
|
+
:param from_: Start of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-01-01`).
|
|
4575
|
+
:param to: End of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-12-31`).
|
|
4576
|
+
:param retries: Override the default retry configuration for this method
|
|
4577
|
+
:param server_url: Override the default server URL for this method
|
|
4578
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
4579
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
4580
|
+
"""
|
|
4581
|
+
base_url = None
|
|
4582
|
+
url_variables = None
|
|
4583
|
+
if timeout_ms is None:
|
|
4584
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
4585
|
+
|
|
4586
|
+
if timeout_ms is None:
|
|
4587
|
+
timeout_ms = 30000
|
|
4588
|
+
|
|
4589
|
+
if server_url is not None:
|
|
4590
|
+
base_url = server_url
|
|
4591
|
+
else:
|
|
4592
|
+
base_url = self._get_url(base_url, url_variables)
|
|
4593
|
+
|
|
4594
|
+
request = models.GetVisaApplicationsRequest(
|
|
4595
|
+
symbol=symbol,
|
|
4596
|
+
from_=from_,
|
|
4597
|
+
to=to,
|
|
4598
|
+
)
|
|
4599
|
+
|
|
4600
|
+
req = self._build_request(
|
|
4601
|
+
method="GET",
|
|
4602
|
+
path="/v1/stock/visa-application",
|
|
4603
|
+
base_url=base_url,
|
|
4604
|
+
url_variables=url_variables,
|
|
4605
|
+
request=request,
|
|
4606
|
+
request_body_required=False,
|
|
4607
|
+
request_has_path_params=False,
|
|
4608
|
+
request_has_query_params=True,
|
|
4609
|
+
user_agent_header="user-agent",
|
|
4610
|
+
accept_header_value="application/json",
|
|
4611
|
+
http_headers=http_headers,
|
|
4612
|
+
security=self.sdk_configuration.security,
|
|
4613
|
+
allow_empty_value=None,
|
|
4614
|
+
allowed_fields=["client_id"],
|
|
4615
|
+
timeout_ms=timeout_ms,
|
|
4616
|
+
)
|
|
4617
|
+
|
|
4618
|
+
if retries == UNSET:
|
|
4619
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
4620
|
+
retries = self.sdk_configuration.retry_config
|
|
4621
|
+
else:
|
|
4622
|
+
retries = utils.RetryConfig(
|
|
4623
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
4624
|
+
)
|
|
4625
|
+
|
|
4626
|
+
retry_config = None
|
|
4627
|
+
if isinstance(retries, utils.RetryConfig):
|
|
4628
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
4629
|
+
|
|
4630
|
+
http_res = self.do_request(
|
|
4631
|
+
hook_ctx=HookContext(
|
|
4632
|
+
config=self.sdk_configuration,
|
|
4633
|
+
base_url=base_url or "",
|
|
4634
|
+
operation_id="getVisaApplications",
|
|
4635
|
+
oauth2_scopes=["market:supplemental"],
|
|
4636
|
+
security_source=self.sdk_configuration.security,
|
|
4637
|
+
tags=["Stock Alternative"],
|
|
4638
|
+
extensions=None,
|
|
4639
|
+
),
|
|
4640
|
+
request=req,
|
|
4641
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
4642
|
+
retry_config=retry_config,
|
|
4643
|
+
)
|
|
4644
|
+
|
|
4645
|
+
response_data: Any = None
|
|
4646
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
4647
|
+
return models.GetVisaApplicationsResponse(
|
|
4648
|
+
visa_applications_response=unmarshal_json_response(
|
|
4649
|
+
Optional[models.VisaApplicationsResponse], http_res
|
|
4650
|
+
),
|
|
4651
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
4652
|
+
)
|
|
4653
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
4654
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
4655
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4656
|
+
request=req, response=http_res
|
|
4657
|
+
)
|
|
4658
|
+
raise errors.BadRequest(response_data, http_res)
|
|
4659
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
4660
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
4661
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4662
|
+
request=req, response=http_res
|
|
4663
|
+
)
|
|
4664
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
4665
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
4666
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
4667
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4668
|
+
request=req, response=http_res
|
|
4669
|
+
)
|
|
4670
|
+
raise errors.Forbidden(response_data, http_res)
|
|
4671
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
4672
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
4673
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4674
|
+
request=req, response=http_res
|
|
4675
|
+
)
|
|
4676
|
+
raise errors.NotFound(response_data, http_res)
|
|
4677
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
4678
|
+
response_data = unmarshal_json_response(
|
|
4679
|
+
errors.InternalServerErrorUnion, http_res
|
|
4680
|
+
)
|
|
4681
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4682
|
+
request=req, response=http_res
|
|
4683
|
+
)
|
|
4684
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
4685
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
4686
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
4687
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
4688
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
4689
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
4690
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
4691
|
+
|
|
4692
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
4693
|
+
|
|
4694
|
+
async def get_visa_applications_async(
|
|
4695
|
+
self,
|
|
4696
|
+
*,
|
|
4697
|
+
symbol: str,
|
|
4698
|
+
from_: date,
|
|
4699
|
+
to: date,
|
|
4700
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
4701
|
+
server_url: Optional[str] = None,
|
|
4702
|
+
timeout_ms: Optional[int] = None,
|
|
4703
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
4704
|
+
) -> models.GetVisaApplicationsResponse:
|
|
4705
|
+
r"""Get Visa Application (H1-B)
|
|
4706
|
+
|
|
4707
|
+
Retrieve H1-B visa application data for a symbol within a date range.
|
|
4708
|
+
|
|
4709
|
+
If set, this operation will use `client_id` from the global security.
|
|
4710
|
+
|
|
4711
|
+
:param symbol: Stock ticker to query. Send the plain uppercase symbol exactly as you'd type it on a brokerage screen, e.g. `AAPL`, `MSFT`.
|
|
4712
|
+
:param from_: Start of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-01-01`).
|
|
4713
|
+
:param to: End of the date window, inclusive. Format: `YYYY-MM-DD` (e.g. `2024-12-31`).
|
|
4714
|
+
:param retries: Override the default retry configuration for this method
|
|
4715
|
+
:param server_url: Override the default server URL for this method
|
|
4716
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
4717
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
4718
|
+
"""
|
|
4719
|
+
base_url = None
|
|
4720
|
+
url_variables = None
|
|
4721
|
+
if timeout_ms is None:
|
|
4722
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
4723
|
+
|
|
4724
|
+
if timeout_ms is None:
|
|
4725
|
+
timeout_ms = 30000
|
|
4726
|
+
|
|
4727
|
+
if server_url is not None:
|
|
4728
|
+
base_url = server_url
|
|
4729
|
+
else:
|
|
4730
|
+
base_url = self._get_url(base_url, url_variables)
|
|
4731
|
+
|
|
4732
|
+
request = models.GetVisaApplicationsRequest(
|
|
4733
|
+
symbol=symbol,
|
|
4734
|
+
from_=from_,
|
|
4735
|
+
to=to,
|
|
4736
|
+
)
|
|
4737
|
+
|
|
4738
|
+
req = self._build_request_async(
|
|
4739
|
+
method="GET",
|
|
4740
|
+
path="/v1/stock/visa-application",
|
|
4741
|
+
base_url=base_url,
|
|
4742
|
+
url_variables=url_variables,
|
|
4743
|
+
request=request,
|
|
4744
|
+
request_body_required=False,
|
|
4745
|
+
request_has_path_params=False,
|
|
4746
|
+
request_has_query_params=True,
|
|
4747
|
+
user_agent_header="user-agent",
|
|
4748
|
+
accept_header_value="application/json",
|
|
4749
|
+
http_headers=http_headers,
|
|
4750
|
+
security=self.sdk_configuration.security,
|
|
4751
|
+
allow_empty_value=None,
|
|
4752
|
+
allowed_fields=["client_id"],
|
|
4753
|
+
timeout_ms=timeout_ms,
|
|
4754
|
+
)
|
|
4755
|
+
|
|
4756
|
+
if retries == UNSET:
|
|
4757
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
4758
|
+
retries = self.sdk_configuration.retry_config
|
|
4759
|
+
else:
|
|
4760
|
+
retries = utils.RetryConfig(
|
|
4761
|
+
"backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
|
|
4762
|
+
)
|
|
4763
|
+
|
|
4764
|
+
retry_config = None
|
|
4765
|
+
if isinstance(retries, utils.RetryConfig):
|
|
4766
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
4767
|
+
|
|
4768
|
+
http_res = await self.do_request_async(
|
|
4769
|
+
hook_ctx=HookContext(
|
|
4770
|
+
config=self.sdk_configuration,
|
|
4771
|
+
base_url=base_url or "",
|
|
4772
|
+
operation_id="getVisaApplications",
|
|
4773
|
+
oauth2_scopes=["market:supplemental"],
|
|
4774
|
+
security_source=self.sdk_configuration.security,
|
|
4775
|
+
tags=["Stock Alternative"],
|
|
4776
|
+
extensions=None,
|
|
4777
|
+
),
|
|
4778
|
+
request=req,
|
|
4779
|
+
is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
|
|
4780
|
+
retry_config=retry_config,
|
|
4781
|
+
)
|
|
4782
|
+
|
|
4783
|
+
response_data: Any = None
|
|
4784
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
4785
|
+
return models.GetVisaApplicationsResponse(
|
|
4786
|
+
visa_applications_response=unmarshal_json_response(
|
|
4787
|
+
Optional[models.VisaApplicationsResponse], http_res
|
|
4788
|
+
),
|
|
4789
|
+
http_meta=models.HTTPMetadata(request=req, response=http_res),
|
|
4790
|
+
)
|
|
4791
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
4792
|
+
response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
|
|
4793
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4794
|
+
request=req, response=http_res
|
|
4795
|
+
)
|
|
4796
|
+
raise errors.BadRequest(response_data, http_res)
|
|
4797
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
4798
|
+
response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
|
|
4799
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4800
|
+
request=req, response=http_res
|
|
4801
|
+
)
|
|
4802
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
4803
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
4804
|
+
response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
|
|
4805
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4806
|
+
request=req, response=http_res
|
|
4807
|
+
)
|
|
4808
|
+
raise errors.Forbidden(response_data, http_res)
|
|
4809
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
4810
|
+
response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
|
|
4811
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4812
|
+
request=req, response=http_res
|
|
4813
|
+
)
|
|
4814
|
+
raise errors.NotFound(response_data, http_res)
|
|
4815
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
4816
|
+
response_data = unmarshal_json_response(
|
|
4817
|
+
errors.InternalServerErrorUnion, http_res
|
|
4818
|
+
)
|
|
4819
|
+
response_data.http_meta = models.HTTPMetadata(
|
|
4820
|
+
request=req, response=http_res
|
|
4821
|
+
)
|
|
4822
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
4823
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
4824
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
4825
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
4826
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
4827
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
4828
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
4829
|
+
|
|
4830
|
+
raise errors.APIError("Unexpected response received", http_res)
|