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.
Files changed (486) hide show
  1. finance_dev/__init__.py +18 -0
  2. finance_dev/_hooks/__init__.py +7 -0
  3. finance_dev/_hooks/clientcredentials.py +319 -0
  4. finance_dev/_hooks/oauth2scopes.py +50 -0
  5. finance_dev/_hooks/registration.py +13 -0
  6. finance_dev/_hooks/sdkhooks.py +82 -0
  7. finance_dev/_hooks/types.py +125 -0
  8. finance_dev/_version.py +16 -0
  9. finance_dev/accounts.py +797 -0
  10. finance_dev/alternativedata.py +4830 -0
  11. finance_dev/analytics.py +3757 -0
  12. finance_dev/basesdk.py +393 -0
  13. finance_dev/calendar.py +1523 -0
  14. finance_dev/chart.py +1881 -0
  15. finance_dev/company.py +1105 -0
  16. finance_dev/corporateactions.py +1795 -0
  17. finance_dev/economy.py +1153 -0
  18. finance_dev/errors/__init__.py +94 -0
  19. finance_dev/errors/apierror.py +41 -0
  20. finance_dev/errors/authenticationerrorenvelope.py +43 -0
  21. finance_dev/errors/badrequest.py +34 -0
  22. finance_dev/errors/errorenvelope.py +42 -0
  23. finance_dev/errors/errorresponse.py +45 -0
  24. finance_dev/errors/financedevapierror.py +31 -0
  25. finance_dev/errors/forbidden.py +34 -0
  26. finance_dev/errors/internalservererror.py +35 -0
  27. finance_dev/errors/no_response_error.py +18 -0
  28. finance_dev/errors/notfound.py +34 -0
  29. finance_dev/errors/orderhistorybadrequest.py +35 -0
  30. finance_dev/errors/predorderserrorenvelope.py +42 -0
  31. finance_dev/errors/responsevalidationerror.py +28 -0
  32. finance_dev/errors/unauthorized.py +34 -0
  33. finance_dev/estimates.py +1906 -0
  34. finance_dev/etf.py +1108 -0
  35. finance_dev/filings.py +586 -0
  36. finance_dev/financials.py +4079 -0
  37. finance_dev/history.py +477 -0
  38. finance_dev/httpclient.py +126 -0
  39. finance_dev/indices.py +2308 -0
  40. finance_dev/logos.py +692 -0
  41. finance_dev/market.py +1825 -0
  42. finance_dev/markets.py +952 -0
  43. finance_dev/models/__init__.py +4568 -0
  44. finance_dev/models/accountbalancev2.py +340 -0
  45. finance_dev/models/accountitem.py +78 -0
  46. finance_dev/models/accountposition.py +147 -0
  47. finance_dev/models/aggregatetechnicalindicatorsresponse.py +192 -0
  48. finance_dev/models/analystinsightitem.py +161 -0
  49. finance_dev/models/analystinsightsresponse.py +39 -0
  50. finance_dev/models/apperror.py +123 -0
  51. finance_dev/models/authenticationerrordetail.py +58 -0
  52. finance_dev/models/bankbranchesresponse.py +96 -0
  53. finance_dev/models/basicfinancials.py +243 -0
  54. finance_dev/models/bullbearanalysisresponse.py +150 -0
  55. finance_dev/models/cancelorderop.py +40 -0
  56. finance_dev/models/cancelordrequest_union.py +287 -0
  57. finance_dev/models/cancelordresponse.py +115 -0
  58. finance_dev/models/cashflowstatement.py +290 -0
  59. finance_dev/models/cashflowstatementsresponse.py +61 -0
  60. finance_dev/models/chartbars.py +111 -0
  61. finance_dev/models/chartconfig.py +81 -0
  62. finance_dev/models/chartresolution.py +46 -0
  63. finance_dev/models/companyesgresponse.py +408 -0
  64. finance_dev/models/companyexecutive.py +70 -0
  65. finance_dev/models/companyexecutiveresponse.py +39 -0
  66. finance_dev/models/companypeersresponse.py +38 -0
  67. finance_dev/models/companypresentationresponse.py +96 -0
  68. finance_dev/models/companyprofile.py +255 -0
  69. finance_dev/models/conferencecallsresponse.py +169 -0
  70. finance_dev/models/congressionaltradingresponse.py +138 -0
  71. finance_dev/models/covid19uscasesresponse.py +79 -0
  72. finance_dev/models/createconfigwatchlistop.py +40 -0
  73. finance_dev/models/createwatchlistrequest.py +43 -0
  74. finance_dev/models/dailymarketsummaryresponse.py +73 -0
  75. finance_dev/models/deleteconfigwatchlistbyidop.py +53 -0
  76. finance_dev/models/dividenditem.py +125 -0
  77. finance_dev/models/dividendsresponse.py +61 -0
  78. finance_dev/models/earningrelease.py +291 -0
  79. finance_dev/models/earningscallliveresponse.py +103 -0
  80. finance_dev/models/earningsqualityscoreresponse.py +140 -0
  81. finance_dev/models/earningssurprisesresponse.py +125 -0
  82. finance_dev/models/ebitdaestimatesresponse.py +176 -0
  83. finance_dev/models/ebitestimatesresponse.py +176 -0
  84. finance_dev/models/economicscalendarevent.py +160 -0
  85. finance_dev/models/economicsindicator.py +87 -0
  86. finance_dev/models/epsestimatesresponse.py +176 -0
  87. finance_dev/models/equitydetailsdto.py +569 -0
  88. finance_dev/models/errorcode.py +48 -0
  89. finance_dev/models/etblistresponse.py +43 -0
  90. finance_dev/models/etbsearchrequest.py +21 -0
  91. finance_dev/models/etbsearchresponse.py +43 -0
  92. finance_dev/models/etfcountryallocationresponse.py +113 -0
  93. finance_dev/models/etfholdingsresponse.py +163 -0
  94. finance_dev/models/etfprofileresponse.py +234 -0
  95. finance_dev/models/etfsectorallocationresponse.py +113 -0
  96. finance_dev/models/exchangecode.py +90 -0
  97. finance_dev/models/fdaadvisorycommitteecalendarresponse.py +88 -0
  98. finance_dev/models/filingsimilarityrecord.py +115 -0
  99. finance_dev/models/filingssimilarityindexdatawrapper.py +52 -0
  100. finance_dev/models/filingssimilarityindexresponse.py +42 -0
  101. finance_dev/models/financialratiosresponse.py +252 -0
  102. finance_dev/models/financialsreporteddatawrapper.py +49 -0
  103. finance_dev/models/financialsreportedresponse.py +42 -0
  104. finance_dev/models/financialsrevenuebreakdowndatawrapper.py +49 -0
  105. finance_dev/models/financialsrevenuebreakdownresponse.py +42 -0
  106. finance_dev/models/financialsstatementsdatawrapper.py +44 -0
  107. finance_dev/models/financialsstatementsresponse.py +42 -0
  108. finance_dev/models/financialstatement.py +171 -0
  109. finance_dev/models/financialstatementtype.py +14 -0
  110. finance_dev/models/getaccountbalanceop.py +53 -0
  111. finance_dev/models/getaccountpositionsop.py +53 -0
  112. finance_dev/models/getaccountsresponse.py +22 -0
  113. finance_dev/models/getaggregatetechnicalindicatorsop.py +94 -0
  114. finance_dev/models/getanalystinsightsop.py +164 -0
  115. finance_dev/models/getbankbranchesop.py +53 -0
  116. finance_dev/models/getbaseeventop.py +87 -0
  117. finance_dev/models/getbullbearanalysisop.py +91 -0
  118. finance_dev/models/getcashflowstatementsop.py +564 -0
  119. finance_dev/models/getchartconfigop.py +40 -0
  120. finance_dev/models/getcharthistoryop.py +122 -0
  121. finance_dev/models/getcharttimeop.py +39 -0
  122. finance_dev/models/getcompanyesgop.py +53 -0
  123. finance_dev/models/getcompanyexecutivesop.py +56 -0
  124. finance_dev/models/getcompanymetricsop.py +68 -0
  125. finance_dev/models/getcompanypeersop.py +53 -0
  126. finance_dev/models/getcompanypresentationop.py +56 -0
  127. finance_dev/models/getcompanyprofileop.py +86 -0
  128. finance_dev/models/getconferencecallsop.py +111 -0
  129. finance_dev/models/getconfigwatchlistbyidop.py +53 -0
  130. finance_dev/models/getconfigwatchlistsop.py +40 -0
  131. finance_dev/models/getcongressionaltradingop.py +73 -0
  132. finance_dev/models/getcovid19uscasesop.py +43 -0
  133. finance_dev/models/getdailymarketsummaryop.py +92 -0
  134. finance_dev/models/getdividendsop.py +294 -0
  135. finance_dev/models/getearningscalendarop.py +87 -0
  136. finance_dev/models/getearningscallliveop.py +91 -0
  137. finance_dev/models/getearningsqualityscoreop.py +81 -0
  138. finance_dev/models/getearningssurprisesop.py +80 -0
  139. finance_dev/models/getebitdaestimatesop.py +91 -0
  140. finance_dev/models/getebitestimatesop.py +88 -0
  141. finance_dev/models/geteconomicscalendarop.py +92 -0
  142. finance_dev/models/geteconomicscalendarresponse.py +56 -0
  143. finance_dev/models/getepsestimatesop.py +88 -0
  144. finance_dev/models/getequitydetailsop.py +56 -0
  145. finance_dev/models/getequitydetailsresponse.py +45 -0
  146. finance_dev/models/getetblistop.py +40 -0
  147. finance_dev/models/getetfcountryallocationop.py +80 -0
  148. finance_dev/models/getetfholdingsop.py +96 -0
  149. finance_dev/models/getetfprofileop.py +77 -0
  150. finance_dev/models/getetfsectorallocationop.py +80 -0
  151. finance_dev/models/geteventcontractsop.py +87 -0
  152. finance_dev/models/getfdaadvisorycommitteecalendarop.py +47 -0
  153. finance_dev/models/getfilingssimilarityindexop.py +102 -0
  154. finance_dev/models/getfinancialratiosop.py +612 -0
  155. finance_dev/models/getfinancialstatementsop.py +117 -0
  156. finance_dev/models/getfundownershipop.py +77 -0
  157. finance_dev/models/gethistoricaldataop.py +61 -0
  158. finance_dev/models/gethistoricalesgop.py +53 -0
  159. finance_dev/models/gethistorybatchop.py +74 -0
  160. finance_dev/models/gethistoryop.py +123 -0
  161. finance_dev/models/getincomestatementsop.py +564 -0
  162. finance_dev/models/getindexbarop.py +140 -0
  163. finance_dev/models/getindexbarsop.py +149 -0
  164. finance_dev/models/getindexchartbarsop.py +178 -0
  165. finance_dev/models/getindexrealtimevaluesop.py +94 -0
  166. finance_dev/models/getinflationexpectationsop.py +157 -0
  167. finance_dev/models/getinflationop.py +154 -0
  168. finance_dev/models/getinsidertransactionsop.py +90 -0
  169. finance_dev/models/getinstitutionalownershipop.py +99 -0
  170. finance_dev/models/getinstitutionalportfolioop.py +75 -0
  171. finance_dev/models/getinvestmentthemeop.py +68 -0
  172. finance_dev/models/getipocalendarop.py +63 -0
  173. finance_dev/models/getlobbyingop.py +70 -0
  174. finance_dev/models/getmarketbreadthop.py +40 -0
  175. finance_dev/models/getmarketholidaysop.py +65 -0
  176. finance_dev/models/getmarketstatusop.py +65 -0
  177. finance_dev/models/getmergersandacquisitionsop.py +113 -0
  178. finance_dev/models/getnetinflowop.py +40 -0
  179. finance_dev/models/getnewsbyidop.py +73 -0
  180. finance_dev/models/getnewsop.py +98 -0
  181. finance_dev/models/getnewssentimentop.py +53 -0
  182. finance_dev/models/getoptionchainsnapshotop.py +244 -0
  183. finance_dev/models/getoptioncontractsnapshotop.py +69 -0
  184. finance_dev/models/getoptiondetailsop.py +56 -0
  185. finance_dev/models/getoptiondetailsresponse.py +45 -0
  186. finance_dev/models/getoptionlasttradeop.py +56 -0
  187. finance_dev/models/getoptionopencloseop.py +66 -0
  188. finance_dev/models/getoptionpreviousdayop.py +56 -0
  189. finance_dev/models/getoptionquotesop.py +177 -0
  190. finance_dev/models/getoptionsactivityop.py +111 -0
  191. finance_dev/models/getoptionsetfstopvolumeop.py +70 -0
  192. finance_dev/models/getoptionsstockstopgainersop.py +70 -0
  193. finance_dev/models/getoptionsstockstopvolumeop.py +70 -0
  194. finance_dev/models/getoptionsunusualactivityop.py +100 -0
  195. finance_dev/models/getoptiontradesop.py +177 -0
  196. finance_dev/models/getordersv2response.py +66 -0
  197. finance_dev/models/getownershipdataop.py +77 -0
  198. finance_dev/models/getpositionsresponse.py +39 -0
  199. finance_dev/models/getpredictionorderop.py +88 -0
  200. finance_dev/models/getpricetargetop.py +53 -0
  201. finance_dev/models/getquotesop.py +53 -0
  202. finance_dev/models/getratingsop.py +164 -0
  203. finance_dev/models/getratingsresponse.py +39 -0
  204. finance_dev/models/getreportedfinancialsop.py +127 -0
  205. finance_dev/models/getrevenuebreakdownop.py +85 -0
  206. finance_dev/models/getrevenueestimatesop.py +91 -0
  207. finance_dev/models/getsecfilingsop.py +113 -0
  208. finance_dev/models/getsectortickersop.py +124 -0
  209. finance_dev/models/getsectorwisechangeop.py +84 -0
  210. finance_dev/models/getshortinterestop.py +334 -0
  211. finance_dev/models/getshortvolumeop.py +333 -0
  212. finance_dev/models/getsocialsentimentop.py +90 -0
  213. finance_dev/models/getspinoffsop.py +112 -0
  214. finance_dev/models/getstockaggregatesop.py +174 -0
  215. finance_dev/models/getstocklastquoteop.py +56 -0
  216. finance_dev/models/getstocklasttradeop.py +56 -0
  217. finance_dev/models/getstockopencloseop.py +90 -0
  218. finance_dev/models/getstockpreviousdayop.py +80 -0
  219. finance_dev/models/getstockquotesop.py +177 -0
  220. finance_dev/models/getstocksnapshotsop.py +82 -0
  221. finance_dev/models/getstocksplitsop.py +243 -0
  222. finance_dev/models/getstocktradesop.py +177 -0
  223. finance_dev/models/getsupplychainop.py +53 -0
  224. finance_dev/models/getsupportresistancelevelsop.py +90 -0
  225. finance_dev/models/getsymbolinfoop.py +53 -0
  226. finance_dev/models/gettechnicalindicatorop.py +172 -0
  227. finance_dev/models/gettechnicalpatternsop.py +88 -0
  228. finance_dev/models/gettenderoffersop.py +112 -0
  229. finance_dev/models/gettickhistoryop.py +104 -0
  230. finance_dev/models/gettopgainersop.py +78 -0
  231. finance_dev/models/gettoplosersop.py +78 -0
  232. finance_dev/models/gettopmostactiveop.py +78 -0
  233. finance_dev/models/gettranscriptop.py +53 -0
  234. finance_dev/models/gettreasuryyieldsop.py +157 -0
  235. finance_dev/models/getunifiedsnapshotop.py +223 -0
  236. finance_dev/models/getupgradesdowngradesop.py +91 -0
  237. finance_dev/models/getusaspendingop.py +70 -0
  238. finance_dev/models/getuseraccountsop.py +40 -0
  239. finance_dev/models/getusptopatentsop.py +70 -0
  240. finance_dev/models/getvisaapplicationsop.py +73 -0
  241. finance_dev/models/historicalesgresponse.py +439 -0
  242. finance_dev/models/httpmetadata.py +24 -0
  243. finance_dev/models/incomestatement.py +296 -0
  244. finance_dev/models/incomestatementsresponse.py +61 -0
  245. finance_dev/models/indexbarresponse.py +194 -0
  246. finance_dev/models/indexbarsresponse.py +123 -0
  247. finance_dev/models/indexchartbarsresponse.py +213 -0
  248. finance_dev/models/indexgroupsresponse.py +78 -0
  249. finance_dev/models/indexlistresponse.py +95 -0
  250. finance_dev/models/indexsearchresponse.py +93 -0
  251. finance_dev/models/indicesbygroupresponse.py +93 -0
  252. finance_dev/models/indicesidentifiertype.py +28 -0
  253. finance_dev/models/indicesrealtimeindexinfo.py +67 -0
  254. finance_dev/models/indicesrealtimeindexvalue.py +157 -0
  255. finance_dev/models/indicesrealtimevaluesitem.py +80 -0
  256. finance_dev/models/indicesrealtimevaluesresponse.py +42 -0
  257. finance_dev/models/inflationexpectationsresponse.py +140 -0
  258. finance_dev/models/inflationresponse.py +132 -0
  259. finance_dev/models/insidertransaction.py +97 -0
  260. finance_dev/models/insidertransactionsresponse.py +39 -0
  261. finance_dev/models/institutionalholding.py +77 -0
  262. finance_dev/models/institutionalownershipresponse.py +39 -0
  263. finance_dev/models/institutionalportfolioresponse.py +39 -0
  264. finance_dev/models/investmentthemeid.py +35 -0
  265. finance_dev/models/investmentthemeresponse.py +80 -0
  266. finance_dev/models/ipocalendarresponse.py +39 -0
  267. finance_dev/models/ipoitem.py +93 -0
  268. finance_dev/models/listactiveordersop.py +87 -0
  269. finance_dev/models/listcategoriesop.py +79 -0
  270. finance_dev/models/listindexgroupsop.py +40 -0
  271. finance_dev/models/listindicesbygroupop.py +58 -0
  272. finance_dev/models/listindicesop.py +91 -0
  273. finance_dev/models/listoptioncontractsop.py +66 -0
  274. finance_dev/models/listoptionexpirydatesop.py +56 -0
  275. finance_dev/models/listorderhistoryop.py +139 -0
  276. finance_dev/models/listpredictionordersop.py +134 -0
  277. finance_dev/models/listtranscriptsop.py +53 -0
  278. finance_dev/models/lobbyingresponse.py +166 -0
  279. finance_dev/models/logosearchresponse.py +152 -0
  280. finance_dev/models/logosyncresponse.py +277 -0
  281. finance_dev/models/marketbreadth.py +97 -0
  282. finance_dev/models/marketbreadthresponse.py +44 -0
  283. finance_dev/models/marketholiday.py +56 -0
  284. finance_dev/models/marketholidayresponse.py +39 -0
  285. finance_dev/models/marketstatus.py +67 -0
  286. finance_dev/models/mergersandacquisitionsresponse.py +186 -0
  287. finance_dev/models/metricseriespoint.py +43 -0
  288. finance_dev/models/netinflow.py +81 -0
  289. finance_dev/models/netinflowresponse.py +44 -0
  290. finance_dev/models/newsitem.py +102 -0
  291. finance_dev/models/newslistresponse.py +128 -0
  292. finance_dev/models/newssentimentresponse.py +176 -0
  293. finance_dev/models/newstypeenum.py +16 -0
  294. finance_dev/models/optionchainsnapshotresponse.py +64 -0
  295. finance_dev/models/optioncontractsnapshotresponse.py +64 -0
  296. finance_dev/models/optioncontractsnapshotrow.py +164 -0
  297. finance_dev/models/optioncontractsresponse.py +131 -0
  298. finance_dev/models/optiondetailsdto.py +72 -0
  299. finance_dev/models/optionexpirydatesresponse.py +53 -0
  300. finance_dev/models/optionlasttraderesponse.py +169 -0
  301. finance_dev/models/optionopencloseresponse.py +97 -0
  302. finance_dev/models/optionpreviousdayresponse.py +89 -0
  303. finance_dev/models/optionquotesresponse.py +138 -0
  304. finance_dev/models/optionsactivityresponse.py +265 -0
  305. finance_dev/models/optionsnapshotcontractdetails.py +85 -0
  306. finance_dev/models/optionsnapshotdaybar.py +107 -0
  307. finance_dev/models/optionsnapshotgreeks.py +67 -0
  308. finance_dev/models/optionsnapshotlastquote.py +116 -0
  309. finance_dev/models/optionsnapshotlasttrade.py +102 -0
  310. finance_dev/models/optionsnapshotunderlying.py +86 -0
  311. finance_dev/models/optionsscreeneritem.py +151 -0
  312. finance_dev/models/optionsunusualactivityresponse.py +62 -0
  313. finance_dev/models/optionsunusualactivitytrade.py +103 -0
  314. finance_dev/models/optiontradesresponse.py +132 -0
  315. finance_dev/models/orderrequesttimeinforceenum.py +29 -0
  316. finance_dev/models/ordersideenum.py +20 -0
  317. finance_dev/models/ordertypeenum.py +20 -0
  318. finance_dev/models/ordleg.py +162 -0
  319. finance_dev/models/ordresponse.py +202 -0
  320. finance_dev/models/ownershipdataresponse.py +39 -0
  321. finance_dev/models/ownershiprecord.py +74 -0
  322. finance_dev/models/placeorderop.py +40 -0
  323. finance_dev/models/placeordrequest_union.py +335 -0
  324. finance_dev/models/placepredictionorderop.py +114 -0
  325. finance_dev/models/predmdbaseevent.py +62 -0
  326. finance_dev/models/predmdbaseeventhit.py +53 -0
  327. finance_dev/models/predmdbaseeventsearchresult.py +46 -0
  328. finance_dev/models/predmdbaseeventwithevents.py +32 -0
  329. finance_dev/models/predmdbatchhistoryrequest.py +16 -0
  330. finance_dev/models/predmdbatchhistoryresponse.py +16 -0
  331. finance_dev/models/predmdcategory.py +48 -0
  332. finance_dev/models/predmdcontract.py +177 -0
  333. finance_dev/models/predmdcontracthit.py +157 -0
  334. finance_dev/models/predmdcontractsearchresult.py +46 -0
  335. finance_dev/models/predmdevent.py +136 -0
  336. finance_dev/models/predmdeventhit.py +73 -0
  337. finance_dev/models/predmdeventsearchresult.py +46 -0
  338. finance_dev/models/predmdeventwithcontracts.py +22 -0
  339. finance_dev/models/predmdhistoryrequest.py +59 -0
  340. finance_dev/models/predmdhistoryresponse.py +53 -0
  341. finance_dev/models/predmdtick.py +53 -0
  342. finance_dev/models/predordersapperror.py +78 -0
  343. finance_dev/models/predordersorder.py +267 -0
  344. finance_dev/models/predordersorderdetail.py +26 -0
  345. finance_dev/models/predordersorderpage.py +45 -0
  346. finance_dev/models/predordersorderreport.py +88 -0
  347. finance_dev/models/predordersplaceorderrequest.py +159 -0
  348. finance_dev/models/previeworderop.py +40 -0
  349. finance_dev/models/previeworderresponse.py +127 -0
  350. finance_dev/models/pricetargetresponse.py +89 -0
  351. finance_dev/models/quotedata.py +49 -0
  352. finance_dev/models/quotesresponse.py +62 -0
  353. finance_dev/models/quotevalues.py +114 -0
  354. finance_dev/models/rating.py +193 -0
  355. finance_dev/models/ratingsaccuracy.py +242 -0
  356. finance_dev/models/replaceconfigwatchlistsop.py +40 -0
  357. finance_dev/models/replaceorderop.py +40 -0
  358. finance_dev/models/replaceordrequest_union.py +367 -0
  359. finance_dev/models/replaceordresponse.py +144 -0
  360. finance_dev/models/reportedbsitem.py +53 -0
  361. finance_dev/models/reportedfiling.py +110 -0
  362. finance_dev/models/reportedreport.py +39 -0
  363. finance_dev/models/reportingfrequency.py +16 -0
  364. finance_dev/models/revenuebreakdownaxis.py +52 -0
  365. finance_dev/models/revenuebreakdowndatapoint.py +58 -0
  366. finance_dev/models/revenuebreakdownentry.py +51 -0
  367. finance_dev/models/revenuebreakdowninner.py +75 -0
  368. finance_dev/models/revenueestimatesresponse.py +176 -0
  369. finance_dev/models/screenclause.py +70 -0
  370. finance_dev/models/screengroup.py +75 -0
  371. finance_dev/models/searchetbsymbolsop.py +40 -0
  372. finance_dev/models/searchindicesop.py +55 -0
  373. finance_dev/models/searchlogosop.py +158 -0
  374. finance_dev/models/searchmarketsymbolsop.py +80 -0
  375. finance_dev/models/searchop.py +232 -0
  376. finance_dev/models/searchsymbolitem.py +76 -0
  377. finance_dev/models/searchsymbolresponseitem.py +71 -0
  378. finance_dev/models/searchsymbolsop.py +77 -0
  379. finance_dev/models/secfiling.py +91 -0
  380. finance_dev/models/secfilingsresponse.py +39 -0
  381. finance_dev/models/sectoravgchange.py +50 -0
  382. finance_dev/models/security.py +59 -0
  383. finance_dev/models/securitytypeenum.py +16 -0
  384. finance_dev/models/shortinterestresponse.py +126 -0
  385. finance_dev/models/shortvolumeresponse.py +198 -0
  386. finance_dev/models/socialsentimentresponse.py +124 -0
  387. finance_dev/models/sortorderenum.py +13 -0
  388. finance_dev/models/spinoffsresponse.py +136 -0
  389. finance_dev/models/stockaggregatesresponse.py +92 -0
  390. finance_dev/models/stocklastquoteresponse.py +175 -0
  391. finance_dev/models/stocklasttraderesponse.py +169 -0
  392. finance_dev/models/stockohlcbar.py +85 -0
  393. finance_dev/models/stockopencloseresponse.py +109 -0
  394. finance_dev/models/stockpreviousdayresponse.py +86 -0
  395. finance_dev/models/stockquotesresponse.py +170 -0
  396. finance_dev/models/stockscreenerop.py +144 -0
  397. finance_dev/models/stockscreenerrequest.py +131 -0
  398. finance_dev/models/stockscreenerresponse.py +197 -0
  399. finance_dev/models/stocksnapshotsresponse.py +454 -0
  400. finance_dev/models/stocksplitsresponse.py +144 -0
  401. finance_dev/models/stocktradesresponse.py +164 -0
  402. finance_dev/models/supplychainresponse.py +158 -0
  403. finance_dev/models/supportresistancelevelsresponse.py +68 -0
  404. finance_dev/models/symboldetails.py +119 -0
  405. finance_dev/models/symbolerror.py +43 -0
  406. finance_dev/models/symbolinfo.py +183 -0
  407. finance_dev/models/synclogosop.py +146 -0
  408. finance_dev/models/technicalindicatorresponse.py +43 -0
  409. finance_dev/models/technicalindicatortype.py +21 -0
  410. finance_dev/models/technicalpatternsresponse.py +249 -0
  411. finance_dev/models/tenderofferidentifiertype.py +26 -0
  412. finance_dev/models/tenderoffersresponse.py +548 -0
  413. finance_dev/models/tickchartbars.py +104 -0
  414. finance_dev/models/tickresolution.py +20 -0
  415. finance_dev/models/timeinforceenum.py +26 -0
  416. finance_dev/models/tradeorderlegv2.py +164 -0
  417. finance_dev/models/tradeorderv2.py +434 -0
  418. finance_dev/models/transcriptresponse.py +162 -0
  419. finance_dev/models/transcriptsresponse.py +89 -0
  420. finance_dev/models/treasuryyieldsresponse.py +160 -0
  421. finance_dev/models/unifiedsnapshotresponse.py +308 -0
  422. finance_dev/models/updateconfigwatchlistbyidop.py +65 -0
  423. finance_dev/models/updatewatchlistrequest_union.py +134 -0
  424. finance_dev/models/upgradesdowngradesresponse.py +98 -0
  425. finance_dev/models/usaspendingresponse.py +222 -0
  426. finance_dev/models/usptopatentsresponse.py +134 -0
  427. finance_dev/models/visaapplicationsresponse.py +228 -0
  428. finance_dev/models/watchlist.py +68 -0
  429. finance_dev/models/watchlistrequest.py +43 -0
  430. finance_dev/models/watchlistresponse.py +44 -0
  431. finance_dev/news_sdk.py +829 -0
  432. finance_dev/options.py +3443 -0
  433. finance_dev/orders.py +1907 -0
  434. finance_dev/ownership.py +1386 -0
  435. finance_dev/predictions.py +29 -0
  436. finance_dev/predictions_orders.py +852 -0
  437. finance_dev/py.typed +1 -0
  438. finance_dev/sdk.py +347 -0
  439. finance_dev/sdkconfiguration.py +50 -0
  440. finance_dev/signals.py +338 -0
  441. finance_dev/stocks.py +3131 -0
  442. finance_dev/technicalanalysis_sdk.py +1137 -0
  443. finance_dev/types/__init__.py +25 -0
  444. finance_dev/types/base64fileinput.py +44 -0
  445. finance_dev/types/basemodel.py +78 -0
  446. finance_dev/utils/__init__.py +181 -0
  447. finance_dev/utils/annotations.py +80 -0
  448. finance_dev/utils/datetimes.py +42 -0
  449. finance_dev/utils/dynamic_imports.py +55 -0
  450. finance_dev/utils/enums.py +135 -0
  451. finance_dev/utils/eventstreaming.py +327 -0
  452. finance_dev/utils/forms.py +240 -0
  453. finance_dev/utils/headers.py +137 -0
  454. finance_dev/utils/logger.py +23 -0
  455. finance_dev/utils/metadata.py +120 -0
  456. finance_dev/utils/queryparams.py +218 -0
  457. finance_dev/utils/requestbodies.py +68 -0
  458. finance_dev/utils/retries.py +373 -0
  459. finance_dev/utils/security.py +199 -0
  460. finance_dev/utils/serializers.py +327 -0
  461. finance_dev/utils/unmarshal_json_response.py +39 -0
  462. finance_dev/utils/url.py +155 -0
  463. finance_dev/utils/values.py +143 -0
  464. finance_dev/watchlist_sdk.py +1583 -0
  465. finance_dev/websocket/__init__.py +57 -0
  466. finance_dev/websocket/account.py +5 -0
  467. finance_dev/websocket/auth.py +124 -0
  468. finance_dev/websocket/chart.py +5 -0
  469. finance_dev/websocket/codec.py +66 -0
  470. finance_dev/websocket/config.py +52 -0
  471. finance_dev/websocket/errors.py +54 -0
  472. finance_dev/websocket/market.py +5 -0
  473. finance_dev/websocket/models/__init__.py +52 -0
  474. finance_dev/websocket/models/account.py +60 -0
  475. finance_dev/websocket/models/chart.py +44 -0
  476. finance_dev/websocket/models/common.py +85 -0
  477. finance_dev/websocket/models/market.py +113 -0
  478. finance_dev/websocket/resources.py +327 -0
  479. finance_dev/websocket/sdk.py +13 -0
  480. finance_dev/websocket/transport/async_connection.py +493 -0
  481. finance_dev/websocket/transport/base.py +78 -0
  482. finance_dev/websocket/transport/sync_connection.py +470 -0
  483. finance_dev-0.9.0.dist-info/METADATA +913 -0
  484. finance_dev-0.9.0.dist-info/RECORD +486 -0
  485. finance_dev-0.9.0.dist-info/WHEEL +5 -0
  486. finance_dev-0.9.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1583 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+ # @generated-id: 5191ed12b50d
3
+
4
+ from .basesdk import BaseSDK
5
+ from finance_dev import errors, models, utils
6
+ from finance_dev._hooks import HookContext
7
+ from finance_dev.types import BaseModel, OptionalNullable, UNSET
8
+ from finance_dev.utils.unmarshal_json_response import unmarshal_json_response
9
+ from typing import Any, Iterable, List, Mapping, Optional, Union, cast
10
+
11
+
12
+ class WatchlistSDK(BaseSDK):
13
+ def list(
14
+ self,
15
+ *,
16
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
17
+ server_url: Optional[str] = None,
18
+ timeout_ms: Optional[int] = None,
19
+ http_headers: Optional[Mapping[str, str]] = None,
20
+ ) -> models.GetConfigWatchlistsResponse:
21
+ r"""List Watchlists
22
+
23
+ List all watchlists owned by the authenticated user. Users normally always have at least one watchlist; if the user has none, this endpoint returns 500 rather than an empty list.
24
+
25
+ If set, this operation will use `client_id` from the global security.
26
+
27
+ :param retries: Override the default retry configuration for this method
28
+ :param server_url: Override the default server URL for this method
29
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
30
+ :param http_headers: Additional headers to set or replace on requests.
31
+ """
32
+ base_url = None
33
+ url_variables = None
34
+ if timeout_ms is None:
35
+ timeout_ms = self.sdk_configuration.timeout_ms
36
+
37
+ if timeout_ms is None:
38
+ timeout_ms = 30000
39
+
40
+ if server_url is not None:
41
+ base_url = server_url
42
+ else:
43
+ base_url = self._get_url(base_url, url_variables)
44
+ req = self._build_request(
45
+ method="GET",
46
+ path="/v1/config/watchlist",
47
+ base_url=base_url,
48
+ url_variables=url_variables,
49
+ request=None,
50
+ request_body_required=False,
51
+ request_has_path_params=False,
52
+ request_has_query_params=True,
53
+ user_agent_header="user-agent",
54
+ accept_header_value="application/json",
55
+ http_headers=http_headers,
56
+ security=self.sdk_configuration.security,
57
+ allow_empty_value=None,
58
+ allowed_fields=["client_id"],
59
+ timeout_ms=timeout_ms,
60
+ )
61
+
62
+ if retries == UNSET:
63
+ if self.sdk_configuration.retry_config is not UNSET:
64
+ retries = self.sdk_configuration.retry_config
65
+ else:
66
+ retries = utils.RetryConfig(
67
+ "backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
68
+ )
69
+
70
+ retry_config = None
71
+ if isinstance(retries, utils.RetryConfig):
72
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
73
+
74
+ http_res = self.do_request(
75
+ hook_ctx=HookContext(
76
+ config=self.sdk_configuration,
77
+ base_url=base_url or "",
78
+ operation_id="getConfigWatchlists",
79
+ oauth2_scopes=["watchlist:information"],
80
+ security_source=self.sdk_configuration.security,
81
+ tags=["Watchlist"],
82
+ extensions=None,
83
+ ),
84
+ request=req,
85
+ is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
86
+ retry_config=retry_config,
87
+ )
88
+
89
+ response_data: Any = None
90
+ if utils.match_response(http_res, "200", "application/json"):
91
+ return models.GetConfigWatchlistsResponse(
92
+ watchlist_response=unmarshal_json_response(
93
+ Optional[models.WatchlistResponse], http_res
94
+ ),
95
+ http_meta=models.HTTPMetadata(request=req, response=http_res),
96
+ )
97
+ if utils.match_response(http_res, "401", "application/json"):
98
+ response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
99
+ response_data.http_meta = models.HTTPMetadata(
100
+ request=req, response=http_res
101
+ )
102
+ raise errors.Unauthorized(response_data, http_res)
103
+ if utils.match_response(http_res, "403", "application/json"):
104
+ response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
105
+ response_data.http_meta = models.HTTPMetadata(
106
+ request=req, response=http_res
107
+ )
108
+ raise errors.Forbidden(response_data, http_res)
109
+ if utils.match_response(http_res, "500", "application/json"):
110
+ response_data = unmarshal_json_response(
111
+ errors.InternalServerErrorUnion, http_res
112
+ )
113
+ response_data.http_meta = models.HTTPMetadata(
114
+ request=req, response=http_res
115
+ )
116
+ raise errors.InternalServerError(response_data, http_res)
117
+ if utils.match_response(http_res, "4XX", "*"):
118
+ http_res_text = utils.stream_to_text(http_res)
119
+ raise errors.APIError("API error occurred", http_res, http_res_text)
120
+ if utils.match_response(http_res, "5XX", "*"):
121
+ http_res_text = utils.stream_to_text(http_res)
122
+ raise errors.APIError("API error occurred", http_res, http_res_text)
123
+
124
+ raise errors.APIError("Unexpected response received", http_res)
125
+
126
+ async def list_async(
127
+ self,
128
+ *,
129
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
130
+ server_url: Optional[str] = None,
131
+ timeout_ms: Optional[int] = None,
132
+ http_headers: Optional[Mapping[str, str]] = None,
133
+ ) -> models.GetConfigWatchlistsResponse:
134
+ r"""List Watchlists
135
+
136
+ List all watchlists owned by the authenticated user. Users normally always have at least one watchlist; if the user has none, this endpoint returns 500 rather than an empty list.
137
+
138
+ If set, this operation will use `client_id` from the global security.
139
+
140
+ :param retries: Override the default retry configuration for this method
141
+ :param server_url: Override the default server URL for this method
142
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
143
+ :param http_headers: Additional headers to set or replace on requests.
144
+ """
145
+ base_url = None
146
+ url_variables = None
147
+ if timeout_ms is None:
148
+ timeout_ms = self.sdk_configuration.timeout_ms
149
+
150
+ if timeout_ms is None:
151
+ timeout_ms = 30000
152
+
153
+ if server_url is not None:
154
+ base_url = server_url
155
+ else:
156
+ base_url = self._get_url(base_url, url_variables)
157
+ req = self._build_request_async(
158
+ method="GET",
159
+ path="/v1/config/watchlist",
160
+ base_url=base_url,
161
+ url_variables=url_variables,
162
+ request=None,
163
+ request_body_required=False,
164
+ request_has_path_params=False,
165
+ request_has_query_params=True,
166
+ user_agent_header="user-agent",
167
+ accept_header_value="application/json",
168
+ http_headers=http_headers,
169
+ security=self.sdk_configuration.security,
170
+ allow_empty_value=None,
171
+ allowed_fields=["client_id"],
172
+ timeout_ms=timeout_ms,
173
+ )
174
+
175
+ if retries == UNSET:
176
+ if self.sdk_configuration.retry_config is not UNSET:
177
+ retries = self.sdk_configuration.retry_config
178
+ else:
179
+ retries = utils.RetryConfig(
180
+ "backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
181
+ )
182
+
183
+ retry_config = None
184
+ if isinstance(retries, utils.RetryConfig):
185
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
186
+
187
+ http_res = await self.do_request_async(
188
+ hook_ctx=HookContext(
189
+ config=self.sdk_configuration,
190
+ base_url=base_url or "",
191
+ operation_id="getConfigWatchlists",
192
+ oauth2_scopes=["watchlist:information"],
193
+ security_source=self.sdk_configuration.security,
194
+ tags=["Watchlist"],
195
+ extensions=None,
196
+ ),
197
+ request=req,
198
+ is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
199
+ retry_config=retry_config,
200
+ )
201
+
202
+ response_data: Any = None
203
+ if utils.match_response(http_res, "200", "application/json"):
204
+ return models.GetConfigWatchlistsResponse(
205
+ watchlist_response=unmarshal_json_response(
206
+ Optional[models.WatchlistResponse], http_res
207
+ ),
208
+ http_meta=models.HTTPMetadata(request=req, response=http_res),
209
+ )
210
+ if utils.match_response(http_res, "401", "application/json"):
211
+ response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
212
+ response_data.http_meta = models.HTTPMetadata(
213
+ request=req, response=http_res
214
+ )
215
+ raise errors.Unauthorized(response_data, http_res)
216
+ if utils.match_response(http_res, "403", "application/json"):
217
+ response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
218
+ response_data.http_meta = models.HTTPMetadata(
219
+ request=req, response=http_res
220
+ )
221
+ raise errors.Forbidden(response_data, http_res)
222
+ if utils.match_response(http_res, "500", "application/json"):
223
+ response_data = unmarshal_json_response(
224
+ errors.InternalServerErrorUnion, http_res
225
+ )
226
+ response_data.http_meta = models.HTTPMetadata(
227
+ request=req, response=http_res
228
+ )
229
+ raise errors.InternalServerError(response_data, http_res)
230
+ if utils.match_response(http_res, "4XX", "*"):
231
+ http_res_text = await utils.stream_to_text_async(http_res)
232
+ raise errors.APIError("API error occurred", http_res, http_res_text)
233
+ if utils.match_response(http_res, "5XX", "*"):
234
+ http_res_text = await utils.stream_to_text_async(http_res)
235
+ raise errors.APIError("API error occurred", http_res, http_res_text)
236
+
237
+ raise errors.APIError("Unexpected response received", http_res)
238
+
239
+ def create(
240
+ self,
241
+ *,
242
+ name: str,
243
+ symbols: Optional[Iterable[str]] = None,
244
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
245
+ server_url: Optional[str] = None,
246
+ timeout_ms: Optional[int] = None,
247
+ http_headers: Optional[Mapping[str, str]] = None,
248
+ ) -> models.CreateConfigWatchlistResponse:
249
+ r"""Create Watchlist
250
+
251
+ Create a new watchlist for the authenticated user. Watchlist names must be unique per user; creating a watchlist with a name the user already has returns 400 with error code `WATCHLIST_ALREADY_EXISTS`.
252
+
253
+ **Symbol validation:** Submitted symbols are uppercased, de-duplicated, and checked against the symbol resolver. Symbols that can't be resolved are dropped from the stored list and returned in the response's `invalid_symbols` field instead of causing the request to fail.
254
+
255
+ If set, this operation will use `client_id` from the global security.
256
+
257
+ :param name: User-facing name for the new watchlist, such as Tech Stocks or Dividend Ideas. Must not match the name of another watchlist the user already has (case-sensitive).
258
+ :param symbols: Symbols to save in the new watchlist. Use exact uppercase ticker symbols; symbols that can't be resolved are dropped from the saved list and returned in the response's `invalid_symbols` field.
259
+ :param retries: Override the default retry configuration for this method
260
+ :param server_url: Override the default server URL for this method
261
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
262
+ :param http_headers: Additional headers to set or replace on requests.
263
+ """
264
+ base_url = None
265
+ url_variables = None
266
+ if timeout_ms is None:
267
+ timeout_ms = self.sdk_configuration.timeout_ms
268
+
269
+ if timeout_ms is None:
270
+ timeout_ms = 30000
271
+
272
+ if server_url is not None:
273
+ base_url = server_url
274
+ else:
275
+ base_url = self._get_url(base_url, url_variables)
276
+
277
+ request = models.CreateWatchlistRequest(
278
+ name=name,
279
+ symbols=utils.unmarshal(symbols, Optional[List[str]]),
280
+ )
281
+
282
+ req = self._build_request(
283
+ method="POST",
284
+ path="/v1/config/watchlist",
285
+ base_url=base_url,
286
+ url_variables=url_variables,
287
+ request=request,
288
+ request_body_required=True,
289
+ request_has_path_params=False,
290
+ request_has_query_params=True,
291
+ user_agent_header="user-agent",
292
+ accept_header_value="application/json",
293
+ http_headers=http_headers,
294
+ security=self.sdk_configuration.security,
295
+ get_serialized_body=lambda: utils.serialize_request_body(
296
+ request, False, False, "json", models.CreateWatchlistRequest
297
+ ),
298
+ allow_empty_value=None,
299
+ allowed_fields=["client_id"],
300
+ timeout_ms=timeout_ms,
301
+ )
302
+
303
+ if retries == UNSET:
304
+ if self.sdk_configuration.retry_config is not UNSET:
305
+ retries = self.sdk_configuration.retry_config
306
+
307
+ retry_config = None
308
+ if isinstance(retries, utils.RetryConfig):
309
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
310
+
311
+ http_res = self.do_request(
312
+ hook_ctx=HookContext(
313
+ config=self.sdk_configuration,
314
+ base_url=base_url or "",
315
+ operation_id="createConfigWatchlist",
316
+ oauth2_scopes=["watchlist:management"],
317
+ security_source=self.sdk_configuration.security,
318
+ tags=["Watchlist"],
319
+ extensions=None,
320
+ ),
321
+ request=req,
322
+ is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
323
+ retry_config=retry_config,
324
+ )
325
+
326
+ response_data: Any = None
327
+ if utils.match_response(http_res, "201", "application/json"):
328
+ return models.CreateConfigWatchlistResponse(
329
+ watchlist=unmarshal_json_response(Optional[models.Watchlist], http_res),
330
+ http_meta=models.HTTPMetadata(request=req, response=http_res),
331
+ )
332
+ if utils.match_response(http_res, "400", "application/json"):
333
+ response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
334
+ response_data.http_meta = models.HTTPMetadata(
335
+ request=req, response=http_res
336
+ )
337
+ raise errors.BadRequest(response_data, http_res)
338
+ if utils.match_response(http_res, "401", "application/json"):
339
+ response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
340
+ response_data.http_meta = models.HTTPMetadata(
341
+ request=req, response=http_res
342
+ )
343
+ raise errors.Unauthorized(response_data, http_res)
344
+ if utils.match_response(http_res, "403", "application/json"):
345
+ response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
346
+ response_data.http_meta = models.HTTPMetadata(
347
+ request=req, response=http_res
348
+ )
349
+ raise errors.Forbidden(response_data, http_res)
350
+ if utils.match_response(http_res, "500", "application/json"):
351
+ response_data = unmarshal_json_response(
352
+ errors.InternalServerErrorUnion, http_res
353
+ )
354
+ response_data.http_meta = models.HTTPMetadata(
355
+ request=req, response=http_res
356
+ )
357
+ raise errors.InternalServerError(response_data, http_res)
358
+ if utils.match_response(http_res, "4XX", "*"):
359
+ http_res_text = utils.stream_to_text(http_res)
360
+ raise errors.APIError("API error occurred", http_res, http_res_text)
361
+ if utils.match_response(http_res, "5XX", "*"):
362
+ http_res_text = utils.stream_to_text(http_res)
363
+ raise errors.APIError("API error occurred", http_res, http_res_text)
364
+
365
+ raise errors.APIError("Unexpected response received", http_res)
366
+
367
+ async def create_async(
368
+ self,
369
+ *,
370
+ name: str,
371
+ symbols: Optional[Iterable[str]] = None,
372
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
373
+ server_url: Optional[str] = None,
374
+ timeout_ms: Optional[int] = None,
375
+ http_headers: Optional[Mapping[str, str]] = None,
376
+ ) -> models.CreateConfigWatchlistResponse:
377
+ r"""Create Watchlist
378
+
379
+ Create a new watchlist for the authenticated user. Watchlist names must be unique per user; creating a watchlist with a name the user already has returns 400 with error code `WATCHLIST_ALREADY_EXISTS`.
380
+
381
+ **Symbol validation:** Submitted symbols are uppercased, de-duplicated, and checked against the symbol resolver. Symbols that can't be resolved are dropped from the stored list and returned in the response's `invalid_symbols` field instead of causing the request to fail.
382
+
383
+ If set, this operation will use `client_id` from the global security.
384
+
385
+ :param name: User-facing name for the new watchlist, such as Tech Stocks or Dividend Ideas. Must not match the name of another watchlist the user already has (case-sensitive).
386
+ :param symbols: Symbols to save in the new watchlist. Use exact uppercase ticker symbols; symbols that can't be resolved are dropped from the saved list and returned in the response's `invalid_symbols` field.
387
+ :param retries: Override the default retry configuration for this method
388
+ :param server_url: Override the default server URL for this method
389
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
390
+ :param http_headers: Additional headers to set or replace on requests.
391
+ """
392
+ base_url = None
393
+ url_variables = None
394
+ if timeout_ms is None:
395
+ timeout_ms = self.sdk_configuration.timeout_ms
396
+
397
+ if timeout_ms is None:
398
+ timeout_ms = 30000
399
+
400
+ if server_url is not None:
401
+ base_url = server_url
402
+ else:
403
+ base_url = self._get_url(base_url, url_variables)
404
+
405
+ request = models.CreateWatchlistRequest(
406
+ name=name,
407
+ symbols=utils.unmarshal(symbols, Optional[List[str]]),
408
+ )
409
+
410
+ req = self._build_request_async(
411
+ method="POST",
412
+ path="/v1/config/watchlist",
413
+ base_url=base_url,
414
+ url_variables=url_variables,
415
+ request=request,
416
+ request_body_required=True,
417
+ request_has_path_params=False,
418
+ request_has_query_params=True,
419
+ user_agent_header="user-agent",
420
+ accept_header_value="application/json",
421
+ http_headers=http_headers,
422
+ security=self.sdk_configuration.security,
423
+ get_serialized_body=lambda: utils.serialize_request_body(
424
+ request, False, False, "json", models.CreateWatchlistRequest
425
+ ),
426
+ allow_empty_value=None,
427
+ allowed_fields=["client_id"],
428
+ timeout_ms=timeout_ms,
429
+ )
430
+
431
+ if retries == UNSET:
432
+ if self.sdk_configuration.retry_config is not UNSET:
433
+ retries = self.sdk_configuration.retry_config
434
+
435
+ retry_config = None
436
+ if isinstance(retries, utils.RetryConfig):
437
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
438
+
439
+ http_res = await self.do_request_async(
440
+ hook_ctx=HookContext(
441
+ config=self.sdk_configuration,
442
+ base_url=base_url or "",
443
+ operation_id="createConfigWatchlist",
444
+ oauth2_scopes=["watchlist:management"],
445
+ security_source=self.sdk_configuration.security,
446
+ tags=["Watchlist"],
447
+ extensions=None,
448
+ ),
449
+ request=req,
450
+ is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
451
+ retry_config=retry_config,
452
+ )
453
+
454
+ response_data: Any = None
455
+ if utils.match_response(http_res, "201", "application/json"):
456
+ return models.CreateConfigWatchlistResponse(
457
+ watchlist=unmarshal_json_response(Optional[models.Watchlist], http_res),
458
+ http_meta=models.HTTPMetadata(request=req, response=http_res),
459
+ )
460
+ if utils.match_response(http_res, "400", "application/json"):
461
+ response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
462
+ response_data.http_meta = models.HTTPMetadata(
463
+ request=req, response=http_res
464
+ )
465
+ raise errors.BadRequest(response_data, http_res)
466
+ if utils.match_response(http_res, "401", "application/json"):
467
+ response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
468
+ response_data.http_meta = models.HTTPMetadata(
469
+ request=req, response=http_res
470
+ )
471
+ raise errors.Unauthorized(response_data, http_res)
472
+ if utils.match_response(http_res, "403", "application/json"):
473
+ response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
474
+ response_data.http_meta = models.HTTPMetadata(
475
+ request=req, response=http_res
476
+ )
477
+ raise errors.Forbidden(response_data, http_res)
478
+ if utils.match_response(http_res, "500", "application/json"):
479
+ response_data = unmarshal_json_response(
480
+ errors.InternalServerErrorUnion, http_res
481
+ )
482
+ response_data.http_meta = models.HTTPMetadata(
483
+ request=req, response=http_res
484
+ )
485
+ raise errors.InternalServerError(response_data, http_res)
486
+ if utils.match_response(http_res, "4XX", "*"):
487
+ http_res_text = await utils.stream_to_text_async(http_res)
488
+ raise errors.APIError("API error occurred", http_res, http_res_text)
489
+ if utils.match_response(http_res, "5XX", "*"):
490
+ http_res_text = await utils.stream_to_text_async(http_res)
491
+ raise errors.APIError("API error occurred", http_res, http_res_text)
492
+
493
+ raise errors.APIError("Unexpected response received", http_res)
494
+
495
+ def replace_all(
496
+ self,
497
+ *,
498
+ request: Union[
499
+ Iterable[models.WatchlistRequest],
500
+ Iterable[models.WatchlistRequestTypedDict],
501
+ ],
502
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
503
+ server_url: Optional[str] = None,
504
+ timeout_ms: Optional[int] = None,
505
+ http_headers: Optional[Mapping[str, str]] = None,
506
+ ) -> models.ReplaceConfigWatchlistsResponse:
507
+ r"""Replace All Watchlists
508
+
509
+ Replace the authenticated user's entire set of watchlists in a single call. Send the full desired list as an array: entries matching an existing watchlist by `name` (exact, case-sensitive) are updated in place, keeping their `id` and replacing their `symbols`; entries with a new `name` are created; and every existing watchlist whose `name` is **not** present in the array is deleted. Sending an empty array `[]` deletes all of the user's watchlists and creates a single new `\"Default\"` watchlist with no symbols.
510
+
511
+ Unlike Create and Update, symbols sent here are stored as-is and are **not** uppercased or checked against the symbol resolver. If `symbols` is omitted for an entry, that watchlist is stored with `symbols: null`.
512
+
513
+ If set, this operation will use `client_id` from the global security.
514
+
515
+ :param request: The request object to send.
516
+ :param retries: Override the default retry configuration for this method
517
+ :param server_url: Override the default server URL for this method
518
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
519
+ :param http_headers: Additional headers to set or replace on requests.
520
+ """
521
+ base_url = None
522
+ url_variables = None
523
+ if timeout_ms is None:
524
+ timeout_ms = self.sdk_configuration.timeout_ms
525
+
526
+ if timeout_ms is None:
527
+ timeout_ms = 30000
528
+
529
+ if server_url is not None:
530
+ base_url = server_url
531
+ else:
532
+ base_url = self._get_url(base_url, url_variables)
533
+
534
+ if not isinstance(request, BaseModel):
535
+ request = utils.unmarshal(request, List[models.WatchlistRequest])
536
+ request = cast(List[models.WatchlistRequest], request)
537
+
538
+ req = self._build_request(
539
+ method="PUT",
540
+ path="/v1/config/watchlist",
541
+ base_url=base_url,
542
+ url_variables=url_variables,
543
+ request=request,
544
+ request_body_required=True,
545
+ request_has_path_params=False,
546
+ request_has_query_params=True,
547
+ user_agent_header="user-agent",
548
+ accept_header_value="application/json",
549
+ http_headers=http_headers,
550
+ security=self.sdk_configuration.security,
551
+ get_serialized_body=lambda: utils.serialize_request_body(
552
+ request, False, False, "json", List[models.WatchlistRequest]
553
+ ),
554
+ allow_empty_value=None,
555
+ allowed_fields=["client_id"],
556
+ timeout_ms=timeout_ms,
557
+ )
558
+
559
+ if retries == UNSET:
560
+ if self.sdk_configuration.retry_config is not UNSET:
561
+ retries = self.sdk_configuration.retry_config
562
+ else:
563
+ retries = utils.RetryConfig(
564
+ "backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
565
+ )
566
+
567
+ retry_config = None
568
+ if isinstance(retries, utils.RetryConfig):
569
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
570
+
571
+ http_res = self.do_request(
572
+ hook_ctx=HookContext(
573
+ config=self.sdk_configuration,
574
+ base_url=base_url or "",
575
+ operation_id="replaceConfigWatchlists",
576
+ oauth2_scopes=["watchlist:management"],
577
+ security_source=self.sdk_configuration.security,
578
+ tags=["Watchlist"],
579
+ extensions=None,
580
+ ),
581
+ request=req,
582
+ is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
583
+ retry_config=retry_config,
584
+ )
585
+
586
+ response_data: Any = None
587
+ if utils.match_response(http_res, "201", "application/json"):
588
+ return models.ReplaceConfigWatchlistsResponse(
589
+ watchlist_response=unmarshal_json_response(
590
+ Optional[models.WatchlistResponse], http_res
591
+ ),
592
+ http_meta=models.HTTPMetadata(request=req, response=http_res),
593
+ )
594
+ if utils.match_response(http_res, "400", "application/json"):
595
+ response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
596
+ response_data.http_meta = models.HTTPMetadata(
597
+ request=req, response=http_res
598
+ )
599
+ raise errors.BadRequest(response_data, http_res)
600
+ if utils.match_response(http_res, "401", "application/json"):
601
+ response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
602
+ response_data.http_meta = models.HTTPMetadata(
603
+ request=req, response=http_res
604
+ )
605
+ raise errors.Unauthorized(response_data, http_res)
606
+ if utils.match_response(http_res, "403", "application/json"):
607
+ response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
608
+ response_data.http_meta = models.HTTPMetadata(
609
+ request=req, response=http_res
610
+ )
611
+ raise errors.Forbidden(response_data, http_res)
612
+ if utils.match_response(http_res, "500", "application/json"):
613
+ response_data = unmarshal_json_response(
614
+ errors.InternalServerErrorUnion, http_res
615
+ )
616
+ response_data.http_meta = models.HTTPMetadata(
617
+ request=req, response=http_res
618
+ )
619
+ raise errors.InternalServerError(response_data, http_res)
620
+ if utils.match_response(http_res, "4XX", "*"):
621
+ http_res_text = utils.stream_to_text(http_res)
622
+ raise errors.APIError("API error occurred", http_res, http_res_text)
623
+ if utils.match_response(http_res, "5XX", "*"):
624
+ http_res_text = utils.stream_to_text(http_res)
625
+ raise errors.APIError("API error occurred", http_res, http_res_text)
626
+
627
+ raise errors.APIError("Unexpected response received", http_res)
628
+
629
+ async def replace_all_async(
630
+ self,
631
+ *,
632
+ request: Union[
633
+ Iterable[models.WatchlistRequest],
634
+ Iterable[models.WatchlistRequestTypedDict],
635
+ ],
636
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
637
+ server_url: Optional[str] = None,
638
+ timeout_ms: Optional[int] = None,
639
+ http_headers: Optional[Mapping[str, str]] = None,
640
+ ) -> models.ReplaceConfigWatchlistsResponse:
641
+ r"""Replace All Watchlists
642
+
643
+ Replace the authenticated user's entire set of watchlists in a single call. Send the full desired list as an array: entries matching an existing watchlist by `name` (exact, case-sensitive) are updated in place, keeping their `id` and replacing their `symbols`; entries with a new `name` are created; and every existing watchlist whose `name` is **not** present in the array is deleted. Sending an empty array `[]` deletes all of the user's watchlists and creates a single new `\"Default\"` watchlist with no symbols.
644
+
645
+ Unlike Create and Update, symbols sent here are stored as-is and are **not** uppercased or checked against the symbol resolver. If `symbols` is omitted for an entry, that watchlist is stored with `symbols: null`.
646
+
647
+ If set, this operation will use `client_id` from the global security.
648
+
649
+ :param request: The request object to send.
650
+ :param retries: Override the default retry configuration for this method
651
+ :param server_url: Override the default server URL for this method
652
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
653
+ :param http_headers: Additional headers to set or replace on requests.
654
+ """
655
+ base_url = None
656
+ url_variables = None
657
+ if timeout_ms is None:
658
+ timeout_ms = self.sdk_configuration.timeout_ms
659
+
660
+ if timeout_ms is None:
661
+ timeout_ms = 30000
662
+
663
+ if server_url is not None:
664
+ base_url = server_url
665
+ else:
666
+ base_url = self._get_url(base_url, url_variables)
667
+
668
+ if not isinstance(request, BaseModel):
669
+ request = utils.unmarshal(request, List[models.WatchlistRequest])
670
+ request = cast(List[models.WatchlistRequest], request)
671
+
672
+ req = self._build_request_async(
673
+ method="PUT",
674
+ path="/v1/config/watchlist",
675
+ base_url=base_url,
676
+ url_variables=url_variables,
677
+ request=request,
678
+ request_body_required=True,
679
+ request_has_path_params=False,
680
+ request_has_query_params=True,
681
+ user_agent_header="user-agent",
682
+ accept_header_value="application/json",
683
+ http_headers=http_headers,
684
+ security=self.sdk_configuration.security,
685
+ get_serialized_body=lambda: utils.serialize_request_body(
686
+ request, False, False, "json", List[models.WatchlistRequest]
687
+ ),
688
+ allow_empty_value=None,
689
+ allowed_fields=["client_id"],
690
+ timeout_ms=timeout_ms,
691
+ )
692
+
693
+ if retries == UNSET:
694
+ if self.sdk_configuration.retry_config is not UNSET:
695
+ retries = self.sdk_configuration.retry_config
696
+ else:
697
+ retries = utils.RetryConfig(
698
+ "backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
699
+ )
700
+
701
+ retry_config = None
702
+ if isinstance(retries, utils.RetryConfig):
703
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
704
+
705
+ http_res = await self.do_request_async(
706
+ hook_ctx=HookContext(
707
+ config=self.sdk_configuration,
708
+ base_url=base_url or "",
709
+ operation_id="replaceConfigWatchlists",
710
+ oauth2_scopes=["watchlist:management"],
711
+ security_source=self.sdk_configuration.security,
712
+ tags=["Watchlist"],
713
+ extensions=None,
714
+ ),
715
+ request=req,
716
+ is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
717
+ retry_config=retry_config,
718
+ )
719
+
720
+ response_data: Any = None
721
+ if utils.match_response(http_res, "201", "application/json"):
722
+ return models.ReplaceConfigWatchlistsResponse(
723
+ watchlist_response=unmarshal_json_response(
724
+ Optional[models.WatchlistResponse], http_res
725
+ ),
726
+ http_meta=models.HTTPMetadata(request=req, response=http_res),
727
+ )
728
+ if utils.match_response(http_res, "400", "application/json"):
729
+ response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
730
+ response_data.http_meta = models.HTTPMetadata(
731
+ request=req, response=http_res
732
+ )
733
+ raise errors.BadRequest(response_data, http_res)
734
+ if utils.match_response(http_res, "401", "application/json"):
735
+ response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
736
+ response_data.http_meta = models.HTTPMetadata(
737
+ request=req, response=http_res
738
+ )
739
+ raise errors.Unauthorized(response_data, http_res)
740
+ if utils.match_response(http_res, "403", "application/json"):
741
+ response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
742
+ response_data.http_meta = models.HTTPMetadata(
743
+ request=req, response=http_res
744
+ )
745
+ raise errors.Forbidden(response_data, http_res)
746
+ if utils.match_response(http_res, "500", "application/json"):
747
+ response_data = unmarshal_json_response(
748
+ errors.InternalServerErrorUnion, http_res
749
+ )
750
+ response_data.http_meta = models.HTTPMetadata(
751
+ request=req, response=http_res
752
+ )
753
+ raise errors.InternalServerError(response_data, http_res)
754
+ if utils.match_response(http_res, "4XX", "*"):
755
+ http_res_text = await utils.stream_to_text_async(http_res)
756
+ raise errors.APIError("API error occurred", http_res, http_res_text)
757
+ if utils.match_response(http_res, "5XX", "*"):
758
+ http_res_text = await utils.stream_to_text_async(http_res)
759
+ raise errors.APIError("API error occurred", http_res, http_res_text)
760
+
761
+ raise errors.APIError("Unexpected response received", http_res)
762
+
763
+ def delete(
764
+ self,
765
+ *,
766
+ watchlist_id: int,
767
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
768
+ server_url: Optional[str] = None,
769
+ timeout_ms: Optional[int] = None,
770
+ http_headers: Optional[Mapping[str, str]] = None,
771
+ ) -> models.DeleteConfigWatchlistByIDResponse:
772
+ r"""Delete Watchlist
773
+
774
+ Delete one of the user's watchlists by its numeric ID.
775
+
776
+ **Important — last-watchlist rule:** If this is the user's *only remaining* watchlist, the server does not actually delete it. Instead it **resets it to a default empty state** (name set to `\"Default\"`, `symbols` cleared) so the user always has at least one watchlist available in the UI.
777
+
778
+ **Tip:** The response body returns the affected watchlist — whether it was actually deleted or reset — so you can update your local store without making a follow-up GET request. Compare `name` and `symbols` in the response to decide whether to render the 'reset to default' state.
779
+
780
+ If set, this operation will use `client_id` from the global security.
781
+
782
+ :param watchlist_id: The numeric ID of the watchlist to delete. You can get this from a previous list/create/update response (the `id` field in the returned watchlist).
783
+ :param retries: Override the default retry configuration for this method
784
+ :param server_url: Override the default server URL for this method
785
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
786
+ :param http_headers: Additional headers to set or replace on requests.
787
+ """
788
+ base_url = None
789
+ url_variables = None
790
+ if timeout_ms is None:
791
+ timeout_ms = self.sdk_configuration.timeout_ms
792
+
793
+ if timeout_ms is None:
794
+ timeout_ms = 30000
795
+
796
+ if server_url is not None:
797
+ base_url = server_url
798
+ else:
799
+ base_url = self._get_url(base_url, url_variables)
800
+
801
+ request = models.DeleteConfigWatchlistByIDRequest(
802
+ watchlist_id=watchlist_id,
803
+ )
804
+
805
+ req = self._build_request(
806
+ method="DELETE",
807
+ path="/v1/config/watchlist/{watchlist_id}",
808
+ base_url=base_url,
809
+ url_variables=url_variables,
810
+ request=request,
811
+ request_body_required=False,
812
+ request_has_path_params=True,
813
+ request_has_query_params=True,
814
+ user_agent_header="user-agent",
815
+ accept_header_value="application/json",
816
+ http_headers=http_headers,
817
+ security=self.sdk_configuration.security,
818
+ allow_empty_value=None,
819
+ allowed_fields=["client_id"],
820
+ timeout_ms=timeout_ms,
821
+ )
822
+
823
+ if retries == UNSET:
824
+ if self.sdk_configuration.retry_config is not UNSET:
825
+ retries = self.sdk_configuration.retry_config
826
+ else:
827
+ retries = utils.RetryConfig(
828
+ "backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
829
+ )
830
+
831
+ retry_config = None
832
+ if isinstance(retries, utils.RetryConfig):
833
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
834
+
835
+ http_res = self.do_request(
836
+ hook_ctx=HookContext(
837
+ config=self.sdk_configuration,
838
+ base_url=base_url or "",
839
+ operation_id="deleteConfigWatchlistById",
840
+ oauth2_scopes=["watchlist:management"],
841
+ security_source=self.sdk_configuration.security,
842
+ tags=["Watchlist"],
843
+ extensions=None,
844
+ ),
845
+ request=req,
846
+ is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
847
+ retry_config=retry_config,
848
+ )
849
+
850
+ response_data: Any = None
851
+ if utils.match_response(http_res, "200", "application/json"):
852
+ return models.DeleteConfigWatchlistByIDResponse(
853
+ watchlist=unmarshal_json_response(Optional[models.Watchlist], http_res),
854
+ http_meta=models.HTTPMetadata(request=req, response=http_res),
855
+ )
856
+ if utils.match_response(http_res, "400", "application/json"):
857
+ response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
858
+ response_data.http_meta = models.HTTPMetadata(
859
+ request=req, response=http_res
860
+ )
861
+ raise errors.BadRequest(response_data, http_res)
862
+ if utils.match_response(http_res, "401", "application/json"):
863
+ response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
864
+ response_data.http_meta = models.HTTPMetadata(
865
+ request=req, response=http_res
866
+ )
867
+ raise errors.Unauthorized(response_data, http_res)
868
+ if utils.match_response(http_res, "403", "application/json"):
869
+ response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
870
+ response_data.http_meta = models.HTTPMetadata(
871
+ request=req, response=http_res
872
+ )
873
+ raise errors.Forbidden(response_data, http_res)
874
+ if utils.match_response(http_res, "404", "application/json"):
875
+ response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
876
+ response_data.http_meta = models.HTTPMetadata(
877
+ request=req, response=http_res
878
+ )
879
+ raise errors.NotFound(response_data, http_res)
880
+ if utils.match_response(http_res, "500", "application/json"):
881
+ response_data = unmarshal_json_response(
882
+ errors.InternalServerErrorUnion, http_res
883
+ )
884
+ response_data.http_meta = models.HTTPMetadata(
885
+ request=req, response=http_res
886
+ )
887
+ raise errors.InternalServerError(response_data, http_res)
888
+ if utils.match_response(http_res, "4XX", "*"):
889
+ http_res_text = utils.stream_to_text(http_res)
890
+ raise errors.APIError("API error occurred", http_res, http_res_text)
891
+ if utils.match_response(http_res, "5XX", "*"):
892
+ http_res_text = utils.stream_to_text(http_res)
893
+ raise errors.APIError("API error occurred", http_res, http_res_text)
894
+
895
+ raise errors.APIError("Unexpected response received", http_res)
896
+
897
+ async def delete_async(
898
+ self,
899
+ *,
900
+ watchlist_id: int,
901
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
902
+ server_url: Optional[str] = None,
903
+ timeout_ms: Optional[int] = None,
904
+ http_headers: Optional[Mapping[str, str]] = None,
905
+ ) -> models.DeleteConfigWatchlistByIDResponse:
906
+ r"""Delete Watchlist
907
+
908
+ Delete one of the user's watchlists by its numeric ID.
909
+
910
+ **Important — last-watchlist rule:** If this is the user's *only remaining* watchlist, the server does not actually delete it. Instead it **resets it to a default empty state** (name set to `\"Default\"`, `symbols` cleared) so the user always has at least one watchlist available in the UI.
911
+
912
+ **Tip:** The response body returns the affected watchlist — whether it was actually deleted or reset — so you can update your local store without making a follow-up GET request. Compare `name` and `symbols` in the response to decide whether to render the 'reset to default' state.
913
+
914
+ If set, this operation will use `client_id` from the global security.
915
+
916
+ :param watchlist_id: The numeric ID of the watchlist to delete. You can get this from a previous list/create/update response (the `id` field in the returned watchlist).
917
+ :param retries: Override the default retry configuration for this method
918
+ :param server_url: Override the default server URL for this method
919
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
920
+ :param http_headers: Additional headers to set or replace on requests.
921
+ """
922
+ base_url = None
923
+ url_variables = None
924
+ if timeout_ms is None:
925
+ timeout_ms = self.sdk_configuration.timeout_ms
926
+
927
+ if timeout_ms is None:
928
+ timeout_ms = 30000
929
+
930
+ if server_url is not None:
931
+ base_url = server_url
932
+ else:
933
+ base_url = self._get_url(base_url, url_variables)
934
+
935
+ request = models.DeleteConfigWatchlistByIDRequest(
936
+ watchlist_id=watchlist_id,
937
+ )
938
+
939
+ req = self._build_request_async(
940
+ method="DELETE",
941
+ path="/v1/config/watchlist/{watchlist_id}",
942
+ base_url=base_url,
943
+ url_variables=url_variables,
944
+ request=request,
945
+ request_body_required=False,
946
+ request_has_path_params=True,
947
+ request_has_query_params=True,
948
+ user_agent_header="user-agent",
949
+ accept_header_value="application/json",
950
+ http_headers=http_headers,
951
+ security=self.sdk_configuration.security,
952
+ allow_empty_value=None,
953
+ allowed_fields=["client_id"],
954
+ timeout_ms=timeout_ms,
955
+ )
956
+
957
+ if retries == UNSET:
958
+ if self.sdk_configuration.retry_config is not UNSET:
959
+ retries = self.sdk_configuration.retry_config
960
+ else:
961
+ retries = utils.RetryConfig(
962
+ "backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
963
+ )
964
+
965
+ retry_config = None
966
+ if isinstance(retries, utils.RetryConfig):
967
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
968
+
969
+ http_res = await self.do_request_async(
970
+ hook_ctx=HookContext(
971
+ config=self.sdk_configuration,
972
+ base_url=base_url or "",
973
+ operation_id="deleteConfigWatchlistById",
974
+ oauth2_scopes=["watchlist:management"],
975
+ security_source=self.sdk_configuration.security,
976
+ tags=["Watchlist"],
977
+ extensions=None,
978
+ ),
979
+ request=req,
980
+ is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
981
+ retry_config=retry_config,
982
+ )
983
+
984
+ response_data: Any = None
985
+ if utils.match_response(http_res, "200", "application/json"):
986
+ return models.DeleteConfigWatchlistByIDResponse(
987
+ watchlist=unmarshal_json_response(Optional[models.Watchlist], http_res),
988
+ http_meta=models.HTTPMetadata(request=req, response=http_res),
989
+ )
990
+ if utils.match_response(http_res, "400", "application/json"):
991
+ response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
992
+ response_data.http_meta = models.HTTPMetadata(
993
+ request=req, response=http_res
994
+ )
995
+ raise errors.BadRequest(response_data, http_res)
996
+ if utils.match_response(http_res, "401", "application/json"):
997
+ response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
998
+ response_data.http_meta = models.HTTPMetadata(
999
+ request=req, response=http_res
1000
+ )
1001
+ raise errors.Unauthorized(response_data, http_res)
1002
+ if utils.match_response(http_res, "403", "application/json"):
1003
+ response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
1004
+ response_data.http_meta = models.HTTPMetadata(
1005
+ request=req, response=http_res
1006
+ )
1007
+ raise errors.Forbidden(response_data, http_res)
1008
+ if utils.match_response(http_res, "404", "application/json"):
1009
+ response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
1010
+ response_data.http_meta = models.HTTPMetadata(
1011
+ request=req, response=http_res
1012
+ )
1013
+ raise errors.NotFound(response_data, http_res)
1014
+ if utils.match_response(http_res, "500", "application/json"):
1015
+ response_data = unmarshal_json_response(
1016
+ errors.InternalServerErrorUnion, http_res
1017
+ )
1018
+ response_data.http_meta = models.HTTPMetadata(
1019
+ request=req, response=http_res
1020
+ )
1021
+ raise errors.InternalServerError(response_data, http_res)
1022
+ if utils.match_response(http_res, "4XX", "*"):
1023
+ http_res_text = await utils.stream_to_text_async(http_res)
1024
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1025
+ if utils.match_response(http_res, "5XX", "*"):
1026
+ http_res_text = await utils.stream_to_text_async(http_res)
1027
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1028
+
1029
+ raise errors.APIError("Unexpected response received", http_res)
1030
+
1031
+ def get(
1032
+ self,
1033
+ *,
1034
+ watchlist_id: int,
1035
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
1036
+ server_url: Optional[str] = None,
1037
+ timeout_ms: Optional[int] = None,
1038
+ http_headers: Optional[Mapping[str, str]] = None,
1039
+ ) -> models.GetConfigWatchlistByIDResponse:
1040
+ r"""Get Watchlist
1041
+
1042
+ Retrieve a single watchlist owned by the authenticated user, identified by its numeric `watchlist_id`.
1043
+
1044
+ If set, this operation will use `client_id` from the global security.
1045
+
1046
+ :param watchlist_id: The numeric ID of the watchlist to retrieve. You can get this from a previous list/create/update response (the `id` field in the returned watchlist).
1047
+ :param retries: Override the default retry configuration for this method
1048
+ :param server_url: Override the default server URL for this method
1049
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1050
+ :param http_headers: Additional headers to set or replace on requests.
1051
+ """
1052
+ base_url = None
1053
+ url_variables = None
1054
+ if timeout_ms is None:
1055
+ timeout_ms = self.sdk_configuration.timeout_ms
1056
+
1057
+ if timeout_ms is None:
1058
+ timeout_ms = 30000
1059
+
1060
+ if server_url is not None:
1061
+ base_url = server_url
1062
+ else:
1063
+ base_url = self._get_url(base_url, url_variables)
1064
+
1065
+ request = models.GetConfigWatchlistByIDRequest(
1066
+ watchlist_id=watchlist_id,
1067
+ )
1068
+
1069
+ req = self._build_request(
1070
+ method="GET",
1071
+ path="/v1/config/watchlist/{watchlist_id}",
1072
+ base_url=base_url,
1073
+ url_variables=url_variables,
1074
+ request=request,
1075
+ request_body_required=False,
1076
+ request_has_path_params=True,
1077
+ request_has_query_params=True,
1078
+ user_agent_header="user-agent",
1079
+ accept_header_value="application/json",
1080
+ http_headers=http_headers,
1081
+ security=self.sdk_configuration.security,
1082
+ allow_empty_value=None,
1083
+ allowed_fields=["client_id"],
1084
+ timeout_ms=timeout_ms,
1085
+ )
1086
+
1087
+ if retries == UNSET:
1088
+ if self.sdk_configuration.retry_config is not UNSET:
1089
+ retries = self.sdk_configuration.retry_config
1090
+ else:
1091
+ retries = utils.RetryConfig(
1092
+ "backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
1093
+ )
1094
+
1095
+ retry_config = None
1096
+ if isinstance(retries, utils.RetryConfig):
1097
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1098
+
1099
+ http_res = self.do_request(
1100
+ hook_ctx=HookContext(
1101
+ config=self.sdk_configuration,
1102
+ base_url=base_url or "",
1103
+ operation_id="getConfigWatchlistById",
1104
+ oauth2_scopes=["watchlist:information"],
1105
+ security_source=self.sdk_configuration.security,
1106
+ tags=["Watchlist"],
1107
+ extensions=None,
1108
+ ),
1109
+ request=req,
1110
+ is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
1111
+ retry_config=retry_config,
1112
+ )
1113
+
1114
+ response_data: Any = None
1115
+ if utils.match_response(http_res, "200", "application/json"):
1116
+ return models.GetConfigWatchlistByIDResponse(
1117
+ watchlist=unmarshal_json_response(Optional[models.Watchlist], http_res),
1118
+ http_meta=models.HTTPMetadata(request=req, response=http_res),
1119
+ )
1120
+ if utils.match_response(http_res, "400", "application/json"):
1121
+ response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
1122
+ response_data.http_meta = models.HTTPMetadata(
1123
+ request=req, response=http_res
1124
+ )
1125
+ raise errors.BadRequest(response_data, http_res)
1126
+ if utils.match_response(http_res, "401", "application/json"):
1127
+ response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
1128
+ response_data.http_meta = models.HTTPMetadata(
1129
+ request=req, response=http_res
1130
+ )
1131
+ raise errors.Unauthorized(response_data, http_res)
1132
+ if utils.match_response(http_res, "403", "application/json"):
1133
+ response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
1134
+ response_data.http_meta = models.HTTPMetadata(
1135
+ request=req, response=http_res
1136
+ )
1137
+ raise errors.Forbidden(response_data, http_res)
1138
+ if utils.match_response(http_res, "404", "application/json"):
1139
+ response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
1140
+ response_data.http_meta = models.HTTPMetadata(
1141
+ request=req, response=http_res
1142
+ )
1143
+ raise errors.NotFound(response_data, http_res)
1144
+ if utils.match_response(http_res, "500", "application/json"):
1145
+ response_data = unmarshal_json_response(
1146
+ errors.InternalServerErrorUnion, http_res
1147
+ )
1148
+ response_data.http_meta = models.HTTPMetadata(
1149
+ request=req, response=http_res
1150
+ )
1151
+ raise errors.InternalServerError(response_data, http_res)
1152
+ if utils.match_response(http_res, "4XX", "*"):
1153
+ http_res_text = utils.stream_to_text(http_res)
1154
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1155
+ if utils.match_response(http_res, "5XX", "*"):
1156
+ http_res_text = utils.stream_to_text(http_res)
1157
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1158
+
1159
+ raise errors.APIError("Unexpected response received", http_res)
1160
+
1161
+ async def get_async(
1162
+ self,
1163
+ *,
1164
+ watchlist_id: int,
1165
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
1166
+ server_url: Optional[str] = None,
1167
+ timeout_ms: Optional[int] = None,
1168
+ http_headers: Optional[Mapping[str, str]] = None,
1169
+ ) -> models.GetConfigWatchlistByIDResponse:
1170
+ r"""Get Watchlist
1171
+
1172
+ Retrieve a single watchlist owned by the authenticated user, identified by its numeric `watchlist_id`.
1173
+
1174
+ If set, this operation will use `client_id` from the global security.
1175
+
1176
+ :param watchlist_id: The numeric ID of the watchlist to retrieve. You can get this from a previous list/create/update response (the `id` field in the returned watchlist).
1177
+ :param retries: Override the default retry configuration for this method
1178
+ :param server_url: Override the default server URL for this method
1179
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1180
+ :param http_headers: Additional headers to set or replace on requests.
1181
+ """
1182
+ base_url = None
1183
+ url_variables = None
1184
+ if timeout_ms is None:
1185
+ timeout_ms = self.sdk_configuration.timeout_ms
1186
+
1187
+ if timeout_ms is None:
1188
+ timeout_ms = 30000
1189
+
1190
+ if server_url is not None:
1191
+ base_url = server_url
1192
+ else:
1193
+ base_url = self._get_url(base_url, url_variables)
1194
+
1195
+ request = models.GetConfigWatchlistByIDRequest(
1196
+ watchlist_id=watchlist_id,
1197
+ )
1198
+
1199
+ req = self._build_request_async(
1200
+ method="GET",
1201
+ path="/v1/config/watchlist/{watchlist_id}",
1202
+ base_url=base_url,
1203
+ url_variables=url_variables,
1204
+ request=request,
1205
+ request_body_required=False,
1206
+ request_has_path_params=True,
1207
+ request_has_query_params=True,
1208
+ user_agent_header="user-agent",
1209
+ accept_header_value="application/json",
1210
+ http_headers=http_headers,
1211
+ security=self.sdk_configuration.security,
1212
+ allow_empty_value=None,
1213
+ allowed_fields=["client_id"],
1214
+ timeout_ms=timeout_ms,
1215
+ )
1216
+
1217
+ if retries == UNSET:
1218
+ if self.sdk_configuration.retry_config is not UNSET:
1219
+ retries = self.sdk_configuration.retry_config
1220
+ else:
1221
+ retries = utils.RetryConfig(
1222
+ "backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
1223
+ )
1224
+
1225
+ retry_config = None
1226
+ if isinstance(retries, utils.RetryConfig):
1227
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1228
+
1229
+ http_res = await self.do_request_async(
1230
+ hook_ctx=HookContext(
1231
+ config=self.sdk_configuration,
1232
+ base_url=base_url or "",
1233
+ operation_id="getConfigWatchlistById",
1234
+ oauth2_scopes=["watchlist:information"],
1235
+ security_source=self.sdk_configuration.security,
1236
+ tags=["Watchlist"],
1237
+ extensions=None,
1238
+ ),
1239
+ request=req,
1240
+ is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
1241
+ retry_config=retry_config,
1242
+ )
1243
+
1244
+ response_data: Any = None
1245
+ if utils.match_response(http_res, "200", "application/json"):
1246
+ return models.GetConfigWatchlistByIDResponse(
1247
+ watchlist=unmarshal_json_response(Optional[models.Watchlist], http_res),
1248
+ http_meta=models.HTTPMetadata(request=req, response=http_res),
1249
+ )
1250
+ if utils.match_response(http_res, "400", "application/json"):
1251
+ response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
1252
+ response_data.http_meta = models.HTTPMetadata(
1253
+ request=req, response=http_res
1254
+ )
1255
+ raise errors.BadRequest(response_data, http_res)
1256
+ if utils.match_response(http_res, "401", "application/json"):
1257
+ response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
1258
+ response_data.http_meta = models.HTTPMetadata(
1259
+ request=req, response=http_res
1260
+ )
1261
+ raise errors.Unauthorized(response_data, http_res)
1262
+ if utils.match_response(http_res, "403", "application/json"):
1263
+ response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
1264
+ response_data.http_meta = models.HTTPMetadata(
1265
+ request=req, response=http_res
1266
+ )
1267
+ raise errors.Forbidden(response_data, http_res)
1268
+ if utils.match_response(http_res, "404", "application/json"):
1269
+ response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
1270
+ response_data.http_meta = models.HTTPMetadata(
1271
+ request=req, response=http_res
1272
+ )
1273
+ raise errors.NotFound(response_data, http_res)
1274
+ if utils.match_response(http_res, "500", "application/json"):
1275
+ response_data = unmarshal_json_response(
1276
+ errors.InternalServerErrorUnion, http_res
1277
+ )
1278
+ response_data.http_meta = models.HTTPMetadata(
1279
+ request=req, response=http_res
1280
+ )
1281
+ raise errors.InternalServerError(response_data, http_res)
1282
+ if utils.match_response(http_res, "4XX", "*"):
1283
+ http_res_text = await utils.stream_to_text_async(http_res)
1284
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1285
+ if utils.match_response(http_res, "5XX", "*"):
1286
+ http_res_text = await utils.stream_to_text_async(http_res)
1287
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1288
+
1289
+ raise errors.APIError("Unexpected response received", http_res)
1290
+
1291
+ def update(
1292
+ self,
1293
+ *,
1294
+ watchlist_id: int,
1295
+ update_watchlist_request: Union[
1296
+ models.UpdateWatchlistRequestUnion,
1297
+ models.UpdateWatchlistRequestUnionTypedDict,
1298
+ ],
1299
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
1300
+ server_url: Optional[str] = None,
1301
+ timeout_ms: Optional[int] = None,
1302
+ http_headers: Optional[Mapping[str, str]] = None,
1303
+ ) -> models.UpdateConfigWatchlistByIDResponse:
1304
+ r"""Update Watchlist
1305
+
1306
+ Partially update a watchlist owned by the authenticated user: rename it, add symbols, remove symbols, or any combination of these. Include at least one of `name`, `add_symbols`, or `remove_symbols`. Renaming to a name the user already uses for another watchlist returns 400 with error code `WATCHLIST_ALREADY_EXISTS`.
1307
+
1308
+ **Symbol validation:** Symbols in `add_symbols` are uppercased; symbols already in the watchlist are skipped, and the rest are checked against the symbol resolver. Any that can't be resolved are dropped from the stored list and returned in the response's `invalid_symbols` field. Symbols in `remove_symbols` are uppercased for comparison and removed from the resulting symbol set after additions are applied, so a symbol present in both lists ends up removed.
1309
+
1310
+ If set, this operation will use `client_id` from the global security.
1311
+
1312
+ :param watchlist_id: The numeric ID of the watchlist to update. You can get this from a previous list/create/update response (the `id` field in the returned watchlist).
1313
+ :param update_watchlist_request: At least one of `name`, `add_symbols`, or `remove_symbols` must be included.
1314
+ :param retries: Override the default retry configuration for this method
1315
+ :param server_url: Override the default server URL for this method
1316
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1317
+ :param http_headers: Additional headers to set or replace on requests.
1318
+ """
1319
+ base_url = None
1320
+ url_variables = None
1321
+ if timeout_ms is None:
1322
+ timeout_ms = self.sdk_configuration.timeout_ms
1323
+
1324
+ if timeout_ms is None:
1325
+ timeout_ms = 30000
1326
+
1327
+ if server_url is not None:
1328
+ base_url = server_url
1329
+ else:
1330
+ base_url = self._get_url(base_url, url_variables)
1331
+
1332
+ request = models.UpdateConfigWatchlistByIDRequest(
1333
+ watchlist_id=watchlist_id,
1334
+ update_watchlist_request=utils.get_pydantic_model(
1335
+ update_watchlist_request, models.UpdateWatchlistRequestUnion
1336
+ ),
1337
+ )
1338
+
1339
+ req = self._build_request(
1340
+ method="PATCH",
1341
+ path="/v1/config/watchlist/{watchlist_id}",
1342
+ base_url=base_url,
1343
+ url_variables=url_variables,
1344
+ request=request,
1345
+ request_body_required=True,
1346
+ request_has_path_params=True,
1347
+ request_has_query_params=True,
1348
+ user_agent_header="user-agent",
1349
+ accept_header_value="application/json",
1350
+ http_headers=http_headers,
1351
+ security=self.sdk_configuration.security,
1352
+ get_serialized_body=lambda: utils.serialize_request_body(
1353
+ request.update_watchlist_request,
1354
+ False,
1355
+ False,
1356
+ "json",
1357
+ models.UpdateWatchlistRequestUnion,
1358
+ ),
1359
+ allow_empty_value=None,
1360
+ allowed_fields=["client_id"],
1361
+ timeout_ms=timeout_ms,
1362
+ )
1363
+
1364
+ if retries == UNSET:
1365
+ if self.sdk_configuration.retry_config is not UNSET:
1366
+ retries = self.sdk_configuration.retry_config
1367
+ else:
1368
+ retries = utils.RetryConfig(
1369
+ "backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
1370
+ )
1371
+
1372
+ retry_config = None
1373
+ if isinstance(retries, utils.RetryConfig):
1374
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1375
+
1376
+ http_res = self.do_request(
1377
+ hook_ctx=HookContext(
1378
+ config=self.sdk_configuration,
1379
+ base_url=base_url or "",
1380
+ operation_id="updateConfigWatchlistById",
1381
+ oauth2_scopes=["watchlist:management"],
1382
+ security_source=self.sdk_configuration.security,
1383
+ tags=["Watchlist"],
1384
+ extensions=None,
1385
+ ),
1386
+ request=req,
1387
+ is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
1388
+ retry_config=retry_config,
1389
+ )
1390
+
1391
+ response_data: Any = None
1392
+ if utils.match_response(http_res, "200", "application/json"):
1393
+ return models.UpdateConfigWatchlistByIDResponse(
1394
+ watchlist=unmarshal_json_response(Optional[models.Watchlist], http_res),
1395
+ http_meta=models.HTTPMetadata(request=req, response=http_res),
1396
+ )
1397
+ if utils.match_response(http_res, "400", "application/json"):
1398
+ response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
1399
+ response_data.http_meta = models.HTTPMetadata(
1400
+ request=req, response=http_res
1401
+ )
1402
+ raise errors.BadRequest(response_data, http_res)
1403
+ if utils.match_response(http_res, "401", "application/json"):
1404
+ response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
1405
+ response_data.http_meta = models.HTTPMetadata(
1406
+ request=req, response=http_res
1407
+ )
1408
+ raise errors.Unauthorized(response_data, http_res)
1409
+ if utils.match_response(http_res, "403", "application/json"):
1410
+ response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
1411
+ response_data.http_meta = models.HTTPMetadata(
1412
+ request=req, response=http_res
1413
+ )
1414
+ raise errors.Forbidden(response_data, http_res)
1415
+ if utils.match_response(http_res, "404", "application/json"):
1416
+ response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
1417
+ response_data.http_meta = models.HTTPMetadata(
1418
+ request=req, response=http_res
1419
+ )
1420
+ raise errors.NotFound(response_data, http_res)
1421
+ if utils.match_response(http_res, "500", "application/json"):
1422
+ response_data = unmarshal_json_response(
1423
+ errors.InternalServerErrorUnion, http_res
1424
+ )
1425
+ response_data.http_meta = models.HTTPMetadata(
1426
+ request=req, response=http_res
1427
+ )
1428
+ raise errors.InternalServerError(response_data, http_res)
1429
+ if utils.match_response(http_res, "4XX", "*"):
1430
+ http_res_text = utils.stream_to_text(http_res)
1431
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1432
+ if utils.match_response(http_res, "5XX", "*"):
1433
+ http_res_text = utils.stream_to_text(http_res)
1434
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1435
+
1436
+ raise errors.APIError("Unexpected response received", http_res)
1437
+
1438
+ async def update_async(
1439
+ self,
1440
+ *,
1441
+ watchlist_id: int,
1442
+ update_watchlist_request: Union[
1443
+ models.UpdateWatchlistRequestUnion,
1444
+ models.UpdateWatchlistRequestUnionTypedDict,
1445
+ ],
1446
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
1447
+ server_url: Optional[str] = None,
1448
+ timeout_ms: Optional[int] = None,
1449
+ http_headers: Optional[Mapping[str, str]] = None,
1450
+ ) -> models.UpdateConfigWatchlistByIDResponse:
1451
+ r"""Update Watchlist
1452
+
1453
+ Partially update a watchlist owned by the authenticated user: rename it, add symbols, remove symbols, or any combination of these. Include at least one of `name`, `add_symbols`, or `remove_symbols`. Renaming to a name the user already uses for another watchlist returns 400 with error code `WATCHLIST_ALREADY_EXISTS`.
1454
+
1455
+ **Symbol validation:** Symbols in `add_symbols` are uppercased; symbols already in the watchlist are skipped, and the rest are checked against the symbol resolver. Any that can't be resolved are dropped from the stored list and returned in the response's `invalid_symbols` field. Symbols in `remove_symbols` are uppercased for comparison and removed from the resulting symbol set after additions are applied, so a symbol present in both lists ends up removed.
1456
+
1457
+ If set, this operation will use `client_id` from the global security.
1458
+
1459
+ :param watchlist_id: The numeric ID of the watchlist to update. You can get this from a previous list/create/update response (the `id` field in the returned watchlist).
1460
+ :param update_watchlist_request: At least one of `name`, `add_symbols`, or `remove_symbols` must be included.
1461
+ :param retries: Override the default retry configuration for this method
1462
+ :param server_url: Override the default server URL for this method
1463
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1464
+ :param http_headers: Additional headers to set or replace on requests.
1465
+ """
1466
+ base_url = None
1467
+ url_variables = None
1468
+ if timeout_ms is None:
1469
+ timeout_ms = self.sdk_configuration.timeout_ms
1470
+
1471
+ if timeout_ms is None:
1472
+ timeout_ms = 30000
1473
+
1474
+ if server_url is not None:
1475
+ base_url = server_url
1476
+ else:
1477
+ base_url = self._get_url(base_url, url_variables)
1478
+
1479
+ request = models.UpdateConfigWatchlistByIDRequest(
1480
+ watchlist_id=watchlist_id,
1481
+ update_watchlist_request=utils.get_pydantic_model(
1482
+ update_watchlist_request, models.UpdateWatchlistRequestUnion
1483
+ ),
1484
+ )
1485
+
1486
+ req = self._build_request_async(
1487
+ method="PATCH",
1488
+ path="/v1/config/watchlist/{watchlist_id}",
1489
+ base_url=base_url,
1490
+ url_variables=url_variables,
1491
+ request=request,
1492
+ request_body_required=True,
1493
+ request_has_path_params=True,
1494
+ request_has_query_params=True,
1495
+ user_agent_header="user-agent",
1496
+ accept_header_value="application/json",
1497
+ http_headers=http_headers,
1498
+ security=self.sdk_configuration.security,
1499
+ get_serialized_body=lambda: utils.serialize_request_body(
1500
+ request.update_watchlist_request,
1501
+ False,
1502
+ False,
1503
+ "json",
1504
+ models.UpdateWatchlistRequestUnion,
1505
+ ),
1506
+ allow_empty_value=None,
1507
+ allowed_fields=["client_id"],
1508
+ timeout_ms=timeout_ms,
1509
+ )
1510
+
1511
+ if retries == UNSET:
1512
+ if self.sdk_configuration.retry_config is not UNSET:
1513
+ retries = self.sdk_configuration.retry_config
1514
+ else:
1515
+ retries = utils.RetryConfig(
1516
+ "backoff", utils.BackoffStrategy(500, 8000, 1.5, 60000), True
1517
+ )
1518
+
1519
+ retry_config = None
1520
+ if isinstance(retries, utils.RetryConfig):
1521
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1522
+
1523
+ http_res = await self.do_request_async(
1524
+ hook_ctx=HookContext(
1525
+ config=self.sdk_configuration,
1526
+ base_url=base_url or "",
1527
+ operation_id="updateConfigWatchlistById",
1528
+ oauth2_scopes=["watchlist:management"],
1529
+ security_source=self.sdk_configuration.security,
1530
+ tags=["Watchlist"],
1531
+ extensions=None,
1532
+ ),
1533
+ request=req,
1534
+ is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c),
1535
+ retry_config=retry_config,
1536
+ )
1537
+
1538
+ response_data: Any = None
1539
+ if utils.match_response(http_res, "200", "application/json"):
1540
+ return models.UpdateConfigWatchlistByIDResponse(
1541
+ watchlist=unmarshal_json_response(Optional[models.Watchlist], http_res),
1542
+ http_meta=models.HTTPMetadata(request=req, response=http_res),
1543
+ )
1544
+ if utils.match_response(http_res, "400", "application/json"):
1545
+ response_data = unmarshal_json_response(errors.BadRequestUnion, http_res)
1546
+ response_data.http_meta = models.HTTPMetadata(
1547
+ request=req, response=http_res
1548
+ )
1549
+ raise errors.BadRequest(response_data, http_res)
1550
+ if utils.match_response(http_res, "401", "application/json"):
1551
+ response_data = unmarshal_json_response(errors.UnauthorizedUnion, http_res)
1552
+ response_data.http_meta = models.HTTPMetadata(
1553
+ request=req, response=http_res
1554
+ )
1555
+ raise errors.Unauthorized(response_data, http_res)
1556
+ if utils.match_response(http_res, "403", "application/json"):
1557
+ response_data = unmarshal_json_response(errors.ForbiddenUnion, http_res)
1558
+ response_data.http_meta = models.HTTPMetadata(
1559
+ request=req, response=http_res
1560
+ )
1561
+ raise errors.Forbidden(response_data, http_res)
1562
+ if utils.match_response(http_res, "404", "application/json"):
1563
+ response_data = unmarshal_json_response(errors.NotFoundUnion, http_res)
1564
+ response_data.http_meta = models.HTTPMetadata(
1565
+ request=req, response=http_res
1566
+ )
1567
+ raise errors.NotFound(response_data, http_res)
1568
+ if utils.match_response(http_res, "500", "application/json"):
1569
+ response_data = unmarshal_json_response(
1570
+ errors.InternalServerErrorUnion, http_res
1571
+ )
1572
+ response_data.http_meta = models.HTTPMetadata(
1573
+ request=req, response=http_res
1574
+ )
1575
+ raise errors.InternalServerError(response_data, http_res)
1576
+ if utils.match_response(http_res, "4XX", "*"):
1577
+ http_res_text = await utils.stream_to_text_async(http_res)
1578
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1579
+ if utils.match_response(http_res, "5XX", "*"):
1580
+ http_res_text = await utils.stream_to_text_async(http_res)
1581
+ raise errors.APIError("API error occurred", http_res, http_res_text)
1582
+
1583
+ raise errors.APIError("Unexpected response received", http_res)